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

MDCPV1.m

Go to the documentation of this file.
  1. MDCPV1 ;HINES OIFO/DP/BJ - PV1 Segment Routine;08 Aug 2007
  1. ;;1.0;CLINICAL PROCEDURES;**16,23**;Apr 01, 2004;Build 281
  1. ;Per VHA Directive 2004-038, this routine should not be modified.
  1. ;
  1. ; - This routine uses the following Integration Agreements (IAs):
  1. ; #2050 - $$EZBLD^DIALOG() (supported)
  1. ;
  1. ; - The PV1 Segment Wrapper Sub-routine. This interfaces the creation of a PV1
  1. ; segment by the PV1 segment builder.
  1. Q
  1. EN(PATMVMT,PV1SEG,PV1RONG) ;
  1. ;
  1. ; PATMVMT = the 704.005 file entry for the HL7 message !! Pass by reference !!
  1. ; PV1SEG = root segment buffer where the PV1 information is to be stored
  1. ; !! Pass by reference !!
  1. ; PV1RONG = the string the error message string goes !! Pass by reference !!
  1. ;
  1. N VAFSTR,CHUNX,HLECH,HLMAXLEN,HLCM,HLRP,HLSC,HLES,HLFS,HLQ,HL7RC,HLECH
  1. S VAFSTR=",1,2,3,"
  1. D MOREDLMS^MDCUTL
  1. ; - obtain PV1 information
  1. ; submit the field selection string and Segment number in addition to the
  1. ; parameters passed by the message builder
  1. D BUILD^MDCSPV1(VAFSTR,"0001",.PATMVMT,.PV1SEG,.PV1RONG)
  1. ;
  1. ; - bail if no segment material
  1. Q:$G(PV1SEG)=""
  1. S CHUNX=($D(PV1SEG))-1
  1. Q:(CHUNX=9)!(CHUNX=-1)
  1. ;
  1. N APL,APLOC
  1. S APL=3+1
  1. S APLOC=$P(PV1SEG,HLFS,APL)
  1. ; Change the delimiters from HLRP to HLCM. Otherwise a message never gets built.
  1. ;I $P(APLOC,HLRP,1)="" S PV1RONG=$$PVERMSG^MDCPV1("PV1.3.1",MDCIEN,704.005) Q
  1. ;I $P(APLOC,HLRP,2)="" S PV1RONG=$$PVERMSG^MDCPV1("PV1.3.2",MDCIEN,704.005) Q
  1. ;Note: if this is an A08, then we're not gonna have an inpatient location and such like.
  1. I $P(PATMVMT("0"),U,7)'="A08" D
  1. .I $P(APLOC,HLCM,1)="" S PV1RONG=$$PVERMSG^MDCPV1("PV1.3.1",MDCIEN,704.005) Q
  1. .I $P(APLOC,HLCM,2)="" S PV1RONG=$$PVERMSG^MDCPV1("PV1.3.2",MDCIEN,704.005) Q
  1. ;
  1. Q
  1. ;
  1. ; here is an interface for the error message routine
  1. PVERMSG(ELMT,RIEN,FILEN) ;
  1. ; - this function invokes error message creation.
  1. ; ELMT = the HL7 element ID, such as PV1.7.2
  1. ; RIEN = IEN of record lacking missing or containing missing element
  1. ; FILEN = File number of fileman file containing record
  1. N PV1PRAMS
  1. S PV1PRAMS(1)=ELMT,PV1PRAMS(2)=RIEN,PV1PRAMS(3)=FILEN
  1. Q $$EZBLD^DIALOG(7040020.001,.PV1PRAMS)