HLOPRS2 ;ALB/CJM-HL7 - Developer API's for parsing messages(continued) ;02/04/2004
;;1.6;HEALTH LEVEL SEVEN;**131**;Oct 13, 1995;Build 10
;
GETTS(SEG,VALUE,FIELD,COMP,REP) ;
;Gets a segment value that is a timestamp in HL7 format and converts it
;to FileMan format. IF the segment value included the timezone, it is
;the timestamp is converted to local time. The degree of precision
;is optionally returned.
;
;IF the component is specified, then the component is parsed for data type rather than at the higher field level.
;
;
;Input:
; SEG - (required, pass by reference) The array returned by a call to $$NEXTSEG^HLOPRS.
; FIELD - The sequence # of the field.
; COMP (optional) If specified, the data type is parsed as a component value.
; REP - The occurrence # (optional, defaults to 1). For a non-repeating fields, this parameter is not necessary.
;Output:
; VALUE (required) The date/time in FileMan format.
; VALUE("PRECISION") (optional) If needed, VALUE must be passed by
; reference. Expected values are:
; "S" - second
; "M" - minute
; "H" - hour
; "D" - day
; "L" - month
; "Y" - year
; "" - precision not specified
; Note: FM does not allow greater precision than seconds, so this API will round off to the second.
;
N TIME,PREC,VAR
Q:'$G(FIELD)
I '$G(COMP) D
.S VAR="COMP",SUB=1
E D
.S VAR="SUB"
S:'$G(REP) REP=1
S @VAR=1,TIME=$$GET^HLOPRS(.SEG,FIELD,COMP,SUB,REP)
S @VAR=2,PREC=$$GET^HLOPRS(.SEG,FIELD,COMP,SUB,REP)
S VALUE=$$HL7TFM^XLFDT(TIME)
I '$L(PREC) D
.I $L(+TIME)>12 S PREC="S" Q
.I $L(+TIME)>10 S PREC="M" Q
.I $L(+TIME)>8 S PREC="H" Q
.I $L(+TIME)>6 S PREC="D" Q
.I $L(+TIME)>4 S PREC="L" Q
.I $L(+TIME)=4 S PREC="Y" Q
S VALUE("PRECISION")=PREC
Q
;
GETDT(SEG,VALUE,FIELD,COMP,REP) ;
;Gets a segment value that is a date in HL7 format and converts it to FileMan format. The degree of precision is optionally returned.
;IF the component is specified, then the component is parsed for data type rather than at the higher field level.
;
;Input:
; SEG - (required, pass by reference) The array returned by a call to $$NEXTSEG^HLOPRS.
; FIELD - The sequence # of the field.
; COMP (optional) If specified, the data type is parsed as a component value.
; REP - the occurrence# (optional, defaults to 1) For a non-repeating fields, this parameter is not necessary.
;Output:
; VALUE (required) The date/time in FileMan format.
; VALUE("PRECISION") (optional) If needed, VALUE must be passed by
; reference. Expected values are:
; "S" - second (not valid for DT)
; "M" - minute (not valid for DT)
; "H" - hour (not valid for DT)
; "D" - day
; "L" - month
; "Y" - year
; "" - not specified
;
N TIME,PREC,VAR
Q:'$G(FIELD)
I '$G(COMP) D
.S VAR="COMP",SUB=1
E D
.S VAR="SUB"
S:'$G(REP) REP=1
S @VAR=1,TIME=$$GET^HLOPRS(.SEG,FIELD,COMP,SUB,REP)
S VALUE=$$HL7TFM^XLFDT(TIME)
S PREC=""
D
.I $L(+TIME)>12 S PREC="S" Q
.I $L(+TIME)>10 S PREC="M" Q
.I $L(+TIME)>8 S PREC="H" Q
.I $L(+TIME)>6 S PREC="D" Q
.I $L(+TIME)>4 S PREC="L" Q
.I $L(+TIME)=4 S PREC="Y" Q
S VALUE("PRECISION")=PREC
Q
;
GETCE(SEG,VALUE,FIELD,COMP,REP) ;
;Gets an CE data type(Coded Element, HL7 Section Reference 2.9.8) from the specified field.
;IF the component is specified, then the component is parsed for data type rather than at the higher field level.
;
;Input:
; SEG - (required, pass by reference) The array returned by a call to NEXTSEG^HLOPRS.
; FIELD (required) The sequence # of the field.
; COMP (optional) If specified, the data type is parsed as a component value.
; REP - The occurrence # (optional, defaults to 1). For a non-repeating fields, this parameter is not necessary.
;Output:
; VALUE (required, pass-by-reference) These subscripts are returned:
; "ID" - the identifier
; "TEXT" -
; "SYSTEM" - name of the code system
; "ALTERNATE ID" - alternate identifier
; "ALTERNATE TEXT"
; "ALTERNATE SYSTEM" - name of the alternate coding system
;
N SUB,VAR
Q:'$G(FIELD)
S:'$G(REP) REP=1
I '$G(COMP) D
.S VAR="COMP",SUB=1
E D
.S VAR="SUB"
S @VAR=1,VALUE("ID")=$$GET^HLOPRS(.SEG,FIELD,COMP,SUB,REP)
S @VAR=2,VALUE("TEXT")=$$GET^HLOPRS(.SEG,FIELD,COMP,SUB,REP)
S @VAR=3,VALUE("SYSTEM")=$$GET^HLOPRS(.SEG,FIELD,COMP,SUB,REP)
S @VAR=4,VALUE("ALTERNATE ID")=$$GET^HLOPRS(.SEG,FIELD,COMP,SUB,REP)
S @VAR=5,VALUE("ALTERNATE TEXT")=$$GET^HLOPRS(.SEG,FIELD,COMP,SUB,REP)
S @VAR=6,VALUE("ALTERNATE SYSTEM")=$$GET^HLOPRS(.SEG,FIELD,COMP,SUB,REP)
Q
;
GETHD(SEG,VALUE,FIELD,COMP,REP) ;
;Gets an HD data type (Hierarchic Designator, HL7 Section Reference 2.9.21) from the specified field.
;IF the component is specified, then the component is parsed for data type rather than at the higher field level.
;
;Input:
; SEG - (required, pass by reference) The array returned by a call to NEXTSEG^HLOPRS.
; FIELD (required) The sequence # of the field.
; COMP (optional) If specified, the data type is parsed as a component value.
; REP - The occurrence # (optional, defaults to 1). For a non-repeating fields, this parameter is not necessary.
;Output:
; VALUE (required, pass-by-reference) These subscripts are returned:
; "NAMESPACE ID"
; "UNIVERSAL ID"
; "UNIVERSAL ID TYPE"
;
N SUB,VAR
Q:'$G(FIELD)
S:'$G(REP) REP=1
I '$G(COMP) D
.S VAR="COMP",SUB=1
E D
.S VAR="SUB"
S @VAR=1,VALUE("NAMESPACE ID")=$$GET^HLOPRS(.SEG,FIELD,COMP,SUB,REP)
S @VAR=2,VALUE("UNIVERSAL ID")=$$GET^HLOPRS(.SEG,FIELD,COMP,SUB,REP)
S @VAR=3,VALUE("UNIVERSAL ID TYPE")=$$GET^HLOPRS(.SEG,FIELD,COMP,SUB,REP)
Q
;
GETCNE(SEG,VALUE,FIELD,COMP,REP) ;
;Gets an CNE data type (Coded With No Exceptions, HL7 Section Reference 2.9.8) from the specified field.
;IF the component is specified, then the component is parsed for data type rather than at the higher field level.
;
;Input:
; SEG - (required, pass by reference) The array returned by a call to NEXTSEG^HLOPRS.
; FIELD (required) The sequence # of the field.
; COMP (optional) If specified, the data type is parsed as a component value.
; REP - The occurrence # (optional, defaults to 1). For a non-repeating fields, this parameter is not necessary.
;Output:
; VALUE (required, pass-by-reference) These subscripts are returned:
; "ID" - the identifier
; "TEXT" -
; "SYSTEM" - name of the code system
; "ALTERNATE ID" - alternate identifier
; "ALTERNATE TEXT"
; "ALTERNATE SYSTEM" - name of the alternate coding system
; "SYSTEM VERSION" - version ID of the coding system
; "ALTERNATE SYSTEM VERSION" - version ID of the alternate coding system
; "ORIGINAL TEXT"
;
D GETCODE^HLOPRS1(.SEG,.VALUE,.FIELD,.COMP,.REP)
Q
;
GETCWE(SEG,VALUE,FIELD,COMP,REP) ;
;Gets an CWE data type (Coded With Exceptions, HL7 Section Reference 2.9.11) from the specified field.
;IF the component is specified, then the component is parsed for the data type rather than at the higher field level.
;
;Input:
; SEG - (required, pass by reference) The array returned by a call to NEXTSEG^HLOPRS.
; FIELD (required) The sequence # of the field.
; COMP (optional) If specified, the data type is parsed as a component value.
; REP - The occurrence # (optional, defaults to 1). For a non-repeating fields, this parameter is not necessary.
;Output:
; VALUE (required, pass-by-reference) These subscripts are returned:
; "ID" - the identifier
; "TEXT" -
; "SYSTEM" - name of the code system
; "ALTERNATE ID" - alternate identifier
; "ALTERNATE TEXT"
; "ALTERNATE SYSTEM" - name of the alternate coding system
; "SYSTEM VERSION" - version ID of the coding system
; "ALTERNATE SYSTEM VERSION" - version ID of the alternate coding system
; "ORIGINAL TEXT"
D GETCODE^HLOPRS1(.SEG,.VALUE,.FIELD,.COMP,.REP)
Q
;
GETAD(SEG,VALUE,FIELD,COMP,REP) ;
;Gets an AD data type (Address, HL7 Section Reference 2.9.1) from the specified field. It can also be used to get the 1st 8 components of the XAD (Extended Address) data type.
;IF the component is specified, then the component is parsed for the address rather than at the higher field level.
;
;Input:
; SEG - (required, pass by reference) The array returned by a call to NEXTSEG^HLOPRS.
; FIELD (required) The sequence # of the field.
; COMP (optional) If specified, the data type is parsed as a component value.
; REP - The occurrence # (optional, defaults to 1). For a non-repeating fields, this parameter is not necessary.
;Output:
; VALUE (required, pass-by-reference) These subscripts are returned:
; "STREET1" -street address
; "STREET2" - other designation
; "CITY"
; "STATE" - state or province
; "ZIP" - zip or postal code
; "COUNTRY"
; "TYPE" - address type
; "OTHER" - other geographic designation
;
N SUB,VAR
Q:'$G(FIELD)
I '$G(COMP) D
.S VAR="COMP",SUB=1
E D
.S VAR="SUB"
S:'$G(REP) REP=1
S @VAR=1,VALUE("STREET1")=$$GET^HLOPRS(.SEG,FIELD,COMP,SUB,REP)
S @VAR=2,VALUE("STREET2")=$$GET^HLOPRS(.SEG,FIELD,COMP,SUB,REP)
S @VAR=3,VALUE("CITY")=$$GET^HLOPRS(.SEG,FIELD,COMP,SUB,REP)
S @VAR=4,VALUE("STATE")=$$GET^HLOPRS(.SEG,FIELD,COMP,SUB,REP)
S @VAR=5,VALUE("ZIP")=$$GET^HLOPRS(.SEG,FIELD,COMP,SUB,REP)
S @VAR=6,VALUE("COUNTRY")=$$GET^HLOPRS(.SEG,FIELD,COMP,SUB,REP)
S @VAR=7,VALUE("TYPE")=$$GET^HLOPRS(.SEG,FIELD,COMP,SUB,REP)
S @VAR=8,VALUE("OTHER")=$$GET^HLOPRS(.SEG,FIELD,COMP,SUB,REP)
Q
HLOPRS2 ;ALB/CJM-HL7 - Developer API's for parsing messages(continued) ;02/04/2004
+1 ;;1.6;HEALTH LEVEL SEVEN;**131**;Oct 13, 1995;Build 10
+2 ;
GETTS(SEG,VALUE,FIELD,COMP,REP) ;
+1 ;Gets a segment value that is a timestamp in HL7 format and converts it
+2 ;to FileMan format. IF the segment value included the timezone, it is
+3 ;the timestamp is converted to local time. The degree of precision
+4 ;is optionally returned.
+5 ;
+6 ;IF the component is specified, then the component is parsed for data type rather than at the higher field level.
+7 ;
+8 ;
+9 ;Input:
+10 ; SEG - (required, pass by reference) The array returned by a call to $$NEXTSEG^HLOPRS.
+11 ; FIELD - The sequence # of the field.
+12 ; COMP (optional) If specified, the data type is parsed as a component value.
+13 ; REP - The occurrence # (optional, defaults to 1). For a non-repeating fields, this parameter is not necessary.
+14 ;Output:
+15 ; VALUE (required) The date/time in FileMan format.
+16 ; VALUE("PRECISION") (optional) If needed, VALUE must be passed by
+17 ; reference. Expected values are:
+18 ; "S" - second
+19 ; "M" - minute
+20 ; "H" - hour
+21 ; "D" - day
+22 ; "L" - month
+23 ; "Y" - year
+24 ; "" - precision not specified
+25 ; Note: FM does not allow greater precision than seconds, so this API will round off to the second.
+26 ;
+27 NEW TIME,PREC,VAR
+28 IF '$GET(FIELD)
QUIT
+29 IF '$GET(COMP)
Begin DoDot:1
+30 SET VAR="COMP"
SET SUB=1
End DoDot:1
+31 IF '$TEST
Begin DoDot:1
+32 SET VAR="SUB"
End DoDot:1
+33 IF '$GET(REP)
SET REP=1
+34 SET @VAR=1
SET TIME=$$GET^HLOPRS(.SEG,FIELD,COMP,SUB,REP)
+35 SET @VAR=2
SET PREC=$$GET^HLOPRS(.SEG,FIELD,COMP,SUB,REP)
+36 SET VALUE=$$HL7TFM^XLFDT(TIME)
+37 IF '$LENGTH(PREC)
Begin DoDot:1
+38 IF $LENGTH(+TIME)>12
SET PREC="S"
QUIT
+39 IF $LENGTH(+TIME)>10
SET PREC="M"
QUIT
+40 IF $LENGTH(+TIME)>8
SET PREC="H"
QUIT
+41 IF $LENGTH(+TIME)>6
SET PREC="D"
QUIT
+42 IF $LENGTH(+TIME)>4
SET PREC="L"
QUIT
+43 IF $LENGTH(+TIME)=4
SET PREC="Y"
QUIT
End DoDot:1
+44 SET VALUE("PRECISION")=PREC
+45 QUIT
+46 ;
GETDT(SEG,VALUE,FIELD,COMP,REP) ;
+1 ;Gets a segment value that is a date in HL7 format and converts it to FileMan format. The degree of precision is optionally returned.
+2 ;IF the component is specified, then the component is parsed for data type rather than at the higher field level.
+3 ;
+4 ;Input:
+5 ; SEG - (required, pass by reference) The array returned by a call to $$NEXTSEG^HLOPRS.
+6 ; FIELD - The sequence # of the field.
+7 ; COMP (optional) If specified, the data type is parsed as a component value.
+8 ; REP - the occurrence# (optional, defaults to 1) For a non-repeating fields, this parameter is not necessary.
+9 ;Output:
+10 ; VALUE (required) The date/time in FileMan format.
+11 ; VALUE("PRECISION") (optional) If needed, VALUE must be passed by
+12 ; reference. Expected values are:
+13 ; "S" - second (not valid for DT)
+14 ; "M" - minute (not valid for DT)
+15 ; "H" - hour (not valid for DT)
+16 ; "D" - day
+17 ; "L" - month
+18 ; "Y" - year
+19 ; "" - not specified
+20 ;
+21 NEW TIME,PREC,VAR
+22 IF '$GET(FIELD)
QUIT
+23 IF '$GET(COMP)
Begin DoDot:1
+24 SET VAR="COMP"
SET SUB=1
End DoDot:1
+25 IF '$TEST
Begin DoDot:1
+26 SET VAR="SUB"
End DoDot:1
+27 IF '$GET(REP)
SET REP=1
+28 SET @VAR=1
SET TIME=$$GET^HLOPRS(.SEG,FIELD,COMP,SUB,REP)
+29 SET VALUE=$$HL7TFM^XLFDT(TIME)
+30 SET PREC=""
+31 Begin DoDot:1
+32 IF $LENGTH(+TIME)>12
SET PREC="S"
QUIT
+33 IF $LENGTH(+TIME)>10
SET PREC="M"
QUIT
+34 IF $LENGTH(+TIME)>8
SET PREC="H"
QUIT
+35 IF $LENGTH(+TIME)>6
SET PREC="D"
QUIT
+36 IF $LENGTH(+TIME)>4
SET PREC="L"
QUIT
+37 IF $LENGTH(+TIME)=4
SET PREC="Y"
QUIT
End DoDot:1
+38 SET VALUE("PRECISION")=PREC
+39 QUIT
+40 ;
GETCE(SEG,VALUE,FIELD,COMP,REP) ;
+1 ;Gets an CE data type(Coded Element, HL7 Section Reference 2.9.8) from the specified field.
+2 ;IF the component is specified, then the component is parsed for data type rather than at the higher field level.
+3 ;
+4 ;Input:
+5 ; SEG - (required, pass by reference) The array returned by a call to NEXTSEG^HLOPRS.
+6 ; FIELD (required) The sequence # of the field.
+7 ; COMP (optional) If specified, the data type is parsed as a component value.
+8 ; REP - The occurrence # (optional, defaults to 1). For a non-repeating fields, this parameter is not necessary.
+9 ;Output:
+10 ; VALUE (required, pass-by-reference) These subscripts are returned:
+11 ; "ID" - the identifier
+12 ; "TEXT" -
+13 ; "SYSTEM" - name of the code system
+14 ; "ALTERNATE ID" - alternate identifier
+15 ; "ALTERNATE TEXT"
+16 ; "ALTERNATE SYSTEM" - name of the alternate coding system
+17 ;
+18 NEW SUB,VAR
+19 IF '$GET(FIELD)
QUIT
+20 IF '$GET(REP)
SET REP=1
+21 IF '$GET(COMP)
Begin DoDot:1
+22 SET VAR="COMP"
SET SUB=1
End DoDot:1
+23 IF '$TEST
Begin DoDot:1
+24 SET VAR="SUB"
End DoDot:1
+25 SET @VAR=1
SET VALUE("ID")=$$GET^HLOPRS(.SEG,FIELD,COMP,SUB,REP)
+26 SET @VAR=2
SET VALUE("TEXT")=$$GET^HLOPRS(.SEG,FIELD,COMP,SUB,REP)
+27 SET @VAR=3
SET VALUE("SYSTEM")=$$GET^HLOPRS(.SEG,FIELD,COMP,SUB,REP)
+28 SET @VAR=4
SET VALUE("ALTERNATE ID")=$$GET^HLOPRS(.SEG,FIELD,COMP,SUB,REP)
+29 SET @VAR=5
SET VALUE("ALTERNATE TEXT")=$$GET^HLOPRS(.SEG,FIELD,COMP,SUB,REP)
+30 SET @VAR=6
SET VALUE("ALTERNATE SYSTEM")=$$GET^HLOPRS(.SEG,FIELD,COMP,SUB,REP)
+31 QUIT
+32 ;
GETHD(SEG,VALUE,FIELD,COMP,REP) ;
+1 ;Gets an HD data type (Hierarchic Designator, HL7 Section Reference 2.9.21) from the specified field.
+2 ;IF the component is specified, then the component is parsed for data type rather than at the higher field level.
+3 ;
+4 ;Input:
+5 ; SEG - (required, pass by reference) The array returned by a call to NEXTSEG^HLOPRS.
+6 ; FIELD (required) The sequence # of the field.
+7 ; COMP (optional) If specified, the data type is parsed as a component value.
+8 ; REP - The occurrence # (optional, defaults to 1). For a non-repeating fields, this parameter is not necessary.
+9 ;Output:
+10 ; VALUE (required, pass-by-reference) These subscripts are returned:
+11 ; "NAMESPACE ID"
+12 ; "UNIVERSAL ID"
+13 ; "UNIVERSAL ID TYPE"
+14 ;
+15 NEW SUB,VAR
+16 IF '$GET(FIELD)
QUIT
+17 IF '$GET(REP)
SET REP=1
+18 IF '$GET(COMP)
Begin DoDot:1
+19 SET VAR="COMP"
SET SUB=1
End DoDot:1
+20 IF '$TEST
Begin DoDot:1
+21 SET VAR="SUB"
End DoDot:1
+22 SET @VAR=1
SET VALUE("NAMESPACE ID")=$$GET^HLOPRS(.SEG,FIELD,COMP,SUB,REP)
+23 SET @VAR=2
SET VALUE("UNIVERSAL ID")=$$GET^HLOPRS(.SEG,FIELD,COMP,SUB,REP)
+24 SET @VAR=3
SET VALUE("UNIVERSAL ID TYPE")=$$GET^HLOPRS(.SEG,FIELD,COMP,SUB,REP)
+25 QUIT
+26 ;
GETCNE(SEG,VALUE,FIELD,COMP,REP) ;
+1 ;Gets an CNE data type (Coded With No Exceptions, HL7 Section Reference 2.9.8) from the specified field.
+2 ;IF the component is specified, then the component is parsed for data type rather than at the higher field level.
+3 ;
+4 ;Input:
+5 ; SEG - (required, pass by reference) The array returned by a call to NEXTSEG^HLOPRS.
+6 ; FIELD (required) The sequence # of the field.
+7 ; COMP (optional) If specified, the data type is parsed as a component value.
+8 ; REP - The occurrence # (optional, defaults to 1). For a non-repeating fields, this parameter is not necessary.
+9 ;Output:
+10 ; VALUE (required, pass-by-reference) These subscripts are returned:
+11 ; "ID" - the identifier
+12 ; "TEXT" -
+13 ; "SYSTEM" - name of the code system
+14 ; "ALTERNATE ID" - alternate identifier
+15 ; "ALTERNATE TEXT"
+16 ; "ALTERNATE SYSTEM" - name of the alternate coding system
+17 ; "SYSTEM VERSION" - version ID of the coding system
+18 ; "ALTERNATE SYSTEM VERSION" - version ID of the alternate coding system
+19 ; "ORIGINAL TEXT"
+20 ;
+21 DO GETCODE^HLOPRS1(.SEG,.VALUE,.FIELD,.COMP,.REP)
+22 QUIT
+23 ;
GETCWE(SEG,VALUE,FIELD,COMP,REP) ;
+1 ;Gets an CWE data type (Coded With Exceptions, HL7 Section Reference 2.9.11) from the specified field.
+2 ;IF the component is specified, then the component is parsed for the data type rather than at the higher field level.
+3 ;
+4 ;Input:
+5 ; SEG - (required, pass by reference) The array returned by a call to NEXTSEG^HLOPRS.
+6 ; FIELD (required) The sequence # of the field.
+7 ; COMP (optional) If specified, the data type is parsed as a component value.
+8 ; REP - The occurrence # (optional, defaults to 1). For a non-repeating fields, this parameter is not necessary.
+9 ;Output:
+10 ; VALUE (required, pass-by-reference) These subscripts are returned:
+11 ; "ID" - the identifier
+12 ; "TEXT" -
+13 ; "SYSTEM" - name of the code system
+14 ; "ALTERNATE ID" - alternate identifier
+15 ; "ALTERNATE TEXT"
+16 ; "ALTERNATE SYSTEM" - name of the alternate coding system
+17 ; "SYSTEM VERSION" - version ID of the coding system
+18 ; "ALTERNATE SYSTEM VERSION" - version ID of the alternate coding system
+19 ; "ORIGINAL TEXT"
+20 DO GETCODE^HLOPRS1(.SEG,.VALUE,.FIELD,.COMP,.REP)
+21 QUIT
+22 ;
GETAD(SEG,VALUE,FIELD,COMP,REP) ;
+1 ;Gets an AD data type (Address, HL7 Section Reference 2.9.1) from the specified field. It can also be used to get the 1st 8 components of the XAD (Extended Address) data type.
+2 ;IF the component is specified, then the component is parsed for the address rather than at the higher field level.
+3 ;
+4 ;Input:
+5 ; SEG - (required, pass by reference) The array returned by a call to NEXTSEG^HLOPRS.
+6 ; FIELD (required) The sequence # of the field.
+7 ; COMP (optional) If specified, the data type is parsed as a component value.
+8 ; REP - The occurrence # (optional, defaults to 1). For a non-repeating fields, this parameter is not necessary.
+9 ;Output:
+10 ; VALUE (required, pass-by-reference) These subscripts are returned:
+11 ; "STREET1" -street address
+12 ; "STREET2" - other designation
+13 ; "CITY"
+14 ; "STATE" - state or province
+15 ; "ZIP" - zip or postal code
+16 ; "COUNTRY"
+17 ; "TYPE" - address type
+18 ; "OTHER" - other geographic designation
+19 ;
+20 NEW SUB,VAR
+21 IF '$GET(FIELD)
QUIT
+22 IF '$GET(COMP)
Begin DoDot:1
+23 SET VAR="COMP"
SET SUB=1
End DoDot:1
+24 IF '$TEST
Begin DoDot:1
+25 SET VAR="SUB"
End DoDot:1
+26 IF '$GET(REP)
SET REP=1
+27 SET @VAR=1
SET VALUE("STREET1")=$$GET^HLOPRS(.SEG,FIELD,COMP,SUB,REP)
+28 SET @VAR=2
SET VALUE("STREET2")=$$GET^HLOPRS(.SEG,FIELD,COMP,SUB,REP)
+29 SET @VAR=3
SET VALUE("CITY")=$$GET^HLOPRS(.SEG,FIELD,COMP,SUB,REP)
+30 SET @VAR=4
SET VALUE("STATE")=$$GET^HLOPRS(.SEG,FIELD,COMP,SUB,REP)
+31 SET @VAR=5
SET VALUE("ZIP")=$$GET^HLOPRS(.SEG,FIELD,COMP,SUB,REP)
+32 SET @VAR=6
SET VALUE("COUNTRY")=$$GET^HLOPRS(.SEG,FIELD,COMP,SUB,REP)
+33 SET @VAR=7
SET VALUE("TYPE")=$$GET^HLOPRS(.SEG,FIELD,COMP,SUB,REP)
+34 SET @VAR=8
SET VALUE("OTHER")=$$GET^HLOPRS(.SEG,FIELD,COMP,SUB,REP)
+35 QUIT