SDECF2 ;ALB/SAT - VISTA SCHEDULING RPCS ;JAN 15, 2016
;;5.3;Scheduling;**627**;Aug 13, 1993;Build 249
;
Q
;
HRCN(PAT,SITE) ;EP; return chart number for patient at this site
;called by ADT ITEMS file
I $G(PAT)="" Q "" ;cmi/maw 6/12/2008 PATCH 1009 added for missing pat node in file 44 for appt
Q $P($G(^AUPNPAT(PAT,41,SITE,0)),U,2)
;
HRCND(X) ;EP; add dashes to chart # passed as X
;called by ADT ITEMS file
S X="00000"_X,X=$E(X,$L(X)-5,$L(X))
S X=$E(X,1,2)_"-"_$E(X,3,4)_"-"_$E(X,5,6)
Q X
;
HRCNT(X) ;EP; return terminal digit format of chart # passed as X
NEW STYLE ;S STYLE=$$GET1^DIQ(9009020.2,$$DIV^SDECU,.09,"I") I STYLE="" S STYLE="A"
S STYLE="A"
S X="00000"_X,X=$E(X,$L(X)-5,$L(X))
I STYLE="A" S X=$E(X,5,6)_"-"_$E(X,3,4)_"-"_$E(X,1,2)
E S X=$E(X,5,6)_"-"_$E(X,1,2)_"-"_$E(X,3,4)
Q X
;
NAMEPRT(DFN,CONVERT) ;EP; return printable name
;CONVERT=1 means convert to mixed case letters
NEW VADM,X
D DEM^VADPT
S X=$P($P(VADM(1),",",2)," ")_" "_$P(VADM(1),",")
I $G(CONVERT) X ^DD("FUNC",14,1)
Q X
;
DEAD(PAT) ;EP; returns 1 if patient has died
Q $S($G(^DPT(PAT,.35)):1,1:0)
;
DOD(PAT) ;EP; returns patient's date of death
Q $$GET1^DIQ(2,PAT,.351)
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSDECF2 1218 printed Oct 16, 2024@18:52:40 Page 2
SDECF2 ;ALB/SAT - VISTA SCHEDULING RPCS ;JAN 15, 2016
+1 ;;5.3;Scheduling;**627**;Aug 13, 1993;Build 249
+2 ;
+3 QUIT
+4 ;
HRCN(PAT,SITE) ;EP; return chart number for patient at this site
+1 ;called by ADT ITEMS file
+2 ;cmi/maw 6/12/2008 PATCH 1009 added for missing pat node in file 44 for appt
IF $GET(PAT)=""
QUIT ""
+3 QUIT $PIECE($GET(^AUPNPAT(PAT,41,SITE,0)),U,2)
+4 ;
HRCND(X) ;EP; add dashes to chart # passed as X
+1 ;called by ADT ITEMS file
+2 SET X="00000"_X
SET X=$EXTRACT(X,$LENGTH(X)-5,$LENGTH(X))
+3 SET X=$EXTRACT(X,1,2)_"-"_$EXTRACT(X,3,4)_"-"_$EXTRACT(X,5,6)
+4 QUIT X
+5 ;
HRCNT(X) ;EP; return terminal digit format of chart # passed as X
+1 ;S STYLE=$$GET1^DIQ(9009020.2,$$DIV^SDECU,.09,"I") I STYLE="" S STYLE="A"
NEW STYLE
+2 SET STYLE="A"
+3 SET X="00000"_X
SET X=$EXTRACT(X,$LENGTH(X)-5,$LENGTH(X))
+4 IF STYLE="A"
SET X=$EXTRACT(X,5,6)_"-"_$EXTRACT(X,3,4)_"-"_$EXTRACT(X,1,2)
+5 IF '$TEST
SET X=$EXTRACT(X,5,6)_"-"_$EXTRACT(X,1,2)_"-"_$EXTRACT(X,3,4)
+6 QUIT X
+7 ;
NAMEPRT(DFN,CONVERT) ;EP; return printable name
+1 ;CONVERT=1 means convert to mixed case letters
+2 NEW VADM,X
+3 DO DEM^VADPT
+4 SET X=$PIECE($PIECE(VADM(1),",",2)," ")_" "_$PIECE(VADM(1),",")
+5 IF $GET(CONVERT)
XECUTE ^DD("FUNC",14,1)
+6 QUIT X
+7 ;
DEAD(PAT) ;EP; returns 1 if patient has died
+1 QUIT $SELECT($GET(^DPT(PAT,.35)):1,1:0)
+2 ;
DOD(PAT) ;EP; returns patient's date of death
+1 QUIT $$GET1^DIQ(2,PAT,.351)