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

AZXZEMP.m

Go to the documentation of this file.
AZXZEMP ;CHECK FOR EMPLOYER # BEING THE SAME [ 07/09/92  8:12 AM ]
 ;04/08/92  JOHN H. LYNCH
 ; INITIALIZE VARIABLES
 S PAT=0,EMP=0,EMPRNO=0
 S VIEW="N",FIXIT="N"
 
MAIN F I=1:1:26 W !  ; CLEAR SCREEN
 W !,"THIS PROGRAM WILL CHECK TO SEE IF AN"
 W !,"EMPLOYER IS BEING REPEATED IN MANY"
 W !,"DIFFERENT PATIENT FILES (AUPNPAT)."
 R !,!,"DO YOU WANT TO CONTINUE (Y/N)? ",YN
 I YN'="Y" Q
 
 R !,!,"PLEASE ENTER IN EMPLOYER NUMBER TO USE IN FIX: ",EMPRNO
 R !,!,"DO YOU WANT TO VIEW THE PATIENT AND EMPLOYER? ",VIEW
 R !,!,"DO YOU WANT TO GO AHEAD AND FIX (SET EACH TO NULL)? ",FIXIT
 
 D PATIENT
 Q
 
PATIENT F  S PAT=$O(^AUPNPAT("AF",EMPRNO,PAT))  Q:'PAT  S EMP=0  D CHECK 
 Q
 
CHECK S EMP=$P(^AUPNPAT(PAT,0),"^",19)
 I VIEW="Y",EMP=EMPRNO  W !,!,"PATIENT: ",PAT," EMPLOYER: ",EMP
 I FIXIT="Y",EMP=EMPRNO  D FIX
 Q
FIX S $P(^AUPNPAT(PAT,0),"^",19)=""  ;SET 19 PIECE (EMPLOYER)=""
 K ^AUPNPAT("AF",EMPRNO,PAT)      ;KILL OFF "AF" CROSS-REF.
 Q