source: FOIAVistA/trunk/r/MEDICINE-MC/MCAR7X.m@ 677

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

initial load of FOIAVistA 6/30/08 version

File size: 863 bytes
Line 
1MCAR7X ; HIRMFO/REL-Generate HL7 Error Message ;3/31/00 09:10
2 ;;2.3;Medicine;**24**;09/13/1996
3 D BULL,GENACK Q
4BULL ; Generate error message
5 S INST=$O(^MCAR(690.7,"B",MCAPP,0)) Q:'INST
6 S MG=$P($G(^MCAR(690.7,INST,0)),"^",2) Q:'MG
7 S MG=$P($G(^XMB(3.8,+MG,0)),"^",1) Q:MG=""
8 S XMTO="G."_MG_"@"_^XMB("NETNAME"),XMDUZ=.5
9 S TXT(1)=ERRTX,TXT(2)=X,TXT(3)=" "
10 S N=3 F X="MSH","PID","OBR","OBX" I $D(SEG(X)) S N=N+1,TXT(N)=SEG(X)
11 S XMSUBJ="A Clinical Instrument HL7 Error has occurred."
12 S XMBODY="TXT"
13 D SENDMSG^XMXAPI(XMDUZ,XMSUBJ,XMBODY,XMTO)
14 K TXT Q
15GENACK ; Generate an HL7 ACK message
16 S HLA("HLA",1)="MSA"_HL("FS")_$S($D(ERRTX):"AR",1:"AA")_HL("FS")_HL("MID")_$S($D(ERRTX):HL("FS")_ERRTX,1:"")
17 S HLEID=HL("EID"),HLEIDS=HL("EIDS"),HLARYTYP="LM",HLFORMAT=1,HLRESLTA=HL("MID")
18 D GENACK^HLMA1(HLEID,HLMTIENS,HLEIDS,HLARYTYP,HLFORMAT,.HLRESTLA)
19 K ERRTX Q
Note: See TracBrowser for help on using the repository browser.