source: FOIAVistA/trunk/r/SCHEDULING-SD-SC/SCENI01.m@ 1783

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

initial load of FOIAVistA 6/30/08 version

File size: 3.7 KB
Line 
1SCENI01 ;ALB/SCK - INCOMPLETE ENCOUNTER MGMT MAIN LM DISPLAY PROTOCOLS; 07-MAY-1997 ; 07 May 99 9:45 PM
2 ;;5.3;Scheduling;**66,194,323**;AUG 13, 1993
3 ;
4ASKDT(SDT) ; Ask for begin and end date for search
5 ; Variable Input
6 ; SDT - Returns Begin date^End date
7 ;
8 ; Returns
9 ; 0 - No dates selected
10 ; 1 - Dates selected
11 ;
12 N X,SDT1
13 S SDT1=$G(SDT)
14 ;
15 S X=$P($G(^DG(43,1,"SCLR")),U,12)
16 S SDBDT=$$FMADD^XLFDT($$DT^XLFDT,-X)
17 ;
18 W !!,"Date Range for Encounters"
19 S DIR(0)="DA^2961001:NOW:EXP",DIR("A")="Enter begin date for search: "
20 S DIR("?")="^D HELP^%DTC"
21 S DIR("B")=$$FMTE^XLFDT(SDBDT)
22 D ^DIR K DIR
23 I $D(DIRUT) S SDT="" G DTQ ; SD*5.3*323 Change K SDT to S SDT=""
24 K DIRUT,DIR
25 S SDT=Y
26 ;
27 S DIR(0)="DA^2961001:NOW:EXP",DIR("A")="Enter end date for search: "
28 S DIR("B")="TODAY"
29 D ^DIR K DIR
30 I $D(DIRUT) S SDT="" G DTQ ; SD*5.3*323 Change K SDT to S SDT=""
31 S SDT=SDT_U_Y
32DTQ S X=1
33 I SDT1,'$D(SDT) S SDT=SDT1,X=0
34 I SDT=SDT1 S X=0
35 Q X
36 ;
37CCLN ; Change Clinic
38 K DIRUT
39 D FULL^VALM1
40 S VALMBCK="R"
41 W !
42 S VAUTNI=2
43 S DIR(0)="P^44:EMZ",DIR("A")="Select Clinic"
44 S DIR("S")="I $$CLINIC^SDAMU(Y),$S(VAUTD:1,$D(VAUTD(+$P(^SC(Y,0),U,15))):1,'$P(^(0),U,15)&$D(VAUTD(+$O(^DG(40.8,0)))):1,1:0)"
45 D ^DIR K DIR
46 I $D(DIRUT) D Q
47 . W !,"Clinic has not been changed"
48 . D PAUSE^VALM1
49 K SDFN,VAUTC
50 S SDENTYP="C",VAUTC=0,VAUTC(+Y)=$P(^SC(+Y,0),U)
51 D HDR^SCENI0,INIT^SCENI0
52 Q
53 ;
54CPAT ; Change Patient
55 D FULL^VALM1
56 S VALMBCK="R"
57 W !
58 S DIR(0)="P^2:EM"
59 S DIR("A")="Select Patient"
60 D ^DIR K DIR
61 I $D(DIRUT) D Q
62 . W !,"Patient was not changed."
63 . D PAUSE^VALM1
64 K VAUTC
65 S VAUTC=1,SDENTYP="P",SDFN=+Y
66 D HDR^SCENI0,INIT^SCENI0
67 Q
68 ;
69CDT ; Change Date range
70 N SCOK
71 D FULL^VALM1
72 S VALMBCK="R"
73 I '$$ASKDT(.SDDT) D Q
74 . W !,"Date range has not been changed"
75 . D PAUSE^VALM1
76 D HDR^SCENI0,INIT^SCENI0
77 Q
78 ;
79CER ; Change Error Code
80 D FULL^VALM1
81 S VALMBCK="R"
82 W !
83 S DIR(0)="P^409.76:EM"
84 S DIR("A")="Select New Error"
85 D ^DIR K DIR
86 I $D(DIRUT) D Q
87 . W !,"Error Code has not been changed"
88 . D PAUSE^VALM1
89 S SDEVAL=+Y,SDENTYP="E"
90 D HDR^SCENI0,INIT^SCENI0
91 Q
92 ;
93DSPLYER ; Display transmission errors
94 N SDXPTR
95 ;
96 S LINENBR=$$SELXENC
97 I $D(SDXPTR) D
98 . S VALMBCK=""
99 . D EN^SCENIA0
100 . S VALMBCK="R"
101 . D SELECT^VALM10(LINENBR,1) ; This line will hilight the entry and not rebuild the list
102 K SDXPTR,LINENBR
103 Q
104 ;
105EXP ; Expand enounter using the Appointment Management Expand protocol.
106 ; This protocol uses the SDAMIDX Tmp global, so if this global already
107 ; exisits (IEMM LM being called from inside Apt. Manager) save off the
108 ; existing global before proceeding, and restore it before returning.
109 ;
110 K ^TMP("SCENI TMP",$J)
111 I $D(^TMP("SDAMIDX",$J)) D
112 . M ^TMP("SCENI TMP",$J)=^TMP("SDAMIDX",$J)
113 ;
114 K ^TMP("SDAMIDX",$J)
115 M ^TMP("SDAMIDX",$J)=^TMP("SCENIDX",$J)
116 K ^TMP("SDAMEP",$J)
117 S VALMBCK=""
118 D SEL^SDAMEP G EXPQ:'$D(SDW)!(SDERR)
119 N SDWIDTH,SDPT,SDSC,SDXMT,SCINF
120 ;
121 S SDXMT=$O(^TMP("SCENI",$J,"XMT",SDW,0))
122 I $$OPENC^SCUTIE1(SDXMT,"SCINF")>-1,SCINF("AE") D G EXPQ
123 . W !!,$C(7),"This encounter is not an appointment, and cannot be expanded."
124 . W !,"Press any key to continue..."
125 . S DIR(0)="FAO" D ^DIR K DIR
126 ;
127 W ! D WAIT^DICD,EN^VALM("SDAM APPT PROFILE")
128 S VALMBCK="R"
129 ;
130EXPQ K ^TMP("SDCOIDX",$J),^TMP("SDAMIDX",$J)
131 I $D(^TMP("SCENI TMP",$J)) D
132 . M ^TMP("SDAMIDX",$J)=^TMP("SCENI TMP",$J)
133 . K ^TMP("SCENI TMP",$J)
134 Q
135 ;
136SELXENC() ; Select transmitted encounter to display errors if no encounter passed in.
137 N VALMI,VALMAT,VALMY
138 ;
139 D FULL^VALM1
140 D EN^VALM2(XQORNOD(0),"S") S VALMI=0
141 I '$D(VALMY) S VALMBCK="R" Q 0
142 S SDN1="",SDN2=$O(VALMY(SDN1))
143 S SDXPTR="",SDXPTR=$O(^TMP("SCENI",$J,"XMT",SDN2,SDXPTR))
144 Q +SDN2
145 ;
146EXIT ;
147 I $D(VALMBCK),VALMBCK="R" D REFRESH^VALM S VALMBCK=$P(VALMBCK,"R")_$P(VALMBCK,"R",2)
148 K SDBT,SDEDT,SDN1,SDN2
149 Q
Note: See TracBrowser for help on using the repository browser.