SCMCMM ;ALB/REW - MailMessages Utilities ; 11/4/99 9:29am
;;5.3;Scheduling;**41,177,205,1015**;AUG 13, 1993;Build 21
;1
PCMAIL(DFN,SCARRAY,SCDATE) ;load standard patient pc info into mail message
; DFN - ptr to Patient File
; SCARRAY - Literal value of XMTEXT ARRAY
; SCDATE - Date of interest - default=dt
; Returned: Ending Line Count for Array
;
N SCLNCNT,SCPCTM,SCPHONE,SCPCAT,SCPCPR,SCPCAP
S SCDATE=$G(SCDATE,DT)
S SCLNCNT=+$O(@SCARRAY@(9999999),-1) ; the current number of lines
S SCPCTM=$$NMPCTM^SCAPMCU2(DFN,SCDATE,1)
I SCPCTM D
.S SCPHONE=$P($G(^SCTM(404.51,+SCPCTM,0)),U,2)
.S:$L(SCPHONE) SCPHONE=" Phone: "_SCPHONE
.S SCPCTM=$P(SCPCTM,U,2)
.S SCPCAT=$P($$NMPCPR^SCAPMCU2(DFN,SCDATE,2),U,2)
.S SCPCPR=$P($$NMPCPR^SCAPMCU2(DFN,SCDATE,1),U,2)
.S SCPCAP=$P($$NMPCPR^SCAPMCU2(DFN,SCDATE,3),U,2)
IF $L(SCPCTM) D
.D SETLN(" ")
.D SETLN("Current Primary Care Management Data: ")
.D:$L(SCPCTM) SETLN(" PC Team: "_SCPCTM_SCPHONE)
.D:$L(SCPCPR) SETLN(" PC Provider(PCP): "_SCPCPR)
.D:$L(SCPCAP) SETLN(" Associate Provider(AP): "_SCPCAP)
.D:$L(SCPCAT) SETLN(" PC Attending: "_SCPCAT)
ELSE D
.D SETLN(" ")
.D SETLN("No Current Primary Care Management Data")
END Q SCLNCNT
;
SETLN(TEXT) ;
;Note - This is not a stand-alone call - needs scarray,sclncnt
Q:$G(TEXT)=""
; increments SCLNCNT, adds text to @scarray@(sclncnt)
S SCLNCNT=SCLNCNT+1
;
;djb/bp Some rtns that call this rtn have text array in ARRY(counter)
;and others use ARRY(counter,0). Add code to handle both types.
;New code begin
I $D(@SCARRAY@((SCLNCNT-1),0)) S @SCARRAY@(SCLNCNT,0)=TEXT
E S @SCARRAY@(SCLNCNT)=TEXT
;New code end
;Old code begin
;S @SCARRAY@(SCLNCNT)=TEXT
;Old code end
;
Q
SCMCMM ;ALB/REW - MailMessages Utilities ; 11/4/99 9:29am
+1 ;;5.3;Scheduling;**41,177,205,1015**;AUG 13, 1993;Build 21
+2 ;1
PCMAIL(DFN,SCARRAY,SCDATE) ;load standard patient pc info into mail message
+1 ; DFN - ptr to Patient File
+2 ; SCARRAY - Literal value of XMTEXT ARRAY
+3 ; SCDATE - Date of interest - default=dt
+4 ; Returned: Ending Line Count for Array
+5 ;
+6 NEW SCLNCNT,SCPCTM,SCPHONE,SCPCAT,SCPCPR,SCPCAP
+7 SET SCDATE=$GET(SCDATE,DT)
+8 ; the current number of lines
SET SCLNCNT=+$ORDER(@SCARRAY@(9999999),-1)
+9 SET SCPCTM=$$NMPCTM^SCAPMCU2(DFN,SCDATE,1)
+10 IF SCPCTM
Begin DoDot:1
+11 SET SCPHONE=$PIECE($GET(^SCTM(404.51,+SCPCTM,0)),U,2)
+12 IF $LENGTH(SCPHONE)
SET SCPHONE=" Phone: "_SCPHONE
+13 SET SCPCTM=$PIECE(SCPCTM,U,2)
+14 SET SCPCAT=$PIECE($$NMPCPR^SCAPMCU2(DFN,SCDATE,2),U,2)
+15 SET SCPCPR=$PIECE($$NMPCPR^SCAPMCU2(DFN,SCDATE,1),U,2)
+16 SET SCPCAP=$PIECE($$NMPCPR^SCAPMCU2(DFN,SCDATE,3),U,2)
End DoDot:1
+17 IF $LENGTH(SCPCTM)
Begin DoDot:1
+18 DO SETLN(" ")
+19 DO SETLN("Current Primary Care Management Data: ")
+20 IF $LENGTH(SCPCTM)
DO SETLN(" PC Team: "_SCPCTM_SCPHONE)
+21 IF $LENGTH(SCPCPR)
DO SETLN(" PC Provider(PCP): "_SCPCPR)
+22 IF $LENGTH(SCPCAP)
DO SETLN(" Associate Provider(AP): "_SCPCAP)
+23 IF $LENGTH(SCPCAT)
DO SETLN(" PC Attending: "_SCPCAT)
End DoDot:1
+24 IF '$TEST
Begin DoDot:1
+25 DO SETLN(" ")
+26 DO SETLN("No Current Primary Care Management Data")
End DoDot:1
END QUIT SCLNCNT
+1 ;
SETLN(TEXT) ;
+1 ;Note - This is not a stand-alone call - needs scarray,sclncnt
+2 IF $GET(TEXT)=""
QUIT
+3 ; increments SCLNCNT, adds text to @scarray@(sclncnt)
+4 SET SCLNCNT=SCLNCNT+1
+5 ;
+6 ;djb/bp Some rtns that call this rtn have text array in ARRY(counter)
+7 ;and others use ARRY(counter,0). Add code to handle both types.
+8 ;New code begin
+9 IF $DATA(@SCARRAY@((SCLNCNT-1),0))
SET @SCARRAY@(SCLNCNT,0)=TEXT
+10 IF '$TEST
SET @SCARRAY@(SCLNCNT)=TEXT
+11 ;New code end
+12 ;Old code begin
+13 ;S @SCARRAY@(SCLNCNT)=TEXT
+14 ;Old code end
+15 ;
+16 QUIT