Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: LEXQHLM

LEXQHLM.m

Go to the documentation of this file.
LEXQHLM ;ISL/KER - Query History - Extract Misc ;05/23/2017
 ;;2.0;LEXICON UTILITY;**62,80,103**;Sep 23, 1996;Build 2
 ;               
 ; Global Variables
 ;    ^TMP("LEXQHO")      SACC 2.3.2.5.1
 ;               
 ; External References
 ;    $$ROOT^ICDEX        ICR   5747
 ;    $$FMTE^XLFDT        ICR  10103
 ;               
 Q
 ; Miscellaneous
BL ;   Blank Line
 D TL(" ")
 Q
TL(X) ;   Text Line
 I $D(LEXTEST) W !,$G(X) Q
 N LEXI S LEXI=$O(^TMP("LEXQHO",$J," "),-1)+1,^TMP("LEXQHO",$J,LEXI)=$G(X),^TMP("LEXQHO",$J,0)=LEXI
 Q
SD(X) ;   Short Date
 Q $TR($$FMTE^XLFDT(+($G(X)),"5DZ"),"@"," ")
IA(X) ;   Initial Activation
 N LEXEF,LEXH,LEXN,LEXS,LEXE,LEXIEN,LEXRT,LEXARY S LEXIEN=+($G(X)),LEXE="" Q:+LEXIEN'>0 ""
 S LEXRT=$$ROOT^ICDEX(80.1) M LEXARY=@(LEXRT_+LEXIEN_",66)") Q:'$D(LEXARY(0)) ""
 S LEXEF="" F  S LEXEF=$O(LEXARY("B",LEXEF)) Q:'$L(LEXEF)  D  Q:$G(LEXE)?7N
 . S LEXH=0 F  S LEXH=$O(LEXARY("B",LEXEF,LEXH)) Q:+LEXH'>0  D
 . . S LEXN=$G(LEXARY(+LEXH,0)) S:+($P(LEXN,U,2))>0 LEXE=$P(LEXN,U,1) Q:$G(LEXE)?7N
 S X="" S:$G(LEXE)?7N X=$G(LEXE)
 Q X
MS(X,Y) ;   Date Message
 Q:$G(X)'>2781001&($G(Y)=0) " (business rule date used)"
 Q:$G(X)'>2890101&($G(Y)=1) " (business rule date used)"
 Q ""
HD(X) ;   Header
 Q:+($G(X))=1 "Status"  Q:+($G(X))=2 "Operation/Procedure"  Q:+($G(X))=3 "Description"  Q:+($G(X))=4 "Major Diagnostic Category/DRG Groups"
 Q ""
AND(X) ;   Substitute 'and'
 S X=$G(X) Q:$L(X,", ")'>1 X
 S X=$P(X,", ",1,($L(X,", ")-1))_" and "_$P(X,", ",$L(X,", "))
 Q X
CS(X) ;   Trim Comma/Space
 S X=$$TM($G(X),","),X=$$TM($G(X)," "),X=$$TM($G(X),","),X=$$TM($G(X)," ")
 Q X
CL ;   Clear
 K LEXTEST
 Q X
TM(X,Y) ;   Trim Character Y - Default " "
 S X=$G(X) Q:X="" X  S Y=$G(Y) S:'$L(Y) Y=" "
 F  Q:$E(X,1)'=Y  S X=$E(X,2,$L(X))
 F  Q:$E(X,$L(X))'=Y  S X=$E(X,1,($L(X)-1))
 Q X