; Arrange in Frequency Order
;
; Input
;
; ^TMP("LEXTKN",$J,#,WORD)=""
;
; Global array containing words parsed from text from
; API PTX^LEXTOKN
;
; "DIABETES MELLITUS KETOACIDOSIS" Parsed as:
;
; ^TMP("LEXTKN",$J,0)=3
; ^TMP("LEXTKN",$J,1,"DIABETES")=
; ^TMP("LEXTKN",$J,2,"MELLITUS")=
; ^TMP("LEXTKN",$J,3,"KETOACIDOSIS")=
;
; Output
;
; ^TMP("LEXTKN",$J,#,WORD)=FREQ
;
; Global array containing words parsed from text arranged
; in order of the frequency of use, the least used word is
; first and the most frequently used word is last.
SWAP(X,LEX1,LEX2)
; Swap text LEX1 for LEX2 in X
;
; Input
;
; X Text string
; LEX1 Word to remove in string (replace)
; LEX2 Word to insert in string (with)
;
; Output
;
; X Text string without LEX1
;