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

BKMVC6.m

Go to the documentation of this file.
BKMVC6 ;PRXM/HC/JGH - Opp. Inf. and AIDS Defining Illnesses; 24-JAN-2005
 ;;2.2;HIV MANAGEMENT SYSTEM;;Apr 01, 2015;Build 40
 ;
GETALL(DFN) ; EP - Gather patient information
 NEW IENDA0,IENDA,IENS,TARGET,HTARGET
 NEW ATAX,ATAX1
 K ICD9S
 S ATAX=$O(^ATXAX("B","BKMV AIDS DEF ILL DXS",""))   ; DX.1
 S ATAX1=$O(^ATXAX("B","BKMV HIV OPP INF DXS",""))   ; DX.8
 ; Modified code to return unique ICDs for a given date.
 S REVDATE=""
 F  S REVDATE=$O(^AUPNVPOV("AA",DFN,REVDATE)) Q:REVDATE=""  D
 . S VPOV=""
 . F  S VPOV=$O(^AUPNVPOV("AA",DFN,REVDATE,VPOV)) Q:VPOV=""  D
 .. S IENS=$$IENS^DILF(VPOV)
 .. S ICD9=$P($G(^AUPNVPOV(VPOV,0)),"^",1)
 .. ;$$GET1^DIQ(9000010.07,IENS,.01,"I")
 .. I ICD9="" Q
 .. I $$PATCH^XPDUTL("ATX*5.1*11") I $$ICD^ATXAPI(ICD9,ATAX,9)=0,$$ICD^ATXAPI(ICD9,ATAX1,9)=0 Q
 .. E  I $$ICD^BKMIXX5(ICD9,ATAX,9)=0,$$ICD^BKMIXX5(ICD9,ATAX1,9)=0 Q
 .. S NAR=$$GET1^DIQ(9000010.07,IENS,.04,"E")
 .. S ICD9S(REVDATE,ICD9)=NAR
 S VPOV=""
 F  S VPOV=$O(^AUPNPROB("AC",DFN,VPOV)) Q:VPOV=""  D
 . S IENS=$$IENS^DILF(VPOV)
 . S POVDATE=$$PROB^BKMVUTL(IENS)
 . Q:POVDATE'?1.N
 . S REVDATE=9999999-POVDATE
 . S ICD9=$P($G(^AUPNPROB(VPOV,0)),"^",1)
 . ;$$GET1^DIQ(9000011,IENS,.01,"I")
 . I ICD9="" Q
 . I $$PATCH^XPDUTL("ATX*5.1*11") I $$ICD^ATXAPI(ICD9,ATAX,9)=0,$$ICD^ATXAPI(ICD9,ATAX1,9)=0 Q
 . E  I $$ICD^BKMIXX5(ICD9,ATAX,9)=0,$$ICD^BKMIXX5(ICD9,ATAX1,9)=0 Q
 . S NAR=$$GET1^DIQ(9000011,IENS,.05,"E")
 . S ICD9S(REVDATE,ICD9)=NAR
 . ;List date entered/last modified if different from date of onset
 . I POVDATE=$$GET1^DIQ(9000011,IENS,.13,"I") D
 ..  N OTHERDT
 ..  S OTHERDT=$$GET1^DIQ(9000011,IENS,.08,"I")
 ..  I OTHERDT="" S OTHERDT=$$GET1^DIQ(9000011,IENS,.03,"I")
 ..  Q:POVDATE=OTHERDT!(OTHERDT="")
 ..  S ICD9S(9999999-OTHERDT,ICD9)=NAR
 Q