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

APCDEGP2.m

Go to the documentation of this file.
  1. APCDEGP2 ; IHS/CMI/LAB - CONT. OF GROUP FORM DATA ENTRY ; 02 Mar 2010 9:13 AM
  1. ;;2.0;IHS PCC SUITE;**1,11**;MAY 14, 2009;Build 58
  1. EDITCHKS ;EP;check and edit visit/pov info
  1. W !,"Checking Visit and POV data for this Patient...",!
  1. K AUPNTALK,APCDEFLG
  1. VISIT ;
  1. S X=APCDDATE
  1. X $P(^DD(9000010,.01,0),U,5,99)
  1. I '$D(X) W !,APCDBEEP,APCDBEEP,?5,"A VISIT Cannot be Created for this Patient!",!?5,"You Must Correct any Problems and Re-Enter this VISIT through ENTER MODE!",! S APCDEFLG="" Q
  1. CHKPOVS ;
  1. S APCDEGX=0 F S APCDEGX=$O(^TMP("APCDEGP",$J,"POV",APCDEGX)) Q:APCDEGX="" D CHKPOV1
  1. I $D(APCDEFLG) W !,APCDBEEP,APCDBEEP,?5,"One of the PURPOSE of VISITS is INVALID for this Patient!!",!?5,"You must Correct any Problems and Re-Enter this VISIT through ENTER MODE!" Q
  1. Q
  1. CHKPOV1 ;
  1. K APCDTACC
  1. S (APCDEGY,Y)=$P($P(^TMP("APCDEGP",$J,"POV",APCDEGX,"APCDTPOV"),U),"`",2)
  1. D ^AUPNSICD
  1. I '$T S APCDEFLG="" Q
  1. AGEEDIT ;
  1. Q:'$D(AUPNDAYS)
  1. ;Q:'$D(^ICD9(APCDEGY,9999999))
  1. ;I $P(^ICD9(APCDEGY,9999999),U)]"",($P(^ICD9(APCDEGY,9999999),U)>AUPNDAYS) D ACCEPT
  1. ;I $P(^ICD9(APCDEGY,9999999),U,2)]"",($P(^ICD9(APCDEGY,9999999),U,2)<AUPNDAYS) D ACCEPT
  1. S %=$$ICDDX^ICDEX(APCDEGY)
  1. S (A,B)="" ;CSV
  1. I $$VERSION^XPDUTL("BCSV")]"" D I 1 ;CSV
  1. .S A=$P(%,U,15),B=$P(%,U,16) ;CSV
  1. E S A=$P($G(^ICD9(APCDEGY,9999999)),U),B=$P($G(^ICD9(APCDEGY,9999999)),U,2)
  1. I A]"",A>$$AGE^AUPNPAT(APCDPAT,$P(APCDDATE,".")) D ACCEPT
  1. I B]"",B<$$AGE^AUPNPAT(APCDPAT,$P(APCDDATE,".")) D ACCEPT
  1. Q
  1. ACCEPT ;
  1. W !!,$C(7),$C(7),"WARNING: The Patient's age is outside the IHS edit age range",!,"for this ICD Code: ",@APCDRVON,$P($$ICDDX^ICDEX(APCDEGY),U,2),@APCDRVOF,!
  1. I $D(AUPNDOB) S Y=AUPNDOB D DD^%DT S APCDRDOB=Y
  1. ;W "Patient's DOB: ",$G(APCDRDOB),?35,"Patient's Age in Days: ",AUPNDAYS,!,"ICD Edit Lower Age: ",$P(^ICD9(APCDEGY,9999999),U),?35,"ICD Edit Upper Age: ",$P(^ICD9(APCDEGY,9999999),U,2)
  1. W "Patient's DOB: ",$G(APCDRDOB),?35,"Patient's Age in Days: ",AUPNDAYS,!
  1. S %=$$ICDDX^ICDEX(APCDEGY)
  1. S (A,B)="" ;CSV
  1. I $$VERSION^XPDUTL("BCSV")]"" D I 1 ;CSV
  1. .S A=$P(%,U,14),B=$P(%,U,15) ;CSV
  1. E S A=$P($G(^ICD9(APCDEGY,9999999)),U),B=$P($G(^ICD9(APCDEGY,9999999)),U,2)
  1. W "ICD Edit Lower Age: ",A,?35,"ICD Edit Upper Age: ",B
  1. W !!,"Do you still want to use this code" S %=2 D YN^DICN I %'=1 S Y=-1 S APCDEFLG="" Q
  1. S APCDTACC=""
  1. Q