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

APCDADSE.m

Go to the documentation of this file.
  1. APCDADSE ; IHS/CMI/LAB - EDIT ADMISSION AND DISCHARGE SERVICE ON IP ;
  1. ;;2.0;IHS PCC SUITE;**11,13**;MAY 14, 2009;Build 9
  1. ;
  1. ;called from the APCD IP (ADD) and APCD IP (MOD) input
  1. ;templates.
  1. ;
  1. START ;
  1. K APCDTERR,APCDTACC,APCDTNAC
  1. Q:'$D(APCDTSC)
  1. D CHECK
  1. K Y
  1. Q
  1. CHECK ;
  1. I APCDTSC="07",AUPNDAYS]"",AUPNDAYS>1 W !!,$C(7),$C(7),"Admitting or Discharge Service cannot be NEWBORN if Patient is over 1 day old.",! S APCDTERR=1 Q
  1. I APCDTSC="11",AUPNDAYS]"",AUPNDAYS>5479 W !!,$C(7),$C(7),"Admitting Service PEDIATRICS (11) cannot be used for a Patient who is over",!,"15 years old!",! S APCDTERR=1 Q
  1. I APCDTSC="05"!(APCDTSC="08"),AUPNSEX'="F" W !!,$C(7),$C(7),"Patient Must be FEMALE if Admitting Service is OBSTETRICS (08) or ",!,"GYNEGOLOGY (05)!",! S APCDTERR=1 Q
  1. I APCDTSC="08",AUPNDAYS]"",(AUPNDAYS<3652!(AUPNDAYS>20088)) W !!,$C(7),$C(7),"This Patient's age is outside the IHS edit range for Admitting/Discharge",!,"Service 08 (OBSETRICS)!",! D ACCEPT Q
  1. Q
  1. ACCEPT ;
  1. I $D(AUPNTALK) S APCDTACC=1 Q
  1. W !!,"Do you still want to use this Service" S %=2 D YN^DICN I %'=1 S APCDTACC=0 Q
  1. S APCDTACC=1
  1. Q
  1. ;
  1. LOS ;
  1. I $D(AUPNTALK) S APCDTACC=1 Q
  1. W !,$C(7),$C(7),"WARNING: The Length of Stay is greater than 99 days and will need ",!,"the ACCEPT command applied."
  1. W !,"Should I apply the ACCEPT command now" S %=2 D YN^DICN I %'=1 W !,"Okay",! K Y Q
  1. S APCDTACC=1
  1. K Y
  1. Q
  1. ICD(V,T) ;EP is any dx a member of taxonomy T
  1. I '$G(V) Q ""
  1. I '$G(T) Q ""
  1. NEW P,H,I
  1. S (P,H)=0 F S P=$O(^AUPNVPOV("AD",V,P)) Q:P'=+P!(H) S I=$P(^AUPNVPOV(P,0),U) I $$ICD^ATXCHK(I,T,9) S H=1
  1. Q H