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

PXBGXAM.m

Go to the documentation of this file.
PXBGXAM ;ISL/PKR - Gather exam data.  Follow the convention established by PXBGCPT. ;7/24/96  14:01
 ;;1.0;PCE PATIENT CARE ENCOUNTER;;Aug 12, 1996
 ;
EXAM(VISIT) ;Gather the entries in the V Exam file.
 N DA,DIC,DIQ,DR,IEN
 ;
 K ^TMP("PXBU",$J)
 I $D(^AUPNVXAM("AD",VISIT)) D
 . S IEN=0
 . F  S IEN=$O(^AUPNVXAM("AD",VISIT,IEN)) Q:IEN'>0  D
 .. S ^TMP("PXBU",$J,"EXAM",IEN)=""
 ;
 N ENCDT,ENCPRV,EXAM,EXAMN,PATIENT,RESULT,TEMP
 I $D(^TMP("PXBU",$J,"EXAM")) D
 . S IEN=0
 . F  S IEN=$O(^TMP("PXBU",$J,"EXAM",IEN)) Q:IEN'>0  D
 .. K TEMP
 .. S DIC=9000010.13,DA=IEN
 .. S DR=".01;.02;.04;1201;1204;811"
 .. S DIQ="TEMP(",DIQ(0)="E"
 .. D EN^DIQ1
 .. S EXAMN=$G(TEMP(9000010.13,DA,.01,"E"))
 .. S PATIENT=$G(TEMP(9000010.13,DA,.02,"E"))
 .. S RESULT=$G(TEMP(9000010.13,DA,.04,"E"))
 .. S ENCDT=$G(TEMP(9000010.13,DA,1201,"E"))
 .. S ENCPRV=$G(TEMP(9000010.13,DA,1204,"E"))
 .. S EXAM(EXAMN,IEN)=EXAMN_U_PATIENT_U_RESULT_U_ENCDT_U_ENCPRV
 ;
 N PXBC
 S PXBC=0
 I $D(EXAM) D
 . S EXAMN=""
 . F  S EXAMN=$O(EXAM(EXAMN)) Q:EXAMN=""  D
 .. S IEN=0
 .. F  S IEN=$O(EXAM(EXAMN,IEN)) Q:IEN=""  D
 ... S PXBC=PXBC+1
 ... S PXBKY(EXAMN,IEN)=EXAM(EXAMN,IEN)
 ... S PXBSAM(PXBC)=EXAM(EXAMN,IEN)
 ... S PXBSKY(PXBC,IEN)=EXAM(EXAMN,IEN)
 ;
 K ^TMP("PXBU",$J)
 S PXBCNT=PXBC
 Q