source: FOIAVistA/tag/r/SCHEDULING-SD-SC/SDQUT.m@ 1590

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

initial load of FOIAVistA 6/30/08 version

File size: 2.3 KB
Line 
1SDQUT ;ALB/MJK - Query Object Utility Methods ;8/12/96
2 ;;5.3;Scheduling;**131**;Aug 13, 1993
3 ;
4REG(SDQ,SDGREF) ; -- regular xref validator
5 N SDSUB
6 S SDSUB=$G(^TMP("SDQUERY CLASS",$J,SDQ,"GL SUBSCRIPTS"))+1
7 IF $QS(SDGREF,SDSUB)'=$G(@SDQUERY@(SDQ,"INDEX INTERNAL")) S SDGREF="" G REGQ
8 IF $QS(SDGREF,SDSUB+1)'=$G(@SDQUERY@(SDQ,"MASTER VALUE")) S SDGREF="" G REGQ
9REGQ Q
10 ;
11 ;
12REGDT(SDQ,SDGREF) ;-- regular date/time xref validator
13 N SDSUB,SDT,SDBEG,SDEND
14 S SDSUB=$G(^TMP("SDQUERY CLASS",$J,SDQ,"GL SUBSCRIPTS"))+1
15 S SDBEG=$G(@SDQUERY@(SDQ,"BEGIN DATE"))
16 S SDEND=$G(@SDQUERY@(SDQ,"END DATE"))
17 ;
18 IF $QS(SDGREF,SDSUB)'=$G(@SDQUERY@(SDQ,"INDEX INTERNAL")) S SDGREF="" G REGDTQ
19 S SDT=$QS(SDGREF,SDSUB+1)
20 IF SDT>SDEND!(SDT<SDBEG) S SDGREF="" G REGDTQ
21REGDTQ Q
22 ;
23 ;
24COM(SDQ,SDGREF) ; -- composite xref validator
25COMQ Q
26 ;
27 ;
28COMDT(SDQ,SDGREF) ;-- composite xref with date/time validator
29 N SDSUB,SDT,SDBEG,SDEND
30 S SDSUB=$G(^TMP("SDQUERY CLASS",$J,SDQ,"GL SUBSCRIPTS"))+1
31 S SDBEG=$G(@SDQUERY@(SDQ,"BEGIN DATE"))
32 S SDEND=$G(@SDQUERY@(SDQ,"END DATE"))
33 IF $QS(SDGREF,SDSUB)'=$G(@SDQUERY@(SDQ,"INDEX INTERNAL")) S SDGREF="" G COMDTQ
34 IF $QS(SDGREF,SDSUB+1)'=$G(@SDQUERY@(SDQ,"MASTER VALUE")) S SDGREF="" G COMDTQ
35 S SDT=$QS(SDGREF,SDSUB+2)
36 IF SDT>SDEND!(SDT<SDBEG) S SDGREF="" G COMDTQ
37COMDTQ Q
38 ;
39 ;
40REFRESH(SDQ,SDERR) ; -- refresh query
41 ; API ID: 94
42 ; API NAME: SDQ REFRESH
43 ;
44REFRESHG ; -- goto entry point
45 ; -- do validation checks
46 IF '$$QRY^SDQVAL(.SDQ,$G(SDERR)) G REFRESHQ
47 IF '$$QRYACT^SDQVAL(.SDQ,$G(SDERR)) G REFRESHQ
48 ;
49 D ACTIVE^SDQPROP(.SDQ,"FALSE","SET",$G(SDERR))
50 D ACTIVE^SDQPROP(.SDQ,"TRUE","SET",$G(SDERR))
51REFRESHQ Q
52 ;
53 ;
54GETENTRY(SDQ,SDERR) ; -- get ID/IEN number for cursor entry
55 ; API ID: 95
56 ; API NAME: SDQ GET CURRENT ENCOUNTER ID
57 ;
58 ; -- do validation checks
59 IF '$$QRY^SDQVAL(.SDQ,$G(SDERR)) Q ""
60 IF '$$QRYACT^SDQVAL(.SDQ,$G(SDERR)) Q ""
61 ;
62 N SDID,SDGREF,SDSUB
63 S SDGREF=$G(^TMP("SDQUERY LIST",$J,SDQ,+$G(@SDQUERY@(SDQ,"CURSOR"))))
64 S SDSUB=+$G(@SDQUERY@(SDQ,"IEN SUBSCRIPT"))
65 S SDID=$QS(SDGREF,SDSUB)
66 Q SDID
67 ;
68 ;
69POST ; -- post error action logic
70 ;W !,"Error: ",!
71 ;ZW DIPI ZW DIPE
72 Q
73 ;
74 ;
75PREP ; -- Prepare environment / clean up generic error arrays
76 D CLEAN^DILF
77 Q
78 ;
79 ;
80ERRCHK(SDQERRS) ; -- is an error present in error array?
81 IF $G(SDQERRS)]"" Q $O(@SDQERRS@("DIERR",0))>0
82 Q $O(^TMP("DIERR",$J,0))>0
83 ;
Note: See TracBrowser for help on using the repository browser.