APCDPG3 ; IHS/CMI/LAB - NO DESCRIPTION PROVIDED ;
;;2.0;IHS PCC SUITE;**7,11**;MAY 14, 2009;Build 58
;
;
;APCDP - GOAL ien
;APCDA - array name - not tested
; will pass back in APCDPG1(N)
P1(APCDP,APCDA) ;EP - send back array of one GOAL entry
Q:'APCDP
Q:'$D(^AUPNGOAL(APCDP))
I $G(APCDA)="" S APCDA="APCDPG1"
K @APCDA
GATHER ;EP
S APCDLINE=1,APCDX=""
S APCDP0=^AUPNGOAL(APCDP,0)
S APCDX=$$SETSTR^VALM1(" GOAL ID: ",APCDX,5,14),X=$S($P(^AUTTLOC($P(APCDP0,U,6),0),U,7)]"":$J($P(^(0),U,7),4),1:"??")_$P(APCDP0,U,7),APCDX=$$SETSTR^VALM1(X,APCDX,20,6)
S APCDX=$$SETSTR^VALM1("DX:",APCDX,28,3),APCDX=$$SETSTR^VALM1($P($$ICDDX^ICDEX($P(APCDP0,U)),U,2),APCDX,33,6),X="Status: "_$$VAL^XBDIQ1(9000093,APCDP,.12),APCDX=$$SETSTR^VALM1(X,APCDX,41,25)
S APCDX=$$SETSTR^VALM1("Onset:",APCDX,65,6) I $P(APCDP0,U,13)]"" S APCDX=$$SETSTR^VALM1($$FDATE^VALM1($P(APCDP0,U,13)),APCDX,72,15)
S @APCDA@(APCDLINE)=APCDX,APCDX=""
S APCDLINE=APCDLINE+1,APCDX=$P(^AUTNPOV($P(APCDP0,U,5),0),U),@APCDA@(APCDLINE)=" Provider Narrative: "_APCDX
STEP S APCDC=0 I $O(^AUPNGOAL(APCDP,11,0)) D
.S (APCDC,APCDL)=0 F S APCDL=$O(^AUPNGOAL(APCDP,11,APCDL)) Q:APCDL'=+APCDL I $O(^AUPNGOAL(APCDP,11,APCDL,11,0)) S APCDLR=$P(^AUTTLOC($P(^AUPNGOAL(APCDP,11,APCDL,0),U),0),U,7) D
..S APCDX=0 F S APCDX=$O(^AUPNGOAL(APCDP,11,APCDL,11,APCDX)) Q:APCDX'=+APCDX D
...S APCDC=APCDC+1 I APCDC=1 S X=" "_"Steps:" S APCDLINE=APCDLINE+1,@APCDA@(APCDLINE)=X
...S X=" "_APCDLR_" Step #"_$P(^AUPNGOAL(APCDP,11,APCDL,11,APCDX,0),U)_" "_$S($P(^(0),U,5)]"":$$FMTE^XLFDT($P(^(0),U,5),5),1:" ")_" "_$P(^AUPNGOAL(APCDP,11,APCDL,11,APCDX,0),U,3)
...S APCDLINE=APCDLINE+1,@APCDA@(APCDLINE)=X
Q
APCDPG3 ; IHS/CMI/LAB - NO DESCRIPTION PROVIDED ;
+1 ;;2.0;IHS PCC SUITE;**7,11**;MAY 14, 2009;Build 58
+2 ;
+3 ;
+4 ;APCDP - GOAL ien
+5 ;APCDA - array name - not tested
+6 ; will pass back in APCDPG1(N)
P1(APCDP,APCDA) ;EP - send back array of one GOAL entry
+1 IF 'APCDP
QUIT
+2 IF '$DATA(^AUPNGOAL(APCDP))
QUIT
+3 IF $GET(APCDA)=""
SET APCDA="APCDPG1"
+4 KILL @APCDA
GATHER ;EP
+1 SET APCDLINE=1
SET APCDX=""
+2 SET APCDP0=^AUPNGOAL(APCDP,0)
+3 SET APCDX=$$SETSTR^VALM1(" GOAL ID: ",APCDX,5,14)
SET X=$SELECT($PIECE(^AUTTLOC($PIECE(APCDP0,U,6),0),U,7)]"":$JUSTIFY($PIECE(^(0),U,7),4),1:"??")_$PIECE(APCDP0,U,7)
SET APCDX=$$SETSTR^VALM1(X,APCDX,20,6)
+4 SET APCDX=$$SETSTR^VALM1("DX:",APCDX,28,3)
SET APCDX=$$SETSTR^VALM1($PIECE($$ICDDX^ICDEX($PIECE(APCDP0,U)),U,2),APCDX,33,6)
SET X="Status: "_$$VAL^XBDIQ1(9000093,APCDP,.12)
SET APCDX=$$SETSTR^VALM1(X,APCDX,41,25)
+5 SET APCDX=$$SETSTR^VALM1("Onset:",APCDX,65,6)
IF $PIECE(APCDP0,U,13)]""
SET APCDX=$$SETSTR^VALM1($$FDATE^VALM1($PIECE(APCDP0,U,13)),APCDX,72,15)
+6 SET @APCDA@(APCDLINE)=APCDX
SET APCDX=""
+7 SET APCDLINE=APCDLINE+1
SET APCDX=$PIECE(^AUTNPOV($PIECE(APCDP0,U,5),0),U)
SET @APCDA@(APCDLINE)=" Provider Narrative: "_APCDX
STEP SET APCDC=0
IF $ORDER(^AUPNGOAL(APCDP,11,0))
Begin DoDot:1
+1 SET (APCDC,APCDL)=0
FOR
SET APCDL=$ORDER(^AUPNGOAL(APCDP,11,APCDL))
IF APCDL'=+APCDL
QUIT
IF $ORDER(^AUPNGOAL(APCDP,11,APCDL,11,0))
SET APCDLR=$PIECE(^AUTTLOC($PIECE(^AUPNGOAL(APCDP,11,APCDL,0),U),0),U,7)
Begin DoDot:2
+2 SET APCDX=0
FOR
SET APCDX=$ORDER(^AUPNGOAL(APCDP,11,APCDL,11,APCDX))
IF APCDX'=+APCDX
QUIT
Begin DoDot:3
+3 SET APCDC=APCDC+1
IF APCDC=1
SET X=" "_"Steps:"
SET APCDLINE=APCDLINE+1
SET @APCDA@(APCDLINE)=X
+4 SET X=" "_APCDLR_" Step #"_$PIECE(^AUPNGOAL(APCDP,11,APCDL,11,APCDX,0),U)_" "_$SELECT($PIECE(^(0),U,5)]"":$$FMTE^XLFDT($PIECE(^(0),U,5),5),1:" ")_" "_$PIECE(^AUPNGOAL(APCDP,11,APCDL,11,APCDX,0),U,3
)
+5 SET APCDLINE=APCDLINE+1
SET @APCDA@(APCDLINE)=X
End DoDot:3
End DoDot:2
End DoDot:1
+6 QUIT