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

ICDAPIU.m

Go to the documentation of this file.
  1. ICDAPIU ;DLS/DEK/KER - ICD UTILITIES FOR APIS ;04/21/2014
  1. ;;18.0;DRG Grouper;**6,11,12,15,57**;Oct 20, 2000;Build 1
  1. ;
  1. ; Global Variables
  1. ; None
  1. ;
  1. ; External References
  1. ; None
  1. ;
  1. Q
  1. EN ; Main Entry Point
  1. HELP ; Developer Help for an API
  1. D HLP^ICDEXH("LEG") Q
  1. ;
  1. DTBR(CDT,CS) ; Date Business Rules
  1. ;
  1. ; Input:
  1. ;
  1. ; CDT Code Date to check default TODAY
  1. ; CS Code System (Default 0 = ICD)
  1. ;
  1. ; Output:
  1. ;
  1. ; If CDT < ICD-9 Date and CS=0, use ICD-9 Date
  1. ; If CDT < 2890101 and CS=1, use 2890101
  1. ; If CDT < 2821001 and CS=2, use 2821001
  1. ; If CDT is year only, use first of the year
  1. ; If CDT is year and month only, use first of the month
  1. ;
  1. Q $$DTBR^ICDEX($G(CDT),$G(CS))
  1. MSG(CDT,CS) ; Inform of code text inaccuracy
  1. ;
  1. ; Input:
  1. ;
  1. ; CDT Code Date to check (FileMan format, Default = today)
  1. ; CS Code System (0:ICD, 1:CPT/HCPCS, 2:DRG, 3:LEX, Default=0)
  1. ;
  1. ; Output:
  1. ;
  1. ; User Alert
  1. ;
  1. Q $$MSG^ICDEX($G(CDT),$G(CS))
  1. STATCHK(CODE,CDT) ; Check Status of ICD Code
  1. ;
  1. ; Input:
  1. ;
  1. ; CODE ICD Code
  1. ; CDT Date to screen against
  1. ;
  1. ; Output:
  1. ;
  1. ; 3-Piece String containing Status, IEN and Effective Date
  1. ;
  1. Q $$STATCHK^ICDEX($G(CODE),$G(CDT))
  1. NEXT(CODE) ; Next ICD Code (active or inactive)
  1. ;
  1. ; Input:
  1. ;
  1. ; CODE ICD Code REQUIRED
  1. ;
  1. ; Output:
  1. ;
  1. ; The Next ICD Code, Null if none
  1. ;
  1. Q $$NEXT^ICDEX($G(CODE))
  1. PREV(CODE) ; Previous ICD Code (active or inactive)
  1. ;
  1. ; Input:
  1. ;
  1. ; CODE ICD Code REQUIRED
  1. ;
  1. ; Output:
  1. ;
  1. ; The Previous ICD Code, Null if none
  1. ;
  1. Q $$PREV^ICDEX($G(CODE))
  1. ;
  1. HIST(CODE,ARY) ; Activation History
  1. ;
  1. ; Input:
  1. ;
  1. ; CODE ICD Code REQUIRED
  1. ; .ARY Array, passed by Reference REQUIRED
  1. ;
  1. ; Output:
  1. ;
  1. ; Mirrors ARY(0) (or, -1 on error)
  1. ; ARY(0) = Number of Activation History Entries
  1. ; ARY(<date>) = status where: 1 is Active
  1. ; ARY("IEN") = <ien>
  1. ;
  1. Q $$HIST^ICDEX($G(CODE),.ARY)
  1. PERIOD(CODE,ARY) ; Return Activation/Inactivation Period in ARY
  1. ;
  1. ; Input:
  1. ;
  1. ; CODE ICD Code (required)
  1. ; ARY Array, passed by Reference (required)
  1. ;
  1. ; Output:
  1. ;
  1. ; ARY(0) = IEN ^ Selectable ^ Error Message
  1. ;
  1. ; Where IEN = -1 if error
  1. ; Selectable = 0 for unselectable
  1. ; Error Message if applicable
  1. ;
  1. ; ARY(Activation Date) = Inactivation Date^Short Name
  1. ;
  1. ; Where the Short Name is versioned as follows:
  1. ;
  1. ; Period is active - Text for TODAY's date
  1. ; Period is inactive - Text for inactivation date
  1. ;
  1. N X S X=$$PERIOD^ICDEX($G(CODE),.ARY) Q