source: FOIAVistA/trunk/r/SCHEDULING-SD-SC/SCRPW7.m@ 731

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

initial load of FOIAVistA 6/30/08 version

File size: 2.9 KB
Line 
1SCRPW7 ;RENO/KEITH - Patient Encounter List ; 15 Jul 98 02:38PM
2 ;;5.3;Scheduling;**139,144,466**;AUG 13, 1993;Build 2
3ASK N DIC,%DT D TITL^SCRPW50("Patient Encounter List")
4 W ! S DIC="^DPT(",DIC(0)="AZEMQ" D ^DIC G:$D(DTOUT)!$D(DUOUT) EXIT G:Y'>0 EXIT S SDPT=$P(Y,U),SDPTNA=$P(Y,U,2),SDPTSN=$P(Y(0),U,9)
5 I '$D(^SCE("ADFN",SDPT)) W !!,$C(7),"This patient has no encounters on file.",! H 3 G ASK
6 D SUBT^SCRPW50("*** Date Range Selection ***")
7FDT W ! S %DT="AEPX",%DT("A")="Beginning date: FIRST// ",%DT(0)="-TODAY" D ^%DT G:X=U!($D(DTOUT)) EXIT I X="" S Y=$O(^SCE("ADFN",SDPT,0)),(Y,SDBDT)=$P(Y,".") X ^DD("DD") W " ",Y S SDPBDA=Y G LDT
8 G:Y<1 FDT S SDBDT=Y X ^DD("DD") W " ",Y S SDPBDA=Y
9LDT W ! S %DT("A")="Ending date: LAST// " D ^%DT G:X=U!($D(DTOUT)) EXIT I X="" S (Y,SDEDT)=DT X ^DD("DD") W " ",Y S SDPEDA=Y W ! G QUE
10 I Y<SDBDT W !!,$C(7),"Ending date must be after beginning date!",! G LDT
11 G:Y<1 LDT S SDEDT=Y X ^DD("DD") W " ",Y S SDPEDA=Y
12QUE S SDEDT=SDEDT+.9999 N ZTSAVE F X="SDPT","SDPTNA","SDPTSN","SDBDT","SDPBDA","SDEDT","SDPEDA" S ZTSAVE(X)=""
13 W ! D EN^XUTMDEVQ("PEL^SCRPW7","Patient Encounter List",.ZTSAVE) G ASK
14 ;
15PEL S SDPAGE=1,SDLINE="",$P(SDLINE,"=",(IOM+1))="",SDOUT=0,SDP=$S($E(IOST)="C":6,1:4),SDDT=SDEDT D:$E(IOST)="C" DISP0^SCRPW23 D NOW^%DTC S Y=% X ^DD("DD") S SDPNOW="Date printed: "_$P(Y,":",1,2),SDCT=0
16 D HDR Q:SDOUT F S SDDT=$O(^SCE("ADFN",SDPT,SDDT),-1) Q:'SDDT!SDOUT!(SDDT<SDBDT) S SDOE=0 F S SDOE=$O(^SCE("ADFN",SDPT,SDDT,SDOE)) Q:'SDOE!SDOUT S SDOE0=$$GETOE^SDOE(SDOE) D:$L(SDOE0) DISP S SDCT=SDCT+1
17 I 'SDCT S X="No encounters found within this date range!" W !!?(IOM-$L(X)\2),X,!
18END I $E(IOST)="C",'SDOUT N DIR S DIR(0)="E" D ^DIR
19EXIT D END^SCRPW50 K %,%I,%H,SDBDT,SDPBDA,SDCT,SDEDT,SDPEDA,SDP,SDLINE,SDPAGE,SDDT,SDI,SDL,SDOE,SDOE0,SDOUT,SDPT,SDPNOW,SDPTNA,SDPTSN,SDS,SDS1,SDT,DTOUT,DUOUT,Y,X Q
20 ;
21STOP ;Check for stop task request
22 S:$G(ZTQUEUED) (SDOUT,ZTSTOP)=$S($$S^%ZTLOAD:1,1:0) Q
23 ;
24HDR W:SDP=6!(SDPAGE>1) $$XY^SCRPW50(IOF,1,0) W:$X $$XY^SCRPW50("",0,0)
25 D STOP Q:SDOUT W SDLINE I SDP=4!(SDPAGE=1) W !?(IOM-32/2),"<*> PATIENT ENCOUNTER LIST <*>",!,SDLINE,!,"Date range: ",SDPBDA," to ",SDPEDA,?(IOM-$L(SDPNOW)),SDPNOW
26 W !,"Patient: ",SDPTNA,?40,"SSN: ",SDPTSN,?(IOM-6-$L(SDPAGE)),"Page: ",SDPAGE,!,SDLINE S SDPAGE=SDPAGE+1
27 Q
28 ;
29DISP S SDL=$P($G(^SC(+$P(SDOE0,U,4),0)),U),SDT=$P(SDOE0,U,8),SDT=$S(SDT=1:"Appointment",SDT=2:"Stop Code Addition",SDT=3:"Disposition",SDT=4:"Credit Stop Code",1:""),SDS=$P($G(^SD(409.63,+$P(SDOE0,U,12),0)),U)
30 S SDS1=$$COTS(SDOE) D:$Y>(IOSL-SDP) WAIT Q:SDOUT S Y=SDDT X ^DD("DD") W !,Y,?30,SDL,!?5,"#",SDOE,?15,SDT,?35,SDS W:$L(SDS1) " - ",SDS1 W ! F SDI=1:1:80 W "-"
31 Q
32 ;
33WAIT I SDP=4 D HDR Q
34 W ! K DIR S DIR(0)="E" D ^DIR S SDOUT=Y'=1
35 D:Y HDR Q
36 ;
37COTS(SDOE) Q:$P(SDOE0,U,6) "Child of enc. #"_$P(SDOE0,U,6)
38 I $P(SDOE0,U,4),$P($G(^SC($P(SDOE0,U,4),0)),U,17)="Y" Q ""
39 Q:"^CHECKED OUT^INPATIENT APPOINTMENT^"'["^"_SDS_"^" "" Q $P($$STX^SCRPW8(SDOE,SDOE0),U,2)
Note: See TracBrowser for help on using the repository browser.