Class Hl7v2Based<C extends Composite>
java.lang.Object
org.openehealth.ipf.commons.ihe.xds.core.metadata.Hl7v2Based<C>
- Type Parameters:
C
- HAPI composite type which corresponds to the HL7 v2 element.
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
Address
,AssigningAuthority
,Code
,Identifiable
,Name
,Organization
,Person
,ReferenceId
,Telecom
An XDS model object backed up by an HL7 v2 element.
- Author:
- Dmytro Rud
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Hl7v2Based.Holder<T extends Type>
Fake enclosing element for an HL7 v2 sub-component, necessary for correct rendering and parsing. -
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
Default constructor, for serialization purposes only.protected
Hl7v2Based
(C hapiObject) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected static Integer
protected static Long
boolean
isEmpty()
static <C extends Composite,
T extends Hl7v2Based<C>>
TParses the given HL7 v2 element into an XDS simplified model object.static String
rawRender
(Hl7v2Based xdsModelObject) Renders the given XDS model object as an HL7 v2 element without applying IHE TF rules regarding unwanted components.protected String
render()
Renders this XDS model object using the XDS-specificHL7 v2 renderer
, i.e.static String
render
(Hl7v2Based xdsModelObject) Renders the given XDS model object as an HL7 v2 element according to the XDS specification, i.e.protected static void
setAssigningAuthority
(AssigningAuthority assigningAuthority, HD target) Helper method used for copying data elements of an assigning authority.protected static void
protected static void
-
Field Details
-
MESSAGE
-
-
Constructor Details
-
Hl7v2Based
protected Hl7v2Based()Default constructor, for serialization purposes only. -
Hl7v2Based
Constructor.- Parameters:
hapiObject
- HAPI composite object.
-
-
Method Details
-
parse
public static <C extends Composite,T extends Hl7v2Based<C>> T parse(String hl7String, Class<T> xdsModelClass) Parses the given HL7 v2 element into an XDS simplified model object.- Type Parameters:
C
- class of HAPI composite object which should hold the HL7 element.T
- class of XDS model object.- Parameters:
hl7String
- HL7 v2 element as a String.xdsModelClass
- class of the XDS model object to be generates.- Returns:
- generated XDS model object or
null
when the given HL7 v2 element isnull
or empty.
-
render
Renders this XDS model object using the XDS-specificHL7 v2 renderer
, i.e. with applying IHE TF rules regarding unwanted components.- Returns:
- HL7 v2 representation of this XDS model object, may be an empty String.
-
render
Renders the given XDS model object as an HL7 v2 element according to the XDS specification, i.e. with applying IHE TF rules regarding unwanted components.- Parameters:
xdsModelObject
- XDS model object.- Returns:
- HL7 v2 representation of the given object, or
null
when the given object isnull
or empty.
-
rawRender
Renders the given XDS model object as an HL7 v2 element without applying IHE TF rules regarding unwanted components.- Parameters:
xdsModelObject
- XDS model object.- Returns:
- HL7 v2 representation of the given object, or an empty string
when the given object is
null
or empty.
-
isEmpty
public boolean isEmpty()- Returns:
true
if this XDS model object does not contain any usable data.
-
getHapiObject
- Returns:
- HAPI composite holding the HL7 v2 element which corresponds to this XDS model object.
-
setValue
-
setValue
-
getIntegerValue
-
getLongValue
-
setAssigningAuthority
Helper method used for copying data elements of an assigning authority.- Parameters:
assigningAuthority
- source assigning authority.target
- target HL7 v2 HD element.
-