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

SRHLMFN.m

Go to the documentation of this file.
  1. SRHLMFN ;B'HAM ISC/DLR - Surgery Interface Master File Notification Message ; [ 05/19/98 9:31 AM ]
  1. ;;3.0; Surgery ;**41**;24 Jun 93
  1. ; Per VHA Directive 10-93-142, this routine SHOULD NOT be modified.
  1. MSG(SRTBL,FEC,REC,SRENT) ;sends MFN message
  1. ;MFN - Master File Notification Message
  1. ; SRTBL - table entry consisting of <name><file><field>
  1. ; FEC - file event code (MAD,MDC,MAC,MDL)
  1. ; REC - record event code (REP,UPD)
  1. ; SRENT - (IEN) internal entry number of the record to be passed
  1. ;
  1. N HLCOMP,HLREP,HLSUB,ID,FIELD,FILE,SRI,XX
  1. S HLDAP=$O(^HL(771,"B","SR SURGERY",0)) Q:$G(HLDAP)=""
  1. Q:$P($G(^HL(771,HLDAP,0)),U,2)'="a"
  1. D INIT
  1. S SRI=1,HLCOMP=$E(HL("ECH"),1),HLREP=$E(HL("ECH"),2),HLSUB=$E(HL("ECH"),4)
  1. S ID=$P(SRTBL,U),FIELD=$P(SRTBL,U,3),FILE=$P(SRTBL,U,2)
  1. D MFI^SRHLUO3(.SRI,ID,FEC,FILE,SRENT)
  1. D MFE^SRHLUO3(.SRI,REC,FILE,FIELD,SRENT)
  1. D GEN
  1. EXIT W !,REC," Sending HL7 Master File ",$S(REC="MAD":"addition",REC="MDC":"deactivate",REC="MAC":"Reactivation",REC="MDL":"Deletion",1:"")," message" F XX=1:1:5 W "."
  1. Q
  1. INIT ;V. 1.6 interface
  1. ;EID - IEN of event protocol
  1. ;HL - array of output parameters
  1. ;INT - only for VISTA-to-VISTA message exchange
  1. ;SRET - Surgery Event Trigger
  1. I $P(SRTBL,U,2)=200 S SRET="SR Staff Master File Notification"
  1. E S SRET="SR Other Master File Notification"
  1. S EID=$O(^ORD(101,"B",SRET,0)),HL="HL",INT=0
  1. D INIT^HLFNC2(EID,.HL,INT) S HLCOMP=$E(HL("ECH"),1),HLREP=$E(HL("ECH"),2),HLSUB=$E(HL("ECH"),4),HLFS=HL("FS"),HLQ=HL("Q"),HLECH=HL("ECH")
  1. Q
  1. GEN ;generate the message
  1. ;HLEID - IEN of event protocol
  1. ;HLARYTYP - acknowledgement array (see V. 1.6 HL7 doc)
  1. ;HLFORMAT - is HLMA is pre-formatted HL7 form
  1. ;HLMTIEN - IEN in 772
  1. ;HLRESLT - message ID and/or the error message (for output)
  1. ;HLP("CONTPTR") - continuation pointer field value (not used)
  1. ;HLP("PRIORITY") - priority field value (not used)
  1. ;HLP("SECURITY") - security information (not used)
  1. S HLEID=EID,HLARYTYP="GM",HLFORMAT=1,HLMTIEN="",HLRESLT=""
  1. D GENERATE^HLMA(HLEID,HLARYTYP,HLFORMAT,.HLRESLT,HLMTIEN,.HLP)
  1. Q