source: FOIAVistA/trunk/r/BAR_CODE_MED_ADMIN-ALPB-PSB/PSBPARIV.m@ 1354

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

initial load of FOIAVistA 6/30/08 version

File size: 7.2 KB
Line 
1PSBPARIV ;BIRMINGHAM/EFC-BCMA IV PARAMETERS FUNCTIONS ;Mar 2004
2 ;;3.0;BAR CODE MED ADMIN;;Mar 2004
3 ;
4 ; Reference/IA
5 ; ^DIC(42/1377
6 ; ^DIC(42/2440
7 ; $$SITE^VASITE/10112
8 ; $$GET^XPAR/2263
9 ; WIN^DGPMDDCF/1246
10 ;
11WLIST(RESULTS,PSBEDIV) ; get the ward list for the IV Parameters GUI
12 K ^TMP("PSB",$J)
13 S RESULTS=$NAME(^TMP("PSB",$J)),^TMP("PSB",$J,0)=1,^TMP("PSB",$J,1)="ALL^1^0^1^1^1^1^1"
14 S PSBX="" F S PSBX=$O(^DIC(42,"B",PSBX)) Q:PSBX="" D
15 .S D0=$O(^DIC(42,"B",PSBX,"")) D WIN^DGPMDDCF Q:X=1
16 .S PSBD=$$GET1^DIQ(42,D0_",",.015,"I") Q:PSBD=""
17 .S PSBD=$P($$SITE^VASITE(DT,PSBD),U,1) Q:PSBD'=$G(PSBEDIV)
18 .S PSBNODE=^TMP("PSB",$J,0)+1,^TMP("PSB",$J,0)=PSBNODE,^TMP("PSB",$J,PSBNODE)=PSBX_"^0"
19 .I $D(^PSB(53.66,"B",D0)) S PSBIEN=$O(^PSB(53.66,"B",D0,"")),$P(^TMP("PSB",$J,PSBNODE),U,2)="1^"_PSBIEN_"^0^0^0^0^0" D
20 ..S PSBY="" F S PSBY=$O(^PSB(53.66,PSBIEN,1,"B",PSBY)) Q:PSBY="" S $P(^TMP("PSB",$J,PSBNODE),U,$FIND("ACHPS",PSBY)+2)=1
21 Q
22 ;
23GETPAR(RESULTS,PSBWARD,PSBIVPT,PSBDIV) ;get parameters for a specific ward and type
24 K ^TMP("PSB",$J)
25 I $G(PSBDIV)'="" S PSBEDIV=PSBDIV
26 S RESULTS=$NAME(^TMP("PSB",$J)),^TMP("PSB",$J,0)="-1^Ward is not defined in BCMA IV PARAMETERS file 53.66"
27 D CHKDIV
28 S:PSBEDIV'["DIV.`" PSBEDIV="DIV.`"_PSBEDIV
29 I PSBWARD=0 D Q
30 .S PSBPAR=PSBIVPT_U_$$GET^XPAR(PSBEDIV,"PSBIV ADDITIVE",PSBIVPT)
31 .S PSBPAR=PSBPAR_U_$$GET^XPAR(PSBEDIV,"PSBIV STRENGTH",PSBIVPT)
32 .S PSBPAR=PSBPAR_U_$$GET^XPAR(PSBEDIV,"PSBIV BOTTLE",PSBIVPT)
33 .S PSBPAR=PSBPAR_U_$$GET^XPAR(PSBEDIV,"PSBIV SOLUTION",PSBIVPT)
34 .S PSBPAR=PSBPAR_U_$$GET^XPAR(PSBEDIV,"PSBIV VOLUME",PSBIVPT)
35 .S PSBPAR=PSBPAR_U_$$GET^XPAR(PSBEDIV,"PSBIV INFUSION RATE",PSBIVPT)
36 .S PSBPAR=PSBPAR_U_$$GET^XPAR(PSBEDIV,"PSBIV MED ROUTE",PSBIVPT)
37 .S PSBPAR=PSBPAR_U_$$GET^XPAR(PSBEDIV,"PSBIV SCHEDULE",PSBIVPT)
38 .S PSBPAR=PSBPAR_U_$$GET^XPAR(PSBEDIV,"PSBIV ADMIN TIME",PSBIVPT)
39 .S PSBPAR=PSBPAR_U_$$GET^XPAR(PSBEDIV,"PSBIV REMARKS",PSBIVPT)
40 .S PSBPAR=PSBPAR_U_$$GET^XPAR(PSBEDIV,"PSBIV OTHER PRINT INFO",PSBIVPT)
41 .S PSBPAR=PSBPAR_U_$$GET^XPAR(PSBEDIV,"PSBIV PROVIDER",PSBIVPT)
42 .S PSBPAR=PSBPAR_U_$$GET^XPAR(PSBEDIV,"PSBIV START DATE/TIME",PSBIVPT)
43 .S PSBPAR=PSBPAR_U_$$GET^XPAR(PSBEDIV,"PSBIV STOP DATE/TIME",PSBIVPT)
44 .S PSBPAR=PSBPAR_U_$$GET^XPAR(PSBEDIV,"PSBIV PROVIDER COMMENTS",PSBIVPT)
45 .S ^TMP("PSB",$J,0)=PSBPAR
46 I '$D(^PSB(53.66,PSBWARD)) Q
47 I '$D(^PSB(53.66,PSBWARD,1,"B",PSBIVPT)) D Q
48 .S PSBIVPTX=$P("^ADDMIXTURE^PIGGYBACK^HYPERAL^SYRINGE^CHEMO",U,$F("APHSC",PSBIVPT))
49 .S ^TMP("PSB",$J,0)="-1^"_PSBIVPTX_" IV PARAMETERS NOT DEFINED FOR WARD"
50 S PSBPAR=$TR(^PSB(53.66,PSBWARD,1,$O(^PSB(53.66,PSBWARD,1,"B",PSBIVPT,0)),0),"WNI",123)
51 S ^TMP("PSB",$J,0)=PSBPAR
52 Q
53 ;
54CHKDIV ;
55 ;
56 S:PSBEDIV'["DIV.`" PSBEDIV="DIV.`"_PSBEDIV
57 I '$$GET^XPAR(PSBEDIV,"PSBIV ADDITIVE") F I=1:1:5 D EN^XPAR(PSBEDIV,"PSBIV ADDITIVE",I,3)
58 I '$$GET^XPAR(PSBEDIV,"PSBIV ADMIN TIME") F I=1:1:5 D EN^XPAR(PSBEDIV,"PSBIV ADMIN TIME",I,3)
59 I '$$GET^XPAR(PSBEDIV,"PSBIV BOTTLE") F I=1:1:5 D EN^XPAR(PSBEDIV,"PSBIV BOTTLE",I,3)
60 I '$$GET^XPAR(PSBEDIV,"PSBIV INFUSION RATE") F I=1:1:5 D EN^XPAR(PSBEDIV,"PSBIV INFUSION RATE",I,1)
61 I '$$GET^XPAR(PSBEDIV,"PSBIV MED ROUTE") F I=1:1:5 D EN^XPAR(PSBEDIV,"PSBIV MED ROUTE",I,3)
62 I '$$GET^XPAR(PSBEDIV,"PSBIV OTHER PRINT INFO") F I=1:1:5 D EN^XPAR(PSBEDIV,"PSBIV OTHER PRINT INFO",I,1)
63 I '$$GET^XPAR(PSBEDIV,"PSBIV PROVIDER") F I=1:1:5 D EN^XPAR(PSBEDIV,"PSBIV PROVIDER",I,3)
64 I '$$GET^XPAR(PSBEDIV,"PSBIV PROVIDER COMMENTS") F I=1:1:5 D EN^XPAR(PSBEDIV,"PSBIV PROVIDER COMMENTS",I,3)
65 I '$$GET^XPAR(PSBEDIV,"PSBIV REMARKS") F I=1:1:5 D EN^XPAR(PSBEDIV,"PSBIV REMARKS",I,3)
66 I '$$GET^XPAR(PSBEDIV,"PSBIV SCHEDULE") F I=1:1:5 D EN^XPAR(PSBEDIV,"PSBIV SCHEDULE",I,3)
67 I '$$GET^XPAR(PSBEDIV,"PSBIV SOLUTION") F I=1:1:5 D EN^XPAR(PSBEDIV,"PSBIV SOLUTION",I,3)
68 I '$$GET^XPAR(PSBEDIV,"PSBIV START DATE/TIME") F I=1:1:5 D EN^XPAR(PSBEDIV,"PSBIV START DATE/TIME",I,3)
69 I '$$GET^XPAR(PSBEDIV,"PSBIV STOP DATE/TIME") F I=1:1:5 D EN^XPAR(PSBEDIV,"PSBIV STOP DATE/TIME",I,3)
70 I '$$GET^XPAR(PSBEDIV,"PSBIV STRENGTH") F I=1:1:5 D EN^XPAR(PSBEDIV,"PSBIV STRENGTH",I,3)
71 I '$$GET^XPAR(PSBEDIV,"PSBIV VOLUME") F I=1:1:5 D EN^XPAR(PSBEDIV,"PSBIV VOLUME",I,3)
72 Q
73 ;
74PUTPAR(RESULTS,PSBWARD,PSBPARS,PSBDIV) ; set 53.66 (parameters file) with input iv parameters
75 K ^TMP("PSB",$J)
76 I $G(PSBDIV)'="" S PSBEDIV=PSBDIV
77 N PSBDIEN S PSBDIEN=+($G(PSBEDIV))
78 S:PSBEDIV'["DIV.`" PSBEDIV="DIV.`"_PSBEDIV
79 N PSBFDA,PSBMSG,PSBWD,PSBIVPT,X,Z,PSBIVPR,I,K
80 S RESULTS=$NAME(^TMP("PSB",$J))
81 S PSBWARD=$G(PSBWARD)
82 S PSBPARS=$G(PSBPARS)
83 I $G(PSBDIEN)="" S ^TMP("PSB",$J,0)="-1^Division IEN required for ward"_$G(PSBWARD) Q
84 S PSBWD=$P(PSBWARD,U,1),PSBIEN=$P(PSBWARD,U,2)
85 S X="^ADDITIVE^STRENGTH^BOTTLE^SOLUTION^VOLUME^INFUSION RATE^MED ROUTE^SCHEDULE^ADMIN TIME"
86 S X=X_"^REMARKS^OTHER PRINT INFO^PROVIDER^START DATE/TIME^STOP DATE/TIME^PROVIDER COMMENTS"
87 S PSBIVPT=$P(PSBPARS,U,1)
88 I PSBWD="ALL" D Q
89 .S K=2,PSBIVPT=$S(PSBIVPT="A":1,PSBIVPT="P":2,PSBIVPT="H":3,PSBIVPT="S":4,1:5)
90 .F I=2:1 Q:$P(X,U,I)="" S PSBIVPR(I)="PSBIV"_" "_$P(X,U,I)
91 .F I=2:1:16 D EN^XPAR(PSBEDIV,$G(PSBIVPR(I)),PSBIVPT,$P(PSBPARS,U,K)) S K=K+1
92 .S ^TMP("PSB",$J,0)="1^Parameters Saved"
93 F I=2:1 Q:$P(PSBPARS,U,I)="" S $P(PSBPARS,U,I)=$TR($P(PSBPARS,U,I),123,"WNI")
94 I PSBWD'="ALL" D
95 .S PSBWIEN=$O(^DIC(42,"B",PSBWD,""))
96 .S PSBDIVPT=$$GET1^DIQ(42,PSBWIEN_",",.015,"I")
97 .I $P($$SITE^VASITE(DT,PSBDIVPT),U,1)'=PSBDIEN S ^TMP("PSB",$J,0)="-1^Data NOT filed - invalid Division IEN" Q
98 .I $P(PSBPARS,U,2)'="" D
99 ..I $D(^PSB(53.66,"B",PSBWIEN)),$D(^PSB(53.66,PSBIEN,1,"B",PSBIVPT)) D MODIFY ;Modify an existing ward,ivtype
100 ..I $D(^PSB(53.66,"B",PSBWIEN)),'$D(^PSB(53.66,PSBIEN,1,"B",PSBIVPT)) D ADD ;ward exists but not type
101 ..I '$D(^PSB(53.66,"B",PSBWIEN)) D NEW ;Create a new ward
102 .I $P(PSBPARS,U,2)="" D RESET ;Delete an existing ward
103 Q
104NEW ;
105 S PSBIEN="+1,"
106 S PSBFDA(53.66,PSBIEN,.01)=$G(PSBWIEN)
107 D FILEIT
108 S PSBIEN="+1,"_PSBIEN(1)_","
109 S PSBFDA(53.67,PSBIEN,.01)=PSBIVPT
110 S PSBFDA(53.67,PSBIEN,1)=$P(PSBPARS,U,2)
111 F I=5:5:70 S PSBFDA(53.67,PSBIEN,I)=""
112 S K=3,I=1 F S I=$O(PSBFDA(53.67,PSBIEN,I)) Q:I="" S PSBFDA(53.67,PSBIEN,I)=$P(PSBPARS,U,K),K=K+1
113 S PSBIEN(1)=""
114 D FILEIT
115 Q:$D(PSBMSG("DIERR"))
116 S ^TMP("PSB",$J,0)="1^Data successfully filed^"_$G(PSBIEN(1))
117 Q
118MODIFY ;
119 S PSBIEN=$O(^PSB(53.66,"B",PSBWIEN,""))
120 S Z=$O(^PSB(53.66,PSBIEN,1,"B",PSBIVPT,""))
121 S PSBIEN=Z_","_PSBIEN_","
122 S PSBFDA(53.67,PSBIEN,.01)=PSBIVPT
123 S PSBFDA(53.67,PSBIEN,1)=$P(PSBPARS,U,2)
124 F I=5:5:70 S PSBFDA(53.67,PSBIEN,I)=""
125 S K=3,I=1 F S I=$O(PSBFDA(53.67,PSBIEN,I)) Q:I="" S PSBFDA(53.67,PSBIEN,I)=$P(PSBPARS,U,K),K=K+1
126 D FILEIT
127 Q:$D(PSBMSG("DIERR"))
128 S ^TMP("PSB",$J,0)="1^Data successfully filed^"
129 Q
130ADD ;
131 S PSBIEN=$O(^PSB(53.66,"B",PSBWIEN,""))
132 S PSBIEN="+1"_","_PSBIEN_","
133 S PSBFDA(53.67,PSBIEN,.01)=PSBIVPT
134 S PSBFDA(53.67,PSBIEN,1)=$P(PSBPARS,U,2)
135 F I=5:5:70 S PSBFDA(53.67,PSBIEN,I)=""
136 S K=3,I=1 F S I=$O(PSBFDA(53.67,PSBIEN,I)) Q:I="" S PSBFDA(53.67,PSBIEN,I)=$P(PSBPARS,U,K),K=K+1
137 D FILEIT
138 Q:$D(PSBMSG("DIERR"))
139 S ^TMP("PSB",$J,0)="1^Data successfully filed^"
140 Q
141RESET ;
142 N DIK,DA
143 S DIK="^PSB(53.66,"
144 S DA=PSBIEN
145 D ^DIK
146 S ^TMP("PSB",$J,0)="1^Data successfully deleted^"
147 Q
148FILEIT ;
149 D CLEAN^DILF
150 D UPDATE^DIE("","PSBFDA","PSBIEN","PSBMSG")
151 I $D(PSBMSG("DIERR")) S ^TMP("PSB",$J,0)="-1^"_PSBMSG("DIERR",1)_": "_PSBMSG("DIERR",1,"TEXT",1) Q
152 Q
Note: See TracBrowser for help on using the repository browser.