- MDUXMLOX ; HOIFO/WAA -OBX converter XML text ; 7/26/00
- ;;1.0;CLINICAL PROCEDURES;**6**;Apr 01, 2004;Build 102
- ; OBX for the XML Parser
- ;
- OBX D XML^MDUXMLU1("<OBSERVATION>")
- D BLDXML^MDUXMLU1("SEQUENCE",$P(LINE,DL,2))
- D XML^MDUXMLU1("<CODE>")
- D BLDXML^MDUXMLU1("SCHEME",DEVICE)
- I $P($P(LINE,DL,4),"^")="",$P($P(LINE,DL,4),"^",2)'="" S $P(LINE,DL,4)=$P($P(LINE,DL,4),"^",2)
- D BLDXML^MDUXMLU1("VALUE",$P(LINE,DL,4))
- D BLDXML^MDUXMLU1("ORIGINAL","Y")
- D XML^MDUXMLU1("</CODE>")
- D BLDXML^MDUXMLU1("DATATYPE",$P(LINE,DL,3))
- I $P(LINE,DL,3)="FT" D FREE
- E D BLDXML^MDUXMLU1("VALUE",$P(LINE,DL,6))
- D BLDXML^MDUXMLU1("UNITS",$P(LINE,DL,7))
- I $P(LINE,DL,8)'="" D
- . N RANGE
- . S RANGE=$P(LINE,DL,8)
- . D XML^MDUXMLU1("<REFERENCE_RANGE>")
- . D BLDXML^MDUXMLU1("LOW",$P(RANGE,"-",1))
- . D BLDXML^MDUXMLU1("HIGH",$P(RANGE,"-",2))
- . D XML^MDUXMLU1("</REFERENCE_RANGE>")
- D XML^MDUXMLU1("</OBSERVATION>")
- Q
- FREE ; This will process free test
- D XML^MDUXMLU1("<VALUE>")
- N I,X,FREE,DATA
- S I=1
- D XML^MDUXMLU1($P(LINE,DL,6)) ; First line
- S X=0
- F S X=$O(^TMP($J,"MDHL7A",NUM,X)) Q:X<1 D
- . S DATA=$G(^TMP($J,"MDHL7A",NUM,X)) Q:DATA=""
- . S DATA=$$VAL^MDUXMLU1($P(DATA,DL))
- . D XML^MDUXMLU1(DATA)
- . Q
- ; ^--- THIS STUFF THE DATA INTO THE DATA ARRAY
- D XML^MDUXMLU1("</VALUE>")
- Q
- --- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HMDUXMLOX 1325 printed Mar 13, 2025@20:49:06 Page 2
- MDUXMLOX ; HOIFO/WAA -OBX converter XML text ; 7/26/00
- +1 ;;1.0;CLINICAL PROCEDURES;**6**;Apr 01, 2004;Build 102
- +2 ; OBX for the XML Parser
- +3 ;
- OBX DO XML^MDUXMLU1("<OBSERVATION>")
- +1 DO BLDXML^MDUXMLU1("SEQUENCE",$PIECE(LINE,DL,2))
- +2 DO XML^MDUXMLU1("<CODE>")
- +3 DO BLDXML^MDUXMLU1("SCHEME",DEVICE)
- +4 IF $PIECE($PIECE(LINE,DL,4),"^")=""
- IF $PIECE($PIECE(LINE,DL,4),"^",2)'=""
- SET $PIECE(LINE,DL,4)=$PIECE($PIECE(LINE,DL,4),"^",2)
- +5 DO BLDXML^MDUXMLU1("VALUE",$PIECE(LINE,DL,4))
- +6 DO BLDXML^MDUXMLU1("ORIGINAL","Y")
- +7 DO XML^MDUXMLU1("</CODE>")
- +8 DO BLDXML^MDUXMLU1("DATATYPE",$PIECE(LINE,DL,3))
- +9 IF $PIECE(LINE,DL,3)="FT"
- DO FREE
- +10 IF '$TEST
- DO BLDXML^MDUXMLU1("VALUE",$PIECE(LINE,DL,6))
- +11 DO BLDXML^MDUXMLU1("UNITS",$PIECE(LINE,DL,7))
- +12 IF $PIECE(LINE,DL,8)'=""
- Begin DoDot:1
- +13 NEW RANGE
- +14 SET RANGE=$PIECE(LINE,DL,8)
- +15 DO XML^MDUXMLU1("<REFERENCE_RANGE>")
- +16 DO BLDXML^MDUXMLU1("LOW",$PIECE(RANGE,"-",1))
- +17 DO BLDXML^MDUXMLU1("HIGH",$PIECE(RANGE,"-",2))
- +18 DO XML^MDUXMLU1("</REFERENCE_RANGE>")
- End DoDot:1
- +19 DO XML^MDUXMLU1("</OBSERVATION>")
- +20 QUIT
- FREE ; This will process free test
- +1 DO XML^MDUXMLU1("<VALUE>")
- +2 NEW I,X,FREE,DATA
- +3 SET I=1
- +4 ; First line
- DO XML^MDUXMLU1($PIECE(LINE,DL,6))
- +5 SET X=0
- +6 FOR
- SET X=$ORDER(^TMP($JOB,"MDHL7A",NUM,X))
- if X<1
- QUIT
- Begin DoDot:1
- +7 SET DATA=$GET(^TMP($JOB,"MDHL7A",NUM,X))
- if DATA=""
- QUIT
- +8 SET DATA=$$VAL^MDUXMLU1($PIECE(DATA,DL))
- +9 DO XML^MDUXMLU1(DATA)
- +10 QUIT
- End DoDot:1
- +11 ; ^--- THIS STUFF THE DATA INTO THE DATA ARRAY
- +12 DO XML^MDUXMLU1("</VALUE>")
- +13 QUIT