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

APCPDR21.m

Go to the documentation of this file.
APCPDR21 ; IHS/TUCSON/LAB - continuation of APCPDR2 AUGUST 14, 1992 ; [ 04/16/02 9:36 AM ]
 ;;2.0;IHS PCC DATA EXTRACTION SYSTEM;**1**;APR 03, 1998
 ;
DEM ;EP
 S APCPV("PATIENT DFN")=$P(APCPV("V REC"),U,5) I APCPV("PATIENT DFN")="" S APCPE("ERROR")="E104" Q
 S Y=APCPV("PATIENT DFN") D ^AUPNPAT
 S APCPV("PATIENT NAME")=$P(^DPT(APCPV("PATIENT DFN"),0),U)
 Q:APCPV("PATIENT NAME")["DEMO,PATIENT"  ;IHS/CMI/LAB - changed to "[" from "="
SEX ;
 I AUPNSEX="" S APCPE("ERROR")="E601" Q
DOB ;
 I AUPNDOB="" S APCPE("ERROR")="E600" Q
 S X2=AUPNDOB,X1=APCPV("V DATE") D ^%DTC S AUPNDAYS=X
 I '$D(^AUPNPAT(AUPNPAT,11)) S APCPE("ERROR")="E602" Q
COMM ;
 S APCPV("COMMX")=0,APCPV("COMMPX")="" F  S APCPV("COMMX")=$O(^AUPNPAT(AUPNPAT,51,APCPV("COMMX"))) Q:APCPV("COMMX")'=+APCPV("COMMX")  S APCPV("COMMPX")=APCPV("COMMX")
 I APCPV("COMMPX")="" S APCPE("ERROR")="E610" Q
 S APCPV("COMMPX")=$P(^AUPNPAT(AUPNPAT,51,APCPV("COMMPX"),0),U,3) I APCPV("COMMPX")="" S APCPE("ERROR")="E611" Q
 I '$D(^AUTTCOM(APCPV("COMMPX"),0)) S APCPE("ERROR")="E611" Q
 I APCPV("COMMPX")]"" S APCPV("COMM CODE")=$P(^AUTTCOM(APCPV("COMMPX"),0),U,8) I APCPV("COMM CODE")="" S APCPE("ERROR")="E612" Q
TRIBE ;
 S X=$P(^AUPNPAT(AUPNPAT,11),U,8) I X="" S APCPE("ERROR")="E605" D RESET Q
 I $P(^AUTTTRI(X,0),U,4)="Y" S APCPE("ERROR")="E607" D RESET Q
 S APCPV("TRIBE CODE")=$P(^AUTTTRI(X,0),U,2) I APCPV("TRIBE CODE")="" S APCPE("ERROR")="E608" Q
CHART S (APCPV("T-HASF"),APCPV("CHART"))=""
 I $D(^AUPNPAT(APCPV("PATIENT DFN"),41,APCPV("LOC DFN"),0))#2 S APCPV("T-HASF")=$P(^(0),U),APCPV("CHART")=$P(^(0),U,2)
 I APCPV("CHART")="" S APCPV("CHART")=999999 Q
 S APCPV("CHART")=$E("000000",1,6-$L(APCPV("CHART")))_APCPV("CHART")
 Q
 ;
RESET ;EP
 Q:$P(APCPV("V REC"),U,11)
 S DA=APCP("V DFN"),DIE="^AUPNVSIT(",DR=".13///"_DT D ^DIE K DA,DIU,DIE,DR,DIV
 Q