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

APCPHOS1.m

Go to the documentation of this file.
APCPHOS1 ; IHS/TUCSON/LAB - REVIEW HOSPITALIZATIONS - CONT. AUGUST 14, 1992 ; [ 09/08/99 7:41 AM ]
 ;;2.0;IHS PCC DATA EXTRACTION SYSTEM;**3**;APR 03, 1998
 ;
START ;
CHKDXOP ; CHECK DX VS OPERATIONS AND CHECK FOR DUPLICATE POVS
 K APCPDUPE,APCPPOVS,APCPHDXP S APCPDX=0 F  S APCPDX=$O(^AUPNVPOV("AD",APCP("V DFN"),APCPDX)) Q:APCPDX=""!($D(APCPE))  S APCPPOVS(APCPDX)="" D CHKDXOP1
 K APCPDUPO,APCPVPRC,APCPOPP
 I $D(APCPE) G XIT
 S APCPOPX=0 F  S APCPOPX=$O(^AUPNVPRC("AD",APCP("V DFN"),APCPOPX)) Q:APCPOPX=""!$D(APCPE)  D CHKDXOP2
 G:$D(APCPE) XIT
 I $D(APCPDUPE),'$D(APCPV("ACC")) D DUPE G XIT
 I $D(APCPDUPO),'$D(APCPV("ACC")) D DUPEOP G XIT
 D C567
XIT ;
 K APCP1,APCP2,APCPDX,APCPOPX,APCPODX,APCPDUPE,APCPDUPO,APCPHDXP,APCPOPP,APCPHIT,APCPOPC,APCPPR,APCPPRC,APCPVPRC,APCPPOVS,APCPOPC
 Q
CHKDXOP1 ;
 I $D(APCPHDXP($P(^AUPNVPOV(APCPDX,0),U))) S APCPDUPE=1
 S APCPHDXP($P(^AUPNVPOV(APCPDX,0),U))=""
 Q
CHKDXOP2 ;
 S APCPODX=$P(^AUPNVPRC(APCPOPX,0),U,5) S:APCPODX]"" APCPVPRC(APCPOPX)=APCPODX_"^"_$P(^ICD9(APCPODX,0),U)
 I APCPODX="" S APCPE("EDFN")=APCPOPX,APCPE("FILE")=9000010.08,APCPE("ERROR")="E044" Q
 I $D(APCPOPP($P(^AUPNVPRC(APCPOPX,0),U))) S APCPDUPO=1
 S APCPOPP($P(^AUPNVPRC(APCPOPX,0),U))=""
 K APCPHIT F  S APCPDX=$O(APCPHDXP(APCPDX)) Q:APCPDX=""  I APCPDX=APCPODX S APCPHIT=1
 ;I '$D(APCPHIT) S APCPE("FILE")=9000010,APCPE("EDFN")=APCP("V DFN"),APCPE("ERROR")="E314" Q ;IHS/CMI/LAB - commented out
 Q
DUPE ;
 S APCPE("FILE")=9000010,APCPE("EDFN")=APCP("V DFN"),APCPE("ERROR")="E315" Q
 Q
DUPEOP ;WARNING RE:  DUPLICATE OPERATIONS USED - ACCEPT REQUIRED
 S APCPE("FILE")=9000010,APCPE("EDFN")=APCP("V DFN"),APCPE("ERROR")="E316" Q
 Q
 ;
C567 ;CHK DX VS OPS
 S APCP1=0 F  S APCP1=$O(APCPVPRC(APCP1)) Q:APCP1=""!$D(APCPE)  S APCP2=$P(APCPVPRC(APCP1),U,2),APCPOPC=$P(^ICD0($P(^AUPNVPRC(APCP1,0),U),0),U) D
 .I $D(^APCDINPT(5,11,"AC",APCP2)),'$D(^APCDINPT(5,12,"AC",APCPOPC)) S APCPE("ERROR")="E317",APCPE("EDFN")=APCP1,APCPE("FILE")=9000010.08
 .I $D(^APCDINPT(6,11,"AC",APCP2)),'$D(^APCDINPT(6,12,"AC",APCPOPC)) S APCPE("ERROR")="E317",APCPE("EDFN")=APCP1,APCPE("FILE")=9000010.08
 .I $D(^APCDINPT(7,11,"AC",APCP2)),'$D(^APCDINPT(7,12,"AC",APCPOPC)) S APCPE("ERROR")="E317",APCPE("EDFN")=APCP1,APCPE("FILE")=9000010.08
 Q:$D(APCPE)
 S APCP1=0 F  S APCP1=$O(APCPPOVS(APCP1)) Q:APCP1=""  S APCPDX=$P(^AUPNVPOV(APCP1,0),U) I $D(^APCDINPT(6,11,"AC",$P(^ICD9(APCPDX,0),U))) D C6ERR
 Q
C6ERR ;
 I '$D(APCPVPRC) S APCPE("ERROR")="E333",APCPE("FILE")=9000010,APCPE("EDFN")=APCP("V DFN") Q
 K APCPHIT S APCP2=0 F  S APCP2=$O(APCPVPRC(APCP2)) Q:APCP2=""  S APCPOPC=$P(^ICD0($P(^AUPNVPRC(APCP2,0),U),0),U) I $D(^APCDINPT(6,12,"AC",APCPOPC)),$P(APCPVPRC(APCP2),U)=APCPDX S APCPHIT=1
 I '$D(APCPHIT) S APCPE("ERROR")="E333",APCPE("FILE")=9000010,APCPE("EDFN")=APCP("V DFN")
 Q