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

APCDVCH1.m

Go to the documentation of this file.
APCDVCH1 ; IHS/CMI/LAB - CONTINUATION OF APCDVCH ; 02 Nov 2015  11:44 AM
 ;;2.0;IHS PCC SUITE;**11,13**;MAY 14, 2009;Build 9
CHKDXOP ; CHECK DX VS OPERATIONS AND CHECK FOR DUPLICATE POVS
 K APCDDUPE,APCDDXP,APCDVCPS S APCDDX=0 F  S APCDDX=$O(^AUPNVPOV("AD",APCDVSIT,APCDDX)) Q:APCDDX=""  S APCDVCPS(APCDDX)="" D CHKDXOP1
 K APCDVPRC,APCDDUPO,APCDOPP S APCDPX=0 F  S APCDPX=$O(^AUPNVPRC("AD",APCDVSIT,APCDPX)) Q:APCDPX=""  S APCDOPDX=$P(^AUPNVPRC(APCDPX,0),U,5) S:APCDOPDX]"" APCDVPRC(APCDPX)=APCDOPDX_U_$$CODEC^ICDEX(80,APCDOPDX) D CHKDXOP2
 I $D(APCDDUPE),'$D(APCDACC) D DUPE
 I $D(APCDDUPO),'$D(APCDACC) D DUPEOP
 D C567
 Q
CHKDXOP1 ;
 I $D(APCDDXP($P(^AUPNVPOV(APCDDX,0),U))) S APCDDUPE=1
 S APCDDXP($P(^AUPNVPOV(APCDDX,0),U))=""
 Q
CHKDXOP2 ;
 I APCDOPDX="" W !,"WARNING:  Diagnosis missing in V Procedure Entry!!"
 I $D(APCDOPP($P(^AUPNVPRC(APCDPX,0),U))) S APCDDUPO=1
 S APCDOPP($P(^AUPNVPRC(APCDPX,0),U))=""
 K APCDFOUN F  S APCDDX=$O(APCDDXP(APCDDX)) Q:APCDDX=""  I APCDDX=APCDOPDX S APCDFOUN=1
 I '$D(APCDFOUN) W !,$C(7),"WARNING: Operation ",$$CODEC^ICDEX(80.1,$P(^AUPNVPRC(APCDPX,0),U))," Not for Diagnosis in V POV file!",!,"Notify your Supervisor or Correct!",!
 Q
DUPE ;
 W !,$C(7),"WARNING: Same ICD9 Code used for 2 POV's.  Please Review.",!
 Q
DUPEOP ;WARNING RE:  DUPLICATE OPERATIONS USED;ACCEPT REQUIRED
 W !,$C(7),"WARNING: Same ICD OPERATION/PROCEDURE Code used for 2 OP's.  Please Review.",!
 Q
 ;
C567  ;
 Q  ;no longer do edits
 ;
 S APCD1=0 F  S APCD1=$O(APCDVPRC(APCD1)) Q:APCD1=""  S APCD2=$P(APCDVPRC(APCD1),U,2),APCDOPC=$$CODEC^ICDEX(80.1,$P(^AUPNVPRC(APCD1,0),U)) D
 . I $D(^APCDINPT(5,11,"AC",APCD2)),'$D(^APCDINPT(5,12,"AC",APCDOPC)) W !,$C(7),"WARNING: Procedure Code ",APCDOPC," should not be used with DX code ",APCD2,".  Please review.",!
 . I $D(^APCDINPT(6,11,"AC",APCD2)),'$D(^APCDINPT(6,12,"AC",APCDOPC)) W !,$C(7),"WARNING: Procedure Code ",APCDOPC," should not be used with DX code ",APCD2,".  Please review.",!
 . I $D(^APCDINPT(7,11,"AC",APCD2)),'$D(^APCDINPT(7,12,"AC",APCDOPC)) W !,$C(7),"WARNING: Procedure Code ",APCDOPC," should not be used with DX code ",APCD2,".  Please review.",!
 S APCD1=0 F  S APCD1=$O(APCDVCPS(APCD1)) Q:APCD1=""  S APCDDX=$P(^AUPNVPOV(APCD1,0),U) I $D(^APCDINPT(6,11,"AC",$$CODEC^ICDEX(80,APCDDX))) D C6ERR
 Q
C6ERR ;
 I '$D(APCDVPRC) W !,$C(7),"WARNING:  A Procedure is REQUIRED when ICD DX code ",$$CODEC^ICDEX(80,APCDDX)," is used!",! Q
 K APCDFOUN S APCD2=0 F  S APCD2=$O(APCDVPRC(APCD2)) Q:APCD2=""  S APCDOP=$$CODEC^ICDEX(80.1,$P(^AUPNVPRC(APCD2,0),U)) I $D(^APCDINPT(6,12,"AC",APCDOP)),$P(APCDVPRC(APCD2),U,1)=APCDDX S APCDFOUN=1
 I '$D(APCDFOUN) W !,$C(7),"WARNING:  If Diagnosis ",$$CODEC^ICDEX(80,APCDDX)," is used a PROCEDURE is REQUIRED!",!
 Q