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

AMHLEAR.m

Go to the documentation of this file.
AMHLEAR ; IHS/CMI/LAB - BH ACTIVITY RECORD LOG ENTRY ;
 ;;4.0;IHS BEHAVIORAL HEALTH;;MAY 14, 2010
 ;
 ;Activty Record Log data entry
 D XIT
 D ^AMHLEIN
 D INFORM
 K AMHPROV F  D GETPROV  Q:'$D(AMHPROV)
 D END
 D XIT
 Q
GETPROV ;get providers
 K AMHPROV S AMHC=0
 K DIR,DA,DTOUT,DIRUT,DUOUT,DIC,X,Y S DIR(0)="9002011.02,.01O",DIR("A")="Enter PRIMARY PROVIDER" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
 I $D(DIRUT) Q
 I Y="" Q
 S AMHC=AMHC+1,AMHPROV(AMHC)=+Y,$P(AMHPROV(AMHC),U,2)=$S(AMHC=1:"P",1:"S")
GETPROG ;
 S AMHPROG=""
 K DIR,DA,DTOUT,DIRUT,DUOUT,DIC,X,Y S DIR(0)="SBO^M:Mental Health;S:Social Services;O:Other",DIR("A")="Enter PROGRAM" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
 G:$D(DIRUT) GETPROV
 I Y="" G GETPROV
 S AMHPROG=Y,AMHPROG(0)=Y(0)
GETLOC ; GET LOCATION OF ENCOUNTER
 S AMHLOC="",DIC="^AUTTLOC(",DIC(0)="AEMQ" D ^DIC K DIC
 G:Y<0 GETPROG
 S AMHLOC=+Y
GETDATE ; GET DATE OF ENCOUNTER
 S AMHDATE="",DIR(0)="DO^:"_DT_":EPT",DIR("A")="Enter ENCOUNTER DATE" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
 I $D(DIRUT) G GETLOC
 I Y="" G GETLOC
 S %DT="ET" D ^%DT G:Y<0 GETDATE
 I Y>DT W "  <Future dates not allowed>",$C(7),$C(7) K X G GETDATE
 S AMHDATE=Y
 ;
GETCOMM ;
 S AMHCOMM="",DIC(0)="AEMQ",DIC("A")="Enter COMMUNITY: ",DIC="^AUTTCOM(" D ^DIC K DIC,DA
 I Y=-1 G GETDATE
 S AMHCOMM=+Y
GETACT ;
 S AMHACT="",DIR(0)="9002011,.06",DIR("A")="Enter ACTIVITY" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
 I $D(DIRUT) G GETCOMM
 I $P(^AMHTACT(+Y,0),U,6)=1 W !!,$C(7),$C(7),?14,"**Enter Acceptable Activity Code (32-43, 51-59, 63-72, 83-84)**",!! G GETACT
 S AMHACT=Y
 I $P(^AMHTACT(+Y,0),U,6) W !,$C(7),$C(7),"Must be in the code range " G GETACT
GETNUM ;
 S AMHNUM="",DIR(0)="9002011,.09",DIR("A")="Enter TOTAL NUMBER SERVED" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
 I $D(DIRUT) G GETACT
 S AMHNUM=Y
GETTIME ;
 S AMHTIME="",DIR(0)="9002011,.12",DIR("A")="Enter TOTAL ACTIVITY TIME" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
 I $D(DIRUT) G GETNUM
 S AMHTIME=Y
GETCONT ;
 S AMHCONT="",DIR(0)="9002011,.07",DIR("A")="Enter TYPE OF CONTACT" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
 I $D(DIRUT) G GETACT
 S AMHCONT=Y,AMHCONT(0)=Y(0)
GETPOVS ;
 K AMHPOV S AMHC=0
GETPOVS1 ;
 K DIR,DA,DTOUT,DIRUT,DUOUT,DIC,X,Y S DIR(0)="9002011.01,.01",DIR("A")="Enter PROBLEM (POV)" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
 I $D(DIRUT),AMHC=0 G GETCONT
 I Y="",AMHC=0 G GETCONT
 S AMHPOVP=+Y
GETNARR ;
 S AMHNARR=""
 K DIR,DA,DTOUT,DIRUT,DUOUT,DIC,X,Y S DIR(0)="9000010.07,.04O",DIR("A")="Provider Narrative" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
 I Y="" S AMHNARR=$E($P(^AMHPROB(AMHPOVP,0),U,2),1,80) G SET
 G:$D(DIRUT) GETPOVS1
 S AMHNARR=$P(^AUTNPOV(+Y,0),U)
SET S AMHC=AMHC+1,AMHPOV(AMHC)=AMHPOVP_U_AMHNARR
CREATE D ^AMHLEAR1
 Q
INFORM ;
 W !!,"               *** ACTIVITY RECORD LOG Data Entry Option ***",!!
 W "       You will be prompted to enter all pertinent Record information",!,"            You will NOT be prompted to enter the Patient Names",!
 W "     .....Only the following ACTIVITY CODES are acceptable Entries.....",!
 W !,"                   **32-43**51-59**63-65*72**83-84**",!!
 Q
END ;ending message
 W !,"                    ","......END OF ACTIVITY RECORD LOG DATA ENTRY......",!
 Q
XIT ;CLEAN UP AND EXIT
 K DIR,X,Y,DIC,DR,DA,D0,DO,DIZ,D
 K AMHDATE,AMHLOC,AMHPROG,AMHPROV,AMHCOMM,AMHACT,AMHCONT,AMHPOVS,AMHPOVP,AMHC,AMHPOV,AMHNARR,AMHTIME,AMHNUM,AMHPOVP,AMHBEEP,AMHGOT,AMHLPCC,AMHVISIT,AMHLEGPI,AMHLEIN,AMHOKAY,AMHPAT,AMHQUIT,AMHREC,AMHDASH,AMHBT
 K AMHR,AMHACTN
 Q