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

APCDVCH2.m

Go to the documentation of this file.
  1. APCDVCH2 ; IHS/CMI/LAB - CONT. HOSP REVIEW ;
  1. ;;2.0;IHS PCC SUITE;**11,13**;MAY 14, 2009;Build 9
  1. START ;
  1. D CHKADM
  1. D CHKTS
  1. ;D CHKAGE
  1. ;D DATES
  1. ;
  1. XIT ;
  1. Q
  1. ;
  1. ;
  1. ERR ;
  1. D ERR^APCDRV
  1. Q
  1. CHKTS ;
  1. I $P(APCDVINR,U,12)="" W !,$C(7),"WARNING: Admitting Diagnosis is Missing!",!
  1. I APCDTS="07",AUPNDAYS]"",AUPNDAYS>1 W !!,"WARNING: Admitting or Discharge Service cannot be NEWBORN if Patient is over 1 day old.",!
  1. I APCDTS="11",AUPNDAYS]"",AUPNDAYS>5479 W !!,"WARNING: Admitting Service is PEDIATRICS (11) and the patient is over 15 years old.",!,"Please Review.",!
  1. I APCDTS="05"!(APCDTS="08"),AUPNSEX'="F" W !!,$C(7),$C(7),"Patient Must be FEMALE if Admitting Service is OBSTETRICS (08) or ",!,"GYNEGOLOGY (05)!",!
  1. ;I APCDDS="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! Please Review!",!
  1. I APCDDS="11",AUPNDAYS]"",AUPNDAYS>5479 W !!,"WARNING: Discharge Service PEDIATRICS (11) and the patient is over",!,"15 years old! Please review.",!
  1. I APCDDS="05"!(APCDDS="08"),AUPNSEX'="F" W !!,$C(7),$C(7),"Patient Must be FEMALE if Discharge Service is OBSTETRICS (08) or ",!,"GYNEGOLOGY (05)!",!
  1. ;I APCDDS="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! Please Review!",!
  1. Q
  1. ;
  1. CHKAGE ;
  1. ;Q:$D(APCDACC)
  1. Q:AUPNDAYS>5
  1. ;LORI NEED CODES BELOW ICD10**
  1. I $$IMP^AUPNSICD($$VD^APCLV(APCDVSIT))=1,$E($P(APCDVCPV("P"),U),1,2)'="V3" W !,$C(7),$C(7),"WARNING: The Admission Date is within 5 days of the DOB, Please Review.",!
  1. Q
  1. CHKADM ;check admission date
  1. S APCDDIS=$P($P(APCDVINR,U),"."),APCDADM=$P($P(APCDVREC,U),".")
  1. I APCDDIS<APCDADM W !!,"Admission Date is less than Discharge Date!!",! Q
  1. ;Q:APCDADM'=AUPNDOB
  1. ;Q:$D(APCDACC)
  1. ;LORI - NEED CODES BELOW ICD10**
  1. ;I $$IMP^AUPNSICD($$VD^APCLV(APCDVSIT))=1,$E($P(APCDVCPV("P"),U),1,2)'="V3" W !,$C(7),$C(7),"WARNING: DOB is equal to Admission Date and 1st DX is NOT V30-V39. PLEASE REVIEW.",!
  1. Q
  1. ;
  1. DATES ;
  1. S X1=$P(APCDVINR,U),X2=$P(APCDVREC,U) D ^%DTC I X<0 W !,$C(7),"WARNING: Discharge Date MUST be greater than or equal to Admission Date!",!,"PLEASE CORRECT!",!
  1. I X>99 W !,$C(7),"WARNING: Length of Stay is > 99 days!.",!,"Notify your Supervisor!",!
  1. Q