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

BQIDCABA.m

Go to the documentation of this file.
  1. BQIDCABA ;GDIT/HS/ALA-Abnormal Lab Results ; 12 Dec 2005 1:07 PM
  1. ;;2.4;ICARE MANAGEMENT SYSTEM;**2**;Apr 01, 2015;Build 10
  1. ;
  1. Q
  1. ;
  1. VIS(DATA,PARMS,MPARMS) ;EP
  1. ;
  1. ;Description
  1. ; Executable that determines abnormal lab flags for the specified parameters
  1. ;Input
  1. ; PARMS = Array of parameters and their values
  1. ; MPARMS = Multiple array of a parameter
  1. ;Parameters
  1. ; TMFRAME = Relative time frame
  1. ; FDT = Starting date for the time frame
  1. ; TDT = Ending date for the time frame
  1. ; IEN = Lab record internal entry number
  1. ; VIEN = Visit record internal entry number
  1. ; ABNFL = Abnormal lab result
  1. ;Output
  1. ; All records found will be put into ^TMP by patient and visit internal entry
  1. ; numbers. The patient will be checked against the patients found in all the
  1. ; panels and added to the ICARE PATIENT INDEX file.
  1. ;
  1. NEW UID
  1. S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
  1. S DATA=$NA(^TMP(UID,"BQIDCABA"))
  1. K @DATA
  1. ;
  1. NEW IEN,NM,FDT,TDT,VTYP,X,DIC,Y,RSTM,VIEN,DFN,%DT,TMFRAME,ABNFL,STAT
  1. S NM=""
  1. F S NM=$O(PARMS(NM)) Q:NM="" S @NM=PARMS(NM)
  1. ;
  1. I $G(TMFRAME)="" S TMFRAME="T-6M"
  1. I TMFRAME["T-" D
  1. . S %DT="",X=TMFRAME D ^%DT S FDT=Y
  1. I $G(DT)="" D DT^DICRW
  1. S TDT=DT
  1. ;
  1. ; Go through the V LAB file for the designated time frame to find any
  1. ; abnormal lab results
  1. S RSTM=FDT
  1. F S RSTM=$O(^AUPNVLAB("ARDT",RSTM)) Q:RSTM=""!(RSTM\1>TDT) D
  1. . S IEN=""
  1. . F S IEN=$O(^AUPNVLAB("ARDT",RSTM,IEN)) Q:IEN="" D
  1. .. ;S DFN=$$GET1^DIQ(9000010.09,IEN_",",.02,"I") I DFN="" Q
  1. .. S DFN=$P($G(^AUPNVLAB(IEN,0)),"^",2) I DFN="" Q
  1. .. ;S STAT=$$GET1^DIQ(9000010.09,IEN_",",1109,"I")
  1. .. S STAT=$P($G(^AUPNVLAB(IEN,11)),"^",9)
  1. .. I STAT'="R",STAT'="M" Q
  1. .. ;S ABNFL=$$GET1^DIQ(9000010.09,IEN_",",.05,"E")
  1. .. S ABNFL=$P($G(^AUPNVLAB(IEN,0)),"^",5)
  1. .. ;Q:ABNFL=""
  1. .. I ABNFL="" Q
  1. .. ;S VIEN=$$GET1^DIQ(9000010.09,IEN_",",.03,"I") Q:VIEN=""
  1. .. S VIEN=$P($G(^AUPNVLAB(IEN,0)),"^",3) I VIEN="" Q
  1. .. ;I $$GET1^DIQ(9000010,VIEN_",",.11,"I")=1 Q
  1. .. I $P($G(^AUPNVSIT(VIEN,0)),"^",11)=1 Q
  1. .. I ABNFL="L"!(ABNFL="L*")!(ABNFL="H")!(ABNFL="H*") S @DATA@(DFN,IEN)=VIEN_U_$P($G(^AUPNVSIT(VIEN,0)),"^",1)
  1. Q