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

VAQPAR6.m

Go to the documentation of this file.
  1. VAQPAR6 ;ALB/JRP - MESSAGE PARSING;28-APR-93
  1. ;;1.5;PATIENT DATA EXCHANGE;;NOV 17, 1993
  1. PARSE(ARRAY) ;PARSING OF VERSION 1.5 TRANSMISSION
  1. ;INPUT : ARRAY - Parsing array (full global reference)
  1. ; (As defined by MailMan)
  1. ; XMFROM, XMREC, XMZ
  1. ; (Declared in SERVER^VAQADM2)
  1. ; XMER, XMRG, XMPOS
  1. ;OUTPUT : XMER - Exit condition
  1. ; 0 = Success
  1. ; -1^Error_Text = Error
  1. ; XMPOS - Last line [number] read in transmission
  1. ; (if NULL end of transmission reached)
  1. ;NOTES : Parsing array will have the following format
  1. ; ARRAY(MessageNumber,BlockName,BlockSeq,LineNumber) = Value
  1. ; [BlockSeq used to keep blocks of same name from
  1. ; overwritting each other. This will typically be '1'
  1. ; except for DATA & DISPLAY blocks.]
  1. ; [MessageNumber is not XMZ ... it denotes the message
  1. ; number withing the transmission]
  1. ; : Calling routine responsible for ARRAY clean up before
  1. ; and after call
  1. ;
  1. ;CHECK INPUT
  1. I ($G(ARRAY)="") S XMER="-1^Did not pass reference to parsing array" Q
  1. ;DECLARE VARIABLES
  1. N MESSAGE,DONE
  1. S XMER=0
  1. ;READ TRANSMISSION
  1. X XMREC
  1. I ((XMER<0)!(XMRG="")) S XMER="-1^Transmission did not contain any information" Q
  1. I (XMRG'="$TRANSMIT") S XMER="-1^Not a valid transmission" Q
  1. S MESSAGE=0
  1. S DONE=0
  1. ;PARSE TRANSMISSION
  1. F D Q:((XMER<0)!(DONE))
  1. .X XMREC
  1. .;END OF TRANSMISSION REACHED
  1. .I (XMRG="$$TRANSMIT") S XMER=0,DONE=1 Q
  1. .;REACHED END OF MAILMAN MESSAGE
  1. .I (XMER<0) S XMER="-1^End of transmission was not designated" Q
  1. .;BEGINNING OF A MESSAGE
  1. .I (XMRG="$MESSAGE") D Q
  1. ..S MESSAGE=MESSAGE+1
  1. ..;PARSE MESSAGE
  1. ..D MESSAGE^VAQPAR60(ARRAY,MESSAGE)
  1. .;EVERYTHING ELSE IS IGNORED
  1. Q