source: WorldVistAEHR/trunk/r/HEALTH_LEVEL_SEVEN-HL/HLCSRPT.m@ 1150

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

initial load of WorldVistAEHR

File size: 5.7 KB
RevLine 
[613]1HLCSRPT ;ISC-SF/RAH-TRANS LOG CONTROL & MISC ;06/23/99 11:10 AM
2 ;;1.6;HEALTH LEVEL SEVEN;**19,50**;Oct 13, 1995
3 ;
4 Q
5 ;
6EN ; Entry Point
7 I '$$TEST^DDBRT S IOP="HOME" D ^%ZIS I '$$TEST^DDBRT W !!," ===>> Screen Attributes NOT Defined. Use ^ZU or ^XUP before invoking.",!! D EXIT H 3 Q
8 D SCREEN
9 S HLCSNREC=BLDON_" ===>>> NO MATCHING RECORDS <<<=== "_BLDOFF
10 S HLCSPTR=1,HLCSRNO=1
11 S VERS22=""
12 I 22=+$$VERSION^XPDUTL("DI")!($$PATCH^XPDUTL("DI*21.0*32")) S VERS22="YES"
13 I VERS22'="YES" S ^TMP("DDBPF1Z",$J)="D SHOWMSG^HLCSRPT Q"
14 S ^TMP($J,"LIST","MESSAGE TEXT")="^TMP($J,""MESSAGE"",HLCSRNO)"
15 S ^TMP($J,"LIST","IEN RECORD # MESSAGE ID # Log Link Msg:Evn IO Sndg Apl Rcvr Apl HDR")="^TMP(""TLOG"",$J)"
16 ;
17REEN ; Internal Re-entry Point
18 W @IOF,! S HLCSHDR="Search Transmission Log" D HLCSBAR
19 K DIR,OUT,DIC,STOP,Y W !!
20 S DIR("A")="Selection"
21 S DIR(0)="SO^M:Message Search;P:Pending Transmissions;E:Error Listing;Q:Quit (also uparrow, or <RETURN>)"
22 D ^DIR G:$D(DIRUT)!(X="") EXIT S ACTION=X,ACTION=$TR(ACTION,"mpeq","MPEQ")
23 K DIR,X,Y
24 S (HLCSAL,HLCSLS,HLCSES)=0
25 I ACTION="Q" G EXIT
26 I "MPE"'[ACTION G ENEND
27 I ACTION="P" S HLCSPS=1 D EN^HLCSRPT1 G REEN
28 I ACTION="E" S HLCSERR=1 D EN^HLCSRPT2 G REEN
29 I ACTION="M" D ADVSRCH^HLCSRPT3 G REEN
30 ;
31ENEND ;
32 K DIR,OUT,DIC,STOP,X,Y,ACTION
33 G REEN
34 ;
35GETTIME ;
36 W @IOF,! S HLCSHDR="Start/Stop Time Selection" D HLCSBAR
37GETSTART ;
38 W !!," Enter START Date and Time. Date is required.",!
39 S DIR(0)="D^::AEPSTX",DIR("?")="^D HELP^%DTC",DIR("B")="T"
40 D ^DIR S:$D(DIRUT)!(X="") STOP=1 I $D(STOP) K DIR,X,Y Q
41 I Y'["." S Y=Y_".000001"
42 S HLCSST=Y K DIR,X,Y
43GETEND ;
44 W !!," Enter END Date and Time. Date is required.",!
45 S DIR(0)="D^::AESTX",DIR("?")="^D HELP^%DTC",DIR("B")="NOW"
46 D ^DIR S:$D(DIRUT)!(X="") STOP=1 I $D(STOP) K DIR,X,Y Q
47 I Y'["." S Y=Y_".235959"
48 S HLCSET=Y K DIR,X,Y
49 Q
50 ;
51DISPLAY ; common display method
52 ; clean-up here
53 S HLCSPTR=$P(^TMP("TLOG",$J,1)," "),HLCSK=$O(^HLMA("C",HLCSPTR,0))
54 S HLCSPTR=+$P($G(^HLMA(+HLCSK,0)),U)
55 I VERS22'="YES" D DOCLIST^DDBR("^TMP($J,""LIST"")","NR")
56 E D BROWSE^DDBR("^TMP(""TLOG"",$J)","NA",HLCSTITL)
57 Q
58 ;
59FORMAT ; Format a report line
60 S HLCSY=""
61 S HLCSRNO=HLCSJ,SPACE20=" "
62 I VERS22'="YES" D
63 . S HLCSRNO=HLCSRNO_SPACE20 S HLCSRNO=$E(HLCSRNO,1,14) S HLCSY=HLCSRNO_" "
64 . S HLCSMID=$P(HLCSX,U,2),HLCSMX=HLCSMID,HLCSPTR=$P(HLCSX,U,1)
65 . S HLCSMID=HLCSMID_SPACE20 S HLCSMID=$E(HLCSMID,1,20)
66 . S HLCSY=HLCSY_HLCSMID_" "
67 I VERS22="YES" D
68 . S HLCSMID=$P(HLCSX,U,2),HLCSMX=HLCSMID,HLCSPTR=$P(HLCSX,U,1)
69 . S HLCSMID="$.%$CREF$^TMP($J,""MESSAGE"","_HLCSRNO_")$CREF$^"_HLCSMX_"$.%"
70 . S Y=$L(HLCSMX),X=$E(SPACE20,1,20-Y) S HLCSMID=HLCSMID_X K X,Y
71 . S HLCSY=HLCSMID_" "
72 . S HLCSDTE=$P(HLCSX,U,1)
73 . S HLCSDTE=$P(^HL(772,HLCSDTE,0),U,1)
74 . S YR=$E(HLCSDTE,2,3),MO=$E(HLCSDTE,4,5),DAY=$E(HLCSDTE,6,7)
75 . S HLCSDTE=MO_DAY_YR_"."_$P(HLCSDTE,".",2)
76 . S HLCSDTE=HLCSDTE_SPACE20,HLCSDTE=$E(HLCSDTE,1,14)
77 . S HLCSY=HLCSY_HLCSDTE_" "
78 S HLCSY=HLCSY_$E(HLCSLNK_SPACE20,1,10)_" "
79 S HLCSY=HLCSY_HLCSEVN_" "
80 S HLCSTYP=$P(HLCSX,U,3) S:HLCSTYP="O" HLCSTYP="OT" S:HLCSTYP="I" HLCSTYP="IN"
81 S HLCSY=HLCSY_$E(HLCSTYP_SPACE20,1,2)_" "
82 S HLCSSRVR=$P(HLCSX,U,11) I HLCSSRVR'="",($D(^HL(771,HLCSSRVR,0))) S HLCSSRVR=$P(^HL(771,HLCSSRVR,0),U,1)
83 S HLCSY=HLCSY_$E(HLCSSRVR_SPACE20,1,8)_" "
84 S HLCSCLNT=$P(HLCSX,U,12) I HLCSCLNT'="",($D(^HL(771,HLCSCLNT,0))) S HLCSCLNT=$P(^HL(771,HLCSCLNT,0),U,1)
85 S HLCSY=HLCSY_$E(HLCSCLNT_SPACE20,1,8)
86 S HLCSLN=HLCSLN+1
87 I VERS22'="YES" S HLCSY=HLCSY_" " I $D(^HLMA(HLCSJ,"MSH",1,0)) S HLCSY=HLCSY_^HLMA(HLCSJ,"MSH",1,0)
88 S ^TMP("TLOG",$J,HLCSLN)=HLCSY
89 I VERS22="YES" S ^TMP($J,"MESSAGE",HLCSJ)="$XC$^D SHOWMSG^HLCSRPT1("_HLCSJ_","_HLCSPTR_")$XC$^MESSAGE"
90 Q
91 ;
92HLCSBAR ; Center Title on Top Line of Screen
93 W RVON,?(80-$L(HLCSHDR)\2),HLCSHDR,$E(SPACE,$X,77),RVOFF,!
94 Q
95 ;
96EXIT ;
97 K DIR,OUT,DIC,STOP,I,X,Y,ACTION,DIRUT,DTOUT,DUOUT
98 K HLCSHDR,HLCSLN,HLCSI,HLCSJ,HLCSY,HLCSX,HLCSRNO
99 K HLCSLINK,HLCSLNK,HLCSEVNT,HLCSEVN,HLCSMID,HLCSTYP,HLCSSRVR,HLCSCLNT
100 K RVON,RVOFF,CEOP,BLDON,BLDOFF,SPACE,SPACE20
101 K HLCSTEVN,HLCSTEV1,HLCSTEV2,HLCSEVN1,HLCSEVN2
102 K HLCSTLNK,HLCSDTP,HLCSDTE,HLCSET,HLCSN,HLCSNREC,HLCSST
103 K HLCSTITL,HLCSPTR,HLCSK,SPACE25,SPACE30,SPACE80
104 K HLCSAL,HLCSLS,HLCSES,HLCSES1,HLCSES2,HLCSIO,HLCSPS
105 K YR,MO,DAY,VERS22,XXY,XXZ,YY1,YY2,Y1Y2,HLCSMX
106 K ^TMP($J,"LIST"),^TMP("DDBPF1Z",$J),^TMP("TLOG",$J)
107 K ^TMP($J,"MESSAGE")
108 Q
109 ;
110SHOWMSG ; Enable switching to specific message (used by PF1Z).
111 ; If VERS22 installed, won't get here.
112 W @IOF
113 S DIR(0)="F:AE",DIR("A")="Enter Record Number: "
114 D ^DIR Q:$D(DIRUT)
115 I Y=-1!(X="") Q
116 S HLCSRNO=X I '$D(^HLMA(HLCSRNO,0)) D Q
117 . W !!,BLDON," ==> NO SUCH RECORD NUMBER <== ",BLDOFF H 3
118 S HLCSPTR=$P(^HLMA(HLCSRNO,0),"^",1)
119 S XXY=HLCSRNO,XXZ=HLCSPTR D SHOWMSG^HLCSRPT1(XXY,XXZ)
120 D SWITCH
121 Q
122SWITCH ; per interim DBIA, until VA Fileman v22.0 released.
123 N DDBLN,DDBZ,DIC,DIR,X,Y,DIRUT,DIROUT,DUOUT,DILN
124 S DILN=DDBRSA(DDBRSA,"DDBSRL")-2
125 S:$G(DDBLST)="" DDBLST="^TMP(""DDBLST"",$J)" S DDBLN=$S($D(@DDBLST@("A",DDBSA)):^(DDBSA),1:$O(@DDBLST@(" "),-1)+1)
126 I $D(@DDBLST) D
127 .I $O(@DDBLST@(" "),-1)=1,$G(@DDBLST@(1,"DDBSA"))=DDBSA Q
128 .S DDBZ=$G(@DDBLST@("A",DDBSA),0)
129 .S Y=2
130 .D SAVEDDB^DDBR2(DDBLST,DDBLN),USAVEDDB^DDBR2(DDBLST,+Y)
131 .S DIROUT=1
132 N DDBLNA
133 I $G(DDBLNA,-1)=-1 G PS
134 I $G(DDBLNA(6))=DDBSA G PS ;if current doc re-selected
135 I $G(DDBLNA(6))]"",$D(@DDBLST@("APSA",DDBSA)) G PS ;on list
136 D:DDBLNA>0 SAVEDDB^DDBR2(DDBLST,DDBLN),WP^DDBR2(.DDBLNA)
137PS D PSR^DDBR0(1)
138 Q
139 ;
140HELP ;
141 W !,"DATE AND TIME ARE BOTH REQUIRED"
142 Q
143 ;
144SCREEN ;screen I/O parameteters
145 S SPACE80=" "
146 F I=1:1:80 S SPACE80=SPACE80_" "
147 S SPACE=SPACE80
148 S SPACE20=$E(SPACE,1,20),SPACE25=$E(SPACE,1,25),SPACE30=$E(SPACE,1,30)
149 S X="IORVON;IORVOFF;IOINHI;IOINLOW" D ENDR^%ZISS
150 S RVON=IORVON,RVOFF=IORVOFF,BLDON=IOINHI,BLDOFF=IOINLOW
151 D KILL^%ZISS
152 Q
Note: See TracBrowser for help on using the repository browser.