source: FOIAVistA/trunk/r/CLINICAL_PROCEDURES-MD/MDHL7M1.m@ 1501

Last change on this file since 1501 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 1.6 KB
Line 
1MDHL7M1 ; HOIFO/WAA - Muse EKG ; [02-06-2002 16:13]
2 ;;1.0;CLINICAL PROCEDURES;;Apr 01, 2004
3OBX ; [Procedure] Process OBX
4 N MDATT,PROC
5 D ATT^MDHL7U(DEVIEN,.MDATT) Q:MDATT<1
6 S PROC=0
7 F S PROC=$O(MDATT(PROC)) Q:PROC<1 D
8 . N PROCESS
9 . S PROCESS=$P(MDATT(PROC),";",5)
10 . I PROCESS="UUEN^MDHL7U1" D ENCODE Q
11 . D @PROCESS
12 . Q
13 Q:'MDIEN
14 D REX^MDHL7U1(MDIEN)
15 D GENACK^MDHL7X
16 Q
17 ;
18ENCODE ; [Procedure] Process to the correct format
19 N CNT,FTYPE,LINE,LINE2
20 K ^TMP($J,"MDHL7M1")
21 S CNT=0
22 F S CNT=$O(^TMP($J,"MDHL7A",CNT)) Q:CNT<1 D
23 . N LCNT,CNT2
24 . S LCNT=0
25 . Q:$E(^TMP($J,"MDHL7A",CNT),1)'="Z"
26 . S FTYPE=".PDF",LINE2=""
27 . S LINE=$P(^TMP($J,"MDHL7A",CNT),"|",4)
28 . S LINE=$E(LINE,$L($P(LINE,"\X0D\\X0A\"))+11,$L(LINE))
29 . S CNT2=0
30 . D TR(.LINE,.LINE2)
31 . Q
32 M ^TMP($J,"MDHL7","UUENCODE")=^TMP($J,"MDHL7M1")
33 D @PROCESS
34 K ^TMP($J,"MDHL7M1")
35 Q
36 ;
37TR(LINE,LINE2) ; [Procedure] PARCE out the line and save the new file format
38 N LLEN,I,X
39 S I=0
40TR2 D INC Q:LINE=""
41 S X=$E(LINE,I)
42 I X="\" D TRANS
43 S LINE2=LINE2_X
44 G TR2
45 Q
46INC ; INCREMENT I
47 I (I+1)>$L(LINE) D
48 . S I=0,CNT2=CNT2+1
49 . S LINE=$G(^TMP($J,"MDHL7A",CNT,CNT2))
50 . Q
51 Q:LINE=""
52 S I=I+1
53 Q
54TRANS ; TRANSLATE X TO THE CORRECT VALUE
55 D INC Q:LINE=""
56 S X=$E(LINE,I)
57 I X="F" S X="|" D INC Q
58 I X="S" S X="^" D INC Q
59 I X="T" S X="&" D INC Q
60 I X="E" S X="\" D INC Q
61 I X="R" S X="~" D INC Q
62 I X="X" D
63 . D INC Q:LINE=""
64 . D INC Q:LINE=""
65 . S X=$E(LINE,I)
66 . I X="D" D INC S LCNT=LCNT+1 D
67 .. I LINE2'="end",LINE2'="" S ^TMP($J,"MDHL7M1",LCNT)=LINE2,X=""
68 .. N Y
69 .. F Y=1:1:5 D INC Q:LINE=""
70 .. S LINE2=""
71 .. Q
72 . Q
73 Q
Note: See TracBrowser for help on using the repository browser.