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

ICDSUPT.m

Go to the documentation of this file.
  1. ICDSUPT ;DLS/DEK - ICD SUPPORT FOR APIS ;04/21/2014
  1. ;;18.0;DRG Grouper;**6,57**;Oct 20, 2000;Build 1
  1. ;
  1. ; Global Variables
  1. ; None
  1. ;
  1. ; External References
  1. ; $$DT^XLFDT ICR 10103
  1. ;
  1. EN ; Main Entry Point
  1. HELP ; Developer Help for an API
  1. D HLP^ICDEXH("LEG") Q
  1. ;
  1. EFF(FILE,IEN,CDT) ; returns effective date and status for code/modifier
  1. ;
  1. ; Input:
  1. ;
  1. ; FILE File number (required)
  1. ; 80 = ICD DX
  1. ; 80.1 = ICD O/P
  1. ; IEN ICD IEN (required)
  1. ; CDT Date to check (FileMan format) (required)
  1. ;
  1. ; Output:
  1. ;
  1. ; A 3 piece "^" delimited string
  1. ;
  1. ; 1 Status
  1. ; 1 - Active
  1. ; 0 - Inactive
  1. ; 2 Inactivation Date
  1. ; 3 Activation Date
  1. ; -or-
  1. ; -1^error message
  1. ;
  1. ;
  1. ; 3 piece "^" delimited string
  1. ;
  1. ; 1 Status
  1. ; 2 Activation Date
  1. ; 3 Inactivation Date
  1. ;
  1. N ICDD,ICDF,ICDI,ICDR,ICDX,ICDY
  1. I $G(IEN)="" Q "-1^No Code Selected"
  1. S ICDF=$$FILE^ICDEX($G(FILE)) Q:+($G(ICDF))'>0 "-1^Invalid File Selected"
  1. S ICDR=$$ROOT^ICDEX($G(ICDF)) Q:'$L(ICDR) "-1^Invalid File Selected"
  1. S ICDI=+($G(IEN)) Q:+ICDI'>0 "-1^IEN Invalid"
  1. S ICDY=$P($G(@(ICDR_+ICDI_",1)")),"^",1) Q:+ICDY'>0 "-1^Invalid Coding System"
  1. S ICDD=$S($G(CDT)="":$$DT^XLFDT,1:$$DTBR^ICDEX($G(CDT),,ICDY))
  1. S ICDX=$P($$SAI^ICDEX($G(ICDF),$G(ICDI),$G(ICDD)),"^",1,3)
  1. Q $S($L(ICDX,"^")=3:($P(ICDX,"^",1)_"^"_$P(ICDX,"^",3)_"^"_$P(ICDX,"^",2)),1:"-1^Not found")
  1. LA(IEN,FILE,CDT) ; Last Current Activation Date
  1. ;
  1. ; Input:
  1. ;
  1. ; IEN Internal Entry Number (Required)
  1. ; FILE Global Root/File Number (Required)
  1. ; CDT Date (default = TODAY) (Optional)
  1. ;
  1. ; Output:
  1. ;
  1. ; $$LA Last Current Activation Date OR -1 ^ Error Message
  1. ;
  1. Q $$LA^ICDEX($G(FILE),$G(IEN),$G(CDT))
  1. LI(IEN,FILE,CDT) ; Last Current Inactivation Date
  1. ;
  1. ; Input:
  1. ;
  1. ; IEN Internal Entry Number (Required)
  1. ; FILE Global Root/File Number (Required)
  1. ; CDT Date (default = TODAY) (Optional)
  1. ;
  1. ; Output:
  1. ;
  1. ; $$LI Last Current Inactivation Date OR -1 ^ Error Message
  1. ;
  1. Q $$LI^ICDEX($G(FILE),$G(IEN),$G(CDT))
  1. NUM(CODE) ; Convert Code to a Numeric Value (opposite of $$COD)
  1. ;
  1. ; Input:
  1. ;
  1. ; CODE ICD CODE (required)
  1. ;
  1. ; Output:
  1. ;
  1. ; NUM Numerical representation of CODE
  1. ;
  1. ; or
  1. ;
  1. ; -1 on error
  1. ;
  1. Q $$NUM^ICDEX($G(CODE))
  1. COD(NUM) ; Convert Numeric Value to a Code (opposite of $$NUM)
  1. ;
  1. ; Input:
  1. ;
  1. ; NUM Numerical representation of an ICD Code (required)
  1. ;
  1. ; Output:
  1. ;
  1. ; CODE ICD Code
  1. ;
  1. ; or
  1. ;
  1. ; null on error
  1. ;
  1. Q $$COD^ICDEX($G(NUM))
  1. FILE(X) ; File Number
  1. ;
  1. ; Input:
  1. ;
  1. ; X File/Identifier/Coding System/Code (required)
  1. ;
  1. ; Output:
  1. ;
  1. ; FILE File Number or -1 on error
  1. ;
  1. Q $$FILE^ICDEX($G(X))
  1. ROOT(X) ; Global Root
  1. ;
  1. ; Input:
  1. ;
  1. ; X File Number, File Name, Root, Identifier
  1. ; or Coding System (required)
  1. ;
  1. ; Output:
  1. ;
  1. ; ROOT Global Root for File or null
  1. ;
  1. Q $$ROOT^ICDEX($G(X))
  1. SNAM(X) ; System Name
  1. ;
  1. ; Input:
  1. ;
  1. ; X Numeric System Identifier (field 1.1)
  1. ;
  1. ; Output:
  1. ;
  1. ; X Character System Identifier
  1. ;
  1. Q $$SNAM^ICDEX($G(X))