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

MDHL7M1.m

Go to the documentation of this file.
  1. MDHL7M1 ; HOIFO/WAA - Muse EKG ; [02-06-2002 16:13]
  1. ;;1.0;CLINICAL PROCEDURES;;Apr 01, 2004
  1. OBX ; [Procedure] Process OBX
  1. N MDATT,PROC
  1. D ATT^MDHL7U(DEVIEN,.MDATT) Q:MDATT<1
  1. S PROC=0
  1. F S PROC=$O(MDATT(PROC)) Q:PROC<1 D
  1. . N PROCESS
  1. . S PROCESS=$P(MDATT(PROC),";",5)
  1. . I PROCESS="UUEN^MDHL7U1" D ENCODE Q
  1. . D @PROCESS
  1. . Q
  1. Q:'MDIEN
  1. D REX^MDHL7U1(MDIEN)
  1. D GENACK^MDHL7X
  1. Q
  1. ;
  1. ENCODE ; [Procedure] Process to the correct format
  1. N CNT,FTYPE,LINE,LINE2
  1. K ^TMP($J,"MDHL7M1")
  1. S CNT=0
  1. F S CNT=$O(^TMP($J,"MDHL7A",CNT)) Q:CNT<1 D
  1. . N LCNT,CNT2
  1. . S LCNT=0
  1. . Q:$E(^TMP($J,"MDHL7A",CNT),1)'="Z"
  1. . S FTYPE=".PDF",LINE2=""
  1. . S LINE=$P(^TMP($J,"MDHL7A",CNT),"|",4)
  1. . S LINE=$E(LINE,$L($P(LINE,"\X0D\\X0A\"))+11,$L(LINE))
  1. . S CNT2=0
  1. . D TR(.LINE,.LINE2)
  1. . Q
  1. M ^TMP($J,"MDHL7","UUENCODE")=^TMP($J,"MDHL7M1")
  1. D @PROCESS
  1. K ^TMP($J,"MDHL7M1")
  1. Q
  1. ;
  1. TR(LINE,LINE2) ; [Procedure] PARCE out the line and save the new file format
  1. N LLEN,I,X
  1. S I=0
  1. TR2 D INC Q:LINE=""
  1. S X=$E(LINE,I)
  1. I X="\" D TRANS
  1. S LINE2=LINE2_X
  1. G TR2
  1. Q
  1. INC ; INCREMENT I
  1. I (I+1)>$L(LINE) D
  1. . S I=0,CNT2=CNT2+1
  1. . S LINE=$G(^TMP($J,"MDHL7A",CNT,CNT2))
  1. . Q
  1. Q:LINE=""
  1. S I=I+1
  1. Q
  1. TRANS ; TRANSLATE X TO THE CORRECT VALUE
  1. D INC Q:LINE=""
  1. S X=$E(LINE,I)
  1. I X="F" S X="|" D INC Q
  1. I X="S" S X="^" D INC Q
  1. I X="T" S X="&" D INC Q
  1. I X="E" S X="\" D INC Q
  1. I X="R" S X="~" D INC Q
  1. I X="X" D
  1. . D INC Q:LINE=""
  1. . D INC Q:LINE=""
  1. . S X=$E(LINE,I)
  1. . I X="D" D INC S LCNT=LCNT+1 D
  1. .. I LINE2'="end",LINE2'="" S ^TMP($J,"MDHL7M1",LCNT)=LINE2,X=""
  1. .. N Y
  1. .. F Y=1:1:5 D INC Q:LINE=""
  1. .. S LINE2=""
  1. .. Q
  1. . Q
  1. Q