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

LREPICD.m

Go to the documentation of this file.
LREPICD ;ALB/TEJ - EMERGING PATHOGENS ICD UTILITIES;16 Jun 2013  5:55 PM ; 19 Jun 2013  2:37 AM
 ;;5.2;LAB SERVICE;**421**;Sep 27, 1994;Build 48
 ;
 ; ICR 5747 - $$SINFO^ICDEX API supported by this IA
 ;
ICDSYS(LREPDOS,LRICDTYP) ;
 ; Parameters
 ;  input:  LREPDOS  - date of service (REQ)
 ;          LRICDTYP - code type requested "D"iag/"P"roc)
 ;  output: LRICDSYS   - icd system for implementation
 ; e.g.  (3131001,"D")
 ;
 N LRDT,LRCTYP,LRICDSYS
 S LRDT=$G(LREPDOS),LRCTYP=$S($G(LRICDTYP)="D":"DIAG",$G(LRICDTYP)="P":"PROC",1:"")
 I LRDT']"" S LRICDSYS="-1^P1(DATE) is REQUIRED" G Q1
 I LRCTYP']"" S LRICDSYS="-1^P2(CODING_SYSTEM) is REQUIRED" G Q1
 ; Check date of interest / code type
 S LRICDSYS=$P($$SINFO^ICDEX(LRCTYP,LRDT),U,3)
Q1 Q LRICDSYS
ICDCONVT ; Convert File #69.5 "ICD-9" text entries to "ICD"
 ;
 K LREPI695
 S LREPI695=0 F  S LREPI695=$O(^LAB(69.5,LREPI695)) Q:+LREPI695=0  D
 .K LREPITXT S LREPIX=$$GET1^DIQ(69.5,LREPI695_",",15,"","LREPITXT") F LRX=1:1 Q:'$D(^LAB(69.5,LREPI695,8,LRX,0))  D
 ..S LRTXT=@(LREPIX_"("_LRX_")") D:(LRTXT["ICDM-9")!(LRTXT["ICD-9")
 ...L +^LAB(69.5,LREPI695):999
 ...S LRP=$S(LRTXT["ICDM-9":"ICDM-9",1:"ICD-9"),^LAB(69.5,LREPI695,8,LRX,0)=$P(LRTXT,LRP)_"ICD"_$P(LRTXT,LRP,2) W !,^LAB(69.5,LREPI695,8,LRX,0)
 ...L -^LAB(69.5,LREPI695)
Q2 K LREPIX,LRP,LRTXT,LRX Q
 ;