[613] | 1 | DGPFHLU6 ;ALB/RPM - PRF HL7 ORU~R01 UTILITIES ; 8/31/05 1:09pm
|
---|
| 2 | ;;5.3;Registration;**425,554**;Aug 13, 1993
|
---|
| 3 | ;
|
---|
| 4 | Q ;no direct entry
|
---|
| 5 | ;
|
---|
| 6 | XMIT(DGPFHIEN,DGHLEID,DGFAC,DGHLROOT,DGHL) ;transmit ORU messages
|
---|
| 7 | ;This function loops through an array of treating facilities. For
|
---|
| 8 | ;each treating facility: the HL7 logical link is determined, the ORU
|
---|
| 9 | ;message contained in the DGHLROOT input parameter is transmitted and
|
---|
| 10 | ;an entry is created in the PRF HL7 TRANSMISSION LOG (#26.17) file.
|
---|
| 11 | ;
|
---|
| 12 | ; Supported DBIA #2171: This supported DBIA is used to access the
|
---|
| 13 | ; Kernel API to convert a station number
|
---|
| 14 | ; to an INSTITUTION (#4) file IEN.
|
---|
| 15 | ;
|
---|
| 16 | ; Input:
|
---|
| 17 | ; DGPFHIEN - pointer to PRF ASSIGNMENT HISTORY (#26.14) file
|
---|
| 18 | ; DGHLEID - event protocol ID
|
---|
| 19 | ; DGFAC - treating facilities array
|
---|
| 20 | ; DGHLROOT - name of array containing formatted ORU message
|
---|
| 21 | ; DGHL - VistA HL7 environment array
|
---|
| 22 | ;
|
---|
| 23 | ; Output:
|
---|
| 24 | ; Function value - returns 1 on sucess, 0 on failure
|
---|
| 25 | ;
|
---|
| 26 | N DGHLLNK ;single logical link
|
---|
| 27 | N DGHLS ;name of HL7 "HLS" array
|
---|
| 28 | N DGI ;generic counter
|
---|
| 29 | N DGINST ;pointer to INSTITUTION (#4) file
|
---|
| 30 | N DGLOGERR ;error array from transmit log filer
|
---|
| 31 | N DGLINST ;pointer to INSTITUTION (#4) file for local site
|
---|
| 32 | N DGRSLT ;function value
|
---|
| 33 | N HLL ;logical links array
|
---|
| 34 | N DGHLRSLT ;message IEN on successful transmit
|
---|
| 35 | ;
|
---|
| 36 | S DGHLS=$NA(^TMP("HLS",$J))
|
---|
| 37 | S DGLINST=$P($$SITE^VASITE(),U,1)
|
---|
| 38 | S DGRSLT=0
|
---|
| 39 | ;
|
---|
| 40 | S DGI=0
|
---|
| 41 | F S DGI=$O(DGFAC(DGI)) Q:'DGI D
|
---|
| 42 | . N DGHLRSLT
|
---|
| 43 | . N DGLOGERR
|
---|
| 44 | . ;
|
---|
| 45 | . ;convert the station number to INSTITUTION (#4) file IEN
|
---|
| 46 | . S DGINST=+$$IEN^XUAF4($P(DGFAC(DGI),U,1))
|
---|
| 47 | . Q:'DGINST!(DGINST=DGLINST)
|
---|
| 48 | . ;
|
---|
| 49 | . ;must be a medical treating facility
|
---|
| 50 | . Q:'$$TF^XUAF4(DGINST)
|
---|
| 51 | . ;
|
---|
| 52 | . ;get the HL7 LOGICAL LINK associated with the institution
|
---|
| 53 | . S DGHLLNK=$$GETLINK^DGPFHLUT(DGINST)
|
---|
| 54 | . Q:DGHLLNK=0
|
---|
| 55 | . ;
|
---|
| 56 | . ;copy formatted message to HL7 "HLS" array
|
---|
| 57 | . K @DGHLS
|
---|
| 58 | . M @DGHLS=@DGHLROOT
|
---|
| 59 | . ;
|
---|
| 60 | . ;build HLL logical link
|
---|
| 61 | . S HLL("LINKS",1)="DGPF PRF ORU/R01 SUBSC"_U_DGHLLNK
|
---|
| 62 | . ;
|
---|
| 63 | . ;generate the message
|
---|
| 64 | . D GENERATE^HLMA(DGHLEID,"GM",1,.DGHLRSLT,"","")
|
---|
| 65 | . Q:$P(DGHLRSLT,U,2)]""
|
---|
| 66 | . ;
|
---|
| 67 | . ;store the message ID and destination site in the HL7 transmission log
|
---|
| 68 | . D STOXMIT^DGPFHLL(DGPFHIEN,$P(DGHLRSLT,U),DGINST,.DGLOGERR)
|
---|
| 69 | . Q:$D(DGLOGERR)
|
---|
| 70 | . ;
|
---|
| 71 | . ;success
|
---|
| 72 | . S DGRSLT=1
|
---|
| 73 | ;
|
---|
| 74 | Q DGRSLT
|
---|