DGWPT1 ; SLC/KCM - Patient Lookup Functions (cont) ;3/1/01
 ;;5.3;Registration;**447**;Aug 13, 1993
 ;
SAVDFLT ; continued from DGWPT, save new default patient list
 
DAY,HOLDX OK=1
 
I $P(X,U)="P" D
 
EN^XPAR(DUZ_";VA(200,","DGLP DEFAULT LIST SOURCE",1,"P")
 . 
EN^XPAR(DUZ_";VA(200,","DGLP DEFAULT PROVIDER",1,"`"_$P(X,U,2))
 
I $P(X,U)="T" D
 
EN^XPAR(DUZ_";VA(200,","DGLP DEFAULT LIST SOURCE",1,"T")
 . 
EN^XPAR(DUZ_";VA(200,","DGLP DEFAULT TEAM",1,"`"_$P(X,U,2))
 
I $P(X,U)="S" D
 
EN^XPAR(DUZ_";VA(200,","DGLP DEFAULT LIST SOURCE",1,"S")
 . 
EN^XPAR(DUZ_";VA(200,","DGLP DEFAULT SPECIALTY",1,"`"_$P(X,U,2))
 
I $P(X,U)="C" D
 
EN^XPAR(DUZ_";VA(200,","DGLP DEFAULT LIST SOURCE",1,"C")
 . 
DAY="MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY","SUNDAY" EN^XPAR(DUZ_";VA(200,","DGLP DEFAULT CLINIC "_DAY,1,"`"_$P(X,U,2))
 . 
EN^XPAR(DUZ_";VA(200,","DGLP DEFAULT CLINIC START DATE",1,$P($P(X,U,3),";"))
 . 
EN^XPAR(DUZ_";VA(200,","DGLP DEFAULT CLINIC STOP DATE",1,$P($P(X,U,3),";",2))
 
; SLC/PKS - 6/25/2001
 ; Added section to save clinic defaults for current day only:
 
I $P(X,U)="CT" D
 
EN^XPAR(DUZ_";VA(200,","DGLP DEFAULT LIST SOURCE",1,"C")
 . 
HOLDX=X
 
NOW^%DTC DW^%DTC DAY=X=HOLDX
 
EN^XPAR(DUZ_";VA(200,","DGLP DEFAULT CLINIC "_DAY,1,"`"_$P(X,U,2))
 . 
EN^XPAR(DUZ_";VA(200,","DGLP DEFAULT CLINIC START DATE",1,$P($P(X,U,3),";"))
 . 
EN^XPAR(DUZ_";VA(200,","DGLP DEFAULT CLINIC STOP DATE",1,$P($P(X,U,3),";",2))
 
I $P(X,U)="W" D
 
EN^XPAR(DUZ_";VA(200,","DGLP DEFAULT LIST SOURCE",1,"W")
 . 
EN^XPAR(DUZ_";VA(200,","DGLP DEFAULT WARD",1,"`"_$P(X,U,2))
 
I $P(X,U)="A" DEL^XPAR(DUZ_";VA(200,","ORLP DEFAULT LIST SOURCE",1)
 
Q
PRCARE(VAL,PATIENT)        ; return Primary Care info
 ; VAL=Primary Care Team^Primary Care Provider^Attending
 
PCT,PCP,ATT
 
PCT=$P($$OUTPTTM^SDUTL3(PATIENT,DT),U,2)
 
PCP=$P($$OUTPTPR^SDUTL3(PATIENT,DT),U,2)
 
ATT=$G(^DPT(PATIENT,.1041)) ATT ATT=$P($G(^VA(200,ATT,0)),U)
 
VAL=PCT_U_PCP_U_ATT
 
Q
PCDETAIL(LST,PATIENT)   ; return Primary Care Detail information
 
ILST,ILST=0
 
X=$$OUTPTTM^SDUTL3(PATIENT,DT)
 
+X>0 D
 
ILST=ILST+1,LST(ILST)="    Primary Care Team:  "_$P(X,U,2)
 . 
ILST=ILST+1,LST(ILST)="                Phone:  "_$P($G(^SCTM(404.51,+X,0)),U,2)
 
E  S ILST=ILST+1,LST(ILST)="No Primary Care Team Assigned."
 
ILST=ILST+1,LST(ILST)=" "
 
X=$$OUTPTPR^SDUTL3(PATIENT,DT)
 
+X>0 D
 
ILST=ILST+1,LST(ILST)="Primary Care Provider:  "_$P(X,U,2)
 . 
ILST=ILST+1,LST(ILST)="         Analog Pager:  "_$P($G(^VA(200,+X,.13)),U,7)
 . 
ILST=ILST+1,LST(ILST)="        Digital Pager:  "_$P($G(^VA(200,+X,.13)),U,8)
 . 
ILST=ILST+1,LST(ILST)="         Office Phone:  "_$P($G(^VA(200,+X,.13)),U,2)
 
E  S ILST=ILST+1,LST(ILST)="No Primary Care Provider Assigned."
 
ILST=ILST+1,LST(ILST)=" "
 
X=$$OUTPTAP^SDUTL3(PATIENT,DT)
 
+X>0 D
 
ILST=ILST+1,LST(ILST)="   Associate Provider:  "_$P(X,U,2)
 . 
ILST=ILST+1,LST(ILST)="         Analog Pager:  "_$P($G(^VA(200,+X,.13)),U,7)
 . 
ILST=ILST+1,LST(ILST)="        Digital Pager:  "_$P($G(^VA(200,+X,.13)),U,8)
 . 
ILST=ILST+1,LST(ILST)="         Office Phone:  "_$P($G(^VA(200,+X,.13)),U,2)
 
E  S ILST=ILST+1,LST(ILST)="No Associate Provider Assigned."
 
ILST=ILST+1,LST(ILST)=" "
 
X=$G(^DPT(PATIENT,.1041))
 
+D
 
ILST=ILST+1,LST(ILST)="  Attending Physician:  "_$P($G(^VA(200,+X,0)),U)
 . 
ILST=ILST+1,LST(ILST)="         Analog Pager:  "_$P($G(^VA(200,+X,.13)),U,7)
 . 
ILST=ILST+1,LST(ILST)="        Digital Pager:  "_$P($G(^VA(200,+X,.13)),U,8)
 . 
ILST=ILST+1,LST(ILST)="         Office Phone:  "_$P($G(^VA(200,+X,.13)),U,2)
 
Q