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

APCDEHI.m

Go to the documentation of this file.
APCDEHI ; IHS/CMI/LAB - enter historical inpatient data ;
 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
 ;  
HDR ;
 F APCDJ=1:1:7 S APCDX=$P($T(TEXT+APCDJ),";;",2) W !?80-$L(APCDX)\2,APCDX
 W !
 K APCDX,APCDJ
 K DIC S APCDHINP=1,APCDTPLT=0,APCDTPLT("NAME")="MNEMONIC",APCDCAT="H" D ^APCDEIN
 S APCDLOC="" F APCDL=0:0 D GETLOC Q:APCDLOC=""  S APCDTYPE="" F APCDL=0:0 D GETTYPE Q:APCDTYPE=""  S APCDDATE="" F APCDL=0:0 D GETDATE Q:APCDDATE=""  S APCDPAT="" D GETPAT D:APCDPAT]"" PROCESS
 D EOJ
 Q
 ;
GETLOC ; GET LOCATION OF ENCOUNTER
 S APCDLOC=""
 S DIC="^AUTTLOC(",DIC(0)="AEMQ" D ^DIC K DIC
 Q:Y<0
 S APCDLOC=+Y
 Q
 ;
GETTYPE ; GET TYPE OF ENCOUNTER
 S APCDTYPE=""
 K DTOUT,DUOUT,DIRUT,DIROUT,DIR,DA
 S DIR(0)="9000010,.03O",DIR("A")="TYPE" D ^DIR K DIR
 S:$D(DIRUT) X=""
 S APCDTYPE=X
 K DIR,DIRUT,DIROUT,DTOUT,DUOUT
 Q
 ;
 ;
GETDATE ; GET DATE OF ENCOUNTER
 S:APCDDATE APCDODAT=APCDDATE\1
 S APCDDATE=""
 W !,"VISIT/ADMIT DATE: " R X:$S($D(DTIME):DTIME,1:300) S:'$T X=""
 Q:X=""!(X="^")
 I X=" ",$D(APCDODAT),APCDODAT]"" S X=APCDODAT W X
 S %DT="ET" D ^%DT G:Y<0 GETDATE
 K APCDODAT
 S APCDDATE=X
GETTIME ;
 S APCDTIME=""
 I APCDTYPE="C"!("CNT"[APCDCAT) S APCDTIME="12:00"
 W !,"TIME OF VISIT: ",$S(APCDTIME]"":APCDTIME_"// ",1:"") R X:$S($D(DTIME):DTIME,1:300) S:'$T X="^" S:X="" X=APCDTIME
 S APCDTIME=""
 I X="^" S APCDDATE="" Q
 I X="" W APCDBEEP,"  Time Required!" G GETTIME
 I X["?" W !,"Enter time of visit, or 'D' for default." G GETTIME
 I X="D" S X="12:00" W "  ",X
EDTIME S APCDTIME=X,X=APCDDATE_"@"_APCDTIME
 X ^TMP("APCD",$J,"APCDDATE")
 I '$D(X) W APCDBEEP G GETDATE
 I X="-1" W ! G GETDATE
 S APCDDATE=X
 Q
GETPAT ; GET PATIENT
 W !
 S APCDPAT=""
 S DIC="^AUPNPAT(",DIC(0)="AEMQ" D ^DIC K DIC
 Q:Y<0
 I $D(APCDPARM),$P(APCDPARM,U,3)="Y" W !?25,"Ok" S %=1 D YN^DICN Q:%'=1
 S APCDPAT=+Y
 I AUPNDOB]"" S X2=AUPNDOB,X1=APCDDATE D ^%DTC S AUPNDAYS=X ; re-set days of age to visit date-dob
 Q
 ;
PROCESS ; PROCESS PATIENT
 D ^APCDEHI2
 I $D(APCDAPP) W !!,"Returning to Add Mode.",! K APCDAPP
 Q
 ;
EOJ ; END OF JOB
 D ^APCDEKL
 K APCDHINP,APCDDOB,APCDDOD,APCDSEX,APCDPAT,APCDVSIT
 K DTOUT,DUOUT,DIR
 Q
TEXT ;
 ;;
 ;;PCC Data Entry Module
 ;;
 ;;***************************************
 ;;*   Historical Inpatient ENTER Mode   *
 ;;***************************************
 ;;