source: FOIAVistA/trunk/r/MASTER_PATIENT_INDEX_VISTA-MPIF/MPIFACHK.m@ 1742

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

initial load of FOIAVistA 6/30/08 version

File size: 2.0 KB
Line 
1MPIFACHK ;CMC/BP-ACKNOWLEDGEMENT CHECK ;JULY 8, 2002
2 ;;1.0; MASTER PATIENT INDEX VISTA ;**22**;30 Apr 99
3 ;
4 ; Integration Agreements Utilized:
5 ; START, STOP, EXC^RGHLLOG - #2796
6 ;
7EN(RETURN,BEFORE) ; CHECKING FOR "A" FOR XTMP("MPIFA.. NODES that happened before FM date BEFORE
8 ;RPC - RETURN will have 0 if no messages need to be resent OR 1 if there are some resent.
9 ;
10 N DFN2,TAG,MPIFHL,ICN,ICN2 K MPIFMSG
11 M MPIFHL=HL ;need to save hl variables to avoid undefined errors when returning to RPC.
12 S MPIFMSG="MPIFA",RETURN=0
13 F S MPIFMSG=$O(^XTMP(MPIFMSG)) Q:$E(MPIFMSG,1,5)'="MPIFA" D
14 .Q:$P(^XTMP(MPIFMSG,0),"^",2)>BEFORE
15 .I $E(MPIFMSG,1,7)="MPIFA40" D
16 ..S DFN2=$O(^XTMP(MPIFMSG,0))
17 ..Q:DFN2=""
18 ..I $G(^XTMP(MPIFMSG,DFN2,"MPI",0))="A" D
19 ...S ICN=$G(^XTMP(MPIFMSG,DFN2,"MPI",1))
20 ...S ICN2=$P(ICN,"^",2),MSGN=$P(ICN,"^",3),ICN=$P(ICN,"^")
21 ...S RETURN=1
22 ...D START^RGHLLOG()
23 ...D EXC^RGHLLOG(208,"Merge msg A40 for TO record ICN1= "_ICN_" FROM record ICN2= "_ICN2_". HL7 msg id= "_MSGN_" No ACK received back")
24 ...D STOP^RGHLLOG()
25 ..K ^XTMP(MPIFMSG)
26 .Q:MPIFMSG["A40"
27 .Q:'$D(^XTMP(MPIFMSG,"MPI",0))
28 .I $G(^XTMP(MPIFMSG,"MPI",0))="A" D
29 ..S TAG=$E(MPIFMSG,5,7)
30 ..D @TAG S RETURN=1
31 K MPIFMSG
32 M HL=MPIFHL
33 ;
34 S MPIFMSG="RGA"
35 F S MPIFMSG=$O(^XTMP(MPIFMSG)) Q:$E(MPIFMSG,1,3)'="RGA" D
36 .Q:$P(^XTMP(MPIFMSG,0),"^",2)>BEFORE
37 .Q:'$D(^XTMP(MPIFMSG,"MPI",0))
38 .I $G(^XTMP(MPIFMSG,"MPI",0))="A" D
39 ..S TAG=$E(MPIFMSG,3,5)
40 ..I TAG="A01"!(TAG="A03")!(TAG="A04")!(TAG="A08") S TAG="A31"
41 ..D @TAG S RETURN=1
42 K MPIFMSG
43 M HL=MPIFHL
44 Q
45 ;
46A28 ;
47 K ^XTMP(MPIFMSG)
48 N NUM
49 S NUM=$$A28^MPIFA28(+$P(MPIFMSG,"%",2))
50 Q
51A31 ;
52 K ^XTMP(MPIFMSG)
53 N NUM
54 S NUM=$$A31^MPIFA31B(+$P(MPIFMSG,"%",2))
55 Q
56A29 ;
57 K ^XTMP(MPIFMSG)
58 N ICN,MSGN
59 S ICN=$G(^XTMP(MPIFMSG,"MPI",1)),MSGN=$P(ICN,"^",2),ICN=$P(ICN,"^")
60 D START^RGHLLOG()
61 D EXC^RGHLLOG(208,"Inactivate msg A29 for DFN= "_$P(MPIFMSG,"%",2)_" with ICN= "_ICN_" original HL7 msg id= "_MSGN_" No ACK received back",$P(MPIFMSG,"%",2))
62 D STOP^RGHLLOG()
63 Q
64A24 ;
65 K ^XTMP(MPIFMSG)
66 N NUM
67 S NUM=$$A24^MPIFA24B(+$P(MPIFMSG,"%",2))
68 Q
Note: See TracBrowser for help on using the repository browser.