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

PXBGPOV.m

Go to the documentation of this file.
PXBGPOV ;ISL/JVS,ESW - GATHER POV (DIAGNOSIS) ; 12/2/02 6:22pm
 ;;1.0;PCE PATIENT CARE ENCOUNTER;**11,112**;Aug 12, 1996
 ;
POV(VISIT) ;--Gather the entries in the V POV file
 ;
 N IEN,QUANTITY,PROVIDER,SNARR,POV,GROUP,PXBC,POVI
 N DIC,DR,DA,DIQ,PRIM,PROBLEM,PXBPLA,PXBPL,PKG,SOURC
 ;
 K ^TMP("PXBU",$J),POV,PXBKY,PXBSAM,PXBSKY,PXDIGNS,NOPLLIST
 K ^UTILITY("DIQ1",$J)
 S FPRI="",PROBLEM=""
 I $D(^AUPNVPOV("AD",VISIT)) D
 .S IEN=0 F  S IEN=$O(^AUPNVPOV("AD",VISIT,IEN)) Q:IEN'>0  D
 ..S ^TMP("PXBU",$J,"POV",IEN)=""
 ;
A ;--Set array with DIAGNOSIS codes
 ;
 D PL^PXBGPL(PATIENT)
 I $D(^TMP("PXBU",$J,"POV")) D
 .S IEN=0 F  S IEN=$O(^TMP("PXBU",$J,"POV",IEN)) Q:IEN'>0  D
 ..S DIC=9000010.07,DR=".01;1204;.04;.12;81202;81203",DA=IEN,DIQ(0)="IE" D EN^DIQ1
 ..S PROVIDER=$G(^UTILITY("DIQ1",$J,9000010.07,DA,"1204","E"))
 ..S LNARR=$G(^UTILITY("DIQ1",$J,9000010.07,DA,".04","E"))
 ..S POV=$G(^UTILITY("DIQ1",$J,9000010.07,DA,".01","E"))
 ..S PROBLEM="" S:$D(^TMP("PXBKYPL",$J,POV)) PROBLEM="YES"
 ..S POVI=$G(^UTILITY("DIQ1",$J,9000010.07,DA,".01","I"))
 ..S PRIM=$G(^UTILITY("DIQ1",$J,9000010.07,DA,".12","E"))
 ..S PKG=$G(^UTILITY("DIQ1",$J,9000010.07,DA,"81202","I"))
 ..I PKG']"" S PKG="NONE"
 ..S SOURC=$G(^UTILITY("DIQ1",$J,9000010.07,DA,"81203","I"))
 ..I SOURC']"" S SOURC="NONE"
 ..S SNARR=$$EXTTEXT^PXUTL1(POVI,1,80,3)
 ..I $L(LNARR)'>30 S LNARR=$$EXTTEXT^PXUTL1(POVI,1,80,10)
 ..S FPRI=FPRI_$E(PRIM,1,3) ;--Creating flag for Promary prompt
 ..S GROUP=POV_"^"_PROVIDER_"^"_SNARR_"^"_PRIM_"^"_PROBLEM
 ..;        1        2            3        4          5
 ..I PRIM["PRI" S PXDIGNS("PRIMARY")=POV
 ..S ^TMP("PXBPOV",$J,POV,IEN)=GROUP
 ..S ^TMP("PXBGPOVMATCH",$J,POVI,IEN)=""
 ..I $P(GROUP,"^",5)'["YES" S NOPLLIST=1
 ;
B ;--Add line numbers
 ;
 I $D(^TMP("PXBPOV",$J)) D
 .S PXBC=0,POV="" F  S POV=$O(^TMP("PXBPOV",$J,POV)) Q:POV=""  Q:PXBC>40  D
 ..S IEN=0 F  S IEN=$O(^TMP("PXBPOV",$J,POV,IEN)) Q:IEN=""  S PXBC=PXBC+1 D
 ...S PXBKY(POV,PXBC)=$G(^TMP("PXBPOV",$J,POV,IEN)),PXBSAM(PXBC)=$G(^TMP("PXBPOV",$J,POV,IEN))
 ...S PXBSKY(PXBC,IEN)=""
 ...S PXBSAM(PXBC,"LNARR")=LNARR
FINISG ;--finish up some variables
 ;--FPRI=0 NO PRIMARY
 S:FPRI'["PRI" FPRI=0 S:FPRI["PRI" FPRI=1
EXIT ;--KILL
 K ^TMP("PXBU",$J),^TMP("PXBKYPL",$J),^TMP("PXBSAMPL",$J),PXBSKYPL
 K ^TMP("PXBPOV",$J)
 K ^UTILITY("DIQ1",$J)
 S PXBCNT=+$G(PXBC)
 Q
 ;