MCARPS1 ;WISC/TJK,RCH-SUMMARY OF PATIENT PROCEDURES (2) ;6/18/97 10:33
;;1.0;CLINICAL PROCEDURES;**5**;Apr 01, 2004;Build 1
K ^TMP("MCAR",$J) S S4="" F M=1:1 S S4=$O(^MCAR(690,"AC",DFN,S4)) Q:S4="" D LOCFIL
Q
LOCFIL G LOCFIL1:$D(S5) S S5="" F K=1:1 S S5=$O(^MCAR(690,"AC",DFN,S4,S5)) Q:S5="" D LOCFIL1
K S5 Q
LOCFIL1 S S6="" F L=1:1 S S6=$O(^MCAR(690,"AC",DFN,S4,S5,S6)) Q:S6="" D CONT
Q
CONT ;CONT+1 modified on 2-7-94,S MCFILE..2) added to conform w/alpha site
Q:$O(^MDD(702,"ACONV",S6_";"_S5_",",0))
I $D(^MCAR(+$P(S5,"(",2),S6,2005)) S MCFILE=+$P(S5,"(",2) D SUM^MCMAG
I S5="MCAR(702.7" Q
I S5="MCAR(699" S (LL,LL1)=$P($G(^MCAR(699,S6,0)),U,12) Q:LL'>0 S LL=$P($G(^MCAR(697.2,LL,0)),U) G CONT1:'$D(PE) Q:PE'=LL G CONT1
;I S5="MCAR(699.5" S (LL,LL1)=$P($G(^MCAR(699.5,S6,0)),U,6) Q:'LL S LL=$P($G(^MCAR(697.2,LL,0)),U) G CONT1:'$D(PE) Q:PE'=LL G CONT1 ;MC*2.3*8
I S5="MCAR(699.5",'$D(PE) D Q ;MC*2.3*8
.S LL6=$P($G(^MCAR(699.5,S6,0)),U,6),LL8=$P($G(^MCAR(699.5,S6,0)),U,8)
.S (LL,LL1)=$P($G(^MCAR(699.5,S6,0)),U,6) Q:'LL S LL=$P($G(^MCAR(697.2,LL,0)),U) D CONT1
I S5="MCAR(699.5",$D(PE) D Q ;MC*2.3*8
.S LL6=$P($G(^MCAR(699.5,S6,0)),U,6),LL8=$P($G(^MCAR(699.5,S6,0)),U,8)
.S (LL,LL1)=$P($G(^MCAR(699.5,S6,0)),U,6) Q:'LL S LL=$P($G(^MCAR(697.2,LL,0)),U)
.N LLX,LLY
.S LLX=$O(^MCAR(697.2,"B",PE,0)) Q:'LLX S LLY=$P($G(^MCAR(697.2,LLX,1)),U)
.I LLY="S",LLX=LL6 D CONT1
.I LLY="P",LLX=LL8 D CONT1
I S5[694 S (LL,LL1)=$P($G(^MCAR(694,S6,0)),U,3) Q:'LL S LL=$P(^MCAR(697.2,LL,0),U) G CONT1:'$D(PE) Q:PE'=LL G CONT1
;MFD 2/5/93 I S5[700,$P($G(^MCAR(700,S6,2)),U)'="Y" Q ; exclude unreleased PFT
S (LL,LL1)=$O(^MCAR(697.2,"C",S5,0)),LL=$P(^MCAR(697.2,LL,0),U,1)
CONT1 ;
S REC=$O(^MCAR(697.2,"B",LL,0)) S:REC="" REC=0
S MCARCODE=""
S MCESON=$P($G(^MCAR(697.2,REC,0)),U,14),MCESKEY=$P($G(^MCAR(697.2,REC,0)),U,15),MCSUP=+$P($G(^MCAR(697.2,REC,0)),U,16)
S (MCARSUM,MCARPSUM)="",MCARFILE=U_S5_","_S6_",.2)" S:$D(@MCARFILE) MCARSUM=$P(@MCARFILE,U,1),MCARPSUM=$P(@MCARFILE,U,2)
K MCARFILE S S1=$S(WH="P":LL,1:S4),S2=$S(WH="P":S4,1:LL)
S MCFILE=+$P(S5,"(",2)
I MCESON,($G(MCESKEY)'=""),('$$SCRSUMPT^MCESSCR(MCESKEY,S6,MCSUP)) K MCARSUM,MCARPSUM,MCFILE,REC,MCSUP Q
I $P($G(@(U_S5_","_S6_",""ES"")")),U,7)="S" G EXIT ;MC*2.3*8
S S2=S2_U_S6 ;MC*2.3*8
S ^TMP("MCAR",$J,S1,S2)=MCARSUM_U_S6_U_$P(^MCAR(697.2,LL1,0),U,5,7)
S $P(^TMP("MCAR",$J,S1,S2),U,10)=MCARPSUM
S $P(^TMP("MCAR",$J,S1,S2),U,11)=LL
I S5="MCAR(699.5" D ;MC*2.3*8
.I LL8="" S LL8=" "
.S $P(^TMP("MCAR",$J,S1,S2),U,12)=$E(($E($P($G(^MCAR(697.2,LL6,0)),U,8),1,13)_"/"_$P($G(^MCAR(697.2,LL8,0)),U)),1,31) K LL6,LL8
EXIT K MCARSUM,MCARPSUM,REC,MCSUP,MCESON Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HMCARPS1 2710 printed Oct 16, 2024@18:15:06 Page 2
MCARPS1 ;WISC/TJK,RCH-SUMMARY OF PATIENT PROCEDURES (2) ;6/18/97 10:33
+1 ;;1.0;CLINICAL PROCEDURES;**5**;Apr 01, 2004;Build 1
+2 KILL ^TMP("MCAR",$JOB)
SET S4=""
FOR M=1:1
SET S4=$ORDER(^MCAR(690,"AC",DFN,S4))
if S4=""
QUIT
DO LOCFIL
+3 QUIT
LOCFIL if $DATA(S5)
GOTO LOCFIL1
SET S5=""
FOR K=1:1
SET S5=$ORDER(^MCAR(690,"AC",DFN,S4,S5))
if S5=""
QUIT
DO LOCFIL1
+1 KILL S5
QUIT
LOCFIL1 SET S6=""
FOR L=1:1
SET S6=$ORDER(^MCAR(690,"AC",DFN,S4,S5,S6))
if S6=""
QUIT
DO CONT
+1 QUIT
CONT ;CONT+1 modified on 2-7-94,S MCFILE..2) added to conform w/alpha site
+1 if $ORDER(^MDD(702,"ACONV",S6_";"_S5_",",0))
QUIT
+2 IF $DATA(^MCAR(+$PIECE(S5,"(",2),S6,2005))
SET MCFILE=+$PIECE(S5,"(",2)
DO SUM^MCMAG
+3 IF S5="MCAR(702.7"
QUIT
+4 IF S5="MCAR(699"
SET (LL,LL1)=$PIECE($GET(^MCAR(699,S6,0)),U,12)
if LL'>0
QUIT
SET LL=$PIECE($GET(^MCAR(697.2,LL,0)),U)
if '$DATA(PE)
GOTO CONT1
if PE'=LL
QUIT
GOTO CONT1
+5 ;I S5="MCAR(699.5" S (LL,LL1)=$P($G(^MCAR(699.5,S6,0)),U,6) Q:'LL S LL=$P($G(^MCAR(697.2,LL,0)),U) G CONT1:'$D(PE) Q:PE'=LL G CONT1 ;MC*2.3*8
+6 ;MC*2.3*8
IF S5="MCAR(699.5"
IF '$DATA(PE)
Begin DoDot:1
+7 SET LL6=$PIECE($GET(^MCAR(699.5,S6,0)),U,6)
SET LL8=$PIECE($GET(^MCAR(699.5,S6,0)),U,8)
+8 SET (LL,LL1)=$PIECE($GET(^MCAR(699.5,S6,0)),U,6)
if 'LL
QUIT
SET LL=$PIECE($GET(^MCAR(697.2,LL,0)),U)
DO CONT1
End DoDot:1
QUIT
+9 ;MC*2.3*8
IF S5="MCAR(699.5"
IF $DATA(PE)
Begin DoDot:1
+10 SET LL6=$PIECE($GET(^MCAR(699.5,S6,0)),U,6)
SET LL8=$PIECE($GET(^MCAR(699.5,S6,0)),U,8)
+11 SET (LL,LL1)=$PIECE($GET(^MCAR(699.5,S6,0)),U,6)
if 'LL
QUIT
SET LL=$PIECE($GET(^MCAR(697.2,LL,0)),U)
+12 NEW LLX,LLY
+13 SET LLX=$ORDER(^MCAR(697.2,"B",PE,0))
if 'LLX
QUIT
SET LLY=$PIECE($GET(^MCAR(697.2,LLX,1)),U)
+14 IF LLY="S"
IF LLX=LL6
DO CONT1
+15 IF LLY="P"
IF LLX=LL8
DO CONT1
End DoDot:1
QUIT
+16 IF S5[694
SET (LL,LL1)=$PIECE($GET(^MCAR(694,S6,0)),U,3)
if 'LL
QUIT
SET LL=$PIECE(^MCAR(697.2,LL,0),U)
if '$DATA(PE)
GOTO CONT1
if PE'=LL
QUIT
GOTO CONT1
+17 ;MFD 2/5/93 I S5[700,$P($G(^MCAR(700,S6,2)),U)'="Y" Q ; exclude unreleased PFT
+18 SET (LL,LL1)=$ORDER(^MCAR(697.2,"C",S5,0))
SET LL=$PIECE(^MCAR(697.2,LL,0),U,1)
CONT1 ;
+1 SET REC=$ORDER(^MCAR(697.2,"B",LL,0))
if REC=""
SET REC=0
+2 SET MCARCODE=""
+3 SET MCESON=$PIECE($GET(^MCAR(697.2,REC,0)),U,14)
SET MCESKEY=$PIECE($GET(^MCAR(697.2,REC,0)),U,15)
SET MCSUP=+$PIECE($GET(^MCAR(697.2,REC,0)),U,16)
+4 SET (MCARSUM,MCARPSUM)=""
SET MCARFILE=U_S5_","_S6_",.2)"
if $DATA(@MCARFILE)
SET MCARSUM=$PIECE(@MCARFILE,U,1)
SET MCARPSUM=$PIECE(@MCARFILE,U,2)
+5 KILL MCARFILE
SET S1=$SELECT(WH="P":LL,1:S4)
SET S2=$SELECT(WH="P":S4,1:LL)
+6 SET MCFILE=+$PIECE(S5,"(",2)
+7 IF MCESON
IF ($GET(MCESKEY)'="")
IF ('$$SCRSUMPT^MCESSCR(MCESKEY,S6,MCSUP))
KILL MCARSUM,MCARPSUM,MCFILE,REC,MCSUP
QUIT
+8 ;MC*2.3*8
IF $PIECE($GET(@(U_S5_","_S6_",""ES"")")),U,7)="S"
GOTO EXIT
+9 ;MC*2.3*8
SET S2=S2_U_S6
+10 SET ^TMP("MCAR",$JOB,S1,S2)=MCARSUM_U_S6_U_$PIECE(^MCAR(697.2,LL1,0),U,5,7)
+11 SET $PIECE(^TMP("MCAR",$JOB,S1,S2),U,10)=MCARPSUM
+12 SET $PIECE(^TMP("MCAR",$JOB,S1,S2),U,11)=LL
+13 ;MC*2.3*8
IF S5="MCAR(699.5"
Begin DoDot:1
+14 IF LL8=""
SET LL8=" "
+15 SET $PIECE(^TMP("MCAR",$JOB,S1,S2),U,12)=$EXTRACT(($EXTRACT($PIECE($GET(^MCAR(697.2,LL6,0)),U,8),1,13)_"/"_$PIECE($GET(^MCAR(697.2,LL8,0)),U)),1,31)
KILL LL6,LL8
End DoDot:1
EXIT KILL MCARSUM,MCARPSUM,REC,MCSUP,MCESON
QUIT