source: WorldVistAEHR/trunk/r/SCHEDULING-SD-SC/SDAMOLP.m@ 1800

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

initial load of WorldVistAEHR

File size: 2.6 KB
Line 
1SDAMOLP ;ALB/CAW - Retroactive Encounter List (Print); 4/15/92 ; 03 Feb 99 4:20 PM
2 ;;5.3;Scheduling;**132,176**;Aug 13, 1993
3 ;
4BLD ; Build info from ^TMP global
5 ;
6 ; -- check if user has asked to stop job
7 IF $$S^%ZTLOAD("Printing Retroactive Report...") S (SDSTOP,ZTSTOP)=1 G BLDQ
8 ;
9 S (SDDV,SDSC,SDAD,SDDFN)="",(SDPAGE,SDSTOP)=0,SDFST=21,SDSEC=50,SDFLEN=14,SDSLEN=30,SDCNT=0,SDMORE=1
10 S $P(SDASH,"-",IOM+1)=""
11 U IO
12 I '$D(^TMP("SDRAL",$J)) D HDR W !,SDASH,!!,"No Encounters found for selected date range." G BLDQ
13 ;
14 D DV
15 ;
16 IF SDSTOP G BLDQ
17 ;
18 IF $G(SDCNT) D TOTAL
19 ;
20BLDQ ; -- send message that job finished or stopped
21 N X
22 S X=$S('SDSTOP:"Retroactive Report Successfully Completed",1:"Retroactive Report Stopped By User")
23 S X=$$S^%ZTLOAD(X)
24 Q
25 ;
26 ; SDDV=Division, SDSC=Stop Code, SDAD=Encounter Date/Time, SDDFN=Patient
27 ;
28DV F S SDDV=$O(^TMP("SDRAL",$J,SDDV)) Q:SDDV="" D SC Q:SDSTOP
29 Q
30SC F S SDSC=$O(^TMP("SDRAL",$J,SDDV,SDSC)) Q:SDSC="" D HDR,AD Q:SDSTOP
31 Q
32AD F S SDAD=$O(^TMP("SDRAL",$J,SDDV,SDSC,SDAD)) Q:'SDAD D DFN Q:SDSTOP
33 Q
34DFN F S SDDFN=$O(^TMP("SDRAL",$J,SDDV,SDSC,SDAD,SDDFN)) Q:'SDDFN S SDATA=^(SDDFN) S DFN=SDDFN D PID^VADPT6 D INFO Q:SDSTOP S SDCNT=$G(SDCNT)+1
35 Q
36 ;
37TOTAL ;
38 W !!!,"Total Encounters: ",SDCNT
39 Q
40INFO ; Encounter Date/Time and Patient
41 ;
42 W !,SDASH
43 W !,"Encounter Date/Time:",?SDFST,$$FDTTM^VALM1(SDAD),?41,"Patient:",?SDSEC,$P(^DPT(SDDFN,0),U)
44 ;
45 ; Date Encounter Entered and ID
46 W !,?7,"Date Entered:",?SDFST,$$FDTTM^VALM1($P(SDATA,U,2)),?46,"ID:",?SDSEC,VA("PID")
47 ;
48 ; Date Transmitted and Type
49 W !,?3,"Close-Out Date :",?SDFST,$$FDTTM^VALM1($P(SDATA,U,5)),?44,"Type:",?SDSEC,$P(SDATA,U,4)
50 ;
51 ; User
52 W !,?13,"Clinic:",?SDFST,$S($P(SDATA,U,6)=0:"",1:$P(SDATA,U,6)),?44,"User:",?SDSEC,$P($G(^VA(200,+$P(SDATA,U,3),0),"UNKNOWN"),U)
53 ;
54 S SDMORE=$S('$O(^TMP("SDRAL",$J,SDDV,SDSC,SDAD)):0,1:1)
55 D CHK
56 ;
57 ; -- check if user has asked to stop job
58 IF $$S^%ZTLOAD() S (SDSTOP,ZTSTOP)=1
59 Q
60 ;
61HDR ; Header
62 ;
63 S SDPAGE=SDPAGE+1
64 I $E(IOST,1,2)="C-",'SDMORE S SDMORE=1 D PAUSE^VALM1 I 'Y S SDSTOP=1 Q
65 W @IOF,"Retroactive Encounter List",?70,"Page: "_SDPAGE
66 W !,?3,"Date Range: "_$$FDATE^VALM1(SDBD)_" to "_$$FDATE^VALM1(SDED) D NOW^%DTC W ?51,"Run Date: "_$E($$FTIME^VALM1(%),1,18) Q:'$D(^TMP("SDRAL",$J))
67 W !,?5,"Division: "_$P($G(^DG(40.8,SDDV,0)),U),?44,"Close-Out Check: ",$S(SDNPDB=1:"DATABASE UPDATE ONLY",1:"WORKLOAD CREDIT")
68 W !,?4,"Stop Code: "_SDSC,?44,"Visit Selection: "_$S(SDSEL=1:"STOP CODE",1:"CLINIC")
69 Q
70 ;
71CHK ;Check to pause on screen
72 I $E(IOST,1,2)="C-",($Y+7)>IOSL D
73 . D PAUSE^VALM1 S SDY=Y
74 . IF SDMORE,SDY D HDR
75 . S:'SDMORE SDMORE=1
76 . IF 'SDY S SDSTOP=1
77 I $E(IOST,1,2)="P-",($Y+6)>IOSL,SDMORE D HDR Q
78 Q
Note: See TracBrowser for help on using the repository browser.