Class Hl7v2Based<C extends ca.uhn.hl7v2.model.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
public abstract class Hl7v2Based<C extends ca.uhn.hl7v2.model.Composite>
extends Object
implements Serializable
An XDS model object backed up by an HL7 v2 element.
- Author:
- Dmytro Rud
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classHl7v2Based.Holder<T extends ca.uhn.hl7v2.model.Type>Fake enclosing element for an HL7 v2 sub-component, necessary for correct rendering and parsing. -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefault constructor, for serialization purposes only.protectedHl7v2Based(C hapiObject) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected static IntegergetIntegerValue(ca.uhn.hl7v2.model.Primitive p) protected static LonggetLongValue(ca.uhn.hl7v2.model.Primitive p) booleanisEmpty()static <C extends ca.uhn.hl7v2.model.Composite,T extends Hl7v2Based<C>>
TParses the given HL7 v2 element into an XDS simplified model object.static StringrawRender(Hl7v2Based<?> xdsModelObject) Renders the given XDS model object as an HL7 v2 element without applying IHE TF rules regarding unwanted components.protected Stringrender()Renders this XDS model object using the XDS-specificHL7 v2 renderer, i.e. with applying IHE TF rules regarding unwanted components.static Stringrender(Hl7v2Based<?> xdsModelObject) 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.protected static voidsetAssigningAuthority(AssigningAuthority assigningAuthority, ca.uhn.hl7v2.model.v25.datatype.HD target) Helper method used for copying data elements of an assigning authority.protected static voidprotected static void
-
Field Details
-
MESSAGE
protected static final ca.uhn.hl7v2.model.Message 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 ca.uhn.hl7v2.model.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
nullwhen the given HL7 v2 element isnullor 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
nullwhen the given object isnullor 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
nullor empty.
-
isEmpty
public boolean isEmpty()- Returns:
trueif 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
protected static void setAssigningAuthority(AssigningAuthority assigningAuthority, ca.uhn.hl7v2.model.v25.datatype.HD target) Helper method used for copying data elements of an assigning authority.- Parameters:
assigningAuthority- source assigning authority.target- target HL7 v2 HD element.
-