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

APCDEGPP.m

Go to the documentation of this file.
APCDEGPP ; IHS/CMI/LAB - NO DESCRIPTION PROVIDED ;
 ;;2.0;IHS PCC SUITE;**11**;MAY 14, 2009;Build 58
 ;FILE 200 CONV
 ;
 ;
 ;
COMP ;EP - do nothing
 Q
PRINT ; EP - print individual forms
 S APCDQUIT=0
D ; Run by visit date
 S APCDR=0
 F  S APCDR=$O(APCDEGP("FORMS",APCDR)) Q:APCDR'=+APCDR!(APCDQUIT)  D PRINT1
 K APCDR,APCDR0
 Q
PRINT1 ;EP - CALLED FROM LAST VISIT DISPLAY
 S APCDVIEN=APCDR
 D VST^APCDEF
 D VFL^APCDEF
 S APCDGROP=1
 D MAIN^APCDEFC
 D MAIN^APCDEFP
 Q
 S APCDR0=^AUPNVSIT(APCDR,0)
 S APCDQUIT=0
 W:$D(IOF) @IOF
 W !!!!,?16,"******* CONFIDENTIAL PATIENT INFORMATION *******"
 W !?25,"PCC AMBULATORY ENCOUNTER RECORD"
 W !,?9,"***  Computer Generated Encounter Record from GROUP FORM  ***"
 W !!,$TR($J("",80)," ","*")
DATE I $Y>(IOSL-6) D FF Q:APCDQUIT
 W !?3,"Visit Date:  " S Y=$P($P(APCDR0,U),".") D DD^%DT W Y
 K Y W ?30,"Primary Provider: " S (C,X)=0 F  S X=$O(^AUPNVPRV("AD",APCDR,X)) Q:X'=+X!($G(Y))  I $P(^AUPNVPRV(X,0),U,4)="P" S Y=+^AUPNVPRV(X,0) D
 . W ?49,$P(^VA(200,Y,0),U)
 W !?3,"Clinic:  " S X=$P(APCDR0,U,8) I X]"" W $P(^DIC(40.7,X,0),U)
 S (C,APCDX)=0 F  S APCDX=$O(^AUPNVPRV("AD",APCDR,APCDX)) Q:APCDX'=+APCDX  I $P(^AUPNVPRV(APCDX,0),U,4)'="P" D
 . W:C ! W ?49,$P(^VA(200,$P(^AUPNVPRV(APCDX,0),U),0),U)
 . Q
TIME W !?3,"Arrival Time:  " S Y=$P(APCDR0,U) D DD^%DT W $P(Y,"@",2)
AT ;
 I '$D(^AUPNVTM("AD",APCDR)) G MEAS
 W !?3,"Activity Time:  " S X=$O(^AUPNVTM("AD",APCDR,X)) Q:X=""  W $P(^AUPNVTM(X,0),U)
MEAS ;
 W !,$TR($J("",80)," ","_")
 I '$D(^AUPNVMSR("AD",APCDR)) W !! G LABS
 I $Y>(IOSL-5) D FF Q:APCDQUIT
 W !?3,"MEASUREMENTS:  "
 S (C,X)=0 F  S X=$O(^AUPNVMSR("AD",APCDR,X)) Q:X'=+X  S Y=+^AUPNVMSR(X,0) D
 . W:C ! W ?18,$P(^AUTTMSR(Y,0),U),?23,$$OUT^AUPNVMSR(X,$P(^AUPNVMSR(X,0),U,4))
 . S C=C+1 Q
 W !,$TR($J("",80)," ","_")
LABS ;
 I '$D(^AUPNVLAB("AD",APCDR)) W !! G PROC
 I $Y>(IOSL-5) D FF Q:APCDQUIT
 W !?3,"LAB TESTS:  "
 S (C,X)=0 F  S X=$O(^AUPNVLAB("AD",APCDR,X)) Q:X'=+X  S Y=+^AUPNVLAB(X,0) D
 . W:C ! W ?15,$P(^LAB(60,Y,0),U),"  RESULT:  ",$P(^AUPNVLAB(X,0),U,4)
 . S C=C+1 Q
PROC ;
 I '$D(^AUPNVPRC("AD",APCDR)) W !! G IMM
 I $Y>(IOSL-5) D FF Q:APCDQUIT
 W !?3,"PROCEDURES:  "
 S (C,X)=0 F  S X=$O(^AUPNVPRC("AD",APCDR,X)) Q:X'=+X  S Y=+^AUPNVPRC(X,0) D
 . W:C ! W ?16,$P($$ICDOP^ICDEX(Y,,,"I"),U,2),?25,$P(^AUTNPOV($P(^AUPNVPRC(X,0),U,4),0),U)
 . S C=C+1 Q
IMM ;
 I '$D(^AUPNVIMM("AD",APCDR)) W !! G SKIN
 I $Y>(IOSL-5) D FF Q:APCDQUIT
 W !?3,"IMMUNIZATIONS:  "
 S (C,X)=0 F  S X=$O(^AUPNVIMM("AD",APCDR,X)) Q:X'=+X  S Y=+^AUPNVIMM(X,0) D
 . W:C ! W ?18,$P(^AUTTIMM(Y,0),U),"  SERIES: ",$P(^AUPNVIMM(X,0),U,4)
 . S C=C+1 Q
SKIN ;
 I '$D(^AUPNVSK("AD",APCDR)) W !! G EXAM
 I $Y>(IOSL-5) D FF Q:APCDQUIT
 W !?3,"SKIN TESTS:  "
 S (C,X)=0 F  S X=$O(^AUPNVSK("AD",APCDR,X)) Q:X'=+X  S Y=+^AUPNVSK(X,0) D
 . W:C ! W ?16,$P(^AUTTSK(Y,0),U),"  READING: ",$P(^AUPNVSK(X,0),U,5)
 . S C=C+1 Q
EXAM ;
 I '$D(^AUPNVXAM("AD",APCDR)) W !! G HF
 I $Y>(IOSL-5) D FF Q:APCDQUIT
 W !?3,"EXAMS:  "
 S (C,X)=0 F  S X=$O(^AUPNVXAM("AD",APCDR,X)) Q:X'=+X  S Y=+^AUPNVXAM(X,0) D
 . W:C ! W ?12,$P(^AUTTEXAM(Y,0),U),"  RESULTS: ",$P(^AUPNVXAM(X,0),U,4)
 . S C=C+1 Q
HF ;
 I '$D(^AUPNVHF("AD",APCDR)) W !! G POV
 I $Y>(IOSL-5) D FF Q:APCDQUIT
 W !?3,"HEALTH FACTORS:  "
 S (C,X)=0 F  S X=$O(^AUPNVHF("AD",APCDR,X)) Q:X'=+X  S Y=+^AUPNVHF(X,0) D
 . W:C ! W ?18,$P(^AUTTHF(Y,0),U)
 . S C=C+1 Q
POV  ;
 D POV^APCDEGP3
 Q:APCDQUIT
 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
XIT ;
 K APCDR,APCDR0,APCDX,C,X,APCDC,APCDHRN,APCDQUIT,APCDTICL,APCDTNRQ,APCDTQ,APCDTTXT,APCDHRN,APCDTC,APCDTDLT,APCDTDOO,APCDTF,APCDTILN,DFN,DIR,I,Y
 Q