source: FOIAVistA/trunk/r/MASTER_PATIENT_INDEX_VISTA-MPIF/MPIFDUPS.m@ 1800

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

initial load of FOIAVistA 6/30/08 version

File size: 966 bytes
Line 
1MPIFDUPS ;SFCIO/CMC-MPIF RPC APIS ;26 Sept 01
2 ;;1.0; MASTER PATIENT INDEX VISTA ;**20**;30 Apr 99
3 ;
4 ;Integration Agreements Utilized:
5 ; ^DPT( - #2070
6 ;
7TOSITE(RETURN,ARRAY) ;
8 ; RPC for processing ICNs from MPI's TOSITE global
9 I $G(ARRAY)="" S RETURN="-1^NO DATA TO CHECK" Q
10 N ENT,ICN,SSN,SITE,NODE,MPIN,DFN
11 S RETURN=""
12 F ENT=1:1 S NODE=$P(ARRAY,"^",ENT) Q:NODE=""!(+RETURN=-1) D
13 .S SITE=$P(NODE,";")
14 .I $P($$SITE^VASITE,"^",3)'=SITE S RETURN="-1^WRONG SITE^"_ARRAY Q
15 .S ICN=$P(NODE,";",2),SSN=$P(NODE,";",3)
16 .S DFN=+$$GETDFN^MPIF001(ICN)
17 .I DFN<0 S RETURN=RETURN_NODE_";1^" Q
18 . ; ^ 1=ICN doesn't exist
19 .I DFN D
20 ..; checking if ICN is on MPI node
21 ..S MPIN=$$MPINODE^MPIFAPI(DFN)
22 ..I $P(MPIN,"^")'=ICN S RETURN=RETURN_NODE_";4^" Q
23 ..; checking if SSN is the same as on MPI - 4=icn should be inactivated
24 ..I $P(^DPT(DFN,0),"^",9)'=SSN S RETURN=RETURN_NODE_";3^" Q
25 ..; 3 = SSN conflict
26 ..S RETURN=RETURN_NODE_";2^" Q
27 ..; 2 = ICN exists
28 Q
29 ;
Note: See TracBrowser for help on using the repository browser.