source: WorldVistAEHR/trunk/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOOREDX.m@ 1144

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

initial load of WorldVistAEHR

File size: 3.5 KB
Line 
1PSOOREDX ;BIR/MHA-Rxs dosing common calls ;03/06/03
2 ;;7.0;OUTPATIENT PHARMACY;**133**;DEC 1997
3 ;External reference to PS(51.2 supported by DBIA 2226
4 ;called from psoored4 & psoored5
5VER D KV S DIR(0)="52.0113,8"
6 S:$G(PSORXED("VERB",ENT))]"" DIR("B")=PSORXED("VERB",ENT)
7 D ^DIR Q
8DUPD ;
9 D KV S DIR(0)="52.0113,1",DIR("A")="DISPENSE UNITS PER DOSE"_$S($G(PSORXED("NOUN",ENT))]"":"("_PSORXED("NOUN",ENT)_")",1:"")
10 I '$G(PSORXED("DOSE",ENT)),$G(PSORXED("DOSE",ENT-1)) S PSORXED("DOSE",ENT)=PSORXED("DOSE",ENT-1)
11 Q
12 ;
13STR S:+STRE>0&(X>0) PSORXED("DOSE",ENT)=(X*STRE) W !,"Dosage Ordered: "_$S($E(PSORXED("DOSE",ENT),1)=".":"0",1:"")_PSORXED("DOSE",ENT)_UNITN,!
14 S:X'="" (PSORXED("DOSE ORDERED",ENT),DUPD)=X
15 Q
16 ;
17NOU D KV S DIR(0)="52.0113,3"
18 S DIR("B")=$S($G(NOUN)]"":NOUN,1:$G(PSORXED("NOUN",ENT))) K:DIR("B")="" DIR("B")
19 S PSONDEF=$G(DIR("B"))
20 D ^DIR Q
21 ;
22DUR1 K:X="@" DUR,PSORXED("DURATION",ENT)
23 I Y'="" S PSORXED("DURATION",ENT)=Y W " ("_$S(Y["L":"MONTHS",Y["W":"WEEKS",Y["H":"HOURS",Y["M":"MINUTES",1:"DAYS")_")"
24 Q
25 ;
26CON D KV S DIR(0)="52.0113,5"
27 S:$G(PSORXED("CONJUNCTION",ENT))'="" DIR("B")=PSORXED("CONJUNCTION",ENT)
28 D ^DIR Q
29 ;
30CON1 D KV S DIR(0)="Y",DIR("A",1)="Deleting this conjunction will delete the dosing sequence that follows!"
31 S DIR("A")="Are you sure you want to delete",DIR("B")="NO" D ^DIR
32 Q
33 ;
34KV K DIR,DIRUT,DTOUT,DUOUT Q
35 ;
36 ;
37FNM S NM=$E(X,2,4),NM=$TR(NM,"qwertyuioplkjhgfdsazxcvbnm","QWERTYUIOPLKJHGFDSAZXCVBNM")
38 S FLDNM=$S(NM="DOS":"DOSE^*Dosage",NM="DIS":"DOSE ORDERED^Dispense Units",NM="ROU":"ROUTE^*Route",NM="SCH":"SCHEDULE^*Schedule",NM="DUR"!(NM="LIM"):"DURATION^*Duration",1:"")
39 S:FLDNM="" FLDNM=$S(NM="CON":"CONJUNCTION^*Conjunction",NM="NOU":"NOUN^Noun",NM="VER":"VERB^Verb",1:"")
40 Q
41JFN K FLDNM,AR S ENT=+Y,FLDNM=$S(NM="NOU":"NOU",NM="VER":"VER",NM="DOS":"ASK",NM="DIS":"DUPD",NM="ROU":"RTE",NM="SCH":"SCH",NM="DUR"!(NM="LIM"):"DUR",NM="CON":"CON",1:"")
42 Q
43JP2 F AR=1:1:PSORXED("ENT") D:$G(PSORXED("SCHEDULE",AR))]""
44 .W !,AR_". "_$P(FLDNM,"^",2)_": "_$S(NM="ROU"&($G(PSORXED($P(FLDNM,"^"),AR))):$P(^PS(51.2,PSORXED($P(FLDNM,"^"),AR),0),"^"),1:$G(PSORXED($P(FLDNM,"^"),AR))) S AR1=AR
45 Q
46UPD ;updates dosing array
47 K PSORXED("CONJUNCTION",ENT) S I=ENT+1 D RV
48 S HENT=ENT
49UPD1 ;
50 S I=HENT+1,J=I+1
51 I $G(PSORXED("CONJUNCTION",I))]"",'$D(PSORXED("DOSE",J)) K PSORXED("CONJUNCTION",I) Q
52 I $G(PSORXED("CONJUNCTION",I))]"" S PSORXED("CONJUNCTION",HENT)=PSORXED("CONJUNCTION",I) D G UPD1
53 .K PSORXED("CONJUNCTION",I) I $D(PSORXED("DOSE",J)) D
54 ..S PSORXED("DOSE",I)=PSORXED("DOSE",J)
55 ..S PSORXED("DOSE ORDERED",I)=$G(PSORXED("DOSE ORDERED",J))
56 ..S PSORXED("UNITS",I)=$G(PSORXED("UNITS",J))
57 ..S PSORXED("NOUN",I)=$G(PSORXED("NOUN",J))
58 ..S PSORXED("VERB",I)=$G(PSORXED("VERB",J))
59 ..S PSORXED("DURATION",I)=$G(PSORXED("DURATION",J))
60 ..S PSORXED("CONJUNCTION",I)=$G(PSORXED("CONJUNCTION",J))
61 ..S PSORXED("ROUTE",I)=$G(PSORXED("ROUTE",J))
62 ..S PSORXED("SCHEDULE",I)=$G(PSORXED("SCHEDULE",J))
63 ..S PSORXED("ODOSE",I)=$G(PSORXED("ODOSE",J))
64 ..S HENT=HENT+1,I=HENT+1
65 ..I $G(PSORXED("CONJUNCTION",I))]"" Q
66 ..K PSORXED("CONJUNCTION",I) D RV
67 S PSORXED("ENT")=HENT K HENT D EN^PSOFSIG(.PSORXED)
68 Q
69RV K PSORXED("UNITS",I),PSORXED("NOUN",I),PSORXED("DURATION",I),PSORXED("ROUTE",I),PSORXED("SCHEDULE",I),PSORXED("DOSE",I),PSORXED("DOSE ORDERED",I),PSORXED("VERB",I),PSORXED("ODOSE",I)
70 Q
71M1 S VALMSG="Prescription Not Updated!"
72 Q
73M2 S VALMSG="This edit will create a new prescription!"
74 Q
75M3 S VALMSG=$S($G(COPY):"Copy Request Cancelled!",1:"Prescription Not Updated!")
76 Q
77MP1 S VALMSG="Pending Order Not Updated!"
78 Q
Note: See TracBrowser for help on using the repository browser.