source: WorldVistAEHR/trunk/r/MASTER_PATIENT_INDEX_VISTA-MPIF/MPIFA28.m@ 660

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

initial load of WorldVistAEHR

File size: 1.7 KB
RevLine 
[613]1MPIFA28 ;BP/CMC-BUILD A28 ADD ME MSGS ;MARCH 4, 2002
2 ;;1.0; MASTER PATIENT INDEX VISTA ;**22,31,25,35,44**;30 Apr 99;Build 7
3 ;
4 ; Integration Agreements Utilized:
5 ; START, EXC, STOP^RGHLLOG - #2796
6 ; BLDEVN, BLDPD1, BLDPID^VAFCQRY - #3630
7 ;
8A28(DFN) ;BUILD AND SEND A28
9 N RESLT,CNT,MPI,EVN,TCNT,ERR,PD1,PID
10 K HLA("HLA"),HLA("HLS")
11 S CNT=1
12 D INIT^HLFNC2("MPIF ADT-A28 SERVER",.HL)
13 I $O(HL(""))="" Q "-1^"_$P(HL,"^",2)
14 S HLECH=HL("ECH"),HLFS=HL("FS"),COMP=$E(HL("ECH"),1),REP=$E(HL("ECH"),2),SUBCOMP=$E(HL("ECH"),4)
15 S ERR="",TCNT=0
16 D BLDEVN^VAFCQRY(DFN,"1,2",.EVN,.HL,"A28",.ERR)
17 Q:ERR'="" ERR
18 D BLDPID^VAFCQRY(DFN,1,"ALL",.PID,.HL,.ERR)
19 Q:ERR'="" ERR
20 D BLDPD1^VAFCQRY(DFN,"3",.PD1,.HL,.ERR)
21 Q:ERR'="" ERR
22 S HLA("HLS",1)=EVN(1)
23 S HLA("HLS",3)=PD1(1)
24 S CNT=0 F S CNT=$O(PID(CNT)) Q:CNT="" D
25 .I CNT=1 S HLA("HLS",2)=PID(CNT)
26 .I CNT>1 S HLA("HLS",2,CNT-1)=PID(CNT)
27 S HLA("HLS",4)=$$EN1^VAFHLZPD(DFN,"1,17,21,34") ;25 ;**44 ADDED PSEUDO SSN REASON, 1 and 21 TO ZPD SEGMENT
28 S MPI=$$MPILINK^MPIFAPI()
29 Q:$P($G(MPI),"^")=-1 "-1^No logical link defined for the MPI"
30 S HLL("LINKS",1)="MPIF ADT-A28 CLIENT^"_MPI
31 D GENERATE^HLMA("MPIF ADT-A28 SERVER","LM",1,.MPIFRSLT,"","")
32 S RESLT=$S(+MPIFRSLT:MPIFRSLT,1:$P(MPIFRSLT,"^",3))
33 I +RESLT S ^XTMP("MPIFA28%"_DFN,0)=$$FMADD^XLFDT(DT,5)_"^"_DT_"^"_"A28 message to MPI for DFN "_DFN,^XTMP("MPIFA28%"_DFN,"MPI",0)="A"
34 I $D(^DPT("AICNL",1,DFN)) D
35 .I $G(^DPT("AICNL",1,DFN))="" S ^DPT("AICNL",1,DFN)="2^"_DT
36 .; **35
37 K HLA,HLEID,HLL("LINKS"),COMP,REP,SUBCOMP,HLECH,HLFS,HLA("HLA"),HLA("HLS"),MPIFRSLT
38 Q RESLT
39 ;
40RES ;
41 N NXT,DFN
42 F NXT=1:1 X HLNEXT Q:HLQUIT'>0 D
43 .I $E(HLNODE,1,3)="MSA" S DFN=$P($P(HLNODE,HL("FS"),7),"=",2)
44 K ^XTMP("MPIFA28%"_DFN)
45 Q
Note: See TracBrowser for help on using the repository browser.