source: FOIAVistA/trunk/r/REGISTRATION-DGQE-DG-DPT-GRPX-VAD-VAF-VAS-VAT-VAU--VA-VIC--DGBT--DGJ--DGYA--VALM/DGMSTL2.m@ 1394

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

initial load of FOIAVistA 6/30/08 version

File size: 3.5 KB
Line 
1DGMSTL2 ;ALB/SCK - MST LISTMANAGER UTILITIES CONT. ; 12/17/98
2 ;;5.3;Registration;**195**;Aug 13, 1993
3 Q
4 ;
5ASKDATE(MSTDT,MSTOLDDT) ; Return status change date
6 ; Future dates will not be allowed
7 ;
8 ; Input
9 ; MSTDT - Date to be used as default [optional] Default is NOW
10 ; MSTOLDDT - Date to be used as the minimum allowed entry date
11 ; [optional] Default is null
12 ; Both dates must be in FM date format is passed in.
13 ;
14 ; Output
15 ; DGRSLT has the following values:
16 ; 0 - if user up-arrows, times out, or enters null
17 ; Y - date in FM date format
18 ;
19 N DGRSLT,Y
20 ;
21 K DIRUT
22 S MSTDT=$G(MSTDT)
23 S MSTOLDDT=$G(MSTOLDDT)
24 S DIR(0)="DAO^"_$S(MSTOLDDT>0:MSTOLDDT,1:"")_":NOW:ERXP"
25 S DIR("B")=$S(MSTDT>0:$$FMTE^XLFDT(MSTDT),1:"NOW")
26 S DIR("A")="Enter date of status change: "
27 D ^DIR K DIR
28 I $D(DIRUT) S DGRSLT=0
29 E S DGRSLT=Y
30 ;
31 Q $G(DGRSLT)
32 ;
33ASKPROV(MSTPV) ; Ask for Provider
34 ; Input
35 ; MSTPV - IEN of default provider [optional]
36 ;
37 ; Returns
38 ; DGRSLT
39 ; 0 - if user up-arrows, times out, or enters null
40 ; +Y - IEN of selected provider
41 ;
42 N DGRSLT
43 ;
44 K DIRUT
45 S MSTPV=$G(MSTPV)
46 S DIR(0)="29.11,4AO"
47 S DIR("B")=$S(MSTPV>0:$$NAME^DGMSTAPI(MSTPV),1:"")
48 S DIR("A")="Provider determining status: "
49 D ^DIR K DIR
50 I $D(DIRUT) S DGRSLT=0
51 E S DGRSLT=+Y
52 ;
53 Q $G(DGRSLT)
54 ;
55ADDSTR(DFN,MSTST,MSTDT,MSTPR,MSTIEN) ; Build the formatted display string for the List Manager display
56 ; Input
57 ; DFN - IEN of patient in the PATIENT File (#2)
58 ; MSTST - Status code for the MST status
59 ; MSTDT - Date of the status change in FM internal format
60 ; MSTPR - IEN of provider in the NEW USER File (#200)
61 ; MSTIEN- IEN of new entry in the MST HISTORY File (#29.11)
62 ;
63 ;; Check for empty list. If list is empty, clear message and reset LM variables.
64 N DGX
65 I $D(^TMP("DGMST",$J,"INIT"))>0 D
66 . K ^TMP("DGMST",$J)
67 . D CLEAN^VALM10
68 . S (VALMCNT,MSTCNT)=0
69 ;
70 N VADM,VA
71 D DEM^VADPT,PID^VADPT
72 S MSTCNT=$G(MSTCNT)+1
73 S DGX=$$SETFLD^VALM1(MSTCNT,"","MST#")
74 S DGX=$$SETFLD^VALM1(VA("BID"),DGX,"SSN")
75 S DGX=$$SETFLD^VALM1(VADM(1),DGX,"PATIENT")
76 S DGX=$$SETFLD^VALM1(MSTST,DGX,"STATUS")
77 S DGX=$$SETFLD^VALM1($$FMTE^XLFDT(MSTDT),DGX,"DATE")
78 S DGX=$$SETFLD^VALM1($S(MSTPR>0:$$NAME^DGMSTAPI(MSTPR),1:""),DGX,"PROVIDER")
79 D SET(DGX,MSTCNT,DFN,MSTIEN)
80 S ^TMP("DGMST",$J,0)=MSTCNT
81 D KVA^VADPT
82 Q
83 ;
84SET(X,IDX,DFN,MSTIEN) ; Set the formatted display string into the List Manager global
85 ; Build the DFN and IDX indexes
86 ; Input
87 ; X - formated display string
88 ; IDX - Index number
89 ; DFN - IEN of patient in the PATIENT File (#2)
90 ;
91 S VALMCNT=$G(VALMCNT)+1,^TMP("DGMST",$J,VALMCNT,0)=X
92 S ^TMP("DGMST",$J,"IDX",VALMCNT,IDX)=""
93 S ^TMP("DGMST",$J,"DFN",VALMCNT,DFN)=""
94 S ^TMP("DGMST",$J,"IEN",VALMCNT,MSTIEN)=""
95 Q
96 ;
97EXTMST(MSTST) ; convert MST status code to external dislay format
98 Q $S(MSTST["Y":"Yes, Screened reports MST",MSTST["N":"No, Screened does not report MST",MSTST["D":"Screened Declines to answer",1:"Unknown, not screened")
99 ;
100NUL ; Check for empty list. If empty display message and force page number
101 I '$O(^TMP("DGMST",$J,0)) D SET^DGMSTL(" No Entries")
102 Q
103 ;
104CHKNUL() ; Checks of an "empty" list to lock out protocols.
105 N DGRSLT
106 S DGRSLT=0
107 I VALMCNT>0,^TMP("DGMST",$J,1,0)["No Entries" D
108 . S DIR(0)="FAO"
109 . S DIR("A",1)="Action not allowed at this point."
110 . S (DIR("A"),DIR("?"),DIR("??"))="Press any key to continue..."
111 . D ^DIR K DIR
112 . S DGRSLT=1
113 Q $G(DGRSLT)
Note: See TracBrowser for help on using the repository browser.