1 | DGPFHLRT ;ALB/RPM - PRF HL7 MESSAGE RETRANSMIT ; 7/18/06 10:49am
|
---|
2 | ;;5.3;Registration;**425,650**;Aug 13, 1993;Build 3
|
---|
3 | ;This routine generates a QRY~R02 HL7 message for all Incomplete
|
---|
4 | ;status PRF HL7 EVENT (#26.21) file patient query records.
|
---|
5 | ;
|
---|
6 | Q ;no direct entry
|
---|
7 | ;
|
---|
8 | RUNQRY ;Generate new PRF QRY~R02 HL7 Query for a patient
|
---|
9 | ;This procedure scans all entries in the ASTAT index of the PRF HL7
|
---|
10 | ;EVENT (#26.21) file, looking for INCOMPLETE status HL7 query records
|
---|
11 | ;
|
---|
12 | N DGASGN ;array of Category I assignment ien's
|
---|
13 | N DGDFN ;pointer to patient in PATIENT (#2) file
|
---|
14 | N DGLIEN ;PRF HL7 EVENT (#26.21) file IEN
|
---|
15 | N DGPFL ;array of event data fields
|
---|
16 | ;
|
---|
17 | S DGLIEN=0
|
---|
18 | F S DGLIEN=$O(^DGPF(26.21,"ASTAT","I",DGLIEN)) Q:'DGLIEN D
|
---|
19 | . K DGPFL,DGASGN
|
---|
20 | . Q:'$$GETEVNT^DGPFHLL1(DGLIEN,.DGPFL)
|
---|
21 | . ;
|
---|
22 | . Q:($P($G(DGPFL("STAT")),U,1)'="I")
|
---|
23 | . ;
|
---|
24 | . S DGDFN=$P($G(DGPFL("DFN")),U,1)
|
---|
25 | . Q:DGDFN']""
|
---|
26 | . ;
|
---|
27 | . ;If patient already has the total possible number of Cat I flags,
|
---|
28 | . ;then mark the query event file as COMPLETE and quit.
|
---|
29 | . I $$GETALL^DGPFAA(DGDFN,.DGASGN,"",1)=$$CNTRECS^DGPFUT1(26.15) D Q
|
---|
30 | . . D STOEVNT^DGPFHLL1(DGDFN,"C")
|
---|
31 | . ;
|
---|
32 | . ;mark the event in ERROR when attempt limit is reached and quit
|
---|
33 | . I $$QRYCNT(DGLIEN)+1>$$TRYLIMIT() D Q
|
---|
34 | . . D STOEVNT^DGPFHLL1(DGDFN,"E")
|
---|
35 | . ;
|
---|
36 | . ;run query in deferred mode
|
---|
37 | . I $$SNDQRY^DGPFHLS(DGDFN,2)
|
---|
38 | . ;
|
---|
39 | Q
|
---|
40 | ;
|
---|
41 | QRYCNT(DGEVNT) ;get number of logged query attempts
|
---|
42 | ;This function counts the number of entries in the PRF HL7 QUERY LOG
|
---|
43 | ;(#26.19) file for a given PRF HL7 EVENT.
|
---|
44 | ;
|
---|
45 | ; Input:
|
---|
46 | ; DGEVNT - pointer to PRF HL7 EVENT (#26.21) file
|
---|
47 | ;
|
---|
48 | ; Function value - number of logged query attempts
|
---|
49 | ;
|
---|
50 | N DGCNT
|
---|
51 | N DGLIEN
|
---|
52 | ;
|
---|
53 | S DGEVNT=+$G(DGEVNT)
|
---|
54 | S DGCNT=0
|
---|
55 | S DGLIEN=0
|
---|
56 | F S DGLIEN=$O(^DGPF(26.19,"C",DGEVNT,DGLIEN)) Q:'DGLIEN D
|
---|
57 | . S DGCNT=DGCNT+1
|
---|
58 | ;
|
---|
59 | Q DGCNT
|
---|
60 | ;
|
---|
61 | TRYLIMIT() ;get PRF Query Try Limit parameter value
|
---|
62 | ;
|
---|
63 | ; Input: none
|
---|
64 | ;
|
---|
65 | ; Output:
|
---|
66 | ; Function value - DGPF QUERY TRY LIMIT parameter [DEFAULT=5]
|
---|
67 | ;
|
---|
68 | N DGVAL
|
---|
69 | S DGVAL=$$GET^XPAR("PKG","DGPF QUERY TRY LIMIT",1,"Q")
|
---|
70 | Q $S(DGVAL="":5,1:DGVAL)
|
---|