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

APCPHOS2.m

Go to the documentation of this file.
APCPHOS2 ; IHS/TUCSON/LAB - CONT. HOSP REVIEW AUGUST 14, 1992 ; [ 04/03/98  08:39 AM ]
 ;;2.0;IHS PCC DATA EXTRACTION SYSTEM;;APR 03, 1998
START ;
 D CHKADM
 I $D(APCPE("ERROR")) S APCPE("FILE")=9000010.02,APCPE("EDFN")=APCPH("VINP PTR") Q
 D CHKTS
 I $D(APCPE("ERROR")) S APCPE("FILE")=9000010.02,APCPE("EDFN")=APCPH("VINP PTR") Q
 D CHKAGE
 Q:$D(APCPE("ERROR"))
 D DATES
 Q:$D(APCPE("ERROR"))
XIT ;
 Q
 ;
 ;
CHKTS ;
 I APCPH("A TS CODE")="07",AUPNDAYS]"",AUPNDAYS>1 S APCPE("ERROR")="E318" Q
 I APCPH("A TS CODE")="11",AUPNDAYS]"",AUPNDAYS>5479 S APCPE("ERROR")="E319" Q
 I APCPH("A TS CODE")="05"!(APCPH("A TS CODE")="08"),AUPNSEX'="F" S APCPE("ERROR")="E320",APCPE("FILE")="9000010.02,",APCPV("EDFN")=APCPH("VINP PTR") Q
 I APCPH("A TS CODE")="08",AUPNDAYS]"",(AUPNDAYS<3652!(AUPNDAYS>20088)),'$D(APCPV("ACC")) S APCPE("ERROR")="E321" Q
 I APCPH("D TS CODE")="05"!(APCPH("D TS CODE")="08"),AUPNSEX'="F" S APCPE("ERROR")="E324",APCPE("FILE")="9000010.02,",APCPV("EDFN")=APCPH("VINP PTR") Q
 I APCPH("D TS CODE")="08",AUPNDAYS]"",(AUPNDAYS<3652!(AUPNDAYS>20088)),'$D(APCPV("ACC")) S APCPE("ERROR")="E325" Q
 Q
DATES ;
 S X1=$P(APCPH("VINP REC"),U),X2=$P(APCPV("V REC"),U) D ^%DTC I X<0 S APCPE("ERROR")="E326" Q
 I X>99,'$D(APCPV("ACC")) S APCPE("ERROR")="E327" Q
 Q
CHKAGE ;
 Q:$D(APCPV("ACC"))
 Q:AUPNDAYS>5
 I $E($P(APCPH("POV","P"),U),1,2)'="V3" S APCPE("ERROR")="E328" Q
 Q
CHKADM ;check admission date
 S APCPH("DISCH DATE")=$P($P(APCPH("VINP REC"),U),"."),APCPH("ADM DATE")=$P($P(APCPV("V REC"),U),".")
 I APCPH("DISCH DATE")<APCPH("ADM DATE") S APCPE("ERROR")="E326" Q
 I AUPNDOB>APCPH("ADM DATE") S APCPE("ERROR")="E329" Q
 Q:APCPH("ADM DATE")'=AUPNDOB
 Q:$D(APCPV("ACC"))
 I $E($P(APCPH("POV","P"),U),1,2)'="V3" S APCPE("ERROR")="E330" Q
 Q
 ;
GETACC ;EP - get accept command if there is one and save variable
 K APCPV("ACC")
 ;$O THRU V POV'S FOR ACCEPT
 S APCPH(2)=0 F  S APCPH(2)=$O(^AUPNVPOV("AD",APCP("V DFN"),APCPH(2))) Q:APCPH(2)=""  I $P(^AUPNVPOV(APCPH(2),0),U,14)]"" S APCPV("ACC")="ACC"
 Q:$D(APCPV("ACC"))
 ;$O THRU V PROCEDURES FOR ACCEPT
 S APCPH(2)=0 F  S APCPH(2)=$O(^AUPNVPRC("AD",APCP("V DFN"),APCPH(2))) Q:APCPH(2)=""  I $P(^AUPNVPRC(APCPH(2),0),U,9)]"" S APCPV("ACC")="ACC"
 Q:$D(APCPV("ACC"))
 S APCPH(1)=$O(^AUPNVINP("AD",APCP("V DFN"),""))
 I $P(^AUPNVINP(APCPH(1),0),U,14)]"" S APCPV("ACC")="ACC"
 Q