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

APCPDRI3.m

Go to the documentation of this file.
  1. APCPDRI3 ; IHS/TUCSON/LAB - initialization part III AUGUST 14, 1992 ; [ 04/07/99 7:47 AM ]
  1. ;;2.0;IHS PCC DATA EXTRACTION SYSTEM;**1**;APR 03, 1998
  1. INFORM ;EP - INFORM OPERATOR WHAT IS GOING TO HAPPEN
  1. Q:$D(ZTQUEUED)
  1. W !!,"This routine will generate the following transaction types:"
  1. ;W:$D(APCPS("APC")) !?15,"APC - AMBULATORY SYSTEM " ;IHS/CMI/LAB - per hdqrts west NO APC records
  1. ;W:$D(APCPS("INPT")) !?15,"INPATIENT - DIRECT INPATIENT" ;IHS/CMI/LAB - per hdqtrs west NO inpatient txs
  1. ;W:$D(APCPS("CHA")) !?15,"CHA - COMMUNITY HEALTH ACTIVITY" ;per hdqtrs west, NO CHA transactions
  1. W !?15,"STATISTICAL DATABASE RECORDS" ;IHS/CMI/LAB - stat recs only per hdqtrs west
  1. W !,"for visits posted between a specified range of dates. You may ""^"" out at any",!,"prompt and will be ask to confirm your entries prior to generating transactions."
  1. Q
  1. ;
  1. CURRUN ;EP - COMPUTE DATES FOR CURRENT RUN
  1. S APCP("RUN BEGIN")=""
  1. I APCP("LAST LOG") S X1=$P(^APCPLOG(APCP("LAST LOG"),0),U,2),X2=1 D C^%DTC S APCP("RUN BEGIN")=X,Y=X D DD^%DT
  1. I APCP("RUN BEGIN")="" D FIRSTRUN
  1. Q:APCP("QFLG")
  1. S X1=DT,X2=$P(^APCPSITE(1,0),U,3)*-1 D C^%DTC S Y=X
  1. I Y<APCP("RUN BEGIN") W:'$D(ZTQUEUED) !!," Ending date cannot be before beginning date!",$C(7) S APCP("QFLG")=18 Q
  1. S APCP("RUN END")=Y
  1. S Y=APCP("RUN BEGIN") X ^DD("DD") S APCP("X")=Y
  1. S Y=APCP("RUN END") X ^DD("DD") S APCP("Y")=Y
  1. W:'$D(ZTQUEUED) !!,"The inclusive dates for this run are ",APCP("X")," through ",APCP("Y"),"."
  1. K %,%H,%I,APCP("RDFN"),APCP("X"),APCP("Y"),APCP("LAST LOG"),APCP("LAST BEGIN"),APCP("Z"),APCP("DATE")
  1. Q
  1. ;
  1. FIRSTRUN ; FIRST RUN EVER (NO LOG ENTRY)
  1. I $D(ZTQUEUED),$D(APCPO("SCHEDULED")) S APCP("QFLG")=12 Q
  1. W !!,"No log entry. First run ever assumed.",!
  1. FRLP ;
  1. S DIR(0)="D^:"_DT_":EP",DIR("A")="Enter Beginning Date for this run" K DA D ^DIR K DIR
  1. I $D(DIRUT)!(Y="") S APCP("QFLG")=99 Q
  1. S APCP("RUN BEGIN")=Y
  1. S APCP("FIRST RUN")=1
  1. Q
  1. ;
  1. ;
  1. ERRBULL ;ENTRY POINT - ERROR BULLETIN
  1. S APCP("QFLG1")=$O(^APCPERRC("B",APCP("QFLG"),"")),APCP("QFLG DES")=$P(^APCPERRC(APCP("QFLG1"),0),U,2)
  1. S XMB(2)=APCP("QFLG"),XMB(3)=APCP("QFLG DES")
  1. S XMB(4)=$S($D(APCP("RUN LOG")):APCP("RUN LOG"),1:"< NONE >")
  1. I '$D(APCP("RUN BEGIN")) S XMB(5)="<UNKNOWN>" G ERRBULL1
  1. S Y=APCP("RUN BEGIN") D DD^%DT S XMB(5)=Y
  1. ERRBULL1 S Y=DT D DD^%DT S XMB(1)=Y,XMB="APCP PCC TRANSMISSION ERROR"
  1. S XMDUZ=.5 D ^XMB
  1. K XMB,XM1,XMA,XMDT,XMM,APCP("QFLG1"),APCP("QFLG DES"),XMDUZ
  1. Q