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

ANSEAD1.m

Go to the documentation of this file.
ANSEAD1 ;IHS/OIRM/DSD/CSC - ENTER/EDIT ADMISSIONS; [ 02/25/98  10:32 AM ]
 ;;3.0;NURSING PATIENT ACUITY;;APR 01, 1996
 ;ENTER/EDIT ADMISSIONS
 Q:'$D(ANSPAR)
 S ANSADMS="",ANSS=$P(ANSPAR,U,5)
 I ANSDA,$D(^ANSR(ANSDA,0)) S ANSADMS=^(0)
 S ANSDT=$P(ANSADMS,U),ANSSH=$P(ANSADMS,U,2),(ANSUN,ANSUNX)=$P(ANSADMS,U,3)
 S ANSX=""
 I ANSDT S Y=ANSDT X ^DD("DD") S ANSX=Y
 S DIR(0)="DO^:"_DT,DIR("A")=$S(ANSTYPE="A":"Admission",1:"Discharge")_" Date"
 S:ANSX]"" DIR("B")=ANSX
 W !
 D DIR^ANSDIC
 Q:$D(DTOUT)!$D(DUOUT)!($G(Y)<1)
 I Y>0,Y'>DT S X=Y D CHKD Q:'$D(Y)
 X ^DD("DD") S ANSDT=Y
 ;S ANSDT=$P(Y,".",1)
 W " "_ANSDT  ;CSC 10-97
 S ANSX=""
 I ANSSH S X=$T(@ANSS),ANSX=$P($P(X,";;",ANSSH+1),U,2)
 D SHIFT^ANSUD
 Q:$D(DTOUT)!$D(DUOUT)  ;CSC 10-97
 Q:'ANSSH
 S X=ANSSH
 D CHKS
 Q:'$D(Y)
 S ANSSH=Y
 D UNIT^ANSUD
 Q:$D(DTOUT)!$D(DUOUT)!'$G(ANSUN)
 I ANSUNX,ANSUN'=ANSUNX W *7,!!,"Patient must be discharged from the unit to which he/she is currently admitted." Q
 D ^ANSEAD2
 Q
CHKD S X=X_"."_ANSS,A=ANSADM
 I ANSDA D @(ANSTYPE_"OLD^ANSUCK") Q
 D @(ANSTYPE_"NEW^ANSUCK")
 Q
CHKS ;S X=ANSDT_"."_X,A=ANSADM
 S X=DT_"."_X,A=ANSADM  ;CSC 10-97
 I ANSDA D @(ANSTYPE_"OLD^ANSUCK") Q
 D @(ANSTYPE_"NEW^ANSUCK")
 Q
2 ;;1^DAY;;2^NIGHT
3 ;;1^DAY;;2^EVENING;;3^NIGHT