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

PXCEHLOC.m

Go to the documentation of this file.
PXCEHLOC ;ISL/dee,ISA/KWP - Creates the List Manager display of visit for a hospital location ;04/30/99
 ;;1.0;PCE PATIENT CARE ENCOUNTER;**1,52,70,75**;Aug 12, 1996
 ;; ;
 Q
 ;
MAKELIST ;
 K VALMHDR S VALMBCK="R"
 ;
 D CLEAN^VALM10
 K ^TMP("PXCEIDX",$J)
 D CHGCAP^VALM("LOCATION","Patient")
 S VALMBG=1
 S VALMCNT=0
 I '$D(PXCEHLOC) D
 . N PXCEHLOC
 . S PXCEHLOC=0
 . F  S PXCEHLOC=$O(^AUPNVSIT("AHL",PXCEHLOC)) Q:PXCEHLOC'>0  D ONEHLOC
 E  D ONEHLOC
 S ^TMP("PXCEIDX",$J,0)=VALMCNT
 I VALMCNT'>0 D
 . S ^TMP("PXCE",$J,1,0)=" "
 . S ^TMP("PXCE",$J,2,0)="    No encounter found that satisfy the above criteria."
 . S VALMCNT=2
 Q
 ;
ONEHLOC ;
 N PXCEDATE,PXCELOC,PXCESTAT,PXCEPDFN,PXCEVSIT,PXCENAME,PXCEIEN
 N PXCEPRIM,PXELIG,PXDATA
 N PXCEDT
 S PXCEDT=PXCE9END
 N PXCECLST,PXCEGAFR,PXCEGAF,DFN,PXCEMH
 S PXCEMH=$$MHCLIN^SDUTL2(PXCEHLOC)
 S PXCECLST=$P(^SC(PXCEHLOC,0),"^",7)
 F  S PXCEDT=$O(^AUPNVSIT("AHL",PXCEHLOC,PXCEDT)) Q:PXCEDT'>0!(PXCEDT>PXCE9BEG)  D
 . S PXCEIEN=""
 . F  S PXCEIEN=$O(^AUPNVSIT("AHL",PXCEHLOC,PXCEDT,PXCEIEN)) Q:PXCEIEN'>0  D
 .. S PXCEVSIT=^AUPNVSIT(PXCEIEN,0)
 .. S PXCEPRIM=$P($G(^AUPNVSIT(PXCEIEN,150)),"^",3)
 .. ;+do not show encounter if the encounter type is S,C or null
 .. Q:"SC"[PXCEPRIM
 .. I PXCEKEYS'["S",PXCEKEYS'["V","A"=PXCEPRIM Q  ;+let supervisor and viewer see ancillary package encounters
 .. S PXCENAME=$P(PXCEVSIT,"^",5),DFN=PXCENAME,PXCEGAFR=" "
 .. I PXCEKEYS'["V",$$DISPOSIT^PXUTL1(PXCENAME,+PXCEVSIT,PXCEIEN) Q  ;+let viewer see dispositions
 .. S PXELIG=$$ELSTAT^SDUTL2(DFN)
 .. S PXDATA=$G(^DPT(DFN,"S",+PXCEVSIT,0))
 .. I PXCEMH,'($$COLLAT^SDUTL2(PXELIG)!$P(PXDATA,U,11)) D
 ... S PXCEGAF=$$NEWGAF^SDUTL2(DFN)
 ... I $P(PXCEGAF,"^") S PXCEGAFR="*"
 .. D PATNAME^PXCEPAT(.PXCENAME)
 .. S VALMCNT=VALMCNT+1
 .. S PXCEDATE=$$DATE^PXCEDATE($P(PXCEVSIT,"^",1))
 .. S PXCEDATE=$E(PXCEDATE,1,18)_$J("",(19-$L(PXCEDATE)))
 .. S PXCELOC=$S($P(PXCEVSIT,"^",22)>0:$P(^SC($P(PXCEVSIT,"^",22),0),"^"),1:"")
 .. S PXCELOC=$E(PXCELOC,1,26)_$J("",(28-$L(PXCELOC)))
 .. S PXCEPDFN=$E(PXCENAME("SSN_BRIEF")_"     ",1,5)_$E(PXCENAME("NAME"),1,21)
 .. S PXCEPDFN=PXCEPDFN_$J("",(28-$L(PXCEPDFN)))
 .. S PXCESTAT=$P($$STATUS^SDPCE(PXCEIEN),"^",2)
 .. S ^TMP("PXCE",$J,VALMCNT,0)=PXCEGAFR_$J(VALMCNT,4)_" "_PXCEDATE_PXCEPDFN_PXCESTAT
 .. S ^TMP("PXCEIDX",$J,VALMCNT)=PXCEIEN
 Q
 ;