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

AMHLEPAT.m

Go to the documentation of this file.
AMHLEPAT ; IHS/CMI/LAB - UPDATE PATIENT RELATED DATA ;
 ;;4.0;IHS BEHAVIORAL HEALTH;;MAY 14, 2010
 ;
 ;
 ;
 D START
 D ^AMHEKL
 K AMHLOC,AMHPAT,AMHDATE,AMHACTN,AMHAUTH,AMHSELS,AMHMHPL,AMHNONE,AMHOTH,AMHHIGH,AMHLOOK
 D KILL^AUPNPAT
 Q
START ;
 D ^AMHLEIN
 S AMHACTN=9
 D GETPAT Q:'$G(AMHPAT)
 D GETLOC Q:'$G(AMHLOC)
 D GETDATE Q:'$G(AMHDATE)
 D GETPROV Q:$G(AMHAUTH)=""
 D OTHER^AMHLEA
 Q
GETPAT ;
 W !
 S DIC="^AUPNPAT(",DIC(0)="AEMQ" D ^DIC K DIC
 Q:Y<0
 S AMHPAT=+Y
 I $G(AUPNDOD)]"" W !!?10,"***** PATIENT'S DATE OF DEATH IS ",$$FMTE^XLFDT(AUPNDOD),!! H 2
 Q
GETLOC ; GET LOCATION OF ENCOUNTER
 S AMHLOC="",DIC="^AUTTLOC(",DIC(0)="AEMQ" D ^DIC K DIC
 Q:Y<0
 S AMHLOC=+Y
 Q
 ;
GETDATE ; GET DATE OF ENCOUNTER
 ;
 S AMHDATE=""
 S DIR(0)="DO^:"_DT_":EPT",DIR("A")="Enter DATE NOTED" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
 Q:$D(DIRUT)
 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
 ;
 Q
GETPROV ;get provider/author for notes
 S AMHAUTH=""
 S DIR(0)="9002011.02,.01",DIR("A")="Enter PROVIDER" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
 Q:$D(DIRUT)
 S AMHAUTH=$P(^VA(200,+Y,0),U)
 Q