TIULMED1 ; SLC/JM - Active/Recent Med Objects Routine ;31-Dec-2012 14:51;DU
;;1.0;TEXT INTEGRATION UTILITIES;**38,73,92,94,1006,202,1010,226,1011**;Jun 20, 1997;Build 13
;;IHS/MSC/MGH added items to display for objects
; All routines here are part of the LIST entry point of TIULMED
;
ADD(TXT) ; Saves TXT in TARGET
S NEXTLINE=NEXTLINE+1
I TAB S TXT=" "_TXT
I TAB,HEADER S TXT=" "_TXT
S @TARGET@(NEXTLINE,0)=TXT
Q
ADDLNUM(TXT) ; Add text with Line Number added to front of string
S TAB=0
I HEADER D ADD($E(COUNT_") ",1,5)_TXT) I 1
E D ADD(TXT)
S TAB=1
Q
ADDL(TXT) ; Add with ADDLNUM on FIRST
I FIRST D I 1
.D ADDLNUM(TXT)
.S FIRST=0
E D ADD(TXT)
Q
ADDMED(XMODE) ; if XMODE creates XSTR, if not add med to TARGET
N DATA,FIRST,XSUM,XCOUNT,TOPLINE,WSTATUS,TSTAT
S FIRST=1
I XMODE S (XSUM,XCOUNT)=0,XSTR=""
E D
.S TOPLINE=NEXTLINE+1,DATA="",WSTATUS=0
.D ADDP(2)
I TYPE="UD" D I 1 ; Unit Dose Meds
.I 'XMODE D
..I DETAILED D FLUSH S DATA="Give:"
..S DATA=DATA_" "
.I $$PL(6) D ADDP(6) I 1
.E I $$PL(7) D ADDP(7) I 1
.E D ADDM("SIG")
.D ADDM("MDR"),ADDM("SCH")
.I DETAILED D FLUSH
.D ADDM("SIO")
E I TYPE="OP" D I 1 ; Outpatient Meds
.I 'XMODE,DETAILED D
..I $$PL(12) D
...S DATA=DATA_" Qty:"
...D ADDP(12)
..I $$PL(11) D
...S DATA=$$STRIP(DATA_" for")
...D ADDP(11)
...S DATA=$$STRIP(DATA_" days")
..D WRAP
.I $$ML("SIG") D I 1
..I 'XMODE,DETAILED S DATA=$$STRIP(DATA_" Sig:")
..D ADDM("SIG")
.E D ADDM("SIO"),ADDM("MDR"),ADDM("SCH")
E I TYPE="IV" D ; IV meds
.I DETAILED D FLUSH
.D ADDM("A")
.I $$ML("B") D
..I 'XMODE S DATA=$$STRIP(DATA_" in")
..D ADDM("B")
.D ADDP(3)
.I DETAILED D FLUSH
.;ELR/VMP patch 226 add route and schedule to IV's
.D ADDM("SIO"),ADDM("MDR"),ADDM("SCH")
.D FLUSH
.I 'XMODE D
..N I
..F I=TOPLINE:1:NEXTLINE S @TARGET@(I,0)=$TR(@TARGET@(I,0),U," ")
I XMODE D I 1
.I XSTR="" S XSTR="_"
.E I $L(XSTR)>80 S XSTR=$E(XCOUNT_"_"_XSUM_"_"_XSTR,1,80)
E D
.D FLUSH
.S WSTATUS=1
.D ADDP(9)
.S WSTATUS=0
.I DETAILED D
..D ADDDATE(TOPLINE,$S(MEDTYPE=OUTPTYPE:"Issu",1:"Strt"),15)
..I MEDTYPE=OUTPTYPE D I 1
...N I
...I TOPLINE=NEXTLINE S I=TOPLINE+1
...E I $L(@TARGET@(TOPLINE+1,0))<48 S I=TOPLINE+1
...E S I=TOPLINE+2
...F Q:(I'>NEXTLINE) D ADD(" ")
...;IHS/MSC/MGH Patch 1006
...S TSTAT=$P(NODE,U,9)
...I TSTAT="PENDING" D
....S PIEN=+$P(NODE,U,1) S REFILL=$P($G(^PS(52.41,PIEN,0)),U,11)
....S @TARGET@(I,0)=$E(@TARGET@(I,0)_SPACE60,1,47)_"Refills: "_REFILL
...I TSTAT'="PENDING" D
....S @TARGET@(I,0)=$E(@TARGET@(I,0)_SPACE60,1,47)_"Refills: "_+$P(NODE,U,5)
...;end mods for pending meds
...D ADDDATE(TOPLINE+1,"Last",10)
...D ADDDATE(TOPLINE+2,"Expr",4)
..E D
...D ADDDATE(TOPLINE+1,"Stop",4)
Q
FDT(PNUM) ;Returns formatted date from piece number
N X,Y
S Y=$P(NODE,U,PNUM)
S X=$E(Y,4,5)_"-"_$E(Y,6,7)_"-"_$E($E(Y,1,3)+1700,3,4)
Q X
ADDDATE(LINENUM,TXT,PNUM) ;Add date to TARGET
I $$PL(PNUM) D
.F Q:(LINENUM'>NEXTLINE) D ADD(" ")
.S @TARGET@(LINENUM,0)=$E(@TARGET@(LINENUM,0)_SPACE60,1,60)_TXT_":"_$$FDT(PNUM)
Q
XSUMS(STR,NOADD) ; XSUMs a string
N IDX,LEN
S LEN=$L(STR) I LEN'>0 Q
I '$G(NOADD),$L(XSTR)<99 S XSTR=XSTR_STR
F IDX=1:1:LEN S XCOUNT=XCOUNT+1,XSUM=XSUM+($A(STR,IDX)*XCOUNT)
Q
WRAP ; Wraps DATA to the output
I XMODE Q
N IDX,LEN,MAX,DATA1,DONE
S DONE=0
F Q:DONE D
.I WSTATUS S MAX=13
.E D
..I FIRST S MAX=41
..E S MAX=39
..I 'HEADER S MAX=MAX+5
..I 'DETAILED S MAX=MAX+13
.S LEN=$L(DATA)
.I 'WSTATUS,LEN<MAX S DONE=1 Q
.I LEN<MAX S IDX=LEN
.E F IDX=MAX:-1:2 Q:$E(DATA,IDX)=" "
.I IDX<3 S IDX=MAX-1
.S DATA1=$$STRIP($E(DATA,1,IDX))
.I WSTATUS D I 1
..S @TARGET@(TOPLINE,0)=$E(@TARGET@(TOPLINE,0)_SPACE60,1,LLEN)_DATA1
.E D ADDL(DATA1)
.S DATA=$$STRIP($E(DATA,IDX+1,999))
.I WSTATUS D
..S DONE=1,WSTATUS=0
..I $L(DATA)>0 D
...I TOPLINE'<NEXTLINE D ADD(" ")
...S @TARGET@(TOPLINE+1,0)=$E(@TARGET@(TOPLINE+1,0)_SPACE60,1,LLEN)_DATA
...S DATA=""
Q
STRIP(X) ; Removes Leading and Trialing Spaces
F Q:$E(X)'=" " S X=$E(X,2,999)
F Q:$E(X,$L(X))'=" " S X=$E(X,1,$L(X)-1)
Q X
ADDP(PNUM) ; Adds or XSUMs a piece of NODE
I XMODE D I 1
.D XSUMS(PNUM,1)
.D XSUMS($P(NODE,U,PNUM))
E D
.N VALUE
.S VALUE=$P(NODE,U,PNUM)
.I PNUM=9,VALUE="ACTIVE/SUSP" S VALUE="ACTIVE (S)"
.S DATA=$$STRIP(DATA_" "_VALUE)
.D WRAP
Q
ADDM(SUB,FORCE) ; Adds or XSUMs Multiple
N IDX
S IDX=0
I XMODE D I 1
.D XSUMS(SUB,1)
.F S IDX=$O(^TMP("PS",$J,INDEX,SUB,IDX)) Q:IDX="" D
..D XSUMS(^TMP("PS",$J,INDEX,SUB,IDX,0))
E D
.I $G(FORCE),DETAILED D FLUSH
.F S IDX=$O(^TMP("PS",$J,INDEX,SUB,IDX)) Q:IDX="" D
..S DATA=$$STRIP(DATA_" "_^TMP("PS",$J,INDEX,SUB,IDX,0))
..D WRAP
Q
FLUSH ; Flush the DATA buffer
I 'XMODE,DATA'="" D
.D WRAP
.I DATA'="" D ADDL(DATA) S DATA=""
Q
PL(PNUM) ;Retuns length of peice
Q $L($P(NODE,U,PNUM))
ML(SUB) ;Returns true if multiple exists and contains data
N IDX,ML
S (IDX,ML)=0
F S IDX=$O(^TMP("PS",$J,INDEX,SUB,IDX)) Q:(IDX="")!ML D
.I $L(^TMP("PS",$J,INDEX,SUB,IDX,0)) S ML=1
Q ML
ADDTITLE ;Adds a title line indicating which meds are in the list
N MSG,ALL,SUP,SUPFX
I ACTVONLY<2 S MSG="Active"
E S MSG=""
I '+ACTVONLY S MSG=MSG_" and "
I ACTVONLY'=1 S MSG=MSG_"Recently Expired"
S ALL=ALLMEDS
I ALL=0 D
.I ISINP S ALL=2
.E S ALL=3
S MSG=MSG_" "
I ALL'=3 S MSG=MSG_"Inpatient"
I ALL=1 S MSG=MSG_" and "
I ALL'=2 S MSG=MSG_"Outpatient"
S MSG=MSG_" Medications"
I SUPPLIES S SUPFX="in"
E S SUPFX="ex"
S SUPFX="("_SUPFX_"cluding Supplies):"
I $L(MSG)>51 D I 1
.D ADD(MSG)
.D ADD(SUPFX)
E D
.S MSG=MSG_" "_SUPFX
.D ADD(MSG)
D ADD(" ")
Q
WARNING ;Inserts warning about CLASSORT if needed
I CLASSORT D
.N MSG
.D ADD("* * WARNING * * Sorting by drug class may not be accurate!")
.D ADD("Medications belonging to multiple drug classes will only be listed")
.S MSG="under a single drug class."
.I UNKNOWNS S MSG=MSG_" In addition, the system is not able to"
.D ADD(MSG)
.I UNKNOWNS D ADD("determine the drug class of some medications.")
Q
TIULMED1 ; SLC/JM - Active/Recent Med Objects Routine ;31-Dec-2012 14:51;DU
+1 ;;1.0;TEXT INTEGRATION UTILITIES;**38,73,92,94,1006,202,1010,226,1011**;Jun 20, 1997;Build 13
+2 ;;IHS/MSC/MGH added items to display for objects
+3 ; All routines here are part of the LIST entry point of TIULMED
+4 ;
ADD(TXT) ; Saves TXT in TARGET
+1 SET NEXTLINE=NEXTLINE+1
+2 IF TAB
SET TXT=" "_TXT
+3 IF TAB
IF HEADER
SET TXT=" "_TXT
+4 SET @TARGET@(NEXTLINE,0)=TXT
+5 QUIT
ADDLNUM(TXT) ; Add text with Line Number added to front of string
+1 SET TAB=0
+2 IF HEADER
DO ADD($EXTRACT(COUNT_") ",1,5)_TXT)
IF 1
+3 IF '$TEST
DO ADD(TXT)
+4 SET TAB=1
+5 QUIT
ADDL(TXT) ; Add with ADDLNUM on FIRST
+1 IF FIRST
Begin DoDot:1
+2 DO ADDLNUM(TXT)
+3 SET FIRST=0
End DoDot:1
IF 1
+4 IF '$TEST
DO ADD(TXT)
+5 QUIT
ADDMED(XMODE) ; if XMODE creates XSTR, if not add med to TARGET
+1 NEW DATA,FIRST,XSUM,XCOUNT,TOPLINE,WSTATUS,TSTAT
+2 SET FIRST=1
+3 IF XMODE
SET (XSUM,XCOUNT)=0
SET XSTR=""
+4 IF '$TEST
Begin DoDot:1
+5 SET TOPLINE=NEXTLINE+1
SET DATA=""
SET WSTATUS=0
+6 DO ADDP(2)
End DoDot:1
+7 ; Unit Dose Meds
IF TYPE="UD"
Begin DoDot:1
+8 IF 'XMODE
Begin DoDot:2
+9 IF DETAILED
DO FLUSH
SET DATA="Give:"
+10 SET DATA=DATA_" "
End DoDot:2
+11 IF $$PL(6)
DO ADDP(6)
IF 1
+12 IF '$TEST
IF $$PL(7)
DO ADDP(7)
IF 1
+13 IF '$TEST
DO ADDM("SIG")
+14 DO ADDM("MDR")
DO ADDM("SCH")
+15 IF DETAILED
DO FLUSH
+16 DO ADDM("SIO")
End DoDot:1
IF 1
+17 ; Outpatient Meds
IF '$TEST
IF TYPE="OP"
Begin DoDot:1
+18 IF 'XMODE
IF DETAILED
Begin DoDot:2
+19 IF $$PL(12)
Begin DoDot:3
+20 SET DATA=DATA_" Qty:"
+21 DO ADDP(12)
End DoDot:3
+22 IF $$PL(11)
Begin DoDot:3
+23 SET DATA=$$STRIP(DATA_" for")
+24 DO ADDP(11)
+25 SET DATA=$$STRIP(DATA_" days")
End DoDot:3
+26 DO WRAP
End DoDot:2
+27 IF $$ML("SIG")
Begin DoDot:2
+28 IF 'XMODE
IF DETAILED
SET DATA=$$STRIP(DATA_" Sig:")
+29 DO ADDM("SIG")
End DoDot:2
IF 1
+30 IF '$TEST
DO ADDM("SIO")
DO ADDM("MDR")
DO ADDM("SCH")
End DoDot:1
IF 1
+31 ; IV meds
IF '$TEST
IF TYPE="IV"
Begin DoDot:1
+32 IF DETAILED
DO FLUSH
+33 DO ADDM("A")
+34 IF $$ML("B")
Begin DoDot:2
+35 IF 'XMODE
SET DATA=$$STRIP(DATA_" in")
+36 DO ADDM("B")
End DoDot:2
+37 DO ADDP(3)
+38 IF DETAILED
DO FLUSH
+39 ;ELR/VMP patch 226 add route and schedule to IV's
+40 DO ADDM("SIO")
DO ADDM("MDR")
DO ADDM("SCH")
+41 DO FLUSH
+42 IF 'XMODE
Begin DoDot:2
+43 NEW I
+44 FOR I=TOPLINE:1:NEXTLINE
SET @TARGET@(I,0)=$TRANSLATE(@TARGET@(I,0),U," ")
End DoDot:2
End DoDot:1
+45 IF XMODE
Begin DoDot:1
+46 IF XSTR=""
SET XSTR="_"
+47 IF '$TEST
IF $LENGTH(XSTR)>80
SET XSTR=$EXTRACT(XCOUNT_"_"_XSUM_"_"_XSTR,1,80)
End DoDot:1
IF 1
+48 IF '$TEST
Begin DoDot:1
+49 DO FLUSH
+50 SET WSTATUS=1
+51 DO ADDP(9)
+52 SET WSTATUS=0
+53 IF DETAILED
Begin DoDot:2
+54 DO ADDDATE(TOPLINE,$SELECT(MEDTYPE=OUTPTYPE:"Issu",1:"Strt"),15)
+55 IF MEDTYPE=OUTPTYPE
Begin DoDot:3
+56 NEW I
+57 IF TOPLINE=NEXTLINE
SET I=TOPLINE+1
+58 IF '$TEST
IF $LENGTH(@TARGET@(TOPLINE+1,0))<48
SET I=TOPLINE+1
+59 IF '$TEST
SET I=TOPLINE+2
+60 FOR
IF (I'>NEXTLINE)
QUIT
DO ADD(" ")
+61 ;IHS/MSC/MGH Patch 1006
+62 SET TSTAT=$PIECE(NODE,U,9)
+63 IF TSTAT="PENDING"
Begin DoDot:4
+64 SET PIEN=+$PIECE(NODE,U,1)
SET REFILL=$PIECE($GET(^PS(52.41,PIEN,0)),U,11)
+65 SET @TARGET@(I,0)=$EXTRACT(@TARGET@(I,0)_SPACE60,1,47)_"Refills: "_REFILL
End DoDot:4
+66 IF TSTAT'="PENDING"
Begin DoDot:4
+67 SET @TARGET@(I,0)=$EXTRACT(@TARGET@(I,0)_SPACE60,1,47)_"Refills: "_+$PIECE(NODE,U,5)
End DoDot:4
+68 ;end mods for pending meds
+69 DO ADDDATE(TOPLINE+1,"Last",10)
+70 DO ADDDATE(TOPLINE+2,"Expr",4)
End DoDot:3
IF 1
+71 IF '$TEST
Begin DoDot:3
+72 DO ADDDATE(TOPLINE+1,"Stop",4)
End DoDot:3
End DoDot:2
End DoDot:1
+73 QUIT
FDT(PNUM) ;Returns formatted date from piece number
+1 NEW X,Y
+2 SET Y=$PIECE(NODE,U,PNUM)
+3 SET X=$EXTRACT(Y,4,5)_"-"_$EXTRACT(Y,6,7)_"-"_$EXTRACT($EXTRACT(Y,1,3)+1700,3,4)
+4 QUIT X
ADDDATE(LINENUM,TXT,PNUM) ;Add date to TARGET
+1 IF $$PL(PNUM)
Begin DoDot:1
+2 FOR
IF (LINENUM'>NEXTLINE)
QUIT
DO ADD(" ")
+3 SET @TARGET@(LINENUM,0)=$EXTRACT(@TARGET@(LINENUM,0)_SPACE60,1,60)_TXT_":"_$$FDT(PNUM)
End DoDot:1
+4 QUIT
XSUMS(STR,NOADD) ; XSUMs a string
+1 NEW IDX,LEN
+2 SET LEN=$LENGTH(STR)
IF LEN'>0
QUIT
+3 IF '$GET(NOADD)
IF $LENGTH(XSTR)<99
SET XSTR=XSTR_STR
+4 FOR IDX=1:1:LEN
SET XCOUNT=XCOUNT+1
SET XSUM=XSUM+($ASCII(STR,IDX)*XCOUNT)
+5 QUIT
WRAP ; Wraps DATA to the output
+1 IF XMODE
QUIT
+2 NEW IDX,LEN,MAX,DATA1,DONE
+3 SET DONE=0
+4 FOR
IF DONE
QUIT
Begin DoDot:1
+5 IF WSTATUS
SET MAX=13
+6 IF '$TEST
Begin DoDot:2
+7 IF FIRST
SET MAX=41
+8 IF '$TEST
SET MAX=39
+9 IF 'HEADER
SET MAX=MAX+5
+10 IF 'DETAILED
SET MAX=MAX+13
End DoDot:2
+11 SET LEN=$LENGTH(DATA)
+12 IF 'WSTATUS
IF LEN<MAX
SET DONE=1
QUIT
+13 IF LEN<MAX
SET IDX=LEN
+14 IF '$TEST
FOR IDX=MAX:-1:2
IF $EXTRACT(DATA,IDX)=" "
QUIT
+15 IF IDX<3
SET IDX=MAX-1
+16 SET DATA1=$$STRIP($EXTRACT(DATA,1,IDX))
+17 IF WSTATUS
Begin DoDot:2
+18 SET @TARGET@(TOPLINE,0)=$EXTRACT(@TARGET@(TOPLINE,0)_SPACE60,1,LLEN)_DATA1
End DoDot:2
IF 1
+19 IF '$TEST
DO ADDL(DATA1)
+20 SET DATA=$$STRIP($EXTRACT(DATA,IDX+1,999))
+21 IF WSTATUS
Begin DoDot:2
+22 SET DONE=1
SET WSTATUS=0
+23 IF $LENGTH(DATA)>0
Begin DoDot:3
+24 IF TOPLINE'<NEXTLINE
DO ADD(" ")
+25 SET @TARGET@(TOPLINE+1,0)=$EXTRACT(@TARGET@(TOPLINE+1,0)_SPACE60,1,LLEN)_DATA
+26 SET DATA=""
End DoDot:3
End DoDot:2
End DoDot:1
+27 QUIT
STRIP(X) ; Removes Leading and Trialing Spaces
+1 FOR
IF $EXTRACT(X)'=" "
QUIT
SET X=$EXTRACT(X,2,999)
+2 FOR
IF $EXTRACT(X,$LENGTH(X))'=" "
QUIT
SET X=$EXTRACT(X,1,$LENGTH(X)-1)
+3 QUIT X
ADDP(PNUM) ; Adds or XSUMs a piece of NODE
+1 IF XMODE
Begin DoDot:1
+2 DO XSUMS(PNUM,1)
+3 DO XSUMS($PIECE(NODE,U,PNUM))
End DoDot:1
IF 1
+4 IF '$TEST
Begin DoDot:1
+5 NEW VALUE
+6 SET VALUE=$PIECE(NODE,U,PNUM)
+7 IF PNUM=9
IF VALUE="ACTIVE/SUSP"
SET VALUE="ACTIVE (S)"
+8 SET DATA=$$STRIP(DATA_" "_VALUE)
+9 DO WRAP
End DoDot:1
+10 QUIT
ADDM(SUB,FORCE) ; Adds or XSUMs Multiple
+1 NEW IDX
+2 SET IDX=0
+3 IF XMODE
Begin DoDot:1
+4 DO XSUMS(SUB,1)
+5 FOR
SET IDX=$ORDER(^TMP("PS",$JOB,INDEX,SUB,IDX))
IF IDX=""
QUIT
Begin DoDot:2
+6 DO XSUMS(^TMP("PS",$JOB,INDEX,SUB,IDX,0))
End DoDot:2
End DoDot:1
IF 1
+7 IF '$TEST
Begin DoDot:1
+8 IF $GET(FORCE)
IF DETAILED
DO FLUSH
+9 FOR
SET IDX=$ORDER(^TMP("PS",$JOB,INDEX,SUB,IDX))
IF IDX=""
QUIT
Begin DoDot:2
+10 SET DATA=$$STRIP(DATA_" "_^TMP("PS",$JOB,INDEX,SUB,IDX,0))
+11 DO WRAP
End DoDot:2
End DoDot:1
+12 QUIT
FLUSH ; Flush the DATA buffer
+1 IF 'XMODE
IF DATA'=""
Begin DoDot:1
+2 DO WRAP
+3 IF DATA'=""
DO ADDL(DATA)
SET DATA=""
End DoDot:1
+4 QUIT
PL(PNUM) ;Retuns length of peice
+1 QUIT $LENGTH($PIECE(NODE,U,PNUM))
ML(SUB) ;Returns true if multiple exists and contains data
+1 NEW IDX,ML
+2 SET (IDX,ML)=0
+3 FOR
SET IDX=$ORDER(^TMP("PS",$JOB,INDEX,SUB,IDX))
IF (IDX="")!ML
QUIT
Begin DoDot:1
+4 IF $LENGTH(^TMP("PS",$JOB,INDEX,SUB,IDX,0))
SET ML=1
End DoDot:1
+5 QUIT ML
ADDTITLE ;Adds a title line indicating which meds are in the list
+1 NEW MSG,ALL,SUP,SUPFX
+2 IF ACTVONLY<2
SET MSG="Active"
+3 IF '$TEST
SET MSG=""
+4 IF '+ACTVONLY
SET MSG=MSG_" and "
+5 IF ACTVONLY'=1
SET MSG=MSG_"Recently Expired"
+6 SET ALL=ALLMEDS
+7 IF ALL=0
Begin DoDot:1
+8 IF ISINP
SET ALL=2
+9 IF '$TEST
SET ALL=3
End DoDot:1
+10 SET MSG=MSG_" "
+11 IF ALL'=3
SET MSG=MSG_"Inpatient"
+12 IF ALL=1
SET MSG=MSG_" and "
+13 IF ALL'=2
SET MSG=MSG_"Outpatient"
+14 SET MSG=MSG_" Medications"
+15 IF SUPPLIES
SET SUPFX="in"
+16 IF '$TEST
SET SUPFX="ex"
+17 SET SUPFX="("_SUPFX_"cluding Supplies):"
+18 IF $LENGTH(MSG)>51
Begin DoDot:1
+19 DO ADD(MSG)
+20 DO ADD(SUPFX)
End DoDot:1
IF 1
+21 IF '$TEST
Begin DoDot:1
+22 SET MSG=MSG_" "_SUPFX
+23 DO ADD(MSG)
End DoDot:1
+24 DO ADD(" ")
+25 QUIT
WARNING ;Inserts warning about CLASSORT if needed
+1 IF CLASSORT
Begin DoDot:1
+2 NEW MSG
+3 DO ADD("* * WARNING * * Sorting by drug class may not be accurate!")
+4 DO ADD("Medications belonging to multiple drug classes will only be listed")
+5 SET MSG="under a single drug class."
+6 IF UNKNOWNS
SET MSG=MSG_" In addition, the system is not able to"
+7 DO ADD(MSG)
+8 IF UNKNOWNS
DO ADD("determine the drug class of some medications.")
End DoDot:1
+9 QUIT