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

APCDECPT.m

Go to the documentation of this file.
APCDECPT ; IHS/CMI/LAB - CPT LOG ENTRY ;
 ;;2.0;IHS PCC SUITE;**2**;MAY 14, 2009
 ;
HDR ;
 W:$D(IOF) @IOF
 F APCDJ=1:1:5 S APCDX=$P($T(TEXT+APCDJ),";;",2) W !?80-$L(APCDX)\2,APCDX
 K APCDJ,APCDX
 W !!
 D ^APCDEIN
 Q:APCDFLG
 S APCDPAT="",APCDCPT=1
 S APCDLOC="" F  D GETLOC Q:APCDLOC=""  S APCDTYPE="" F  D GETTYPE Q:APCDTYPE=""  S APCDCAT="" F  D GETCAT Q:APCDCAT=""  D RESTOFIT
 D EOJ
 Q
 ;
RESTOFIT S APCDDATE="" F  D GETDATE Q:APCDDATE=""  D PROCESS
 Q
 ;
GETLOC ; GET LOCATION OF ENCOUNTER
 S APCDLOC=""
 S DIC="^AUTTLOC(",DIC(0)="AEMQ" D ^DIC K DIC,DA
 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
 K DIR,DIRUT,DIROUT,DTOUT,DUOUT
 I $D(DIRUT) S X="" Q
 S APCDTYPE=Y
 Q
 ;
 ;
GETCAT ; GET SERVICE CATEGORY
 S APCDCAT=""
 K DTOUT,DUOUT,DIRUT,DIROUT,DIR,DA
 S DIR(0)="9000010,.07O",DIR("A")="SERVICE CATEGORY" D ^DIR K DIR
 I $D(DIRUT) S X="" Q
 S APCDCAT=Y
 K DIR,DIRUT,DIROUT,DTOUT,DUOUT,DA,X,Y
 Q
 ;
GETDATE ; GET DATE
 W ! S APCDDATE="",%DT="AEPX",%DT("A")="Enter VISIT DATE: " D ^%DT
 Q:Y<0
 S APCDDATE=+Y
 K %DT("A")
 Q
 ;
 ;
PROCESS ; PROCESS MNEMONIC
 D CPTLOG Q
 Q
 ;
GETPAT ; GET PATIENT
 D GETPAT^APCDEA
 Q:APCDPAT=""
 I AUPNDOB]"" S X2=AUPNDOB,X1=APCDDATE D ^%DTC S AUPNDAYS=X ; re-set days of age to visit date-dob
 Q
 ;
CPTLOG ;
 S X="CPTLOG",DIC="^APCDTKW(",DIC(0)="",DIC("S")="I $L($P(^(0),U))>5" D ^DIC K DIC("B"),DIC("A"),DIC("S")
 I Y<0 W !!,$C(7),$C(7),"CPT LOG TEMPLATE MISSING, NOTIFY YOUR SUPERVISOR" Q
 S APCDTPLT=+Y,APCDTPLT("NAME")=$P(Y,U,2)
 S APCDPAT="" F  D GETPAT Q:APCDPAT=""  K APCDALVR,APCDADD D ^APCDEA2,GETMNEK
 Q
CPTTEST ;
 S APCDCPTT=""
 S X="CPTTEST",DIC="^APCDTKW(",DIC(0)="",DIC("S")="I $L($P(^(0),U))>3" D ^DIC K DIC
 I Y<0 W !!,$C(7),$C(7),"CPT TEST TEMPLATE MISSING, NOTIFY YOUR SUPERVISOR" Q
 S APCDTPLT=+Y,APCDTPLT("NAME")=$P(Y,U,2)
 S DIC("A")="Enter CPT TEST type: ",DIC="^CPT(60,",DIC(0)="AEMQ" D ^DIC I Y<0 K DIC Q
 K DIC S APCDCPTT="`"_+Y
 S APCDPAT="" F  D GETPAT Q:APCDPAT=""  K APCDALVR,APCDADD D ^APCDEA2,GETMNEK
 Q
GETMNEK ; KILL GETMNE SPECIFIC VARIABLES
 K APCDVSIT
 Q
 ;
EOJ ; END OF JOB
 D ^APCDEKL
 D KILL^AUPNPAT
 K AGE,DFN
 K POP,X,Y,DI,DX,DQ,D,DIG,DIH,DIW,DK,DL,DLOUT
 K APCDCPT,APCDCPTT
 K %DT,%
 Q
 ;
TEXT ;
 ;;PCC Data Entry Module
 ;;
 ;;********************************
 ;;*      CPT Log ENTER Mode      *
 ;;********************************
 ;;