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

APCDEGP3.m

Go to the documentation of this file.
APCDEGP3 ; IHS/CMI/LAB - NO DESCRIPTION PROVIDED ;
 ;;2.0;IHS PCC SUITE;**11**;MAY 14, 2009;Build 58
 ;
POV ;EP
 I $Y>(IOSL-5) D FF Q:APCDQUIT
 W !,$TR($J("",80)," ","_")
 W !?3,"ICD CODE      PURPOSE OF VISIT (POV)"
 W !,$TR($J("",80)," ","_")
POV1 ;
 S (APCDX,APCDC)=0 F  S APCDX=$O(^AUPNVPOV("AD",APCDR,APCDX)) Q:APCDX'=+APCDX!(APCDQUIT)  D
 .I $Y>(IOSL-3) D FF Q:APCDQUIT
 .W !?5,$P($$ICDDX^ICDEX($P(^AUPNVPOV(APCDX,0),U)),U,2)
 .;S APCDTNRQ=$P(^ICD9($P(^AUPNVPOV(APCDX,0),U),0),U,2),APCDTICL=18,APCDTTXT="" D PRTTXT
 .S APCDTNRQ=$$VAL^XBDIQ1(9000010.07,APCDX,.04) S APCDTNRQ=$S(APCDTNRQ]"":APCDTNRQ,1:"<<none>>"),APCDTICL=18,APCDTTXT="" D PRTTXT
 .S APCDC=APCDC+2
 .Q
 F I=APCDC:1:3 D:$Y>(IOSL-3) FF Q:APCDQUIT  W !
 D:$Y>(IOSL-3) FF Q:APCDQUIT  W !,$TR($J("",80)," ","_")
MEDS ;
 I '$D(^AUPNVMED("AD",APCDR)) W !! G TRT
 I $Y>(IOSL-5) D FF Q:APCDQUIT
 W !?3,"MEDICATIONS:  "
 S (C,X)=0 F  S X=$O(^AUPNVMED("AD",APCDR,X)) Q:X'=+X  S Y=+^AUPNVMED(X,0) D
 . W:C ! W ?16,$P(^PSDRUG(Y,0),U)
 . W ?48,"QUANTITY: ",$P(^AUPNVMED(X,0),U,6),"  DAYS: ",$P(^(0),U,7)
 . W !?17,"SIG: ",$P(^AUPNVMED(X,0),U,5)
 . S C=C+1 Q
TRT ;
 I '$D(^AUPNVTRT("AD",APCDR)) W !! G PTED
 I $Y>(IOSL-5) D FF Q:APCDQUIT
 W !,$TR($J("",80)," ","_")
 W !?3,"TREATMENTS PROVIDED:  "
 S (C,X)=0 F  S X=$O(^AUPNVTRT("AD",APCDR,X)) Q:X'=+X  S Y=+^AUPNVTRT(X,0) D
 . W:C ! W ?26,$P(^AUTTTRT(Y,0),U)
 . S C=C+1 Q
PTED ;
 I '$D(^AUPNVPED("AD",APCDR)) W !! G DEMO
 I $Y>(IOSL-5) D FF Q:APCDQUIT
 W !,$TR($J("",80)," ","_")
 W !?3,"PATIENT EDUCATION PROVIDED:  "
 S (C,X)=0 F  S X=$O(^AUPNVPED("AD",APCDR,X)) Q:X'=+X  S Y=+^AUPNVPED(X,0) D
 . W:C ! W ?32,$P(^AUTTEDT(Y,0),U)
 . S C=C+1 Q
DEMO ;demographics
 I $Y>(IOSL-9) D FF Q:APCDQUIT
 S DFN=$P(APCDR0,U,5)
 S APCDHRN=$P($G(^AUPNPAT(DFN,41,DUZ(2),0)),U,2)
 S:APCDHRN="" APCDHRN="<?????>"
 W !,$TR($J("",80)," ","_")
 W !?3,"HR#:  ",APCDHRN,?30,"SSN:  ",$P(^DPT(DFN,0),U,9)
 W !,?3,"NAME:",?9,$P(^DPT(DFN,0),U)
 W !?3,"SEX: ",?9,$$EXTSET^XBFUNC(2,.02,$P(^DPT(DFN,0),U,2)),?30,"TRIBE: " I $P(^AUPNPAT(DFN,11),U,8)]"" W $P(^AUTTTRI($P(^AUPNPAT(DFN,11),U,8),0),U)
 W !?3,"DOB:  " S Y=$P(^DPT(DFN,0),U,3) I Y]"" D DD^%DT W ?9,Y
 W !?3,"RESIDENCE:  ",$P($G(^AUPNPAT(DFN,11)),U,18)
 W !?3,"FACILITY: ",$E($P(^DIC(4,DUZ(2),0),U),1,25),?38,"LOCATION: ",$P(^DIC(4,$P(APCDR0,U,6),0),U)
 I $P($G(^AUPNVSIT(APCDR,21)),U)]"" W !?3,"OUTSIDE LOCATION: ",$P(^AUPNVSIT(APCDR,21),U)
 W !!?20,"PROVIDER SIGNATURE:  "
 W !!
 W !,$TR($J("",80)," ","*")
 Q
PRTTXT ; GENERALIZED TEXT PRINTER
 S APCDTDLT=1,APCDTILN=80-APCDTICL-1
 F APCDTQ=0:0 S:APCDTNRQ]""&(($L(APCDTNRQ)+$L(APCDTTXT)+2)<255) APCDTTXT=$S(APCDTTXT]"":APCDTTXT_"; ",1:"")_APCDTNRQ,APCDTNRQ="" Q:APCDTTXT=""  D PRTTXT2
 K APCDTILN,APCDTDLT,APCDTF,APCDTC,APCDTTXT,APCDTDOO
 Q
PRTTXT2 D GETFRAG W ?APCDTICL W APCDTF,! S APCDTICL=APCDTICL+APCDTDLT,APCDTILN=APCDTILN-APCDTDLT,APCDTDLT=0
 Q
GETFRAG I $L(APCDTTXT)<APCDTILN S APCDTF=APCDTTXT,APCDTTXT="" Q
 F APCDTC=APCDTILN:-1:1 Q:$E(APCDTTXT,APCDTC)=" "
 S APCDTF=$E(APCDTTXT,1,APCDTC-1),APCDTTXT=$E(APCDTTXT,APCDTC+1,255)
 Q
 ;
FF ;
 I $E(IOST)="C",IO=IO(0) W ! S DIR(0)="EO" D ^DIR K DIR I Y=0!(Y="^")!($D(DTOUT)) S APCDQUIT=1 Q
 W:$D(IOF) @IOF
 Q
 Q