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

APCDPG3.m

Go to the documentation of this file.
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