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

APCPDRPP.m

Go to the documentation of this file.
APCPDRPP ; IHS/TUCSON/LAB - OHPRD-TUCSON/LAB Check PV and Prov prior to tx generation AUGUST 14, 1992 ; [ 02/14/00 2:26 PM ]
 ;;2.0;IHS PCC DATA EXTRACTION SYSTEM;**4**;APR 03, 1998
 ;IHS/CMI/LAB - took out check for 2N on disc code only check for null
START ;
 K APCPE
 D CHKPROV
 G:$D(APCPE) EOJ
 I '$D(^AUPNVPOV("AD",APCP("V DFN"))) S APCPE("ERROR")="E102" Q
EOJ ;
 K APCPV("TX"),APCP1,APCP2
 Q
CHKPROV ;EP
 S (APCP1,APCP2)=0 F  S APCP2=$O(^AUPNVPRV("AD",APCP("V DFN"),APCP2)) Q:APCP2=""  I $P(^AUPNVPRV(APCP2,0),U,4)="P" S APCP1=APCP1+1,APCPV("PP VPRV DFN")=APCP2,APCPV("PP DFN")=$P(^AUPNVPRV(APCP2,0),U)
 I APCP1=0 S APCPE("ERROR")="E101" Q
 E  I APCP1>1 S APCPE("ERROR")="E103" Q
 ;store and save primary provider information
POS ; Provider Code. CP
 I APCPS("PROV FILE")=200,'$D(^VA(200,APCPV("PP DFN"))) S APCPE("ERROR")="E002" Q
 I APCPS("PROV FILE")=6,'$D(^DIC(6,APCPV("PP DFN"))) S APCPE("ERROR")="E002" Q
 S APCPV("PP AFFL")=$$VALI^XBDIQ1(APCPS("PROV FILE"),APCPV("PP DFN"),9999999.01) I APCPV("PP AFFL")="" S APCPE("ERROR")="E028" Q
 S APCPV("PP DISC")=$$VAL^XBDIQ1(APCPS("PROV FILE"),APCPV("PP DFN"),9999999.03) I APCPV("PP DISC")="" S APCPE("ERROR")="E027" Q
 S APCPV("PP CODE")=$$VAL^XBDIQ1(APCPS("PROV FILE"),APCPV("PP DFN"),9999999.02) I APCPV("PP CODE")="" S APCPE("ERROR")="E002" Q
 S I=$L(APCPV("PP CODE"))+1 F L=I:1:3 S APCPV("PP CODE")=APCPV("PP CODE")_" "
 S APCPV("PP POS")=APCPV("PP AFFL")_APCPV("PP DISC")_APCPV("PP CODE")
 K APCPL
 Q