source: FOIAVistA/trunk/r/PROBLEM_LIST-GMPL/GMPLPRF1.m@ 1094

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

initial load of FOIAVistA 6/30/08 version

File size: 5.0 KB
Line 
1GMPLPRF1 ; SLC/MKB -- Problem List User Prefs cont ;;9-5-95 11:54am
2 ;;2.0;Problem List;**3**;Aug 25, 1994
3ADD ; -- add item(s) to view
4 N GMPLSEL,GMPLNO,IFN,NUM,CNUM,I,J S VALMBCK=$S(VALMCC:"",1:"R")
5ADD1 S GMPLSEL=$$SELECT Q:GMPLSEL="^"
6 S GMPLNO=$L(GMPLSEL,","),I=$S(GMPLMODE="S":"service",1:"clinic")
7 I (^TMP("GMPLIST",$J,"VIEW",0)+GMPLNO-1)>60 D G ADD1
8 . W !!,"You may not have more than 60 "_I_"s included in your view!"
9 . W !,"Your view currently includes "_^TMP("GMPLIST",$J,"VIEW",0)_" "_I_$S(^TMP("GMPLIST",$J,"VIEW",0)'=1:"s",1:"")_"."
10 . W !,"Please select again, choosing no more than "_(60-^TMP("GMPLIST",$J,"VIEW",0))_" "_I_$S(^TMP("GMPLIST",$J,"VIEW",0)'=1:"s",1:"")_"."
11ADD2 W !!,"Adding "_(GMPLNO-1)_" "_I_"(s) ..." K I
12 F I=1:1:GMPLNO S NUM=$P(GMPLSEL,",",I) I NUM D
13 . S IFN=^TMP("GMPLIST",$J,"IDX",NUM) W "."
14 . S TMP=$E($P(^TMP("GMPLIST",$J,NUM,0),U,1),1,44)_" Y",^TMP("GMPLIST",$J,NUM,0)=TMP
15 . S:'$D(^TMP("GMPLIST",$J,"VIEW",IFN)) ^TMP("GMPLIST",$J,"VIEW",IFN)="",^TMP("GMPLIST",$J,"VIEW",0)=^TMP("GMPLIST",$J,"VIEW",0)+1
16 . Q:GMPLMODE'="S" Q:'$D(^DIC(49,"ACHLD",IFN))
17 . I $$INCLCHLD(IFN) F J=0:0 S J=$O(^DIC(49,"ACHLD",IFN,J)) Q:J'>0 D
18 . . S CNUM=+$G(^TMP("GMPLIST",$J,"B",J)) W "."
19 . . I CNUM S TMP=$E(^TMP("GMPLIST",$J,CNUM,0),1,44)_" Y",^TMP("GMPLIST",$J,CNUM,0)=TMP S:'$D(^TMP("GMPLIST",$J,"VIEW",J)) ^TMP("GMPLIST",$J,"VIEW",J)="",^TMP("GMPLIST",$J,"VIEW",0)=^TMP("GMPLIST",$J,"VIEW",0)+1
20 S VALMBCK="R",VALMSG=$$MSG^GMPLPREF K VALMHDR
21 Q
22 ;
23REMOVE ; -- delete item(s) from view
24 N GMPLSEL,GMPLNO,IFN,NUM,CNUM,I,J S VALMBCK=$S(VALMCC:"",1:"R")
25 S GMPLSEL=$$SELECT Q:GMPLSEL="^"
26 S GMPLNO=$L(GMPLSEL,",")
27 W !!,"Removing "_(GMPLNO-1)_" "_$S(GMPLMODE="S":"service",1:"clinic")_"(s) ..."
28 F I=1:1:GMPLNO S NUM=$P(GMPLSEL,",",I) I NUM D
29 . S IFN=+^TMP("GMPLIST",$J,"IDX",NUM),^TMP("GMPLIST",$J,NUM,0)=$E(^TMP("GMPLIST",$J,NUM,0),1,44)
30 . S:$D(^TMP("GMPLIST",$J,"VIEW",IFN)) ^TMP("GMPLIST",$J,"VIEW",0)=^TMP("GMPLIST",$J,"VIEW",0)-1
31 . K ^TMP("GMPLIST",$J,"VIEW",IFN) W "."
32 . Q:GMPLMODE'="S" Q:'$D(^DIC(49,"ACHLD",IFN))
33 . I $$INCLCHLD(IFN) F J=0:0 S J=$O(^DIC(49,"ACHLD",IFN,J)) Q:J'>0 D
34 . . S CNUM=+$G(^TMP("GMPLIST",$J,"B",J)) W "."
35 . . I CNUM S ^TMP("GMPLIST",$J,CNUM,0)=$E(^TMP("GMPLIST",$J,CNUM,0),1,44) S:$D(^TMP("GMPLIST",$J,"VIEW",J)) ^TMP("GMPLIST",$J,"VIEW",0)=^TMP("GMPLIST",$J,"VIEW",0)-1 K ^TMP("GMPLIST",$J,"VIEW",J)
36 S VALMBCK="R",VALMSG=$$MSG^GMPLPREF K VALMHDR
37 Q
38 ;
39INCLCHLD(IFN) ; Returns 1 or 0, to include 'child' services in selection
40 N DIR,X,Y,NAME S NAME=$P($G(^DIC(49,IFN,0)),U),DIR("B")="YES"
41 S DIR(0)="Y",DIR("A")="Include all sub-services/sections of "_NAME
42 S DIR("?",1)="This service is a 'parent' to other services/sections,"
43 S DIR("?",2)="listed indented above; enter YES to include all of these"
44 S DIR("?")="as well in this action, or enter NO to exclude them."
45 D ^DIR S:$D(DTOUT) Y="^"
46 Q Y
47 ;
48SELECT() ; Select item(s) from list
49 N DIR,X,Y,MAX
50 S MAX=+$G(^TMP("GMPLIST",$J,0)) I MAX'>0 Q "^"
51 S DIR(0)="LAO^1:"_MAX
52 S DIR("A")="Select "_$S(GMPLMODE="S":"Service",1:"Clinic")
53 S:MAX>1 DIR("A")=DIR("A")_" (1-"_MAX_"): "
54 S:MAX'>1 DIR("A")=DIR("A")_": ",DIR("B")=1
55 S DIR("?")="Enter the display number of the "_$S(GMPLMODE="S":"service",1:"clinic")_"(s) you wish to select"
56 D ^DIR I $D(DTOUT)!(X="") S Y="^"
57 Q Y
58 ;
59DIFFRENT() ; -- Returns 1 if view has changed, else 0
60 N I,TEMP S TEMP=""
61 F I=0:0 S I=$O(^TMP("GMPLIST",$J,"VIEW",I)) Q:I'>0 S TEMP=TEMP_I_"/"
62 S:$L(TEMP) TEMP=GMPLMODE_"/"_TEMP
63 Q TEMP'=$P($G(^VA(200,DUZ,125)),U)
64 ;
65SAVE ; -- save new view in File #200/Field #125
66 N I,TEMP,TMP S TEMP=GMPLMODE,TMP=$P($G(^VA(200,DUZ,125)),U,2,999)
67 F I=0:0 S I=$O(^TMP("GMPLIST",$J,"VIEW",I)) Q:I'>0 S TEMP=TEMP_"/"_I
68 S:$L(TEMP)>1 TEMP=TEMP_"/"
69 S ^VA(200,DUZ,125)=TEMP_U_TMP,GMPSAVED=1
70 Q
71 ;
72SWITCH ; -- change preferred views (service <--> clinic)
73 N DIR,X,Y S Y=1,VALMBCK=$S(VALMCC:"",1:"R")
74 G SW1:'$L($G(GMPLVIEW)) ; no current view
75 S DIR(0)="Y",DIR("A")="Are you sure this is ok",DIR("B")="NO"
76 S DIR("?",1)="You may have only one preferred view at a time."
77 S DIR("?",2)="Enter YES to change how your preferred view is defined,"
78 S DIR("?")="or press <return> to keep the view you currently have."
79 W !!,">>> This action will clear your current view of problems by "
80 W $S(GMPLMODE="S":"service",1:"clinic")
81 W !?5,"and present a list of "_$S(GMPLMODE="S":"clinics",1:"services")
82 W " to replace it with.",! D ^DIR
83SW1 I Y D
84 . S VALMBCK="R",GMPLVIEW="",GMPLMODE=$S(GMPLMODE="S":"C",1:"S")
85 . D @("GET"_GMPLMODE_"LIST^GMPLPREF") K VALMHDR
86 Q
87 ;
88DELETE ; -- delete preferred view (no view)
89 N DIR,X,Y S DIR(0)="Y",DIR("B")="NO",VALMBCK=$S(VALMCC:"",1:"R")
90 S DIR("A")="Are you sure you want to delete your preferred view"
91 S DIR("?",1)="Enter YES to remove your preferred view; the default view of Outpatient,",DIR("?",2)="including all active problems, will be used to display problem information.",DIR("?")="Enter NO to continue editing your current view."
92 D ^DIR I Y D
93 . W !!,"Deleting preferred view of "_$S(GMPLMODE="S":"services",1:"clinics")_" ..."
94 . K ^TMP("GMPLIST",$J,"VIEW") S ^TMP("GMPLIST",$J,"VIEW",0)=0,VALMBCK="Q",GMPLMODE=""
95 . D SAVE W " done."
96 Q
Note: See TracBrowser for help on using the repository browser.