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

MAGT7SN.m

Go to the documentation of this file.
  1. MAGT7SN ;WOIFO/MLH/PMK - telepathology - create HL7 message to DPS - segment build - NTE ; 17 Jul 2013 11:53 AM
  1. ;;3.0;IMAGING;**138**;Mar 19, 2002;Build 5380;Sep 03, 2013
  1. ;; Per VHA Directive 2004-038, this routine should not be modified.
  1. ;; +---------------------------------------------------------------+
  1. ;; | Property of the US Government. |
  1. ;; | No permission to copy or redistribute this software is given. |
  1. ;; | Use of unreleased versions of this software requires the user |
  1. ;; | to execute a written test agreement with the VistA Imaging |
  1. ;; | Development Office of the Department of Veterans Affairs, |
  1. ;; | telephone (301) 734-0100. |
  1. ;; | The Food and Drug Administration classifies this software as |
  1. ;; | a medical device. As such, it may not be changed in any way. |
  1. ;; | Modifications to this software may result in an adulterated |
  1. ;; | medical device under 21CFR820, the use of which is considered |
  1. ;; | to be a violation of US Federal Statutes. |
  1. ;; +---------------------------------------------------------------+
  1. ;;
  1. Q
  1. ;
  1. NTESEGC(SEGELTS,FILE,IENSX,ACNUMB,IX) ;create a NTE segment for comments
  1. N FLDSETID S FLDSETID=1 ; set ID field number
  1. N FLDCMTSRC S FLDCMTSRC=2 ; source of comment field number
  1. N FLDCMTTEXT S FLDCMTTEXT=3 ; comment field number
  1. N FLDCMTTYPE S FLDCMTTYPE=4 ; comment type field number
  1. N SETID ; --- counters used for message segments
  1. N ERRSTAT S ERRSTAT=0 ; error status - assume nothing to report
  1. ;
  1. K SEGELTS ; always refresh *segment* array (not message array) on entry
  1. ;
  1. D SET^HLOAPI(.SEGELTS,"NTE",0) ; segment type
  1. D ; set up fields, check exit flag after each
  1. . S SETID=$G(SETID("NTE"))+1,SETID("NTE")=SETID
  1. . D Q:ERRSTAT ; NTE-1-set ID
  1. . . D SET^HLOAPI(.SEGELTS,SETID,FLDSETID)
  1. . . Q
  1. . D Q:ERRSTAT ; NTE-2-source of comment
  1. . . D SET^HLOAPI(.SEGELTS,"L",FLDCMTSRC)
  1. . . Q
  1. . D Q:ERRSTAT ; NTE-3-comment
  1. . . N COMMENT
  1. . . S COMMENT=$G(@LABDATA@(FILE("COMMENT"),IENSX,.01,"I"))
  1. . . D SET^HLOAPI(.SEGELTS,COMMENT,FLDCMTTEXT)
  1. . . Q
  1. . D Q:ERRSTAT ; NTE-4-comment type
  1. . . D SET^HLOAPI(.SEGELTS,"I",FLDCMTTYPE,1)
  1. . . Q
  1. . Q
  1. ;
  1. Q ERRSTAT
  1. ;
  1. NTESEGT(SEGELTS,TEXT) ; create a NTE segment for text objects
  1. N FLDSETID S FLDSETID=1 ; set ID field number
  1. N FLDCMTSRC S FLDCMTSRC=2 ; source of comment field number
  1. N FLDCMTTEXT S FLDCMTTEXT=3 ; comment field number
  1. N FLDCMTTYPE S FLDCMTTYPE=4 ; comment type field number
  1. N SETID ; --- counters used for message segments
  1. N ERRSTAT S ERRSTAT=0 ; error status - assume nothing to report
  1. ;
  1. K SEGELTS ; always refresh *segment* array (not message array) on entry
  1. ;
  1. D SET^HLOAPI(.SEGELTS,"NTE",0) ; segment type
  1. D ; set up fields, check exit flag after each
  1. . S SETID=$G(SETID("NTE"))+1,SETID("NTE")=SETID
  1. . D Q:ERRSTAT ; NTE-1-set ID
  1. . . D SET^HLOAPI(.SEGELTS,SETID,FLDSETID)
  1. . . Q
  1. . D Q:ERRSTAT ; NTE-2-source of comment
  1. . . D SET^HLOAPI(.SEGELTS,"L",FLDCMTSRC)
  1. . . Q
  1. . D Q:ERRSTAT ; NTE-3-comment
  1. . . D SET^HLOAPI(.SEGELTS,TEXT,FLDCMTTEXT)
  1. . . Q
  1. . D Q:ERRSTAT ; NTE-4-comment type
  1. . . D SET^HLOAPI(.SEGELTS,"I",FLDCMTTYPE,1)
  1. . . Q
  1. . Q
  1. ;
  1. Q ERRSTAT