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

BHL3MI.m

Go to the documentation of this file.
  1. BHL3MI ; cmi/anchorage/maw - BHL Setup HL7 message and pass to APCD ; [ 06/07/2002 7:04 AM ]
  1. ;;3.01;BHL IHS Interfaces with GIS;**1,14**;JUN 01, 2002
  1. ;
  1. ;
  1. ;
  1. ;this routine will pull the message out of the UIF and give it back
  1. ;to APCD the way they expect
  1. ;
  1. ;cmi/anch/maw 10/7/2005 modified due to message structure at
  1. ;Claremore with new 3M interface
  1. ;
  1. ;
  1. ;
  1. MAIN ;EP - this is the main routine driver
  1. D SET,MSH,PASS,EOJ^BHLSETI
  1. Q
  1. ;
  1. SET ;-- this is the main routine driver
  1. Q:'$G(UIF)
  1. S BHLUIF=UIF
  1. S BHL3MC=1
  1. N BHLBSEG,BHLCNT
  1. S BHLCNT=1
  1. S BHL3DA=0 F S BHL3DA=$O(^INTHU(UIF,3,BHL3DA)) Q:'BHL3DA D
  1. . N BHLSEG
  1. . S BHLSEG=$G(^INTHU(UIF,3,BHL3DA,0))
  1. . N I
  1. . F I=1:1:$L(BHLSEG) D
  1. .. S $E(BHLBSEG,BHLCNT,BHLCNT)=$E(BHLSEG,I,I)
  1. .. D CHKSEG(BHLBSEG,BHL3MC)
  1. .. S BHLCNT=BHLCNT+1
  1. D SETSEG(BHL3MC,BHLBSEG)
  1. Q
  1. ;
  1. CHKSEG(BSEG,MC) ;-- see if we are at a start of a segment
  1. I $E(BSEG,$L(BSEG)-2,$L(BSEG))="EVN" D SETSEG(MC,BSEG) Q
  1. I $E(BSEG,$L(BSEG)-2,$L(BSEG))="PID" D SETSEG(MC,BSEG) Q
  1. I $E(BSEG,$L(BSEG)-2,$L(BSEG))="PV1" D SETSEG(MC,BSEG) Q
  1. I $E(BSEG,$L(BSEG)-2,$L(BSEG))="DG1" D SETSEG(MC,BSEG) Q
  1. I $E(BSEG,$L(BSEG)-2,$L(BSEG))="PR1" D SETSEG(MC,BSEG) Q
  1. I $E(BSEG,$L(BSEG)-2,$L(BSEG))="Z3A" D SETSEG(MC,BSEG) Q
  1. I $E(BSEG,$L(BSEG)-2,$L(BSEG))="Z3R" D SETSEG(MC,BSEG) Q
  1. Q
  1. ;
  1. SETSEG(C,BS) ;-- setup the segment array
  1. S APCDHL7M(C)=$E(BS,1,$L(BS)-3)
  1. S BHL3MC=BHL3MC+1
  1. S BHLBSEG=$E(BHLBSEG,$L(BHLBSEG)-2,$L(BHLBSEG))
  1. S BHLCNT=3
  1. Q
  1. ;
  1. MSH ;-- let's setup the msh segment
  1. S BHLMDA=0 F S BHLMDA=$O(APCDHL7M(BHLMDA)) Q:'BHLMDA D
  1. . Q:$E(APCDHL7M(BHLMDA),1,3)'="MSH"
  1. . S FS=$E(APCDHL7M(BHLMDA),4,4)
  1. . S ENC=$P(APCDHL7M(BHLMDA),FS,2)
  1. Q
  1. ;
  1. PASS ;-- call 3M filer
  1. D IN^APCD3M
  1. Q
  1. ;