LEXXM2 ;ISL/KER - Convert Text to Mix Case (2) ;12/19/2014
;;2.0;General Lexicon Utilities;**80,86**;Sep 23, 1996;Build 1
;
; Global Variables
; None
;
; External References
; None
;
; Local Variables NEWed or KILLed Elsewhere
; LEXCTL,LEXNXT,LEXORG,LEXPRE,UIN Newed in LEXXM
; Y Set and returned to LEXXM
;
T2 ; 2 Characters
N XU,CHR,PRE,ORG,NXT,USE S ORG=$G(LEXORG),PRE=$G(LEXPRE),NXT=$G(LEXNXT),UIN=$G(UIN),USE=$G(LEXUSE) S XU=$$UP(X),CHR=$E(XU,1)
; Exceptions
S:$E(XU,1)?1U&($E(XU,2)?1N) Y=XU Q:$L($G(Y)) S:$E(XU,1)?1N&($E(XU,2)?1U) Y=XU Q:$L($G(Y))
I $E(XU,($L(XU)-1),$L(XU))="CC",$E(XU,($L(XU)-2))?1N S Y=$$LO(XU) Q
I XU="SO",$E(NXT,1,7)="STATED " S Y=$$LO(X) Q
S:$G(LEXCTL)["OR ROOM"!($G(LEXCTL)["OR-ROOM") Y=XU Q:$L($G(Y))
S:XU="ST"&($G(PRE)=1) Y="st" S:XU="ND"&($G(PRE)=2) Y="nd" S:XU="RD"&($G(PRE)=3) Y="rd" S:XU="TH"&(+($G(PRE))>3) Y="th" Q:$L($G(Y))
S:XU="KR"&($G(UIN)["KRYPTON")&($G(UIN)["KR-") Y=XU Q:$L($G(Y))
S:XU="CO"&($G(UIN)["COBALT")&($G(UIN)["CO-") Y=XU Q:$L($G(Y))
S:XU="CO"&($G(UIN)["CO-") Y=$$MX(XU) Q:$L($G(Y))
S:XU="SO"&(($G(UIN)["SO STATED")!($G(UIN)["SO DESCRIBED")) Y=$$LO(XU) Q:$L($G(Y))
S:XU="SO"&(($G(UIN)["SHOULDER ORTHOSIS")!($G(UIN)["SUPERIOR OBLIQUE")) Y=XU Q:$L($G(Y))
S:XU="HB"&(($G(UIN)["HB-C")!($G(UIN)["HB-S")!($G(UIN)["HB-D")!($G(UIN)["HB-E")) Y=$$MX(XU) Q:$L($G(Y))
S:XU="DU"&($G(UIN)["Deoxyuridine") Y="dU" Q:$L($G(Y))
S:XU="DU"&($G(UIN)["CHAT") Y=$$LO(XU) Q:$L($G(Y))
S:XU="DU"&(($G(UIN)["POSITIVE")!($G(UIN)["NEGATIVE")!($G(UIN)["ANTIGEN")!($G(UIN)["12")) Y=$$MX(XU) Q:$L($G(Y))
S:XU="DU"&(($G(UIN)["DUODENAL")!($G(UIN)["PERFORATED")!($G(UIN)["ANTIGEN")) Y=XU Q:$L($G(Y))
S:XU="RB"&(($G(UIN)["RUBIDIUM")!($G(UIN)["RETINOBLAST")) Y=$$MX(XU) Q:$L($G(Y))
S:XU="OZ"&(+($G(PRE))>0) Y=$$LO(XU) Q:$L($G(Y))
S:XU="CM"&($G(UIN)["CM-") Y=XU Q:$L($G(Y))
S:XU="IN"&(($G(UIN)["IN/S")!($G(UIN)["INDIUM")) Y=XU Q:$L($G(Y))
S:XU="MN"&($G(UIN)["BLOOD") Y=XU Q:$L($G(Y))
S:XU="RH"&(($G(UIN)'["LH")) Y="Rh" Q:$L($G(Y))
S:XU="GM"&(($G(UIN)["GM/")!($G(UIN)["GM)")!($G(UIN)["/GM")!($E($G(UIN),($L($G(UIN))-2),$L($G(UIN)))[" GM"))&(UIN'["METHYLASE") Y="gm" Q:$L($G(Y))
S:XU="FT"&($G(UIN)["FT-") Y=XU Q:$L($G(Y))
; Special Case
S:X="DA" Y="dA" S:X="DG" Y="dG" S:X="DU" Y="dU" Q:$L($G(Y))
S:X="GB" Y="gB" S:X="GH" Y="gH" S:X="KB" Y="kB" S:X="KD" Y="kD" Q:$L($G(Y))
S:X="PH" Y="pH" S:X="PX" Y="pX" Q:$L($G(Y))
S:$G(UIN)'["GC/"&(X="GC") Y="gC" Q:$L($G(Y))
S:($G(UIN)["OLIGO"!($G(UIN)["POLY"))&(X="DT") Y="dT" Q:$L($G(Y))
; Lower Case
S:$G(UIN)'["IF-"&(+$P($G(UIN),"IF ",2)'>0)&($G(UIN)'["BLOOD GROUP")&($G(UIN)'["IF(")&(X="IF") Y="if" Q:$L($G(Y))
I "^AM^AN^AS^AT^AT^BE^BY^CC^CM^DE^DO^EG^FT^IE^IN^"[("^"_XU_"^") S Y=$$LO(XU) Q
I "^IS^IT^IN^MG^MM^NO^OF^ON^OR^PM^SQ^TO^UP^W/^WO^YL^"[("^"_XU_"^") S Y=$$LO(XU) Q
I $G(UIN)["PER IU"!($E($P($G(UIN)," IU",1),$L($P($G(UIN)," IU",1)))?1N) S:X="IU" Y="iu" Q:$L($G(Y))
I ($G(UIN)["ML/")!($G(UIN)["/ML")!($G(UIN)["PER ML")!($E($P($G(UIN)," ML",1),$L($P($G(UIN)," ML",1)))?1N) S:X="ML" Y="ml" Q:$L($G(Y))
I $G(UIN)["(ML)" S:XU="ML" Y=XU Q:$L($G(Y))
S:($G(UIN)["; EA "!($G(UIN)[", EA ")!($G(UIN)["(EA ")!($G(UIN)[" EA)")!($G(UIN)[" EA ADD")!($G(UIN)[" EA SUB")!($G(UIN)[" EA 1"))&(X="EA") Y="ea" Q:$L($G(Y))
; Mixed Case
I "^ST^"[("^"_XU_"^") S Y=$$MX(XU) Q
; Upper Case
I CHR?1N!("^A^B^C^D^"[("^"_CHR_"^")) D Q:$L($G(Y))
. I "^AA^AB^AC^AD^AF^AG^AH^AI^AK^AM^AP^AR^AV^BA^BB^BC^BE^"[("^"_XU_"^") S Y=XU Q
. I "^BG^BH^BK^BL^BM^BN^BP^BR^BS^BT^BW^BX^CA^CB^CD^CE^CF^"[("^"_XU_"^") S Y=XU Q
. I "^CG^CH^CI^CK^CL^CN^CO^CP^CR^CS^CT^CV^CW^CY^DB^DC^DD^"[("^"_XU_"^") S Y=XU Q
. I "^DG^DI^DL^DM^DN^DP^DQ^DR^DS^DT^DX^"[("^"_XU_"^") S Y=XU Q
I "^E^F^G^H^I^J^K^L^M^"[("^"_CHR_"^") D Q:$L($G(Y))
. I "^EA^EB^EC^EF^EM^EN^EO^EP^ER^ES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^XI^XI^XL^XM^XP^XS^XT^XU^XV^XX^XY^YM^YS^"[("^"_XU_"^") S Y=XU Q
. I "^YY^ZP^ZY^"[("^"_XU_"^") S Y=XU Q
Q
;
LO(X) ; Lower Case
Q $TR(X,"ABCDEFGHIJKLMNOPQRSTUVWXYZ","abcdefghijklmnopqrstuvwxyz")
UP(X) ; Uppercase
Q $TR(X,"abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ")
MX(X) ; Mix Case
Q $TR($E(X,1),"abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ")_$TR($E(X,2,$L(X)),"ABCDEFGHIJKLMNOPQRSTUVWXYZ","abcdefghijklmnopqrstuvwxyz")
TRIM(X) ; Trim Spaces
S X=$G(X) F Q:$E(X,1)'=" " S X=$E(X,2,$L(X))
F Q:$E(X,$L(X))'=" " S X=$E(X,1,($L(X)-1))
N LEXCTL,LEXNXT,LEXORG,LEXPRE,LEXUSE,UIN,Y
Q X
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HLEXXM2 5637 printed Nov 22, 2024@17:20:30 Page 2
LEXXM2 ;ISL/KER - Convert Text to Mix Case (2) ;12/19/2014
+1 ;;2.0;General Lexicon Utilities;**80,86**;Sep 23, 1996;Build 1
+2 ;
+3 ; Global Variables
+4 ; None
+5 ;
+6 ; External References
+7 ; None
+8 ;
+9 ; Local Variables NEWed or KILLed Elsewhere
+10 ; LEXCTL,LEXNXT,LEXORG,LEXPRE,UIN Newed in LEXXM
+11 ; Y Set and returned to LEXXM
+12 ;
T2 ; 2 Characters
+1 NEW XU,CHR,PRE,ORG,NXT,USE
SET ORG=$GET(LEXORG)
SET PRE=$GET(LEXPRE)
SET NXT=$GET(LEXNXT)
SET UIN=$GET(UIN)
SET USE=$GET(LEXUSE)
SET XU=$$UP(X)
SET CHR=$EXTRACT(XU,1)
+2 ; Exceptions
+3 if $EXTRACT(XU,1)?1U&($EXTRACT(XU,2)?1N)
SET Y=XU
if $LENGTH($GET(Y))
QUIT
if $EXTRACT(XU,1)?1N&($EXTRACT(XU,2)?1U)
SET Y=XU
if $LENGTH($GET(Y))
QUIT
+4 IF $EXTRACT(XU,($LENGTH(XU)-1),$LENGTH(XU))="CC"
IF $EXTRACT(XU,($LENGTH(XU)-2))?1N
SET Y=$$LO(XU)
QUIT
+5 IF XU="SO"
IF $EXTRACT(NXT,1,7)="STATED "
SET Y=$$LO(X)
QUIT
+6 if $GET(LEXCTL)["OR ROOM"!($GET(LEXCTL)["OR-ROOM")
SET Y=XU
if $LENGTH($GET(Y))
QUIT
+7 if XU="ST"&($GET(PRE)=1)
SET Y="st"
if XU="ND"&($GET(PRE)=2)
SET Y="nd"
if XU="RD"&($GET(PRE)=3)
SET Y="rd"
if XU="TH"&(+($GET(PRE))>3)
SET Y="th"
if $LENGTH($GET(Y))
QUIT
+8 if XU="KR"&($GET(UIN)["KRYPTON")&($GET(UIN)["KR-")
SET Y=XU
if $LENGTH($GET(Y))
QUIT
+9 if XU="CO"&($GET(UIN)["COBALT")&($GET(UIN)["CO-")
SET Y=XU
if $LENGTH($GET(Y))
QUIT
+10 if XU="CO"&($GET(UIN)["CO-")
SET Y=$$MX(XU)
if $LENGTH($GET(Y))
QUIT
+11 if XU="SO"&(($GET(UIN)["SO STATED")!($GET(UIN)["SO DESCRIBED"))
SET Y=$$LO(XU)
if $LENGTH($GET(Y))
QUIT
+12 if XU="SO"&(($GET(UIN)["SHOULDER ORTHOSIS")!($GET(UIN)["SUPERIOR OBLIQUE"))
SET Y=XU
if $LENGTH($GET(Y))
QUIT
+13 if XU="HB"&(($GET(UIN)["HB-C")!($GET(UIN)["HB-S")!($GET(UIN)["HB-D")!($GET(UIN)["HB-E"))
SET Y=$$MX(XU)
if $LENGTH($GET(Y))
QUIT
+14 if XU="DU"&($GET(UIN)["Deoxyuridine")
SET Y="dU"
if $LENGTH($GET(Y))
QUIT
+15 if XU="DU"&($GET(UIN)["CHAT")
SET Y=$$LO(XU)
if $LENGTH($GET(Y))
QUIT
+16 if XU="DU"&(($GET(UIN)["POSITIVE")!($GET(UIN)["NEGATIVE")!($GET(UIN)["ANTIGEN")!($GET(UIN)["12"))
SET Y=$$MX(XU)
if $LENGTH($GET(Y))
QUIT
+17 if XU="DU"&(($GET(UIN)["DUODENAL")!($GET(UIN)["PERFORATED")!($GET(UIN)["ANTIGEN"))
SET Y=XU
if $LENGTH($GET(Y))
QUIT
+18 if XU="RB"&(($GET(UIN)["RUBIDIUM")!($GET(UIN)["RETINOBLAST"))
SET Y=$$MX(XU)
if $LENGTH($GET(Y))
QUIT
+19 if XU="OZ"&(+($GET(PRE))>0)
SET Y=$$LO(XU)
if $LENGTH($GET(Y))
QUIT
+20 if XU="CM"&($GET(UIN)["CM-")
SET Y=XU
if $LENGTH($GET(Y))
QUIT
+21 if XU="IN"&(($GET(UIN)["IN/S")!($GET(UIN)["INDIUM"))
SET Y=XU
if $LENGTH($GET(Y))
QUIT
+22 if XU="MN"&($GET(UIN)["BLOOD")
SET Y=XU
if $LENGTH($GET(Y))
QUIT
+23 if XU="RH"&(($GET(UIN)'["LH"))
SET Y="Rh"
if $LENGTH($GET(Y))
QUIT
+24 if XU="GM"&(($GET(UIN)["GM/")!($GET(UIN)["GM)")!($GET(UIN)["/GM")!($EXTRACT($GET(UIN),($LENGTH($GET(UIN))-2),$LENGTH($GET(UIN)))[" GM"))&(UIN'["METHYLASE")
SET Y="gm"
if $LENGTH($GET(Y))
QUIT
+25 if XU="FT"&($GET(UIN)["FT-")
SET Y=XU
if $LENGTH($GET(Y))
QUIT
+26 ; Special Case
+27 if X="DA"
SET Y="dA"
if X="DG"
SET Y="dG"
if X="DU"
SET Y="dU"
if $LENGTH($GET(Y))
QUIT
+28 if X="GB"
SET Y="gB"
if X="GH"
SET Y="gH"
if X="KB"
SET Y="kB"
if X="KD"
SET Y="kD"
if $LENGTH($GET(Y))
QUIT
+29 if X="PH"
SET Y="pH"
if X="PX"
SET Y="pX"
if $LENGTH($GET(Y))
QUIT
+30 if $GET(UIN)'["GC/"&(X="GC")
SET Y="gC"
if $LENGTH($GET(Y))
QUIT
+31 if ($GET(UIN)["OLIGO"!($GET(UIN)["POLY"))&(X="DT")
SET Y="dT"
if $LENGTH($GET(Y))
QUIT
+32 ; Lower Case
+33 if $GET(UIN)'["IF-"&(+$PIECE($GET(UIN),"IF ",2)'>0)&($GET(UIN)'["BLOOD GROUP")&($GET(UIN)'["IF(")&(X="IF")
SET Y="if"
if $LENGTH($GET(Y))
QUIT
+34 IF "^AM^AN^AS^AT^AT^BE^BY^CC^CM^DE^DO^EG^FT^IE^IN^"[("^"_XU_"^")
SET Y=$$LO(XU)
QUIT
+35 IF "^IS^IT^IN^MG^MM^NO^OF^ON^OR^PM^SQ^TO^UP^W/^WO^YL^"[("^"_XU_"^")
SET Y=$$LO(XU)
QUIT
+36 IF $GET(UIN)["PER IU"!($EXTRACT($PIECE($GET(UIN)," IU",1),$LENGTH($PIECE($GET(UIN)," IU",1)))?1N)
if X="IU"
SET Y="iu"
if $LENGTH($GET(Y))
QUIT
+37 IF ($GET(UIN)["ML/")!($GET(UIN)["/ML")!($GET(UIN)["PER ML")!($EXTRACT($PIECE($GET(UIN)," ML",1),$LENGTH($PIECE($GET(UIN)," ML",1)))?1N)
if X="ML"
SET Y="ml"
if $LENGTH($GET(Y))
QUIT
+38 IF $GET(UIN)["(ML)"
if XU="ML"
SET Y=XU
if $LENGTH($GET(Y))
QUIT
+39 if ($GET(UIN)["; EA "!($GET(UIN)[", EA ")!($GET(UIN)["(EA ")!($GET(UIN)[" EA)")!($GET(UIN)[" EA ADD")!($GET(UIN)[" EA SUB")!($GET(UIN)[" EA 1"))&(X="EA")
SET Y="ea"
if $LENGTH($GET(Y))
QUIT
+40 ; Mixed Case
+41 IF "^ST^"[("^"_XU_"^")
SET Y=$$MX(XU)
QUIT
+42 ; Upper Case
+43 IF CHR?1N!("^A^B^C^D^"[("^"_CHR_"^"))
Begin DoDot:1
+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_"^")
SET Y=XU
QUIT
+57 IF "^OL^OP^OT^OX^PA^PC^PD^PE^PF^PG^PI^PK^PL^PM^PN^PO^PP^"[("^"_XU_"^")
SET Y=XU
QUIT
+58 IF "^PR^PS^PT^PV^PX^PZ^QA^QT^RA^RB^RC^RF^RG^RH^RI^RN^RO^"[("^"_XU_"^")
SET Y=XU
QUIT
+59 IF "^RP^RR^RS^RT^RV^RX^SA^SB^SC^SD^SE^SF^SG^SH^SI^SK^SL^"[("^"_XU_"^")
SET Y=XU
QUIT
+60 IF "^SM^SO^SP^SR^SS^ST^SV^SW^SX^"[("^"_XU_"^")
SET Y=XU
QUIT
End DoDot:1
if $LENGTH($GET(Y))
QUIT
+61 IF "^T^U^V^W^X^Y^Z^"[("^"_CHR_"^")
Begin DoDot:1
+62 IF "^TA^TB^TC^TD^TF^TH^TI^TK^TL^TP^TR^TS^TT^TX^UD^UK^US^"[("^"_XU_"^")
SET Y=XU
QUIT
+63 IF "^UV^UV^VA^VC^VC^VH^VI^VI^VO^VP^VR^VS^VV^VW^VX^VZ^WB^WC^"[("^"_XU_"^")
SET Y=XU
QUIT
+64 IF "^WS^WV^XE^XH^XI^XI^XL^XM^XP^XS^XT^XU^XV^XX^XY^YM^YS^"[("^"_XU_"^")
SET Y=XU
QUIT
+65 IF "^YY^ZP^ZY^"[("^"_XU_"^")
SET Y=XU
QUIT
End DoDot:1
if $LENGTH($GET(Y))
QUIT
+66 QUIT
+67 ;
LO(X) ; Lower Case
+1 QUIT $TRANSLATE(X,"ABCDEFGHIJKLMNOPQRSTUVWXYZ","abcdefghijklmnopqrstuvwxyz")
UP(X) ; Uppercase
+1 QUIT $TRANSLATE(X,"abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ")
MX(X) ; Mix Case
+1 QUIT $TRANSLATE($EXTRACT(X,1),"abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ")_$TRANSLATE($EXTRACT(X,2,$LENGTH(X)),"ABCDEFGHIJKLMNOPQRSTUVWXYZ","abcdefghijklmnopqrstuvwxyz")
TRIM(X) ; Trim Spaces
+1 SET X=$GET(X)
FOR
if $EXTRACT(X,1)'=" "
QUIT
SET X=$EXTRACT(X,2,$LENGTH(X))
+2 FOR
if $EXTRACT(X,$LENGTH(X))'=" "
QUIT
SET X=$EXTRACT(X,1,($LENGTH(X)-1))
+3 NEW LEXCTL,LEXNXT,LEXORG,LEXPRE,LEXUSE,UIN,Y
+4 QUIT X