Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: MCAR7X

MCAR7X.m

Go to the documentation of this file.
MCAR7X ; HIRMFO/REL-Generate HL7 Error Message ;3/31/00  09:10
 ;;2.3;Medicine;**24**;09/13/1996
 D BULL,GENACK Q
BULL ; Generate error message
 S INST=$O(^MCAR(690.7,"B",MCAPP,0)) Q:'INST
 S MG=$P($G(^MCAR(690.7,INST,0)),"^",2) Q:'MG
 S MG=$P($G(^XMB(3.8,+MG,0)),"^",1) Q:MG=""
 S XMTO="G."_MG_"@"_^XMB("NETNAME"),XMDUZ=.5
 S TXT(1)=ERRTX,TXT(2)=X,TXT(3)=" "
 S N=3 F X="MSH","PID","OBR","OBX" I $D(SEG(X)) S N=N+1,TXT(N)=SEG(X)
 S XMSUBJ="A Clinical Instrument HL7 Error has occurred."
 S XMBODY="TXT"
 D SENDMSG^XMXAPI(XMDUZ,XMSUBJ,XMBODY,XMTO)
 K TXT Q
GENACK ; Generate an HL7 ACK message
 S HLA("HLA",1)="MSA"_HL("FS")_$S($D(ERRTX):"AR",1:"AA")_HL("FS")_HL("MID")_$S($D(ERRTX):HL("FS")_ERRTX,1:"")
 S HLEID=HL("EID"),HLEIDS=HL("EIDS"),HLARYTYP="LM",HLFORMAT=1,HLRESLTA=HL("MID")
 D GENACK^HLMA1(HLEID,HLMTIENS,HLEIDS,HLARYTYP,HLFORMAT,.HLRESTLA)
 K ERRTX Q