diff --git a/.classpath b/.classpath index e9bcd511f1..badcccf588 100644 --- a/.classpath +++ b/.classpath @@ -1,5 +1,5 @@ - + diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs index 589bcbceb4..ecb398fa58 100644 --- a/.settings/org.eclipse.jdt.core.prefs +++ b/.settings/org.eclipse.jdt.core.prefs @@ -5,9 +5,10 @@ org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annota org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate @@ -21,6 +22,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled org.eclipse.jdt.core.compiler.problem.discouragedReference=warning org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore @@ -63,6 +65,7 @@ org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=igno org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled @@ -92,8 +95,10 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning org.eclipse.jdt.core.compiler.problem.unusedWarningToken=ignore org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.5 +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=1.8 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 @@ -101,16 +106,19 @@ org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_c org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 org.eclipse.jdt.core.formatter.alignment_for_assignment=0 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16 org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16 org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16 org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16 org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 @@ -171,9 +179,12 @@ org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert @@ -189,11 +200,12 @@ org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert @@ -223,6 +235,8 @@ org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=inser org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert @@ -246,12 +260,16 @@ org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert @@ -297,6 +315,8 @@ org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do n org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert @@ -332,8 +352,11 @@ org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not inser org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert @@ -359,5 +382,9 @@ org.eclipse.jdt.core.formatter.tabulation.char=tab org.eclipse.jdt.core.formatter.tabulation.size=4 org.eclipse.jdt.core.formatter.use_on_off_tags=false org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true +org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true +org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true +org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true +org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/hapi-base/.classpath b/hapi-base/.classpath index 63cc387026..f5f1febe53 100644 --- a/hapi-base/.classpath +++ b/hapi-base/.classpath @@ -11,18 +11,25 @@ + + + + + + + - + - + diff --git a/hapi-base/.project b/hapi-base/.project index f810e22862..2e2a525f77 100644 --- a/hapi-base/.project +++ b/hapi-base/.project @@ -1,34 +1,27 @@ - hapi-base - HAPI (HL7 application programming interface; pronounced "happy") is an open-source, - object-oriented HL7 2.x parser for Java. HL7 (http://hl7org) is a messaging - specification for healthcare information systems. This project is not affiliated with - the HL7 organization; we are just writing some software that conforms to their - specification. The project was initiated by University Health Network + hapi-base + HAPI (HL7 application programming interface; pronounced "happy") is an open-source, + object-oriented HL7 2.x parser for Java. HL7 (http://hl7org) is a messaging + specification for healthcare information systems. This project is not affiliated with + the HL7 organization; we are just writing some software that conforms to their + specification. The project was initiated by University Health Network (a large multi-site teaching hospital in Toronto, Canada). NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse. - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.wst.common.project.facet.core.builder - - - - - org.eclipse.m2e.core.maven2Builder - - - - - - org.eclipse.m2e.core.maven2Nature - org.eclipse.wst.common.project.facet.core.nature - org.eclipse.jdt.core.javanature - - + + + + org.eclipse.jdt.core.javabuilder + + + org.eclipse.wst.common.project.facet.core.builder + + + org.eclipse.m2e.core.maven2Builder + + + + org.eclipse.m2e.core.maven2Nature + org.eclipse.wst.common.project.facet.core.nature + org.eclipse.jdt.core.javanature + + \ No newline at end of file diff --git a/hapi-base/.settings/org.eclipse.jdt.core.prefs b/hapi-base/.settings/org.eclipse.jdt.core.prefs index 5696c5b53f..8b1fbd6af8 100644 --- a/hapi-base/.settings/org.eclipse.jdt.core.prefs +++ b/hapi-base/.settings/org.eclipse.jdt.core.prefs @@ -5,9 +5,9 @@ org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annota org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate @@ -21,6 +21,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled org.eclipse.jdt.core.compiler.problem.discouragedReference=warning org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore @@ -63,6 +64,7 @@ org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=igno org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled @@ -92,4 +94,5 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/hapi-base/.settings/org.eclipse.wst.common.project.facet.core.xml b/hapi-base/.settings/org.eclipse.wst.common.project.facet.core.xml index 5c9bd7532a..f4bf050d00 100644 --- a/hapi-base/.settings/org.eclipse.wst.common.project.facet.core.xml +++ b/hapi-base/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -1,5 +1,5 @@ - + diff --git a/hapi-base/src/main/java/ca/uhn/hl7v2/Version.java b/hapi-base/src/main/java/ca/uhn/hl7v2/Version.java index b94598f1fa..0d2b0525d0 100644 --- a/hapi-base/src/main/java/ca/uhn/hl7v2/Version.java +++ b/hapi-base/src/main/java/ca/uhn/hl7v2/Version.java @@ -141,6 +141,11 @@ public static Version[] before(Version v) { return versions.toArray(new Version[0]); } + /** + * + * @return name of the $package.model.$version + */ + public String modelPackageName() { String classname = getClass().getName(); String p = classname.substring(0, classname.lastIndexOf(".")); diff --git a/hapi-base/src/main/java/ca/uhn/hl7v2/conf/store/ProfileCodeStore.java b/hapi-base/src/main/java/ca/uhn/hl7v2/conf/store/ProfileCodeStore.java index c64f04e4a1..7830559370 100644 --- a/hapi-base/src/main/java/ca/uhn/hl7v2/conf/store/ProfileCodeStore.java +++ b/hapi-base/src/main/java/ca/uhn/hl7v2/conf/store/ProfileCodeStore.java @@ -7,6 +7,9 @@ import java.util.List; import java.util.Map; +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; + import org.xml.sax.Attributes; import org.xml.sax.XMLReader; import org.xml.sax.helpers.DefaultHandler; @@ -47,7 +50,9 @@ public ProfileCodeStore(String uri) throws ProfileException, IOException { if (uri == null) { throw new ProfileException("The input url parameter cannot be null"); } - XMLReader reader = XMLReaderFactory.createXMLReader(); + SAXParserFactory parserFactory = SAXParserFactory.newInstance(); + SAXParser parser = parserFactory.newSAXParser(); + XMLReader reader = parser.getXMLReader(); reader.setContentHandler(new ProfileCodeStoreHandler()); reader.parse(uri); } catch (IOException e) { diff --git a/hapi-base/src/main/java/ca/uhn/hl7v2/model/AbstractGroup.java b/hapi-base/src/main/java/ca/uhn/hl7v2/model/AbstractGroup.java index 21bff601f6..a5059866f7 100644 --- a/hapi-base/src/main/java/ca/uhn/hl7v2/model/AbstractGroup.java +++ b/hapi-base/src/main/java/ca/uhn/hl7v2/model/AbstractGroup.java @@ -436,6 +436,15 @@ public Structure[] getAll(String name) throws HL7Exception { } return list.toArray(new Structure[0]); } + + public Map> getAllStructure() throws HL7Exception { + Map> map = this.structures; + if (map == null) { + throw new HL7Exception("The structure does not exist"); + } + return map; + } + /** * Returns a list containing all existing repetitions of the structure identified by name diff --git a/hapi-base/src/main/java/ca/uhn/hl7v2/model/AbstractSegment.java b/hapi-base/src/main/java/ca/uhn/hl7v2/model/AbstractSegment.java index 5e16fe5e45..c8be65423d 100644 --- a/hapi-base/src/main/java/ca/uhn/hl7v2/model/AbstractSegment.java +++ b/hapi-base/src/main/java/ca/uhn/hl7v2/model/AbstractSegment.java @@ -135,6 +135,11 @@ public Type[] getField(int number) throws HL7Exception { // the user's // perspective } + + public List> getAllFields() throws HL7Exception { + + return fields; + } /** * @see ca.uhn.hl7v2.model.Segment#isEmpty() diff --git a/hapi-base/src/main/java/ca/uhn/hl7v2/model/Group.java b/hapi-base/src/main/java/ca/uhn/hl7v2/model/Group.java index d0f922c376..04b01103c4 100644 --- a/hapi-base/src/main/java/ca/uhn/hl7v2/model/Group.java +++ b/hapi-base/src/main/java/ca/uhn/hl7v2/model/Group.java @@ -31,6 +31,9 @@ GNU General Public License (the �GPL�), in which case the provisions of the package ca.uhn.hl7v2.model; +import java.util.List; +import java.util.Map; + import ca.uhn.hl7v2.HL7Exception; /** @@ -55,6 +58,9 @@ public interface Group extends Structure { */ Structure[] getAll(String name) throws HL7Exception; + + Map> getAllStructure() throws HL7Exception; + /** * Returns the named structure. If this Structure is repeating then the first * repetition is returned. Creates the Structure if necessary. diff --git a/hapi-base/src/main/java/ca/uhn/hl7v2/model/Segment.java b/hapi-base/src/main/java/ca/uhn/hl7v2/model/Segment.java index 54efe3cd2e..ea0e3b6da0 100644 --- a/hapi-base/src/main/java/ca/uhn/hl7v2/model/Segment.java +++ b/hapi-base/src/main/java/ca/uhn/hl7v2/model/Segment.java @@ -27,6 +27,8 @@ GNU General Public License (the �GPL�), in which case the provisions of the */ package ca.uhn.hl7v2.model; +import java.util.List; + import ca.uhn.hl7v2.HL7Exception; /** @@ -52,6 +54,8 @@ public interface Segment extends Structure { * @throws HL7Exception if field index is out of range. */ Type[] getField(int number) throws HL7Exception; + + List> getAllFields() throws HL7Exception; /** * Returns a specific repetition of field at the specified index. If there exist diff --git a/hapi-base/src/main/java/ca/uhn/hl7v2/model/Unmodifiable.java b/hapi-base/src/main/java/ca/uhn/hl7v2/model/Unmodifiable.java index ce7dc6a1b0..c93f8bc7e7 100644 --- a/hapi-base/src/main/java/ca/uhn/hl7v2/model/Unmodifiable.java +++ b/hapi-base/src/main/java/ca/uhn/hl7v2/model/Unmodifiable.java @@ -33,6 +33,8 @@ GNU General Public License (the "GPL"), in which case the provisions of the GPL import ca.uhn.hl7v2.parser.Parser; import java.io.IOException; +import java.util.List; +import java.util.Map; /** * A static helper class that allows to obtain unmodifiable message wrappers, i.e. all modification to these wrappers @@ -263,6 +265,12 @@ public int numFields() { public void parse(String string) { throw new UnsupportedOperationException("This segment is unmodifiable"); } + + @Override + public List> getAllFields() throws HL7Exception { + // TODO Auto-generated method stub + return null; + } } private static class UnmodifiableGroup extends UnmodifiableStructure implements Group { @@ -329,6 +337,12 @@ public String addNonstandardSegment(String name) { public String addNonstandardSegment(String name, int theIndex) { throw new UnsupportedOperationException("This group is unmodifiable"); } + + @Override + public Map> getAllStructure() throws HL7Exception { + // TODO Auto-generated method stub + return null; + } } private static class UnmodifiableMessage extends UnmodifiableGroup implements Message { diff --git a/hapi-base/src/main/java/ca/uhn/hl7v2/validation/builder/support/DefaultValidationBuilder.java b/hapi-base/src/main/java/ca/uhn/hl7v2/validation/builder/support/DefaultValidationBuilder.java index 5928f6a43d..ff15f1ab9f 100644 --- a/hapi-base/src/main/java/ca/uhn/hl7v2/validation/builder/support/DefaultValidationBuilder.java +++ b/hapi-base/src/main/java/ca/uhn/hl7v2/validation/builder/support/DefaultValidationBuilder.java @@ -25,6 +25,7 @@ GNU General Public License (the "GPL"), in which case the provisions of the GPL */ package ca.uhn.hl7v2.validation.builder.support; +import ca.uhn.hl7v2.Version; /** * Builder implementing the default validation rules as described in the diff --git a/hapi-bom/.project b/hapi-bom/.project new file mode 100644 index 0000000000..29aabb4ec8 --- /dev/null +++ b/hapi-bom/.project @@ -0,0 +1,17 @@ + + + hapi-bom + + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.m2e.core.maven2Nature + + diff --git a/hapi-bom/.settings/org.eclipse.core.resources.prefs b/hapi-bom/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000000..99f26c0203 --- /dev/null +++ b/hapi-bom/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/hapi-bom/.settings/org.eclipse.m2e.core.prefs b/hapi-bom/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000000..f897a7f1cb --- /dev/null +++ b/hapi-bom/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/hapi-examples/.classpath b/hapi-examples/.classpath index 658fc2e33f..6889759949 100644 --- a/hapi-examples/.classpath +++ b/hapi-examples/.classpath @@ -6,23 +6,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + - + - + diff --git a/hapi-examples/.project b/hapi-examples/.project index b97ffd1acd..ed2917bcf9 100644 --- a/hapi-examples/.project +++ b/hapi-examples/.project @@ -1,35 +1,30 @@ - hapi-examples - HAPI (HL7 application programming interface; pronounced "happy") is an open-source, + hapi-examples + HAPI (HL7 application programming interface; pronounced "happy") is an open-source, object-oriented HL7 2.x parser for Java. HL7 (http://hl7org) is a messaging specification for healthcare information systems. This project is not affiliated with the HL7 organization; we are just writing some software that conforms to their specification. The project was initiated by University Health Network (a large multi-site teaching hospital in Toronto, Canada). NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse. - - hapi-hl7overhttp - - - - org.maven.ide.eclipse.maven2Builder - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.m2e.core.maven2Builder - - - - - - org.eclipse.m2e.core.maven2Nature - org.maven.ide.eclipse.maven2Nature - org.eclipse.jdt.core.javanature - - + + hapi-base + hapi-hl7overhttp + + + + org.maven.ide.eclipse.maven2Builder + + + org.eclipse.jdt.core.javabuilder + + + org.eclipse.m2e.core.maven2Builder + + + + org.eclipse.m2e.core.maven2Nature + org.maven.ide.eclipse.maven2Nature + org.eclipse.jdt.core.javanature + + \ No newline at end of file diff --git a/hapi-examples/.settings/org.eclipse.core.resources.prefs b/hapi-examples/.settings/org.eclipse.core.resources.prefs index abdea9ac03..839d647eef 100644 --- a/hapi-examples/.settings/org.eclipse.core.resources.prefs +++ b/hapi-examples/.settings/org.eclipse.core.resources.prefs @@ -1,4 +1,5 @@ eclipse.preferences.version=1 encoding//src/main/java=UTF-8 encoding//src/main/resources=UTF-8 +encoding//src/test/java=UTF-8 encoding/=UTF-8 diff --git a/hapi-examples/.settings/org.eclipse.jdt.core.prefs b/hapi-examples/.settings/org.eclipse.jdt.core.prefs index 60105c1b95..cac0df4df3 100644 --- a/hapi-examples/.settings/org.eclipse.jdt.core.prefs +++ b/hapi-examples/.settings/org.eclipse.jdt.core.prefs @@ -1,5 +1,11 @@ eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/hapi-hl7overhttp/.classpath b/hapi-hl7overhttp/.classpath index f5639d785d..e2cb7ddca3 100644 --- a/hapi-hl7overhttp/.classpath +++ b/hapi-hl7overhttp/.classpath @@ -1,39 +1,61 @@ - + + - + + - + + - + - - + - - + + + + + + + + + + + + + + + + + + + + + + - + diff --git a/hapi-hl7overhttp/.project b/hapi-hl7overhttp/.project index 8a347a7b5a..c62d3cb1ee 100644 --- a/hapi-hl7overhttp/.project +++ b/hapi-hl7overhttp/.project @@ -1,28 +1,25 @@ - hapi-hl7overhttp - HAPI (HL7 application programming interface; pronounced "happy") is an open-source, + hapi-hl7overhttp + HAPI (HL7 application programming interface; pronounced "happy") is an open-source, object-oriented HL7 2.x parser for Java. HL7 (http://hl7org) is a messaging specification for healthcare information systems. This project is not affiliated with the HL7 organization; we are just writing some software that conforms to their specification. The project was initiated by University Health Network (a large multi-site teaching hospital in Toronto, Canada). NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse. - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.m2e.core.maven2Builder - - - - - - org.eclipse.m2e.core.maven2Nature - org.eclipse.jdt.core.javanature - - + + hapi-base + + + + org.eclipse.jdt.core.javabuilder + + + org.eclipse.m2e.core.maven2Builder + + + + org.eclipse.m2e.core.maven2Nature + org.eclipse.jdt.core.javanature + + \ No newline at end of file diff --git a/hapi-hl7overhttp/.settings/org.eclipse.jdt.core.prefs b/hapi-hl7overhttp/.settings/org.eclipse.jdt.core.prefs index 60105c1b95..cac0df4df3 100644 --- a/hapi-hl7overhttp/.settings/org.eclipse.jdt.core.prefs +++ b/hapi-hl7overhttp/.settings/org.eclipse.jdt.core.prefs @@ -1,5 +1,11 @@ eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/hapi-hl7overhttp/src/test/java/ca/uhn/hl7v2/hoh/sockets/CustomCertificateTlsSocketFactoryTest.java b/hapi-hl7overhttp/src/test/java/ca/uhn/hl7v2/hoh/sockets/CustomCertificateTlsSocketFactoryTest.java index e1a27260a4..cfa59832c3 100644 --- a/hapi-hl7overhttp/src/test/java/ca/uhn/hl7v2/hoh/sockets/CustomCertificateTlsSocketFactoryTest.java +++ b/hapi-hl7overhttp/src/test/java/ca/uhn/hl7v2/hoh/sockets/CustomCertificateTlsSocketFactoryTest.java @@ -61,7 +61,7 @@ public void testConnectToTrustedSocket() throws IOException, InterruptedExceptio CustomCertificateTlsSocketFactory goodClient = new CustomCertificateTlsSocketFactory(); goodClient.setKeystoreFilename("src/test/resources/truststore.jks"); - // goodClient.setKeystorePassphrase("changeit"); + goodClient.setKeystorePassphrase("changeit"); Socket client = goodClient.createClientSocket(); client.connect(new InetSocketAddress("localhost", myPort)); diff --git a/hapi-osgi-base/.classpath b/hapi-osgi-base/.classpath index fd7ad7fbda..ff15d8a27c 100644 --- a/hapi-osgi-base/.classpath +++ b/hapi-osgi-base/.classpath @@ -8,16 +8,17 @@ + - + - + diff --git a/hapi-osgi-base/.settings/org.eclipse.core.resources.prefs b/hapi-osgi-base/.settings/org.eclipse.core.resources.prefs index 99f26c0203..f9fe34593f 100644 --- a/hapi-osgi-base/.settings/org.eclipse.core.resources.prefs +++ b/hapi-osgi-base/.settings/org.eclipse.core.resources.prefs @@ -1,2 +1,4 @@ eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 +encoding//src/test/java=UTF-8 encoding/=UTF-8 diff --git a/hapi-osgi-base/.settings/org.eclipse.jdt.core.prefs b/hapi-osgi-base/.settings/org.eclipse.jdt.core.prefs index 60105c1b95..cac0df4df3 100644 --- a/hapi-osgi-base/.settings/org.eclipse.jdt.core.prefs +++ b/hapi-osgi-base/.settings/org.eclipse.jdt.core.prefs @@ -1,5 +1,11 @@ eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/hapi-osgi-test/.classpath b/hapi-osgi-test/.classpath index 053af21d29..fa446f0bef 100644 --- a/hapi-osgi-test/.classpath +++ b/hapi-osgi-test/.classpath @@ -1,35 +1,36 @@ + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hapi-osgi-test/.settings/org.eclipse.jdt.core.prefs b/hapi-osgi-test/.settings/org.eclipse.jdt.core.prefs index 63ff378124..fb1077bcea 100644 --- a/hapi-osgi-test/.settings/org.eclipse.jdt.core.prefs +++ b/hapi-osgi-test/.settings/org.eclipse.jdt.core.prefs @@ -1,5 +1,8 @@ -#Mon Aug 24 20:06:02 EDT 2009 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.source=1.5 -org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/hapi-sourcegen/.classpath b/hapi-sourcegen/.classpath index 01e4c33360..57b7dfc2b9 100644 --- a/hapi-sourcegen/.classpath +++ b/hapi-sourcegen/.classpath @@ -1,29 +1,99 @@ - + + - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + diff --git a/hapi-sourcegen/.project b/hapi-sourcegen/.project index 26f41849ff..84c5339636 100644 --- a/hapi-sourcegen/.project +++ b/hapi-sourcegen/.project @@ -1,35 +1,29 @@ - hapi-sourcegen - HAPI (HL7 application programming interface; pronounced "happy") is an open-source, + hapi-sourcegen + HAPI (HL7 application programming interface; pronounced "happy") is an open-source, object-oriented HL7 2.x parser for Java. HL7 (http://hl7org) is a messaging specification for healthcare information systems. This project is not affiliated with the HL7 organization; we are just writing some software that conforms to their specification. The project was initiated by University Health Network (a large multi-site teaching hospital in Toronto, Canada). NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse. - - hapi-base - - - - org.maven.ide.eclipse.maven2Builder - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.m2e.core.maven2Builder - - - - - - org.eclipse.m2e.core.maven2Nature - org.maven.ide.eclipse.maven2Nature - org.eclipse.jdt.core.javanature - - + + hapi-base + + + + org.maven.ide.eclipse.maven2Builder + + + org.eclipse.jdt.core.javabuilder + + + org.eclipse.m2e.core.maven2Builder + + + + org.eclipse.m2e.core.maven2Nature + org.maven.ide.eclipse.maven2Nature + org.eclipse.jdt.core.javanature + + \ No newline at end of file diff --git a/hapi-sourcegen/.settings/org.eclipse.jdt.core.prefs b/hapi-sourcegen/.settings/org.eclipse.jdt.core.prefs index 5ce4518899..8b5c4dca75 100644 --- a/hapi-sourcegen/.settings/org.eclipse.jdt.core.prefs +++ b/hapi-sourcegen/.settings/org.eclipse.jdt.core.prefs @@ -1,13 +1,16 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/hapi-sourcegen/src/main/java/ca/uhn/hl7v2/conf/classes/generator/builders/ConformancePrimitiveBuilder.java b/hapi-sourcegen/src/main/java/ca/uhn/hl7v2/conf/classes/generator/builders/ConformancePrimitiveBuilder.java index d147b48630..c8a0efc427 100644 --- a/hapi-sourcegen/src/main/java/ca/uhn/hl7v2/conf/classes/generator/builders/ConformancePrimitiveBuilder.java +++ b/hapi-sourcegen/src/main/java/ca/uhn/hl7v2/conf/classes/generator/builders/ConformancePrimitiveBuilder.java @@ -59,7 +59,7 @@ public ConformancePrimitiveBuilder(String packageName, DeploymentManager depMana /** This method will build a primitive conformance class (ST, NM, etc) which is * a Component or Subcomponent. */ - public void buildClass(ca.uhn.hl7v2.conf.spec.message.AbstractComponent primitive, int profileType) { + public void buildClass(ca.uhn.hl7v2.conf.spec.message.AbstractComponent primitive, int profileType) { GeneratedPrimitive genClass = new GeneratedPrimitive(); ProfileName profileName = new ProfileName(primitive.getName(), profileType); diff --git a/hapi-sourcegen/src/main/java/ca/uhn/hl7v2/conf/classes/generator/builders/DocumentationBuilder.java b/hapi-sourcegen/src/main/java/ca/uhn/hl7v2/conf/classes/generator/builders/DocumentationBuilder.java index 332eaa0b43..d590a855b7 100644 --- a/hapi-sourcegen/src/main/java/ca/uhn/hl7v2/conf/classes/generator/builders/DocumentationBuilder.java +++ b/hapi-sourcegen/src/main/java/ca/uhn/hl7v2/conf/classes/generator/builders/DocumentationBuilder.java @@ -241,7 +241,7 @@ public void decorateMinReps(GeneratedMethod genMethod) { */ public void decoratePrimitive( GeneratedPrimitive genClass, - AbstractComponent ac) { + AbstractComponent ac) { genClass.addClassComment( "This represents a constrained " + ac.getName() diff --git a/hapi-structures-v21/.classpath b/hapi-structures-v21/.classpath index fd7ad7fbda..ff15d8a27c 100644 --- a/hapi-structures-v21/.classpath +++ b/hapi-structures-v21/.classpath @@ -8,16 +8,17 @@ + - + - + diff --git a/hapi-structures-v21/.settings/org.eclipse.core.resources.prefs b/hapi-structures-v21/.settings/org.eclipse.core.resources.prefs index e9441bb123..f9fe34593f 100644 --- a/hapi-structures-v21/.settings/org.eclipse.core.resources.prefs +++ b/hapi-structures-v21/.settings/org.eclipse.core.resources.prefs @@ -1,3 +1,4 @@ eclipse.preferences.version=1 encoding//src/main/java=UTF-8 +encoding//src/test/java=UTF-8 encoding/=UTF-8 diff --git a/hapi-structures-v21/.settings/org.eclipse.jdt.core.prefs b/hapi-structures-v21/.settings/org.eclipse.jdt.core.prefs index 60105c1b95..cac0df4df3 100644 --- a/hapi-structures-v21/.settings/org.eclipse.jdt.core.prefs +++ b/hapi-structures-v21/.settings/org.eclipse.jdt.core.prefs @@ -1,5 +1,11 @@ eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/hapi-structures-v22/.classpath b/hapi-structures-v22/.classpath index e060e82db1..f140d82c2c 100644 --- a/hapi-structures-v22/.classpath +++ b/hapi-structures-v22/.classpath @@ -7,19 +7,20 @@ - + + + + - - + - - + diff --git a/hapi-structures-v22/.settings/org.eclipse.core.resources.prefs b/hapi-structures-v22/.settings/org.eclipse.core.resources.prefs index e9441bb123..f9fe34593f 100644 --- a/hapi-structures-v22/.settings/org.eclipse.core.resources.prefs +++ b/hapi-structures-v22/.settings/org.eclipse.core.resources.prefs @@ -1,3 +1,4 @@ eclipse.preferences.version=1 encoding//src/main/java=UTF-8 +encoding//src/test/java=UTF-8 encoding/=UTF-8 diff --git a/hapi-structures-v22/.settings/org.eclipse.jdt.core.prefs b/hapi-structures-v22/.settings/org.eclipse.jdt.core.prefs index 60105c1b95..cac0df4df3 100644 --- a/hapi-structures-v22/.settings/org.eclipse.jdt.core.prefs +++ b/hapi-structures-v22/.settings/org.eclipse.jdt.core.prefs @@ -1,5 +1,11 @@ eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/hapi-structures-v23/.classpath b/hapi-structures-v23/.classpath index 15e380f80b..402e794bfd 100644 --- a/hapi-structures-v23/.classpath +++ b/hapi-structures-v23/.classpath @@ -6,21 +6,26 @@ - + + + + + + - + - + diff --git a/hapi-structures-v23/.settings/org.eclipse.core.resources.prefs b/hapi-structures-v23/.settings/org.eclipse.core.resources.prefs index e9441bb123..47577272bf 100644 --- a/hapi-structures-v23/.settings/org.eclipse.core.resources.prefs +++ b/hapi-structures-v23/.settings/org.eclipse.core.resources.prefs @@ -1,3 +1,5 @@ eclipse.preferences.version=1 encoding//src/main/java=UTF-8 +encoding//src/test/java=UTF-8 +encoding//target/generated-sources/resourcegen=UTF-8 encoding/=UTF-8 diff --git a/hapi-structures-v23/.settings/org.eclipse.jdt.core.prefs b/hapi-structures-v23/.settings/org.eclipse.jdt.core.prefs index 60105c1b95..cac0df4df3 100644 --- a/hapi-structures-v23/.settings/org.eclipse.jdt.core.prefs +++ b/hapi-structures-v23/.settings/org.eclipse.jdt.core.prefs @@ -1,5 +1,11 @@ eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/hapi-structures-v231-alternatenames/.classpath b/hapi-structures-v231-alternatenames/.classpath index fd7ad7fbda..ff15d8a27c 100644 --- a/hapi-structures-v231-alternatenames/.classpath +++ b/hapi-structures-v231-alternatenames/.classpath @@ -8,16 +8,17 @@ + - + - + diff --git a/hapi-structures-v231-alternatenames/.settings/org.eclipse.core.resources.prefs b/hapi-structures-v231-alternatenames/.settings/org.eclipse.core.resources.prefs index 99f26c0203..f9fe34593f 100644 --- a/hapi-structures-v231-alternatenames/.settings/org.eclipse.core.resources.prefs +++ b/hapi-structures-v231-alternatenames/.settings/org.eclipse.core.resources.prefs @@ -1,2 +1,4 @@ eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 +encoding//src/test/java=UTF-8 encoding/=UTF-8 diff --git a/hapi-structures-v231-alternatenames/.settings/org.eclipse.jdt.core.prefs b/hapi-structures-v231-alternatenames/.settings/org.eclipse.jdt.core.prefs index 60105c1b95..cac0df4df3 100644 --- a/hapi-structures-v231-alternatenames/.settings/org.eclipse.jdt.core.prefs +++ b/hapi-structures-v231-alternatenames/.settings/org.eclipse.jdt.core.prefs @@ -1,5 +1,11 @@ eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/hapi-structures-v231-alternatenames/pom.xml b/hapi-structures-v231-alternatenames/pom.xml index 27370b4413..9b7c7e1ec3 100644 --- a/hapi-structures-v231-alternatenames/pom.xml +++ b/hapi-structures-v231-alternatenames/pom.xml @@ -1,4 +1,3 @@ - diff --git a/hapi-structures-v231/.classpath b/hapi-structures-v231/.classpath index ff3b4b50db..a0e7d83676 100644 --- a/hapi-structures-v231/.classpath +++ b/hapi-structures-v231/.classpath @@ -8,20 +8,20 @@ - - - + + + + - + - - + diff --git a/hapi-structures-v231/.settings/org.eclipse.core.resources.prefs b/hapi-structures-v231/.settings/org.eclipse.core.resources.prefs index e9441bb123..f9fe34593f 100644 --- a/hapi-structures-v231/.settings/org.eclipse.core.resources.prefs +++ b/hapi-structures-v231/.settings/org.eclipse.core.resources.prefs @@ -1,3 +1,4 @@ eclipse.preferences.version=1 encoding//src/main/java=UTF-8 +encoding//src/test/java=UTF-8 encoding/=UTF-8 diff --git a/hapi-structures-v231/.settings/org.eclipse.jdt.core.prefs b/hapi-structures-v231/.settings/org.eclipse.jdt.core.prefs index 60105c1b95..cac0df4df3 100644 --- a/hapi-structures-v231/.settings/org.eclipse.jdt.core.prefs +++ b/hapi-structures-v231/.settings/org.eclipse.jdt.core.prefs @@ -1,5 +1,11 @@ eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/hapi-structures-v24/.classpath b/hapi-structures-v24/.classpath index 15e380f80b..402e794bfd 100644 --- a/hapi-structures-v24/.classpath +++ b/hapi-structures-v24/.classpath @@ -6,21 +6,26 @@ - + + + + + + - + - + diff --git a/hapi-structures-v24/.settings/org.eclipse.core.resources.prefs b/hapi-structures-v24/.settings/org.eclipse.core.resources.prefs index e9441bb123..47577272bf 100644 --- a/hapi-structures-v24/.settings/org.eclipse.core.resources.prefs +++ b/hapi-structures-v24/.settings/org.eclipse.core.resources.prefs @@ -1,3 +1,5 @@ eclipse.preferences.version=1 encoding//src/main/java=UTF-8 +encoding//src/test/java=UTF-8 +encoding//target/generated-sources/resourcegen=UTF-8 encoding/=UTF-8 diff --git a/hapi-structures-v24/.settings/org.eclipse.jdt.core.prefs b/hapi-structures-v24/.settings/org.eclipse.jdt.core.prefs index 60105c1b95..8b5c4dca75 100644 --- a/hapi-structures-v24/.settings/org.eclipse.jdt.core.prefs +++ b/hapi-structures-v24/.settings/org.eclipse.jdt.core.prefs @@ -1,5 +1,16 @@ eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/hapi-structures-v25/.classpath b/hapi-structures-v25/.classpath index 0bf11fc663..4f24eddf21 100644 --- a/hapi-structures-v25/.classpath +++ b/hapi-structures-v25/.classpath @@ -8,18 +8,19 @@ - + + + - + - - + diff --git a/hapi-structures-v25/.settings/org.eclipse.core.resources.prefs b/hapi-structures-v25/.settings/org.eclipse.core.resources.prefs index e9441bb123..f9fe34593f 100644 --- a/hapi-structures-v25/.settings/org.eclipse.core.resources.prefs +++ b/hapi-structures-v25/.settings/org.eclipse.core.resources.prefs @@ -1,3 +1,4 @@ eclipse.preferences.version=1 encoding//src/main/java=UTF-8 +encoding//src/test/java=UTF-8 encoding/=UTF-8 diff --git a/hapi-structures-v25/.settings/org.eclipse.jdt.core.prefs b/hapi-structures-v25/.settings/org.eclipse.jdt.core.prefs index 60105c1b95..cac0df4df3 100644 --- a/hapi-structures-v25/.settings/org.eclipse.jdt.core.prefs +++ b/hapi-structures-v25/.settings/org.eclipse.jdt.core.prefs @@ -1,5 +1,11 @@ eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/hapi-structures-v251/.classpath b/hapi-structures-v251/.classpath index 8c758e43fc..6a8e632582 100644 --- a/hapi-structures-v251/.classpath +++ b/hapi-structures-v251/.classpath @@ -7,20 +7,25 @@ - + + + + + + - + - + diff --git a/hapi-structures-v251/.settings/org.eclipse.core.resources.prefs b/hapi-structures-v251/.settings/org.eclipse.core.resources.prefs index e9441bb123..47577272bf 100644 --- a/hapi-structures-v251/.settings/org.eclipse.core.resources.prefs +++ b/hapi-structures-v251/.settings/org.eclipse.core.resources.prefs @@ -1,3 +1,5 @@ eclipse.preferences.version=1 encoding//src/main/java=UTF-8 +encoding//src/test/java=UTF-8 +encoding//target/generated-sources/resourcegen=UTF-8 encoding/=UTF-8 diff --git a/hapi-structures-v251/.settings/org.eclipse.jdt.core.prefs b/hapi-structures-v251/.settings/org.eclipse.jdt.core.prefs index 5ce4518899..8b5c4dca75 100644 --- a/hapi-structures-v251/.settings/org.eclipse.jdt.core.prefs +++ b/hapi-structures-v251/.settings/org.eclipse.jdt.core.prefs @@ -1,13 +1,16 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/hapi-structures-v26/.classpath b/hapi-structures-v26/.classpath index 4f1e4e1c15..196146adb2 100644 --- a/hapi-structures-v26/.classpath +++ b/hapi-structures-v26/.classpath @@ -8,19 +8,24 @@ - + + + + + + - + - + diff --git a/hapi-structures-v26/.settings/org.eclipse.core.resources.prefs b/hapi-structures-v26/.settings/org.eclipse.core.resources.prefs index e9441bb123..47577272bf 100644 --- a/hapi-structures-v26/.settings/org.eclipse.core.resources.prefs +++ b/hapi-structures-v26/.settings/org.eclipse.core.resources.prefs @@ -1,3 +1,5 @@ eclipse.preferences.version=1 encoding//src/main/java=UTF-8 +encoding//src/test/java=UTF-8 +encoding//target/generated-sources/resourcegen=UTF-8 encoding/=UTF-8 diff --git a/hapi-structures-v26/.settings/org.eclipse.jdt.core.prefs b/hapi-structures-v26/.settings/org.eclipse.jdt.core.prefs index 60105c1b95..cac0df4df3 100644 --- a/hapi-structures-v26/.settings/org.eclipse.jdt.core.prefs +++ b/hapi-structures-v26/.settings/org.eclipse.jdt.core.prefs @@ -1,5 +1,11 @@ eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/hapi-structures-v27/.classpath b/hapi-structures-v27/.classpath index 39a4dda46a..ff15d8a27c 100644 --- a/hapi-structures-v27/.classpath +++ b/hapi-structures-v27/.classpath @@ -6,23 +6,19 @@ - - - - - + - + - + diff --git a/hapi-structures-v27/.settings/org.eclipse.core.resources.prefs b/hapi-structures-v27/.settings/org.eclipse.core.resources.prefs index 09119248cb..47577272bf 100644 --- a/hapi-structures-v27/.settings/org.eclipse.core.resources.prefs +++ b/hapi-structures-v27/.settings/org.eclipse.core.resources.prefs @@ -1,3 +1,5 @@ eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 +encoding//src/test/java=UTF-8 encoding//target/generated-sources/resourcegen=UTF-8 encoding/=UTF-8 diff --git a/hapi-structures-v27/.settings/org.eclipse.jdt.core.prefs b/hapi-structures-v27/.settings/org.eclipse.jdt.core.prefs index 60105c1b95..cac0df4df3 100644 --- a/hapi-structures-v27/.settings/org.eclipse.jdt.core.prefs +++ b/hapi-structures-v27/.settings/org.eclipse.jdt.core.prefs @@ -1,5 +1,11 @@ eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/hapi-structures-v271/.classpath b/hapi-structures-v271/.classpath index 39a4dda46a..e51e38c9ea 100644 --- a/hapi-structures-v271/.classpath +++ b/hapi-structures-v271/.classpath @@ -6,15 +6,11 @@ - - - - - + diff --git a/hapi-structures-v271/.settings/org.eclipse.jdt.core.prefs b/hapi-structures-v271/.settings/org.eclipse.jdt.core.prefs index 60105c1b95..71e67c60a9 100644 --- a/hapi-structures-v271/.settings/org.eclipse.jdt.core.prefs +++ b/hapi-structures-v271/.settings/org.eclipse.jdt.core.prefs @@ -1,5 +1,8 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore +org.eclipse.jdt.core.compiler.release=disabled org.eclipse.jdt.core.compiler.source=1.6 diff --git a/hapi-structures-v28/.classpath b/hapi-structures-v28/.classpath index eaac78b49f..c0c35d9b8d 100644 --- a/hapi-structures-v28/.classpath +++ b/hapi-structures-v28/.classpath @@ -7,23 +7,19 @@ - - - - - + - + - + diff --git a/hapi-structures-v28/.settings/org.eclipse.jdt.core.prefs b/hapi-structures-v28/.settings/org.eclipse.jdt.core.prefs index 60105c1b95..cac0df4df3 100644 --- a/hapi-structures-v28/.settings/org.eclipse.jdt.core.prefs +++ b/hapi-structures-v28/.settings/org.eclipse.jdt.core.prefs @@ -1,5 +1,11 @@ eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/hapi-structures-v281/.classpath b/hapi-structures-v281/.classpath index eaac78b49f..c0c35d9b8d 100644 --- a/hapi-structures-v281/.classpath +++ b/hapi-structures-v281/.classpath @@ -7,23 +7,19 @@ - - - - - + - + - + diff --git a/hapi-structures-v281/.settings/org.eclipse.jdt.core.prefs b/hapi-structures-v281/.settings/org.eclipse.jdt.core.prefs index 60105c1b95..cac0df4df3 100644 --- a/hapi-structures-v281/.settings/org.eclipse.jdt.core.prefs +++ b/hapi-structures-v281/.settings/org.eclipse.jdt.core.prefs @@ -1,5 +1,11 @@ eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/hapi-test/.classpath b/hapi-test/.classpath index cbf8096701..6f9894184c 100644 --- a/hapi-test/.classpath +++ b/hapi-test/.classpath @@ -2,29 +2,117 @@ + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + diff --git a/hapi-test/.project b/hapi-test/.project index e9438029aa..95d746f005 100644 --- a/hapi-test/.project +++ b/hapi-test/.project @@ -1,35 +1,30 @@ - hapi-test - HAPI (HL7 application programming interface; pronounced "happy") is an open-source, + hapi-test + HAPI (HL7 application programming interface; pronounced "happy") is an open-source, object-oriented HL7 2.x parser for Java. HL7 (http://hl7org) is a messaging specification for healthcare information systems. This project is not affiliated with the HL7 organization; we are just writing some software that conforms to their specification. The project was initiated by University Health Network (a large multi-site teaching hospital in Toronto, Canada). NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse. - - hapi-base - - - - org.eclipse.jdt.core.javabuilder - - - - - org.maven.ide.eclipse.maven2Builder - - - - - org.eclipse.m2e.core.maven2Builder - - - - - - org.eclipse.m2e.core.maven2Nature - org.eclipse.jdt.core.javanature - org.maven.ide.eclipse.maven2Nature - - + + hapi-base + hapi-sourcegen + + + + org.eclipse.jdt.core.javabuilder + + + org.maven.ide.eclipse.maven2Builder + + + org.eclipse.m2e.core.maven2Builder + + + + org.eclipse.m2e.core.maven2Nature + org.eclipse.jdt.core.javanature + org.maven.ide.eclipse.maven2Nature + + \ No newline at end of file diff --git a/hapi-test/.settings/org.eclipse.jdt.core.prefs b/hapi-test/.settings/org.eclipse.jdt.core.prefs index 92eb1cf57c..c67d925706 100644 --- a/hapi-test/.settings/org.eclipse.jdt.core.prefs +++ b/hapi-test/.settings/org.eclipse.jdt.core.prefs @@ -5,9 +5,9 @@ org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annota org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate @@ -21,6 +21,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled org.eclipse.jdt.core.compiler.problem.discouragedReference=warning org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore @@ -63,6 +64,7 @@ org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=igno org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled @@ -92,4 +94,5 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/hapi-test/src/test/java/ca/uhn/hl7v2/validation/impl/XMLSchemaRuleTest.java b/hapi-test/src/test/java/ca/uhn/hl7v2/validation/impl/XMLSchemaRuleTest.java index 121c377f86..c43475f555 100644 --- a/hapi-test/src/test/java/ca/uhn/hl7v2/validation/impl/XMLSchemaRuleTest.java +++ b/hapi-test/src/test/java/ca/uhn/hl7v2/validation/impl/XMLSchemaRuleTest.java @@ -74,11 +74,11 @@ public void testDynamicFails() { @Test public void testDynamicNotFound() { - String msg = getMessage3(); // unknown location, override with locations property + String msg = getMessage3(); //unknown location, override with locations property ValidationException[] errors = rule.test(msg); assertEquals(Arrays.asList(errors).toString(), 1, errors.length); assertTrue(errors[0].getMessage().contains("MSA.XXXXXXXX")); - } + } // TODO add tests using dynamic location detection, missing schema files etc. diff --git a/hapi-test/src/test/resources/XMLSchema.xsd b/hapi-test/src/test/resources/XMLSchema.xsd index 8ba565e09a..b0582dd4e6 100644 --- a/hapi-test/src/test/resources/XMLSchema.xsd +++ b/hapi-test/src/test/resources/XMLSchema.xsd @@ -66,7 +66,8 @@ ]> + xmlns:hfp="http://www.w3.org/2001/XMLSchema-hasFacetAndProperty" + xmlns:xsd="http://www.w3.org/2001/XMLSchema"> Part 1 version: Id: structures.xsd,v 1.2 2004/01/15 11:34:25 ht Exp @@ -174,31 +175,36 @@ - + + + A utility type, not for public use + + + + + A utility type, not for public use - - - - + + + + A utility type, not for public use + + #all or (possibly empty) subset of {extension, restriction} - - - - @@ -209,30 +215,28 @@ + + + A utility type, not for public use - - #all or (possibly empty) subset of {extension, restriction} - - - - + + + A utility type, not for public use + + #all or (possibly empty) subset of {extension, restriction, list, union} - - - - @@ -243,12 +247,6 @@ - - - A utility type, not for public use - - #all or (possibly empty) subset of {extension, restriction, list, union} - @@ -343,7 +341,10 @@ - + + + for maxOccurs + @@ -351,10 +352,6 @@ - - - for maxOccurs - @@ -711,7 +708,13 @@ - + + + A utility type, not for public use + + #all or (possibly empty) subset of {substitution, extension, + restriction} + @@ -730,13 +733,6 @@ - - - A utility type, not for public use - - #all or (possibly empty) subset of {substitution, extension, - restriction} - @@ -1099,7 +1095,10 @@ - + + + A utility type, not for public use + @@ -1122,10 +1121,6 @@ - - - A utility type, not for public use - @@ -1381,14 +1376,13 @@ - - A utility type, not for public use A public identifier, per ISO 8879 + @@ -1507,10 +1501,6 @@ - - - - @@ -1526,13 +1516,12 @@ + + + - - - - @@ -1544,13 +1533,12 @@ + + + - - - - @@ -1567,13 +1555,12 @@ + + + - - - - @@ -1590,13 +1577,12 @@ + + + - - - - @@ -1615,13 +1601,12 @@ + + + - - - - @@ -1638,13 +1623,12 @@ + + + - - - - @@ -1661,13 +1645,12 @@ + + + - - - - @@ -1684,13 +1667,12 @@ + + + - - - - @@ -1707,13 +1689,12 @@ + + + - - - - @@ -1730,13 +1711,12 @@ + + + - - - - @@ -1753,13 +1733,12 @@ + + + - - - - @@ -1776,13 +1755,12 @@ + + + - - - - @@ -1799,13 +1777,12 @@ + + + - - - - @@ -1822,13 +1799,12 @@ + + + - - - - @@ -1844,13 +1820,12 @@ + + + - - - - @@ -1866,13 +1841,12 @@ + + + - - - - @@ -1888,13 +1862,12 @@ + + + - - - - @@ -1910,13 +1883,12 @@ + + + - - - - @@ -1939,6 +1911,9 @@ schema. + + + @@ -1948,27 +1923,29 @@ - - - - + + + + - - - - + + + + - + + + @@ -1979,19 +1956,10 @@ - - - + - - - - - - - @@ -2007,16 +1975,16 @@ - - - - - + - + + + + + @@ -2032,10 +2000,18 @@ + + + + + + - + + + @@ -2045,19 +2021,9 @@ - - - - - - - - - - @@ -2073,10 +2039,18 @@ + + + + + + - + + + @@ -2086,13 +2060,12 @@ - - - - + + + @@ -2102,72 +2075,58 @@ - - - - - + - - + - - + - + + + - - - - - - - + + + - - - - + + + - - - - - @@ -2175,56 +2134,52 @@ + + + + - + + + - - - - + + + - - - - + + + - - - - - - - + + + - - - - @@ -2232,50 +2187,52 @@ + + + - - - - + + + - - - - + + + - - - - + + + - - - - + + + - + + + A utility type, not for public use + @@ -2283,10 +2240,6 @@ - - - A utility type, not for public use - @@ -2302,7 +2255,13 @@ - + + + #all or (possibly empty) subset of {restriction, union, list} + + + A utility type, not for public use + @@ -2321,13 +2280,6 @@ - - - #all or (possibly empty) subset of {restriction, union, list} - - - A utility type, not for public use - @@ -2658,4 +2610,4 @@ - + \ No newline at end of file diff --git a/hapi-testmindeps/.classpath b/hapi-testmindeps/.classpath index fd7ad7fbda..c83f1b4064 100644 --- a/hapi-testmindeps/.classpath +++ b/hapi-testmindeps/.classpath @@ -1,23 +1,31 @@ - + + - + + + + + + + + - + - + diff --git a/hapi-testmindeps/.project b/hapi-testmindeps/.project index a985117f70..d886ef901e 100644 --- a/hapi-testmindeps/.project +++ b/hapi-testmindeps/.project @@ -1,23 +1,20 @@ - hapi-testmindeps - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.m2e.core.maven2Builder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.m2e.core.maven2Nature - - + hapi-testmindeps + This project contains unit tests which verify that HAPI works correctly when it has a minimal classpath. NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse. + + hapi-base + + + + org.eclipse.jdt.core.javabuilder + + + org.eclipse.m2e.core.maven2Builder + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + + \ No newline at end of file diff --git a/hapi-testmindeps/.settings/org.eclipse.core.resources.prefs b/hapi-testmindeps/.settings/org.eclipse.core.resources.prefs index 8dd9b1df3d..f9fe34593f 100644 --- a/hapi-testmindeps/.settings/org.eclipse.core.resources.prefs +++ b/hapi-testmindeps/.settings/org.eclipse.core.resources.prefs @@ -1,3 +1,4 @@ eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 encoding//src/test/java=UTF-8 encoding/=UTF-8 diff --git a/hapi-testmindeps/.settings/org.eclipse.jdt.core.prefs b/hapi-testmindeps/.settings/org.eclipse.jdt.core.prefs index 60105c1b95..cac0df4df3 100644 --- a/hapi-testmindeps/.settings/org.eclipse.jdt.core.prefs +++ b/hapi-testmindeps/.settings/org.eclipse.jdt.core.prefs @@ -1,5 +1,11 @@ eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 -org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/hapi-testmindeps/id_file b/hapi-testmindeps/id_file index 0454041723..7ab97ac26d 100644 --- a/hapi-testmindeps/id_file +++ b/hapi-testmindeps/id_file @@ -1 +1 @@ -6600 +13200 diff --git a/hapi-testnodeps/.classpath b/hapi-testnodeps/.classpath index fa99d4ffc6..e8505c20aa 100644 --- a/hapi-testnodeps/.classpath +++ b/hapi-testnodeps/.classpath @@ -2,22 +2,29 @@ + - + + + + + + + + - + - - + diff --git a/hapi-testnodeps/.project b/hapi-testnodeps/.project index 3d06921569..dcf8665c38 100644 --- a/hapi-testnodeps/.project +++ b/hapi-testnodeps/.project @@ -1,24 +1,20 @@ - hapi-testnodeps - This project contains unit tests which verify that HAPI works correctly when it has no structure JARs on the classpath. NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse. - - hapi-base - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.m2e.core.maven2Builder - - - - - - org.eclipse.m2e.core.maven2Nature - org.eclipse.jdt.core.javanature - - + hapi-testnodeps + This project contains unit tests which verify that HAPI works correctly when it has no structure JARs on the classpath. NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse. + + hapi-base + + + + org.eclipse.jdt.core.javabuilder + + + org.eclipse.m2e.core.maven2Builder + + + + org.eclipse.m2e.core.maven2Nature + org.eclipse.jdt.core.javanature + + \ No newline at end of file diff --git a/hapi-testnodeps/.settings/org.eclipse.core.resources.prefs b/hapi-testnodeps/.settings/org.eclipse.core.resources.prefs index 8dd9b1df3d..f9fe34593f 100644 --- a/hapi-testnodeps/.settings/org.eclipse.core.resources.prefs +++ b/hapi-testnodeps/.settings/org.eclipse.core.resources.prefs @@ -1,3 +1,4 @@ eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 encoding//src/test/java=UTF-8 encoding/=UTF-8 diff --git a/hapi-testnodeps/.settings/org.eclipse.jdt.core.prefs b/hapi-testnodeps/.settings/org.eclipse.jdt.core.prefs index 75bbcdb601..1a75e8e0ac 100644 --- a/hapi-testnodeps/.settings/org.eclipse.jdt.core.prefs +++ b/hapi-testnodeps/.settings/org.eclipse.jdt.core.prefs @@ -5,9 +5,9 @@ org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annota org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate @@ -21,6 +21,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled org.eclipse.jdt.core.compiler.problem.discouragedReference=warning org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore @@ -63,6 +64,7 @@ org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=igno org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled @@ -92,8 +94,10 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning org.eclipse.jdt.core.compiler.problem.unusedWarningToken=ignore org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=1.8 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 @@ -101,16 +105,19 @@ org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_c org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 org.eclipse.jdt.core.formatter.alignment_for_assignment=0 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16 org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16 org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16 org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16 org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 @@ -171,9 +178,12 @@ org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert @@ -189,11 +199,12 @@ org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert @@ -223,6 +234,8 @@ org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=inser org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert @@ -246,12 +259,16 @@ org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert @@ -297,6 +314,8 @@ org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do n org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert @@ -332,8 +351,11 @@ org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not inser org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert @@ -359,5 +381,9 @@ org.eclipse.jdt.core.formatter.tabulation.char=tab org.eclipse.jdt.core.formatter.tabulation.size=4 org.eclipse.jdt.core.formatter.use_on_off_tags=false org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true +org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true +org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true +org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true +org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/hapi-testpanel/.classpath b/hapi-testpanel/.classpath index 91dbb706d4..5fcf374650 100644 --- a/hapi-testpanel/.classpath +++ b/hapi-testpanel/.classpath @@ -2,14 +2,15 @@ + - - + + @@ -33,15 +34,16 @@ + - + - + diff --git a/hapi-testpanel/.project b/hapi-testpanel/.project index b6bfcee264..ce9c421f74 100644 --- a/hapi-testpanel/.project +++ b/hapi-testpanel/.project @@ -10,6 +10,11 @@ + + org.eclipse.wst.common.project.facet.core.builder + + + org.eclipse.jdt.core.javabuilder @@ -24,5 +29,6 @@ org.eclipse.m2e.core.maven2Nature org.eclipse.jdt.core.javanature + org.eclipse.wst.common.project.facet.core.nature diff --git a/hapi-testpanel/.settings/org.eclipse.jdt.core.prefs b/hapi-testpanel/.settings/org.eclipse.jdt.core.prefs index e4e7fb7daa..72ead006bf 100644 --- a/hapi-testpanel/.settings/org.eclipse.jdt.core.prefs +++ b/hapi-testpanel/.settings/org.eclipse.jdt.core.prefs @@ -10,9 +10,9 @@ org.eclipse.jdt.core.compiler.annotation.nullable.secondary= org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.compliance=17 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate @@ -26,6 +26,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled org.eclipse.jdt.core.compiler.problem.discouragedReference=warning org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore @@ -71,6 +72,7 @@ org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=igno org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled @@ -103,4 +105,5 @@ org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=17 diff --git a/hapi-testpanel/.settings/org.eclipse.wst.common.project.facet.core.xml b/hapi-testpanel/.settings/org.eclipse.wst.common.project.facet.core.xml new file mode 100644 index 0000000000..48ff4f398f --- /dev/null +++ b/hapi-testpanel/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -0,0 +1,4 @@ + + + + diff --git a/hapi-testpanel/id_file b/hapi-testpanel/id_file index 29d6383b52..b752769ee9 100644 --- a/hapi-testpanel/id_file +++ b/hapi-testpanel/id_file @@ -1 +1 @@ -100 +5800 diff --git a/hapi-testpanel/pom.xml b/hapi-testpanel/pom.xml index d9f8c588c7..632fd95231 100644 --- a/hapi-testpanel/pom.xml +++ b/hapi-testpanel/pom.xml @@ -13,7 +13,7 @@ netbeans NetBeans Platform Maven Repository - http://bits.netbeans.org/maven2/ + https://netbeans.apidesign.org/maven2/ @@ -51,20 +51,20 @@ org.netbeans.api org-netbeans-swing-outline - RELEASE73 + RELEASE90 org.netbeans.api org-netbeans-swing-outline - RELEASE73 + RELEASE90 sources provided - jsyntaxpane - jsyntaxpane - 0.9.6-hapi2 + de.sciss + jsyntaxpane + 1.0.0 commons-lang @@ -72,6 +72,33 @@ 2.4 + javax.xml.bind + jaxb-api + 2.3.0-b170201.1204 + + + + + javax.activation + activation + 1.1 + + + + + jakarta.xml.bind + jakarta.xml.bind-api + 2.3.2 + + + + + org.glassfish.jaxb + jaxb-runtime + 2.3.2 + + + ca.uhn.hapi hapi-base ${hapi.version} @@ -180,8 +207,8 @@ install - - com.sun.tools.xjc.maven2 + + com.sun.tools.xjc.maven2 maven-jaxb-plugin 1.1.1 @@ -201,19 +228,24 @@ - + org.apache.maven.plugins maven-compiler-plugin - 1.6 - 1.6 + 1.7 + 1.7 + + 0.2 + --> + de.jflex + maven-jflex-plugin + 0.3 @@ -296,6 +328,7 @@ + true ca.uhn.hl7v2.testpanel.App @@ -317,7 +350,7 @@ - + diff --git a/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/App.java b/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/App.java index 51989729a9..ec1de7636a 100644 --- a/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/App.java +++ b/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/App.java @@ -68,7 +68,7 @@ public static void main(String[] args) { try { Class clazz = Class.forName("ca.uhn.hl7v2.testpanel.OSXInitializer"); Method runMethod = clazz.getMethod("run", Controller.class); - runMethod.invoke(clazz.newInstance(), myController); + runMethod.invoke(clazz.getDeclaredConstructor().newInstance(), myController); } catch (Exception e) { e.printStackTrace(); } @@ -79,7 +79,8 @@ public static void main(String[] args) { try { Class clazz = Class.forName("ca.uhn.hl7v2.testpanel.WindowsInitializer"); Method runMethod = clazz.getMethod("run", Controller.class); - runMethod.invoke(clazz.newInstance(), myController); + // runMethod.invoke(clazz.newInstance(), myController); + runMethod.invoke(clazz.getDeclaredConstructor().newInstance(), myController); } catch (Exception e) { e.printStackTrace(); } @@ -90,7 +91,7 @@ public static void main(String[] args) { try { Class clazz = Class.forName("ca.uhn.hl7v2.testpanel.LinuxInitializer"); Method runMethod = clazz.getMethod("run", Controller.class); - runMethod.invoke(clazz.newInstance(), myController); + runMethod.invoke(clazz.getDeclaredConstructor().newInstance(), myController); } catch (Exception e) { e.printStackTrace(); } diff --git a/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/controller/Controller.java b/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/controller/Controller.java index 30aa3d8a97..947780dd36 100644 --- a/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/controller/Controller.java +++ b/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/controller/Controller.java @@ -193,9 +193,8 @@ public void addMessage(String theVersion, String theType, String theTrigger, Str col.setValidationContext(new DefaultValidation()); Class messageClass = mcf.getMessageClass(theStructure, theVersion, true); - ca.uhn.hl7v2.model.AbstractMessage message = (ca.uhn.hl7v2.model.AbstractMessage) messageClass.newInstance(); + ca.uhn.hl7v2.model.AbstractMessage message = (ca.uhn.hl7v2.model.AbstractMessage) messageClass.getDeclaredConstructor().newInstance(); message.initQuickstart(theType, theTrigger, "T"); - GenericParser p = new GenericParser(); Hl7V2MessageBase msg; if (theEncoding == Hl7V2EncodingTypeEnum.ER_7) { @@ -203,11 +202,17 @@ public void addMessage(String theVersion, String theType, String theTrigger, Str col.setEncoding(Hl7V2EncodingTypeEnum.ER_7); msg = new Hl7V2MessageEr7(); msg.setSourceMessage(p.encode(message)); - } else { + } if (theEncoding == Hl7V2EncodingTypeEnum.XML){ p.setXMLParserAsPrimary(); col.setEncoding(Hl7V2EncodingTypeEnum.XML); msg = new Hl7V2MessageXml(); msg.setSourceMessage(p.encode(message)); + } + else { + p.setPipeParserAsPrimary(); + col.setEncoding(Hl7V2EncodingTypeEnum.ER_7); + msg = new Hl7V2MessageEr7(); + msg.setSourceMessage(p.encode(message)); } col.addMessage(new Comment("")); diff --git a/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/controller/Prefs.java b/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/controller/Prefs.java index c9c358e4c3..aa5a12e130 100644 --- a/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/controller/Prefs.java +++ b/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/controller/Prefs.java @@ -385,14 +385,16 @@ public String getOutboundConnectionList() { public List getRecentMessageXmlFiles(ProfileFileList theProfileFileList) { List retVal = new ArrayList(); List savedVals = myRecentMessageXmlFiles; - for (XmlFormat string : savedVals) { - try { - Hl7V2MessageCollection nextMsg = Hl7V2MessageCollection.fromXml(theProfileFileList, string); - if (StringUtils.isNotBlank(nextMsg.getSaveFileName())) { - retVal.add(nextMsg); + if(savedVals != null) { + for (XmlFormat string : savedVals) { + try { + Hl7V2MessageCollection nextMsg = Hl7V2MessageCollection.fromXml(theProfileFileList, string); + if (StringUtils.isNotBlank(nextMsg.getSaveFileName())) { + retVal.add(nextMsg); + } + } catch (Exception e) { + ourLog.error("Failed to restore profile", e); } - } catch (Exception e) { - ourLog.error("Failed to restore profile", e); } } return retVal; @@ -860,12 +862,12 @@ public static File getTempWorkfilesDirectory() throws IOException { } public static File getTestpanelHomeDirectory() { - File userHome = new File(System.getProperty("user.home")); + File userHome = new File(System.getProperty("user.home")); File testPanelHome = new File(userHome, "HapiTestPanel"); return testPanelHome; } - // @XmlType() + // @XmlType()h // @XmlAccessorType(XmlAccessType.FIELD) // public static class OpenImportedProfileGroupFile { // diff --git a/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/model/conf/ConformanceComposite.java b/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/model/conf/ConformanceComposite.java index 26e5e6c3b8..4f14a0afab 100644 --- a/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/model/conf/ConformanceComposite.java +++ b/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/model/conf/ConformanceComposite.java @@ -44,12 +44,12 @@ public class ConformanceComposite extends AbstractType implements Composite, Con private List myChildren = new ArrayList(); private List myName = new ArrayList(); - private AbstractComponent myConfDefinition; + private AbstractComponent myConfDefinition; /** * Constructor */ - public ConformanceComposite(ConformanceMessage theMessage, AbstractComponent theConfDefinition) { + public ConformanceComposite(ConformanceMessage theMessage, AbstractComponent theConfDefinition) { super(theMessage); myConfDefinition = theConfDefinition; @@ -58,7 +58,7 @@ public ConformanceComposite(ConformanceMessage theMessage, AbstractComponent the /** * @return the confDefinition */ - public AbstractComponent getConfDefinition() { + public AbstractComponent getConfDefinition() { return myConfDefinition; } diff --git a/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/model/conf/ConformancePrimitive.java b/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/model/conf/ConformancePrimitive.java index 4cd3a42247..1de1073978 100644 --- a/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/model/conf/ConformancePrimitive.java +++ b/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/model/conf/ConformancePrimitive.java @@ -36,9 +36,9 @@ public ConformanceMessage getMessage() { return (ConformanceMessage) super.getMessage(); } - private AbstractComponent myConfDefinition; + private AbstractComponent myConfDefinition; - public ConformancePrimitive(ConformanceMessage theMessage, AbstractComponent theConfDefinition) { + public ConformancePrimitive(ConformanceMessage theMessage, AbstractComponent theConfDefinition) { super(theMessage); myConfDefinition = theConfDefinition; @@ -47,7 +47,7 @@ public ConformancePrimitive(ConformanceMessage theMessage, AbstractComponent the /** * @return the confDefinition */ - public AbstractComponent getConfDefinition() { + public AbstractComponent getConfDefinition() { return myConfDefinition; } diff --git a/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/model/conf/ConformanceStructureHolderSupport.java b/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/model/conf/ConformanceStructureHolderSupport.java index a3f36df880..ca32445f23 100644 --- a/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/model/conf/ConformanceStructureHolderSupport.java +++ b/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/model/conf/ConformanceStructureHolderSupport.java @@ -240,4 +240,10 @@ public Location provideLocation(Location theParentLocation, int theIndex, int th throw new UnsupportedOperationException(); } + @Override + public Map> getAllStructure() throws HL7Exception { + // TODO Auto-generated method stub + return null; + } + } diff --git a/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/model/msg/Hl7V2MessageBase.java b/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/model/msg/Hl7V2MessageBase.java index c227239f00..fd6562bc0e 100755 --- a/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/model/msg/Hl7V2MessageBase.java +++ b/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/model/msg/Hl7V2MessageBase.java @@ -384,6 +384,15 @@ public void updateSourceMessageBasedOnParsedMessage() { } } + /** + * + * @param theField + * @param theRepNum + * @param theSegmentRange + * @param theSourceMessage + * @param theParsedMessage + * @return Range of highlighted path, selected by user + */ static Range findFieldRange(List theField, int theRepNum, Range theSegmentRange, String theSourceMessage, Message theParsedMessage) { EncodingCharacters enc; try { @@ -405,6 +414,14 @@ static Range findFieldRange(List theField, int theRepNum, Range theSegm if (!theSegmentRange.applyTo(theSourceMessage).startsWith("MSH")) { offset++; } + if(theSegmentRange.applyTo(theSourceMessage).startsWith("MSH") ) { + if(theField.get(0)==1) { + return currentRange = new Range(3,4); + } + if(theField.get(0)==2) { + return currentRange = new Range(4,theSourceMessage.indexOf(enc.getFieldSeparator(), 4)); + } + } break; case 1: sep = enc.getComponentSeparator(); @@ -431,16 +448,17 @@ static Range findFieldRange(List theField, int theRepNum, Range theSegm } else { if (componentPathIndex == 0) { - char repSep = enc.getRepetitionSeparator(); - for (int i = 1; i <= theRepNum; i++) { + char repSep =enc.getRepetitionSeparator(); + for (int i = 1; i <= theRepNum; i++) { + int nextFieldSep=theSourceMessage.indexOf(enc.getFieldSeparator(), currentRange.getStart()); int repIndex = theSourceMessage.indexOf(repSep, currentRange.getStart()); - if (repIndex == -1) { + + if (repIndex == -1 || repIndex > nextFieldSep) { if (i == theRepNum) { currentRange = new Range(currentRange.getStart(), nextSeparatorIndex); } else { - // rep is beyond what the message actually - // has.. this probably shouldn't happen - return new Range(currentRange.getEnd(), currentRange.getEnd()); + //return new Range(currentRange.getEnd(), currentRange.getEnd()); + currentRange = new Range(currentRange.getStart(), nextFieldSep != -1 ? nextFieldSep : currentRange.getEnd() ); } } else if (i == theRepNum) { currentRange = new Range(currentRange.getStart(), repIndex); diff --git a/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/model/msg/Hl7V2MessageCollection.java b/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/model/msg/Hl7V2MessageCollection.java index 2fc2139440..10c4a9e4e1 100644 --- a/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/model/msg/Hl7V2MessageCollection.java +++ b/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/model/msg/Hl7V2MessageCollection.java @@ -671,16 +671,15 @@ public void setEncoding(Hl7V2EncodingTypeEnum theEncoding) { Validate.notNull(theEncoding); Hl7V2EncodingTypeEnum oldEncodingValue = myEncoding; - if (myEncoding != theEncoding) { + //if (myEncoding != theEncoding) { myEncoding = theEncoding; - switch (myEncoding) { case ER_7: myParser.setPipeParserAsPrimary(); break; case XML: myParser.setXMLParserAsPrimary(); - break; + break; } StringBuilder b = new StringBuilder(); @@ -712,15 +711,16 @@ public void setEncoding(Hl7V2EncodingTypeEnum theEncoding) { String oldValue = mySourceMessage; mySourceMessage = b.toString(); - firePropertyChange(SOURCE_MESSAGE_PROPERTY, oldValue, mySourceMessage); + firePropertyChange(SOURCE_MESSAGE_PROPERTY, "oldValue", mySourceMessage); if (StringUtils.equals(oldValue, mySourceMessage) == false) { setSaved(false); } firePropertyChange(PROP_ENCODING, oldEncodingValue, myEncoding); - } + //} } + public void setHighlitedPathBasedOnRange(Range theRange) { diff --git a/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/model/msg/Hl7V2MessageEr7.java b/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/model/msg/Hl7V2MessageEr7.java index cb8ad5d012..7968c9d124 100644 --- a/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/model/msg/Hl7V2MessageEr7.java +++ b/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/model/msg/Hl7V2MessageEr7.java @@ -45,6 +45,7 @@ import ca.uhn.hl7v2.model.Varies; import ca.uhn.hl7v2.parser.DefaultXMLParser; import ca.uhn.hl7v2.parser.EncodingCharacters; +import ca.uhn.hl7v2.parser.PipeParser; import ca.uhn.hl7v2.testpanel.util.CharCountingStringIteratorDecorator; import ca.uhn.hl7v2.testpanel.util.Range; import ca.uhn.hl7v2.testpanel.util.SegmentAndComponentPath; @@ -72,9 +73,8 @@ public Hl7V2MessageEr7(int theIndexWithinCollection) throws PropertyVetoExceptio public Hl7V2MessageBase asEncoding(Hl7V2EncodingTypeEnum theEncoding) { switch (theEncoding) { case ER_7: - return this; - case XML: - default: + return this; + case XML: Hl7V2MessageXml retVal = new Hl7V2MessageXml(); try { retVal.setSourceMessage(new DefaultXMLParser().encode(getParsedMessage())); @@ -85,6 +85,20 @@ public Hl7V2MessageBase asEncoding(Hl7V2EncodingTypeEnum theEncoding) { } return retVal; + + default: + Hl7V2MessageEr7 retVal1 = new Hl7V2MessageEr7(); + try { + PipeParser pipeParser = new PipeParser(); + String encode = pipeParser.encode(getParsedMessage()); + retVal1.setSourceMessage(encode); + } catch (PropertyVetoException e) { + ourLog.error("Failed to create XML message", e); + } catch (HL7Exception e) { + ourLog.error("Failed to create XML message", e); + } + return retVal1; + } } diff --git a/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/ui/AboutDialog.java b/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/ui/AboutDialog.java index b170937ebb..b9d5b3193e 100644 --- a/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/ui/AboutDialog.java +++ b/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/ui/AboutDialog.java @@ -30,6 +30,7 @@ import java.awt.Component; import java.awt.Cursor; import java.awt.Desktop; +import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; @@ -38,6 +39,7 @@ import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; +import java.io.File; import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; @@ -46,8 +48,10 @@ import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JDialog; +import javax.swing.JEditorPane; import javax.swing.JLabel; import javax.swing.JPanel; +import javax.swing.JScrollPane; import javax.swing.SwingConstants; import javax.swing.border.EmptyBorder; import javax.swing.border.LineBorder; @@ -77,7 +81,7 @@ public static void main(String[] args) { * Create the dialog. */ public AboutDialog() { - setBounds(100, 100, 583, 553); + setBounds(100, 100, 583, 553); getContentPane().setLayout(new BorderLayout()); mycontentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); getContentPane().add(mycontentPanel, BorderLayout.CENTER); @@ -141,11 +145,18 @@ public AboutDialog() { lblLearnMore.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { - try { - open(new URI("http://hl7api.sourceforge.net/newtestpanel.html")); - } catch (URISyntaxException e1) { - ourLog.error("Failed to create hyperlink", e1); - } + + //open(new URI("https://hapifhir.github.io/hapi-hl7v2/")); + if (Desktop.isDesktopSupported()) { + try { + ClassLoader classLoader = getClass().getClassLoader(); + File myFile = new File(AboutDialog.class.getResource("/ca/uhn/hl7v2/testpanel/images/Help_HAPI.pdf").getFile()); + Desktop.getDesktop().open(myFile); + } catch (IOException ex) { + //Control the exception + } + } + } }); lblLearnMore.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); @@ -215,6 +226,7 @@ public void mouseClicked(MouseEvent e) { gbc_lblNewLabel_2.gridy = 7; panel.add(lblNewLabel_2, gbc_lblNewLabel_2); } + } { JPanel buttonPane = new JPanel(); diff --git a/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/ui/AddMessageDialog.java b/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/ui/AddMessageDialog.java index 9bd37a355b..e3d1305291 100644 --- a/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/ui/AddMessageDialog.java +++ b/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/ui/AddMessageDialog.java @@ -70,6 +70,7 @@ public class AddMessageDialog extends JDialog { private JList myVersionList; private JList myMessageTypeList; private JRadioButton myEr7Radio; + private JRadioButton myXmLRadio; private final ButtonGroup encodingButtonGroup = new ButtonGroup(); private String myCurrentSelectedVersion; private DefaultListModel myMessageTypeListModel; @@ -95,6 +96,7 @@ public static void main(String[] args) { public AddMessageDialog(Controller theController) { myController = theController; + setMinimumSize(new Dimension(450, 400)); setPreferredSize(new Dimension(450, 400)); setSize(new Dimension(450, 400)); @@ -214,9 +216,10 @@ public AddMessageDialog(Controller theController) { panel_1.add(myEr7Radio); } { - JRadioButton myXmlRadio = new JRadioButton("XML"); - encodingButtonGroup.add(myXmlRadio); - panel_1.add(myXmlRadio); + myXmLRadio = new JRadioButton("XML"); + myXmLRadio.setSelected(true); + encodingButtonGroup.add(myXmLRadio); + panel_1.add(myXmLRadio); } } } @@ -236,7 +239,13 @@ public void actionPerformed(ActionEvent e) { String type = fullTypeBits[0]; String trigger = fullTypeBits[1]; - Hl7V2EncodingTypeEnum encoding = myEr7Radio.isSelected() ? Hl7V2EncodingTypeEnum.ER_7 : Hl7V2EncodingTypeEnum.XML; + Hl7V2EncodingTypeEnum encoding = Hl7V2EncodingTypeEnum.ER_7; + if(myXmLRadio.isSelected()) + encoding= Hl7V2EncodingTypeEnum.XML; + if(myEr7Radio.isSelected()) + encoding=Hl7V2EncodingTypeEnum.ER_7 ; + + myController.addMessage(version, type, trigger, structure, encoding); } finally { setVisible(false); diff --git a/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/ui/FileChooserOpenAccessory.java b/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/ui/FileChooserOpenAccessory.java index 3c8bb5a670..e0ffefbd36 100644 --- a/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/ui/FileChooserOpenAccessory.java +++ b/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/ui/FileChooserOpenAccessory.java @@ -78,7 +78,7 @@ public FileChooserOpenAccessory() { List charSets = new ArrayList(Charset.availableCharsets().keySet()); Collections.sort(charSets); - ComboBoxModel charsetModel = new DefaultComboBoxModel(charSets.toArray(new String[0])); + ComboBoxModel charsetModel = new DefaultComboBoxModel(charSets.toArray(new String[0])); myCharsetCombo.setModel(charsetModel); Charset openOrSaveCharset = Prefs.getInstance().getOpenOrSaveCharset(); myCharsetCombo.setSelectedItem(openOrSaveCharset.name()); diff --git a/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/ui/FileChooserSaveAccessory.java b/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/ui/FileChooserSaveAccessory.java index 58de343209..37df519903 100644 --- a/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/ui/FileChooserSaveAccessory.java +++ b/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/ui/FileChooserSaveAccessory.java @@ -153,7 +153,7 @@ public FileChooserSaveAccessory() { List charSets = new ArrayList(Charset.availableCharsets().keySet()); Collections.sort(charSets); - ComboBoxModel charsetModel = new DefaultComboBoxModel(charSets.toArray(new String[0])); + ComboBoxModel charsetModel = new DefaultComboBoxModel(charSets.toArray(new String[0])); myCharsetCombo.setModel(charsetModel); Charset openOrSaveCharset = Prefs.getInstance().getOpenOrSaveCharset(); myCharsetCombo.setSelectedItem(openOrSaveCharset.name()); diff --git a/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/ui/conf/ConformanceEditorPanel.java b/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/ui/conf/ConformanceEditorPanel.java index 59d5fb08b6..24d0d2d3ed 100644 --- a/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/ui/conf/ConformanceEditorPanel.java +++ b/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/ui/conf/ConformanceEditorPanel.java @@ -145,8 +145,8 @@ public void propertyChange(PropertyChangeEvent theEvt) { private void addTable() { Object selectedObject = getSelectedFileOrTable(); - TableFile file; + if (selectedObject instanceof TableFile) { file = (TableFile) selectedObject; } else if (selectedObject instanceof Table) { @@ -759,7 +759,7 @@ public void run() { myTableFilesTreeModel.nodeStructureChanged(myTableFilesTreeRoot); } - private void updateProfileTree(Object theSelectedObject) { + private void updateProfileTree(Object theSelectedObject) { List profileFiles = myController.getProfileFileList().getProfiles(); int row = 0; diff --git a/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/ui/editor/Hl7V2MessageEditorPanel.java b/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/ui/editor/Hl7V2MessageEditorPanel.java index 225d933eae..8e24c5beea 100644 --- a/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/ui/editor/Hl7V2MessageEditorPanel.java +++ b/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/ui/editor/Hl7V2MessageEditorPanel.java @@ -47,7 +47,13 @@ import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedList; import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Properties; import javax.swing.Box; import javax.swing.ButtonGroup; @@ -79,10 +85,29 @@ import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.Validate; +import org.mortbay.xml.XmlParser; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import ca.uhn.hl7v2.DefaultHapiContext; +import ca.uhn.hl7v2.HL7Exception; +import ca.uhn.hl7v2.HapiContext; +import ca.uhn.hl7v2.Location; +import ca.uhn.hl7v2.Version; import ca.uhn.hl7v2.conf.ProfileException; +import ca.uhn.hl7v2.model.AbstractGroup; +import ca.uhn.hl7v2.model.AbstractPrimitive; +import ca.uhn.hl7v2.model.AbstractSegment; +import ca.uhn.hl7v2.model.AbstractStructure; +import ca.uhn.hl7v2.model.GenericMessage; +import ca.uhn.hl7v2.model.Message; +import ca.uhn.hl7v2.model.Segment; +import ca.uhn.hl7v2.model.Structure; +import ca.uhn.hl7v2.model.Type; +import ca.uhn.hl7v2.parser.DefaultXMLParser; +import ca.uhn.hl7v2.parser.GenericModelClassFactory; +import ca.uhn.hl7v2.parser.Parser; +import ca.uhn.hl7v2.parser.ParserConfiguration; import ca.uhn.hl7v2.testpanel.controller.Controller; import ca.uhn.hl7v2.testpanel.controller.Prefs; import ca.uhn.hl7v2.testpanel.model.conf.ProfileFileList; @@ -90,6 +115,8 @@ import ca.uhn.hl7v2.testpanel.model.conn.OutboundConnection; import ca.uhn.hl7v2.testpanel.model.conn.OutboundConnectionList; import ca.uhn.hl7v2.testpanel.model.msg.Hl7V2MessageCollection; +import ca.uhn.hl7v2.testpanel.model.msg.Hl7V2MessageEr7; +import ca.uhn.hl7v2.testpanel.model.msg.Hl7V2MessageXml; import ca.uhn.hl7v2.testpanel.ui.ActivityTable; import ca.uhn.hl7v2.testpanel.ui.BaseMainPanel; import ca.uhn.hl7v2.testpanel.ui.Er7SyntaxKit; @@ -103,6 +130,31 @@ import ca.uhn.hl7v2.testpanel.xsd.Hl7V2EncodingTypeEnum; import ca.uhn.hl7v2.validation.impl.DefaultValidation; +import java.io.IOException; +import java.io.StringReader; +import java.io.StringWriter; +import java.text.AttributedString; + +import javax.xml.XMLConstants; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; + +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; + + public class Hl7V2MessageEditorPanel extends BaseMainPanel implements IDestroyable { private static final String CREATE_NEW_CONNECTION = "Create New Connection..."; private static final String NO_CONNECTIONS = "No Connections"; @@ -120,7 +172,7 @@ public class Hl7V2MessageEditorPanel extends BaseMainPanel implements IDestroyab } catch (Throwable e) { e.printStackTrace(); } - + } private boolean myDontRespondToSourceMessageChanges; @@ -148,6 +200,7 @@ public class Hl7V2MessageEditorPanel extends BaseMainPanel implements IDestroyab private PropertyChangeListener myRangeListener; private JRadioButton myRdbtnEr7; private JRadioButton myRdbtnXml; + private JRadioButton myRdbtnTableView; private PropertyChangeListener mySelectedPathListener; private JButton mySendButton; private JSplitPane mysplitPane; @@ -221,7 +274,7 @@ public void run() { myMessageEditor.setSelectedTextColor(Color.black); myMessageEditor.setCaret(new EditorCaret()); - + myMessageScrollPane = new JScrollPane(myMessageEditor); messageEditorContainerPanel.add(myMessageScrollPane); @@ -237,7 +290,8 @@ public void actionPerformed(ActionEvent e) { theController.setMessageEditorInFollowMode(myFollowToggle.isSelected()); } }); - myFollowToggle.setIcon(new ImageIcon(Hl7V2MessageEditorPanel.class.getResource("/ca/uhn/hl7v2/testpanel/images/updown.png"))); + myFollowToggle.setIcon( + new ImageIcon(Hl7V2MessageEditorPanel.class.getResource("/ca/uhn/hl7v2/testpanel/images/updown.png"))); myFollowToggle.setSelected(theController.isMessageEditorInFollowMode()); toolBar.add(myFollowToggle); @@ -250,18 +304,25 @@ public void actionPerformed(ActionEvent e) { myRdbtnEr7 = new JRadioButton("ER7"); myRdbtnEr7.setMargin(new Insets(1, 2, 0, 1)); toolBar.add(myRdbtnEr7); + myRdbtnEr7.setSelected(true); myRdbtnXml = new JRadioButton("XML"); myRdbtnXml.setMargin(new Insets(1, 5, 0, 1)); toolBar.add(myRdbtnXml); + + myRdbtnTableView = new JRadioButton("View as Table"); + myRdbtnTableView.setMargin(new Insets(1, 5, 0, 1)); + toolBar.add(myRdbtnTableView); encGrp.add(myRdbtnEr7); encGrp.add(myRdbtnXml); + encGrp.add(myRdbtnTableView); treeContainerPanel = new JPanel(); mysplitPane.setLeftComponent(treeContainerPanel); treeContainerPanel.setLayout(new BorderLayout(0, 0)); - mySpinnerIconOn = new ImageIcon(Hl7V2MessageEditorPanel.class.getResource("/ca/uhn/hl7v2/testpanel/images/spinner.gif")); + mySpinnerIconOn = new ImageIcon( + Hl7V2MessageEditorPanel.class.getResource("/ca/uhn/hl7v2/testpanel/images/spinner.gif")); mySpinnerIconOff = new ImageIcon(); myTreePanel = new Hl7V2MessageTree(theController); @@ -273,7 +334,6 @@ public void startedWorking() { mySpinnerIconOn.setImageObserver(mySpinner); } - public void finishedWorking(String theStatus) { mySpinner.setText(theStatus); @@ -315,7 +375,8 @@ public void actionPerformed(ActionEvent e) { } }); collapseAllButton.setToolTipText("Collapse All"); - collapseAllButton.setIcon(new ImageIcon(Hl7V2MessageEditorPanel.class.getResource("/ca/uhn/hl7v2/testpanel/images/collapse_all.png"))); + collapseAllButton.setIcon(new ImageIcon( + Hl7V2MessageEditorPanel.class.getResource("/ca/uhn/hl7v2/testpanel/images/collapse_all.png"))); mytoolBar_1.add(collapseAllButton); expandAllButton = new JButton(); @@ -327,7 +388,8 @@ public void actionPerformed(ActionEvent e) { } }); expandAllButton.setToolTipText("Expand All"); - expandAllButton.setIcon(new ImageIcon(Hl7V2MessageEditorPanel.class.getResource("/ca/uhn/hl7v2/testpanel/images/expand_all.png"))); + expandAllButton.setIcon(new ImageIcon( + Hl7V2MessageEditorPanel.class.getResource("/ca/uhn/hl7v2/testpanel/images/expand_all.png"))); mytoolBar_1.add(expandAllButton); myhorizontalGlue = Box.createHorizontalGlue(); @@ -368,7 +430,8 @@ public void actionPerformed(ActionEvent e) { // int selectedIndex = // myOutboundInterfaceComboModel.getIndexOf(myOutboundInterfaceComboModel.getSelectedItem()); int selectedIndex = myOutboundInterfaceCombo.getSelectedIndex(); - OutboundConnection connection = myController.getOutboundConnectionList().getConnections().get(selectedIndex); + OutboundConnection connection = myController.getOutboundConnectionList().getConnections() + .get(selectedIndex); activateSendingActivityTabForConnection(connection); myController.sendMessages(connection, myMessage, mySendingActivityTable.provideTransmissionCallback()); } @@ -384,7 +447,8 @@ public void actionPerformed(ActionEvent e) { mySendOptionsButton.setBorderPainted(false); final HoverButtonMouseAdapter sendOptionsHoverAdaptor = new HoverButtonMouseAdapter(mySendOptionsButton); mySendOptionsButton.addMouseListener(sendOptionsHoverAdaptor); - mySendOptionsButton.setIcon(new ImageIcon(Hl7V2MessageEditorPanel.class.getResource("/ca/uhn/hl7v2/testpanel/images/sendoptions.png"))); + mySendOptionsButton.setIcon(new ImageIcon( + Hl7V2MessageEditorPanel.class.getResource("/ca/uhn/hl7v2/testpanel/images/sendoptions.png"))); mytoolBar.add(mySendOptionsButton); mySendOptionsButton.addActionListener(new ActionListener() { @@ -394,14 +458,16 @@ public void actionPerformed(ActionEvent theE) { mySendOptionsPopupDialog = null; return; } - mySendOptionsPopupDialog = new SendOptionsPopupDialog(Hl7V2MessageEditorPanel.this, myMessage, mySendOptionsButton, sendOptionsHoverAdaptor); + mySendOptionsPopupDialog = new SendOptionsPopupDialog(Hl7V2MessageEditorPanel.this, myMessage, + mySendOptionsButton, sendOptionsHoverAdaptor); Point los = mySendOptionsButton.getLocationOnScreen(); mySendOptionsPopupDialog.setLocation(los.x, los.y + mySendOptionsButton.getHeight()); mySendOptionsPopupDialog.setVisible(true); } }); - mySendButton.setIcon(new ImageIcon(Hl7V2MessageEditorPanel.class.getResource("/ca/uhn/hl7v2/testpanel/images/button_execute.png"))); + mySendButton.setIcon(new ImageIcon( + Hl7V2MessageEditorPanel.class.getResource("/ca/uhn/hl7v2/testpanel/images/button_execute.png"))); mytoolBar.add(mySendButton); myhorizontalStrut_1 = Box.createHorizontalStrut(20); @@ -428,7 +494,8 @@ public void actionPerformed(ActionEvent e) { } else if (myProfileCombobox.getSelectedIndex() == 1) { myMessage.setValidationContext(new DefaultValidation()); } else if (myProfileCombobox.getSelectedIndex() > 0) { - ProfileGroup profile = myProfileComboboxModel.myProfileGroups.get(myProfileCombobox.getSelectedIndex()); + ProfileGroup profile = myProfileComboboxModel.myProfileGroups + .get(myProfileCombobox.getSelectedIndex()); myMessage.setRuntimeProfile(profile); // } else if (myProfileCombobox.getSelectedItem() == @@ -525,7 +592,6 @@ public void mouseClicked(MouseEvent e) { } - public void destroy() { myMessage.removePropertyChangeListener(Hl7V2MessageCollection.SOURCE_MESSAGE_PROPERTY, myMessageListeneer); myMessage.removePropertyChangeListener(Hl7V2MessageCollection.PROP_HIGHLITED_RANGE, myRangeListener); @@ -533,13 +599,13 @@ public void destroy() { myMessage.removePropertyChangeListener(Hl7V2MessageCollection.PROP_SAVE_FILENAME, myWindowTitleListener); myTreePanel.destroy(); - myController.getOutboundConnectionList().addPropertyChangeListener(OutboundConnectionList.PROP_LIST, myOutboundConnectionsListener); + myController.getOutboundConnectionList().addPropertyChangeListener(OutboundConnectionList.PROP_LIST, + myOutboundConnectionsListener); myTablesComboModel.destroy(); unregisterProfileNamesListeners(); } - private void initLocal() { myDocumentListener = new DocumentListener() { @@ -549,7 +615,6 @@ public void changedUpdate(DocumentEvent theE) { handleChange(theE); } - private void handleChange(DocumentEvent theE) { myDontRespondToSourceMessageChanges = true; try { @@ -566,13 +631,11 @@ private void handleChange(DocumentEvent theE) { } } - public void insertUpdate(DocumentEvent theE) { ourLog.info("Document insert: " + theE); handleChange(theE); } - public void removeUpdate(DocumentEvent theE) { ourLog.info("Document removed: " + theE); handleChange(theE); @@ -589,7 +652,8 @@ public void caretUpdate(final CaretEvent theE) { public void run() { myMessage.setHighlitedPathBasedOnRange(new Range(theE.getDot(), theE.getMark())); myTreePanel.repaint(); - }}); + } + }); } } }); @@ -601,7 +665,8 @@ public void propertyChange(PropertyChangeEvent theEvt) { updateOutboundConnectionsBox(); } }; - myController.getOutboundConnectionList().addPropertyChangeListener(OutboundConnectionList.PROP_LIST, myOutboundConnectionsListener); + myController.getOutboundConnectionList().addPropertyChangeListener(OutboundConnectionList.PROP_LIST, + myOutboundConnectionsListener); myOutboundInterfaceCombo.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent theE) { @@ -640,7 +705,6 @@ public void propertyChange(PropertyChangeEvent theEvt) { } - private void registerProfileNamesListeners() { unregisterProfileNamesListeners(); for (ProfileGroup next : myController.getProfileFileList().getProfiles()) { @@ -648,14 +712,12 @@ private void registerProfileNamesListeners() { } } - private void unregisterProfileNamesListeners() { for (ProfileGroup next : myController.getProfileFileList().getProfiles()) { next.removePropertyChangeListener(ProfileGroup.PROP_NAME, myProfilesNamesListener); } } - private void updateSendButton() { String selected = (String) myOutboundInterfaceCombo.getSelectedItem(); if (selected == null || selected == NO_CONNECTIONS) { @@ -673,7 +735,6 @@ public void ok(OutboundConnection theArg) { myOutboundInterfaceCombo.setSelectedIndex(myOutboundInterfaceComboModel.getSize() - 2); } - public void cancel(OutboundConnection theArg) { myOutboundInterfaceCombo.setSelectedIndex(0); } @@ -684,17 +745,16 @@ public void cancel(OutboundConnection theArg) { if (myMessage != null) { int selectedIndex = myOutboundInterfaceCombo.getSelectedIndex(); - OutboundConnection connection = myController.getOutboundConnectionList().getConnections().get(selectedIndex); + OutboundConnection connection = myController.getOutboundConnectionList().getConnections() + .get(selectedIndex); myMessage.setLastSendToInterfaceId(connection.getId()); } mySendButton.setEnabled(true); } - /** - * @param theMessage - * the message to set + * @param theMessage the message to set */ public void setMessage(Hl7V2MessageCollection theMessage) { Validate.isTrue(myMessage == null); @@ -706,14 +766,15 @@ public void setMessage(Hl7V2MessageCollection theMessage) { // Prepopulate the "send to interface" combo to the last value it had if (StringUtils.isNotBlank(myMessage.getLastSendToInterfaceId())) { for (int i = 0; i < myOutboundInterfaceComboModelShadow.size(); i++) { - if (myOutboundInterfaceComboModelShadow.get(i).getId().equals(myMessage.getLastSendToInterfaceId())) { + if (myOutboundInterfaceComboModelShadow != null && myMessage != null + && myOutboundInterfaceComboModelShadow.get(i) != null && myOutboundInterfaceComboModelShadow + .get(i).getId().equals(myMessage.getLastSendToInterfaceId())) { myOutboundInterfaceCombo.setSelectedIndex(i); break; } } } - - updateEncodingButtons(); + myRdbtnEr7.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent theE) { removeHighlights(); @@ -727,6 +788,15 @@ public void actionPerformed(ActionEvent theE) { } }); + + myRdbtnTableView.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent theE) { + removeHighlights(); + myMessage.setEncoding(Hl7V2EncodingTypeEnum.ER_7); + } + }); + + try { myDisableCaretUpdateHandling = true; updateMessageEditor(); @@ -819,7 +889,6 @@ public void run() { } - private void removeHighlights() { Highlighter hilite = myMessageEditor.getHighlighter(); Highlighter.Highlight[] hilites = hilite.getHighlights(); @@ -828,7 +897,6 @@ private void removeHighlights() { } } - // Removes all but the 2 most recent highlights - the last tag pair // selected. private void removeMostHighlights() { @@ -839,7 +907,6 @@ private void removeMostHighlights() { } } - private void updateWindowTitle() { StringBuilder b = new StringBuilder(); @@ -860,50 +927,44 @@ private void updateWindowTitle() { } - private void updateEncodingButtons() { - switch (myMessage.getEncoding()) { - case XML: - myRdbtnXml.setSelected(true); - myRdbtnEr7.setSelected(false); - break; - case ER_7: - myRdbtnXml.setSelected(false); - myRdbtnEr7.setSelected(true); - } - } - - - private void updateMessageEditor() { final JScrollBar vsb = myMessageScrollPane.getVerticalScrollBar(); int initialVerticalValue = vsb.getValue(); myMessageEditor.getDocument().removeDocumentListener(myDocumentListener); - + String sourceMessage = myMessage.getSourceMessage(); + if (myMessage.getEncoding() == Hl7V2EncodingTypeEnum.XML) { myMessageEditor.setContentType("text/xml"); - } else { + } else if (myMessage.getEncoding() == Hl7V2EncodingTypeEnum.ER_7) { myMessageEditor.setContentType("text/er7"); sourceMessage = sourceMessage.replace('\r', '\n'); - } + } + + if (myRdbtnTableView.isSelected()) { + sourceMessage = ConvertMessageToHtml(sourceMessage.trim().replaceAll("((\r\n)|\r)|(\n)", "\n"), myMessage); + myMessageEditor.setContentType("text/html"); + myMessageEditor.disable(); + } myMessageEditor.setText(sourceMessage); - myMessageEditor.getDocument().addDocumentListener(myDocumentListener); - + myMessageEditor.repaint(); final int verticalValue = Math.min(initialVerticalValue, vsb.getMaximum()); SwingUtilities.invokeLater(new Runnable() { public void run() { // myMessageEditor.setFont(Prefs.getHl7EditorFont()); + myMessageEditor.repaint(); vsb.setValue(verticalValue); } }); } + private void updateOutboundConnectionsBox() { @@ -945,7 +1006,6 @@ private class ProfileComboModel extends DefaultComboBoxModel { // "Apply Conformance Profile..."; private ArrayList myProfileGroups; - public void update() { myHandlingProfileComboboxChange = true; try { @@ -999,7 +1059,6 @@ public class ShowComboModel extends DefaultComboBoxModel implements ActionListen private static final String POPULATED = "Populated"; private static final String SUPPORTED = "Supported"; - public ShowComboModel() { addElement(POPULATED); addElement(ALL); @@ -1007,24 +1066,23 @@ public ShowComboModel() { addElement(SUPPORTED); switch (myMessage.getEditorShowMode()) { - case ALL: - setSelectedItem(ALL); - break; - case ERROR: - setSelectedItem(ERRORS); - break; - case POPULATED: - setSelectedItem(POPULATED); - break; - case SUPPORTED: - setSelectedItem(SUPPORTED); - break; + case ALL: + setSelectedItem(ALL); + break; + case ERROR: + setSelectedItem(ERRORS); + break; + case POPULATED: + setSelectedItem(POPULATED); + break; + case SUPPORTED: + setSelectedItem(SUPPORTED); + break; } myShowCombo.addActionListener(this); } - public void actionPerformed(ActionEvent theE) { String value = (String) myShowCombo.getSelectedItem(); @@ -1041,7 +1099,6 @@ public void actionPerformed(ActionEvent theE) { } } - private void activateSendingActivityTabForConnection(OutboundConnection theConnection) { mySendingActivityTable.setConnection(theConnection, false); myTopTabBar.setSelectedComponent(mySendingActivityTable); @@ -1051,4 +1108,282 @@ public Frame getWindow() { return myController.getWindow(); } + /** + * Creates html elements to add tables in View as Table + * @param xml + * @param theMessage + * @return html code in a string format + */ + private String ConvertMessageToHtml(String xml, Hl7V2MessageCollection theMessage) { + + + StringBuilder html = new StringBuilder("\r\n"); + try { + int index=getFirstMessage(theMessage); + Message message = (Message) ((Hl7V2MessageEr7) theMessage.getMessages().get(index)).getParsedMessage(); + Map> map = message.getAllStructure(); + String version=message.getMessage().getVersion(); + + Iterator>> itr = map.entrySet().iterator(); + List segs=new ArrayList<>(); + while (itr.hasNext()) { + Entry> entry = itr.next(); + + if (entry.getValue().size() > 0) { + + for (Structure item : entry.getValue()) { + String segName; + Structure subItem= item; + getSegments(item, segs); + + } + + } + } + + //Create Table header + html.append("\n" + ""+"\n"+ "\n" + "\n" + " \n"); + for(Segment subItem: segs) { + String name=subItem.getName(); + + if(name.equals("MSH") ) { + headerTable(html, subItem.getName(),version, subItem); + } + } + + html.append("
Header
Field NameValue
\n"+ "
");//table header + //Table about patient + html.append("\n" + ""+"\n"+ "\n" + "\n" + " \n" ); + for(Segment subItem: segs) { + String name=subItem.getName(); + + if(name.equals("PID") ) { + patientTable(html, subItem.getName(),version, subItem); + } + } + html.append("
Patient
Field NameValue
\n"+ "
");//table patient + + //Table about examination + html.append("\n" + ""+"\n"+ "\n" + "\n" + " \n"); + for(Segment subItem: segs) { + String name=subItem.getName(); + + if(name.equals("OBR") || name.equals("ZDS") ||name.equals("ORC") || name.equals("ZEI")) { + examTable(html, subItem.getName(),version, subItem); + } + } + + html.append("
Examination
Field NameValue
\n"+ "
");//table request + + //Create Table request + html.append("\n" + ""+"\n"+ "\n" + "\n" + " \n"); + for(Segment subItem: segs) { + String name=subItem.getName(); + + if(name.equals("OBR") || name.equals("OBX") ||name.equals("ORC") || name.equals("PV1")) { + requestTable(html, subItem.getName(),version, subItem); + } + } + + html.append("
Request
Field NameValue
\n"+ "
");//table request + + + html.append(""); + } catch (Exception e) { + return xml; + } + + return html.toString(); + } + + + void getSegments(Structure group, List segs) throws HL7Exception { + + if(group instanceof Segment) { + segs.add((Segment)group); + + } + else { + AbstractGroup absgroup=(AbstractGroup)group; + String[] names=absgroup.getNames(); + + for(String name : names) { + for(Structure elem : absgroup.getAll(name)) { + getSegments(elem, segs); + } + } + } + + + } + + int getFirstMessage(Hl7V2MessageCollection theMessage) { + int index=0; + String myClass; + + for(Range msg : theMessage.getMessageRanges()) { + + myClass=theMessage.getMessages().get(index).getParsedMessage().getClass().toString(); + if(myClass.contains("ca.uhn.hl7v2.model.")) + return index; + else + index++; + + } + + return index; + } + + + + /** + * Creates html table with some rows of message HL7 fields associated with request/order + * @param html + * @param name of the segment + * @param HL7 message version + * @param Structure (segment) + * @return html StringBuilder + * @throws HL7Exception + */ + private StringBuilder requestTable(StringBuilder html, String segName, String version, Structure subItem) throws HL7Exception { + + AbstractSegment seg = (AbstractSegment) subItem; + int[] val= {}; + List> fields=seg.getAllFields(); + String[] fieldNames=seg.getNames(); + int[] obr= {3,13,16,5,31}; + int[] obx= {2,5,7,16,20}; + int[] orc= {12}; + int[] pv1= {8}; + + + if(segName.equals("OBR")) + val=obr; + if(segName.equals("OBX")) + val=obx; + if(segName.equals("ORC")) + val=orc; + if(segName.equals("PV1")) + val=pv1; + + for(int i : val) { + if(i <= fieldNames.length && !fields.get(i-1).isEmpty()) { + + html.append(""); + html.append("" + fieldNames[i-1] + ""); + html.append("" + fields.get(i-1).toString() + ""); //valor do campo + html.append("\n"); + + } + } + + return html; + } + + /** + * Creates html table with some rows of message HL7 fields associated with patient + * @param html + * @param name of the segment + * @param HL7 message version + * @param Structure (segment) + * @return html StringBuilder + * @throws HL7Exception + */ + private StringBuilder patientTable(StringBuilder html, String segName, String version, Structure subItem) throws HL7Exception { + + AbstractSegment seg = (AbstractSegment) subItem; + List> fields=seg.getAllFields(); + String[] fieldNames=seg.getNames(); + int[] pid= {2,5,7,8,29,30}; + + + for(int i : pid) { + if(i <= fieldNames.length && !fields.get(i-1).isEmpty()) { + + html.append(""); + html.append("" + fieldNames[i-1] + ""); + html.append("" + fields.get(i-1).toString() + ""); //valor do campo + html.append(""); + + } + } + + return html; + } + + /** + * Creates html table with some rows of message HL7 fields associated with examination + * @param html + * @param name of the segment + * @param HL7 message version + * @param Structure (segment) + * @return html StringBuilder + * @throws HL7Exception + */ + private StringBuilder examTable(StringBuilder html, String segName, String version, Structure subItem) throws HL7Exception { + + int[] val= {}; + AbstractSegment seg = (AbstractSegment) subItem; + List> fields=seg.getAllFields(); + String[] fieldNames=seg.getNames(); + int[] obr= {19,4,21,27,20,32,24,15,28}; + int[] zds= {1}; + int[] orc= {5,}; + int[] zei= {7,8}; + + + if(segName.equals("OBR")) + val=obr; + if(segName.equals("ZEI")) + val=zei; + if(segName.equals("ORC")) + val=orc; + if(segName.equals("ZDS")) + val=zds; + + + for(int i : val) { + if(i <= fieldNames.length && !fields.get(i-1).isEmpty()) { + + html.append(""); + html.append("" + fieldNames[i-1] + ""); + html.append("" + fields.get(i-1).toString() + ""); //valor do campo + html.append(""); + + } + } + + return html; + } + + /** + * Creates html table with some rows of message HL7 fields associated with header + * @param html + * @param name of the segment + * @param HL7 message version + * @param Structure (segment) + * @return html StringBuilder + * @throws HL7Exception + */ + private StringBuilder headerTable(StringBuilder html, String segName, String version, Structure subItem) throws HL7Exception { + + AbstractSegment seg = (AbstractSegment) subItem; + List> fields=seg.getAllFields(); + String[] fieldNames=seg.getNames(); + int[] msh= {3,4,5,6,7,9,10,12}; + + + for(int i : msh) { + if(i <= fieldNames.length && !fields.get(i-1).isEmpty()) { + + html.append(""); + html.append("" + fieldNames[i-1] + ""); + html.append("" + fields.get(i-1).toString() + ""); //valor do campo + html.append(""); + + } + } + + return html; + } } diff --git a/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/ui/v2tree/Hl7V2MessageTree.java b/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/ui/v2tree/Hl7V2MessageTree.java index 8ac5135290..cb29a764fa 100644 --- a/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/ui/v2tree/Hl7V2MessageTree.java +++ b/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/ui/v2tree/Hl7V2MessageTree.java @@ -42,6 +42,8 @@ import java.util.HashSet; import java.util.List; import java.util.Set; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import javax.swing.DefaultListSelectionModel; import javax.swing.Icon; @@ -58,6 +60,7 @@ import javax.swing.tree.AbstractLayoutCache; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultTreeModel; +import javax.swing.tree.MutableTreeNode; import javax.swing.tree.TreeNode; import javax.swing.tree.TreePath; @@ -259,6 +262,7 @@ void addChildren() throws InterruptedException, InvocationTargetException { if (myMessages != null) { try { addChildren(myMessages.getMessages(), myTop, ""); + } catch (InterruptedException e) { ourLog.info("Interrupted during an update loop, going to schedule another pass"); myUpdaterThread.scheduleUpdate(); @@ -454,16 +458,17 @@ void addChildren(Segment messParent, TreeNodeBase treeParent, String theTerserPa } Type[] reps = messParent.getField(i); + boolean repeating = messParent.getMaxCardinality(i) != 1; boolean required = messParent.isRequired(i); String name = i <= names.length ? names[i - 1] : "Unknown"; - + for (int j = 0; j < reps.length; j++) { // String field = PipeParser.encode(reps[j], encChars); Type type = reps[j]; - String parentName = messParent.getName() + "-" + (i); + String parentName = messParent.getName() + "-" + (i) + " " + name ; StringBuilder b = new StringBuilder(); b.append(theTerserPath); @@ -761,6 +766,10 @@ private void handleKeyPress(KeyEvent theE) { } } } + /** + * Compares the instance of selected message components and based on that will highlight them + * @param theNewIndex + */ private void handleNewSelectedIndex(int theNewIndex) { if (mySelectionHandlingDisabled) { @@ -790,7 +799,14 @@ private void handleNewSelectedIndex(int theNewIndex) { } } else if (lead instanceof TreeNodeType) { TreeNodeType type = (TreeNodeType) lead; - myMessages.setHighlitedRangeBasedOnField(type.getSegmentAndComponentPath()); + Pattern p = Pattern.compile(".*\\((.*)\\).*"); + Matcher m = p.matcher(type.getTerserPath()); + if(m.find()) { + SegmentAndComponentPath typeLeaf= new SegmentAndComponentPath(type.mySegment, type.myComponentPath, Integer.parseInt(m.group(1))); + myMessages.setHighlitedRangeBasedOnField(typeLeaf); + }else { + myMessages.setHighlitedRangeBasedOnField(type.getSegmentAndComponentPath()); + } } else { myMessages.clearHighlight(); } @@ -1143,6 +1159,7 @@ public String getDisplayName() { * @return the errorDescription */ public String getErrorDescription() { + if (myErrorDescription == null && myValidationExceptions.size() > 0) { StringBuilder b = new StringBuilder(); b.append("
    "); @@ -1320,21 +1337,53 @@ public void setErrorDescription(String theErrorDescription) { } public final void validate() throws InterruptedException, InvocationTargetException { + for (int i = 0; i < getChildCount(); i++) { TreeNodeBase next = (TreeNodeBase) getChildAt(i); - if (next.isHasContent()) { next.validate(); } ShowEnum showMode = myMessages.getEditorShowMode(); - if ((next.getErrorDescription() == null && showMode == ShowEnum.ERROR) || (next.isHasContent() == false && showMode == ShowEnum.POPULATED) || (next.isSupported() == false && next.getErrorDescription() == null && showMode == ShowEnum.SUPPORTED)) { + + if ((next.getErrorDescription() == null && showMode == ShowEnum.ERROR )) { final int index = i; + boolean isMSG=false; + if(next.toString() != null) { + if(next.toString().contains("Hl7V2Message")) + isMSG=true; + + } + if( (next.getChildCount()==0 || (next.getClass().toString().contains("Primitive")) ||next.isHasContent()==false) && isMSG== false) + i--; + + EventQueue.invokeAndWait(new Runnable() { + public void run() { - remove(index); + boolean isMSG=false; + if(next.toString() != null) { + if(next.toString().contains("Hl7V2Message")) + isMSG=true; + + } + + if( (next.getChildCount()==0 || (next.getClass().toString().contains("Primitive")) ||next.isHasContent()==false) && isMSG== false) { + remove(index); + } } - }); + } ); + + continue; + } + + if((next.isHasContent() == false && showMode == ShowEnum.POPULATED) || (next.isSupported() == false && next.getErrorDescription() == null && showMode == ShowEnum.SUPPORTED)) { + final int index = i; + EventQueue.invokeAndWait(new Runnable() { + public void run() { + remove(index); + } + } ); i--; continue; } @@ -1629,7 +1678,6 @@ public void doValidate() { Primitive primitive = getPrimitive(); if (myMessages != null) { if (myMessages.getRuntimeProfile() != null) { - // If we're using a conformance profile, also // use datatype validation as well String version = primitive.getMessage().getVersion(); @@ -1649,7 +1697,6 @@ public void doValidate() { for (PrimitiveTypeRule primitiveTypeRule : rules) { boolean test = primitiveTypeRule.test(primitive.getValue()); if (!test) { - // setErrorDescription(primitiveTypeRule.getDescription()); addValidationExceptions(new HL7Exception(primitiveTypeRule.getDescription())); } } diff --git a/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/util/Range.java b/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/util/Range.java index e40a9b3925..b3a6f650bc 100644 --- a/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/util/Range.java +++ b/hapi-testpanel/src/main/java/ca/uhn/hl7v2/testpanel/util/Range.java @@ -63,7 +63,8 @@ public Range addToEnd(int theDelta) { public String applyTo(String theMessage) { int end = myEnd; - if (theMessage.length() < myEnd) { + +if (theMessage.length() < myEnd) { end = theMessage.length(); } return theMessage.substring(myStart, end); diff --git a/hapi-testpanel/src/main/resources/Vfdcxznb_test_test.pdf b/hapi-testpanel/src/main/resources/Vfdcxznb_test_test.pdf new file mode 100644 index 0000000000..795c98bb61 Binary files /dev/null and b/hapi-testpanel/src/main/resources/Vfdcxznb_test_test.pdf differ diff --git a/hapi-testpanel/src/main/resources/ca/uhn/hl7v2/testpanel/images/Help_HAPI.pdf b/hapi-testpanel/src/main/resources/ca/uhn/hl7v2/testpanel/images/Help_HAPI.pdf new file mode 100644 index 0000000000..17d85bdbcf Binary files /dev/null and b/hapi-testpanel/src/main/resources/ca/uhn/hl7v2/testpanel/images/Help_HAPI.pdf differ diff --git a/pom.xml b/pom.xml index 19945027c6..0259cb803a 100644 --- a/pom.xml +++ b/pom.xml @@ -159,7 +159,7 @@ codehaus Codehaus Repo - http://repository.codehaus.org/org/codehaus/mojo/ + https://repo1.maven.org/maven2/org/codehaus/mojo mc-release