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

APCDEPO.m

Go to the documentation of this file.
APCDEPO ; IHS/CMI/LAB - ENTER NON-VISIT DATA ;
 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
 ;
 ; APCDFLG=0 ... RUN
 ; APCDFLG=1 ... ERROR
 ;
 ; APCDMODE=A ... ADD
 ; APCDMODE=M ... MOD
HDR ; Write Header
 W:$D(IOF) @IOF
 F APCDJ=1:1:7 S APCDX=$P($T(TEXT+APCDJ),";;",2) W !?80-$L(APCDX)\2,APCDX
 K APCDX,APCDJ
 ;W !!
 ;
 D ^APCDEIN
 Q:APCDFLG
 S APCDPAT="",APCDEPO=1
 ;F APCDL=0:0 S APCDPAT="" D GETPAT Q:APCDPAT=""  F APCDL=0:0 S APCDLOC="" D GETLOC Q:APCDLOC=""  F APCDL=0:0 S APCDDATE="" D GETDATE Q:APCDDATE=""  F APCDL=0:0 D PROCESS Q:APCDEMF
 F  S APCDPAT="" D GETPAT Q:APCDPAT=""
 D EOJ
 Q
 ;
GETPAT ; GET PATIENT
 I APCDPAT S DIE="^AUPNPAT(",DR=".16///TODAY",DA=APCDPAT D ^DIE
 W !
 S APCDPAT=""
 S DIC="^AUPNPAT(",DIC(0)="AEMQ" D ^DIC K DIC
 Q:Y<0
 S APCDPAT=+Y
 S APCDDATE=DT,APCDLOC=DUZ(2)
 I AUPNDOB]"" S X2=AUPNDOB,X1=APCDDATE D ^%DTC S AUPNDAYS=X ; re-set days of age to visit date-dob
 D GETMNE
 Q
 ;
GETLOC ; GET LOCATION
 S APCDLOC=DUZ(2)
 Q
 S APCDLOC="" S DIC="^AUTTLOC(",DIC(0)="AEMQ" D ^DIC
 Q:Y<0
 S APCDLOC=+Y
 Q
 ;
GETDATE ; GET DATE
 S APCDDATE=DT
 Q
 ;
 ;
PROCESS ; PROCESS MNEMONIC
 D GETMNE
 K DIU,DIV S DIE="^AUPNPAT(",DR=".16///TODAY",DA=APCDPAT D ^DIE K DIV,DIU,DIE,DR,DA
 S APCDEMF=1
 Q
 ;
GETMNE ; GET MNEMONIC
 W !
 S DIR(0)="S^A:ADD a Problem;M:Modify a Problem",DIR("A")="Do you want to",DIR("B")="A" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
 G:$D(DIRUT) GETMNEK
 S APCDMODE=Y
 S X="PO",DIC="^APCDTKW(",DIC(0)="E",DIC("S")="I $L($P(^(0),U))<5,'$P(^(0),U,8)" D ^DIC K DIC("A"),DIC("S")
 G:Y<0 GETMNEK
 S APCDMNE=+Y,APCDMNE("NAME")=$P(Y,U,2)
 D ^APCDEA3
 S APCDDATE="" G GETMNEK
 ;
 ;
GETMNEK ; KILL GETMNE SPECIFIC VARIABLES
 K APCDVSIT,APCDX
 Q
 ;
EOJ ; END OF JOB
 D ^APCDEKL
 K APCDEPO
 K %DT,%W,%A,C,DI,DIG,DIH,DIPGM,DIW
 Q
TEXT ;
 ;;
 ;;PCC Data Entry Module
 ;;
 ;;*******************************
 ;;*    Entry of PROBLEM Data    *
 ;;*******************************
 ;;