source: FOIAVistA/trunk/r/REGISTRATION-DGQE-DG-DPT-GRPX-VAD-VAF-VAS-VAT-VAU--VA-VIC--DGBT--DGJ--DGYA--VALM/VAFHBGJ.m@ 1650

Last change on this file since 1650 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 1.5 KB
Line 
1VAFHBGJ ;ALB/CM BACKGROUND JOB FOR UPDATE MESSAGES ;05/23/95
2 ;;5.3;Registration;**91,415**;Jun 06, 1996
3 ;
4 ;This routine will loop through the pivot file, getting the entries
5 ;that have the TRANSMITTED-NEED TO TRANSMIT field populated and
6 ; generating an A08 message for the update.
7 ;
8 ;
9EN ;check to see if sending is on or off
10 I '$$SEND^VAFHUTL() Q
11 ;make sure only one job will run
12ENT L +^XTMP("ADT/HL7 VAFH BATCH UPDATE"):3 E Q
13 ;
14 D MAIN
15 K HLA D KILL^HLTRANS
16 L -^XTMP("ADT/HL7 VAFH BATCH UPDATE")
17 Q
18 ;
19MAIN N LSTR,LOOP,NODE,DFN,RECENT,EVTY,EVDT,PIVOT,VPTR,GBL,COUNT,UP,ERR,CLEAN
20 I '$O(^VAT(391.71,"AC",1,"")) Q
21 S LOOP="",GBL="HLA(""HLS"")"
22 K HLA
23 ;
24 F S COUNT=1,LOOP=$O(^VAT(391.71,"AC",1,LOOP)) Q:LOOP="" D Q:$D(HL)=1
25 .; bad x-ref, delete it and quit
26 .I '$D(^VAT(391.71,LOOP)) K ^VAT(391.71,"AC",1,LOOP) Q
27 .S NODE=$G(^VAT(391.71,LOOP,0)) Q:'NODE
28 .K HL D INIT^HLFNC2("VAFH A08",.HL)
29 .I $D(HL)=1 Q
30 .I LOOP#10=0,+$$S^%ZTLOAD K HL S HL="TaskMan User Stop " Q
31 .S DFN=$P(NODE,"^",3),PIVOT=$P(NODE,"^",2) Q:'DFN
32 .; need to check if anything but registration
33 .S LSTR=$P($$LTD^VAFHUTL(DFN),"^",2)
34 .I LSTR'="R",LSTR'["No l" S LSTR=",2,50"
35 .E S LSTR=50
36 .;
37 .; generate the a08 message
38 .S ERR=$$UP^VAFHCA08(DFN,PIVOT,NODE,COUNT,GBL,"2,3,4,5,6,7,8,9,10B,11,12,13,14,16,19,22B","2,3,4,5,6,7,8,9,10,11,12,13,14,15",LSTR)
39 .I +ERR=0 DO
40 . .S CLEAN=$$CLNTRAN^VAFHPIV2(PIVOT),COUNT=$P(ERR,"^",2)+1
41 .E Q
42 .;;;I COUNT<2&($D(CLEAN)) D
43 .I +CLEAN=-1 D ERROR^VAFHCCAP(CLEAN,DFN) Q
44 .D GENERATE^HLMA("VAFH A08","LM",1,.HLRESLT)
45 .K HLA
46 Q
Note: See TracBrowser for help on using the repository browser.