1 | PSOOREDX ;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
|
---|
5 | VER D KV S DIR(0)="52.0113,8"
|
---|
6 | S:$G(PSORXED("VERB",ENT))]"" DIR("B")=PSORXED("VERB",ENT)
|
---|
7 | D ^DIR Q
|
---|
8 | DUPD ;
|
---|
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 | ;
|
---|
13 | STR 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 | ;
|
---|
17 | NOU 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 | ;
|
---|
22 | DUR1 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 | ;
|
---|
26 | CON D KV S DIR(0)="52.0113,5"
|
---|
27 | S:$G(PSORXED("CONJUNCTION",ENT))'="" DIR("B")=PSORXED("CONJUNCTION",ENT)
|
---|
28 | D ^DIR Q
|
---|
29 | ;
|
---|
30 | CON1 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 | ;
|
---|
34 | KV K DIR,DIRUT,DTOUT,DUOUT Q
|
---|
35 | ;
|
---|
36 | ;
|
---|
37 | FNM 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
|
---|
41 | JFN 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
|
---|
43 | JP2 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
|
---|
46 | UPD ;updates dosing array
|
---|
47 | K PSORXED("CONJUNCTION",ENT) S I=ENT+1 D RV
|
---|
48 | S HENT=ENT
|
---|
49 | UPD1 ;
|
---|
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
|
---|
69 | RV 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
|
---|
71 | M1 S VALMSG="Prescription Not Updated!"
|
---|
72 | Q
|
---|
73 | M2 S VALMSG="This edit will create a new prescription!"
|
---|
74 | Q
|
---|
75 | M3 S VALMSG=$S($G(COPY):"Copy Request Cancelled!",1:"Prescription Not Updated!")
|
---|
76 | Q
|
---|
77 | MP1 S VALMSG="Pending Order Not Updated!"
|
---|
78 | Q
|
---|