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

ANSEAD2.m

Go to the documentation of this file.
ANSEAD2 ;IHS/OIRM/DSD/CSC - ENTER/EDIT ADMISSIONS; [ 02/25/98  10:32 AM ]
 ;;3.0;NURSING PATIENT ACUITY;;APR 01, 1996
 ;;ADD/EDIT ADMISSIONS
Z D LST
 S F=1
 I 'ANSDA D NUM S (ANSADM,ANSDA,L)=+Y,F=0
 I ANSTYPE="D" D DC Q
 D STR
 S ANSDC=$P($G(^ANSR(ANSDA,"DX")),U,5)
 D CUR
 I L=ANSADM,N=ANSADM,$D(^ANSR("PT",ANSDFN,ANSADM)) D RB
 Q
DC I F D VAR
 D STR
 I L=ANSADM K ^ANSR("PT",ANSDFN)
 S DIE="^ANSR(",DA=ANSADM,DR="6////"_ANSDA
 D DIE^ANSDIC
 Q
STR S DIE="^ANSR(",DA=ANSDA,DR=".01///"_ANSDT_";.02////"_ANSSH_";.03////"_ANSUN_";.04////"_ANSDFN_";.05////"_ANSTYPE_";.06////"_ANSADM_";.07////"_DUZ
 D DIE^ANSDIC
 Q
VAR S P=0
 F I="ANSDT","ANSSH","ANSUN" S P=P+1,@I=$P(ANSADMS,U,P)
 Q
NUM S DIC="^ANSR(",DIC(0)="L",X=ANSDT
 D FILE^ANSDIC
 Q
LST S (N,Y)=0,L="",D=$O(^ANSR("AA",ANSDFN,0))
 Q:D=""
 F  S N=$O(^ANSR("AA",ANSDFN,D,N)) Q:N=""  I $D(^ANSR(N,0)) S X=$P(^ANSR(N,0),U)_"."_$P(^(0),U,2) S:X>Y X=Y,L=N
 Q
CUR S N=ANSADM,M=0
 F  S M=$O(^ANSR(ANSADM,"AT",M)) Q:M=""  D
 .S O=0
 .F  S O=$O(^ANSR(ANSADM,"AT",M,O)) Q:O=""  I $D(^ANSR(O,0)),$P(^(0),U,5)'="D" D
 ..S N=O
 S V=$P(^ANSR(N,0),U,3),X=""
 I V'=$P($G(^ANSR(ANSADM,"DX")),U,2) S DIE="^ANSR(",DA=ANSADM,DR="3////"_V_";4///@;5///@" D DIE^ANSDIC
 Q
RB S ANSUN=V,ANSDX=$G(^ANSR(ANSDA,"DX"))
 D ^ANSUEU
 Q