diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/.classpath b/org.openhealthtools.mdht.uml.cda.ccd.tests/.classpath new file mode 100644 index 000000000..121e527a9 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/.project b/org.openhealthtools.mdht.uml.cda.ccd.tests/.project new file mode 100644 index 000000000..cebddd178 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/.project @@ -0,0 +1,28 @@ + + + org.openhealthtools.mdht.uml.cda.ccd.tests + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.pde.PluginNature + + diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/.settings/org.eclipse.jdt.core.prefs b/org.openhealthtools.mdht.uml.cda.ccd.tests/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..fd79a3e6c --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,355 @@ +#Mon May 16 10:24:25 EDT 2011 +eclipse.preferences.version=1 +org.eclipse.jdt.core.codeComplete.argumentPrefixes= +org.eclipse.jdt.core.codeComplete.argumentSuffixes= +org.eclipse.jdt.core.codeComplete.fieldPrefixes= +org.eclipse.jdt.core.codeComplete.fieldSuffixes= +org.eclipse.jdt.core.codeComplete.localPrefixes= +org.eclipse.jdt.core.codeComplete.localSuffixes= +org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.5 +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.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning +org.eclipse.jdt.core.compiler.problem.deadCode=warning +org.eclipse.jdt.core.compiler.problem.deprecation=warning +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore +org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=error +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore +org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning +org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +org.eclipse.jdt.core.compiler.problem.nullReference=warning +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore +org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=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 +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedImport=warning +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +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.5 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=36 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=36 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=36 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=36 +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_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=49 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=32 +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_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=0 +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 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=1 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=150 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@fmtOff +org.eclipse.jdt.core.formatter.enabling_tag=@fmtOn +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +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=true +org.eclipse.jdt.core.formatter.indentation.size=4 +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_parameter=do not 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=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +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_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_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 +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +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_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 +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +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_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not 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_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 +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +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_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 +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +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_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_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 +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=false +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=120 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +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=false +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/.settings/org.eclipse.jdt.ui.prefs b/org.openhealthtools.mdht.uml.cda.ccd.tests/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 000000000..6245d2099 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,120 @@ +#Tue Mar 29 22:38:51 EDT 2011 +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=false +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=false +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=false +cleanup.format_source_code=true +cleanup.format_source_code_changes_only=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=false +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=true +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=true +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=true +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_blocks=true +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_parentheses_in_expressions=false +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup_profile=_MDHT +cleanup_settings_version=2 +eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true +formatter_profile=_MDHT +formatter_settings_version=11 +org.eclipse.jdt.ui.exception.name=e +org.eclipse.jdt.ui.gettersetter.use.is=true +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com; +org.eclipse.jdt.ui.javadoc=true +org.eclipse.jdt.ui.keywordthis=false +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.overrideannotation=true +org.eclipse.jdt.ui.staticondemandthreshold=99 +org.eclipse.jdt.ui.text.custom_code_templates= +sp_cleanup.add_default_serial_version_id=true +sp_cleanup.add_generated_serial_version_id=false +sp_cleanup.add_missing_annotations=true +sp_cleanup.add_missing_deprecated_annotations=true +sp_cleanup.add_missing_methods=false +sp_cleanup.add_missing_nls_tags=false +sp_cleanup.add_missing_override_annotations=true +sp_cleanup.add_missing_override_annotations_interface_methods=false +sp_cleanup.add_serial_version_id=false +sp_cleanup.always_use_blocks=true +sp_cleanup.always_use_parentheses_in_expressions=false +sp_cleanup.always_use_this_for_non_static_field_access=false +sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.convert_to_enhanced_for_loop=false +sp_cleanup.correct_indentation=false +sp_cleanup.format_source_code=true +sp_cleanup.format_source_code_changes_only=false +sp_cleanup.make_local_variable_final=false +sp_cleanup.make_parameters_final=false +sp_cleanup.make_private_fields_final=true +sp_cleanup.make_type_abstract_if_missing_method=false +sp_cleanup.make_variable_declarations_final=false +sp_cleanup.never_use_blocks=false +sp_cleanup.never_use_parentheses_in_expressions=true +sp_cleanup.on_save_use_additional_actions=true +sp_cleanup.organize_imports=true +sp_cleanup.qualify_static_field_accesses_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_with_declaring_class=false +sp_cleanup.qualify_static_method_accesses_with_declaring_class=false +sp_cleanup.remove_private_constructors=true +sp_cleanup.remove_trailing_whitespaces=true +sp_cleanup.remove_trailing_whitespaces_all=true +sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +sp_cleanup.remove_unnecessary_casts=true +sp_cleanup.remove_unnecessary_nls_tags=false +sp_cleanup.remove_unused_imports=false +sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_private_fields=true +sp_cleanup.remove_unused_private_members=false +sp_cleanup.remove_unused_private_methods=true +sp_cleanup.remove_unused_private_types=true +sp_cleanup.sort_members=false +sp_cleanup.sort_members_all=false +sp_cleanup.use_blocks=false +sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_parentheses_in_expressions=false +sp_cleanup.use_this_for_non_static_field_access=false +sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true +sp_cleanup.use_this_for_non_static_method_access=false +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/META-INF/MANIFEST.MF b/org.openhealthtools.mdht.uml.cda.ccd.tests/META-INF/MANIFEST.MF new file mode 100644 index 000000000..8644818a8 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/META-INF/MANIFEST.MF @@ -0,0 +1,21 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: org.openhealthtools.mdht.uml.cda.ccd.tests;singleton:=true +Bundle-Version: 1.1.0.qualifier +Bundle-ClassPath: . +Bundle-Vendor: %providerName +Bundle-Localization: plugin +Bundle-RequiredExecutionEnvironment: J2SE-1.5 +Export-Package: org.openhealthtools.mdht.uml.cda.ccd.tests +Require-Bundle: org.eclipse.core.runtime, + org.openhealthtools.mdht.uml.cda.ccd;visibility:=reexport, + org.openhealthtools.mdht.uml.cda;visibility:=reexport, + org.openhealthtools.mdht.uml.hl7.datatypes;visibility:=reexport, + org.openhealthtools.mdht.uml.hl7.vocab;visibility:=reexport, + org.eclipse.emf.ecore;visibility:=reexport, + org.openhealthtools.mdht.uml.hl7.rim;visibility:=reexport, + org.eclipse.emf.ecore.xmi;visibility:=reexport, + org.junit;visibility:=reexport, + org.openhealthtools.mdht.uml.cda.test +Bundle-ActivationPolicy: lazy diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/build.properties b/org.openhealthtools.mdht.uml.cda.ccd.tests/build.properties new file mode 100644 index 000000000..e8b61f336 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/build.properties @@ -0,0 +1,17 @@ +############################################################################### +# Copyright (c) 2011, 2012 Sean Muir and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Sean Muir (JKM Software) - initial API and implementation +############################################################################### + +bin.includes = .,\ + META-INF/,\ + plugin.properties +jars.compile.order = . +source.. = src/ +output.. = bin/ diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/plugin.properties b/org.openhealthtools.mdht.uml.cda.ccd.tests/plugin.properties new file mode 100644 index 000000000..a7a55de51 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/plugin.properties @@ -0,0 +1,14 @@ +############################################################################### +# Copyright (c) 2011, 2012 Sean Muir and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Sean Muir (JKM Software) - initial API and implementation +############################################################################### + +pluginName = CCD Tests +providerName = www.example.org + diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/AdvanceDirectiveObservationTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/AdvanceDirectiveObservationTest.java new file mode 100644 index 000000000..5377fec7b --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/AdvanceDirectiveObservationTest.java @@ -0,0 +1,559 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ccd.AdvanceDirectiveObservation; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.operations.AdvanceDirectiveObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; + +/** + * A static utility class that provides operations + * related to 'Advance Directive Observation' model objects. + * + * + *

+ * The following operations are supported: + *

+ *

+ * + * @generated + */ + +public class AdvanceDirectiveObservationTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateAdvanceDirectiveObservationAdvDirectiveCodeValueSet() { + OperationsTestCase validateAdvanceDirectiveObservationAdvDirectiveCodeValueSetTestCase = new OperationsTestCase( + "validateAdvanceDirectiveObservationAdvDirectiveCodeValueSet", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_OBSERVATION_ADV_DIRECTIVE_CODE_VALUE_SET__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveObservation target) { + + } + + @Override + protected void updateToPass(AdvanceDirectiveObservation target) { + target.init(); + CD cd = DatatypesFactory.eINSTANCE.createCD(); + cd.setCodeSystem("2.16.840.1.113883.6.96"); + target.setCode(cd); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveObservationOperations.validateAdvanceDirectiveObservationAdvDirectiveCodeValueSet( + (AdvanceDirectiveObservation) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveObservationAdvDirectiveCodeValueSetTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAdvanceDirectiveObservationAdvDirectiveCodeCodeSystem() { + OperationsTestCase validateAdvanceDirectiveObservationAdvDirectiveCodeCodeSystemTestCase = new OperationsTestCase( + "validateAdvanceDirectiveObservationAdvDirectiveCodeCodeSystem", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_OBSERVATION_ADV_DIRECTIVE_CODE_CODE_SYSTEM__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveObservation target) { + + } + + @Override + protected void updateToPass(AdvanceDirectiveObservation target) { + target.init(); + CD cd = DatatypesFactory.eINSTANCE.createCD(); + cd.setCodeSystem("2.16.840.1.113883.6.96"); + cd.setCode("304251008"); + target.setCode(cd); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveObservationOperations.validateAdvanceDirectiveObservationAdvDirectiveCodeCodeSystem( + (AdvanceDirectiveObservation) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveObservationAdvDirectiveCodeCodeSystemTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAdvanceDirectiveObservationTemplateId() { + OperationsTestCase validateAdvanceDirectiveObservationTemplateIdTestCase = new OperationsTestCase( + "validateAdvanceDirectiveObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveObservation target) { + + } + + @Override + protected void updateToPass(AdvanceDirectiveObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveObservationOperations.validateAdvanceDirectiveObservationTemplateId( + (AdvanceDirectiveObservation) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAdvanceDirectiveObservationClassCode() { + OperationsTestCase validateAdvanceDirectiveObservationClassCodeTestCase = new OperationsTestCase( + "validateAdvanceDirectiveObservationClassCode", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_OBSERVATION_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveObservation target) { + + } + + @Override + protected void updateToPass(AdvanceDirectiveObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveObservationOperations.validateAdvanceDirectiveObservationClassCode( + (AdvanceDirectiveObservation) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveObservationClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAdvanceDirectiveObservationMoodCode() { + OperationsTestCase validateAdvanceDirectiveObservationMoodCodeTestCase = new OperationsTestCase( + "validateAdvanceDirectiveObservationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_OBSERVATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveObservation target) { + + } + + @Override + protected void updateToPass(AdvanceDirectiveObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveObservationOperations.validateAdvanceDirectiveObservationMoodCode( + (AdvanceDirectiveObservation) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveObservationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAdvanceDirectiveObservationId() { + OperationsTestCase validateAdvanceDirectiveObservationIdTestCase = new OperationsTestCase( + "validateAdvanceDirectiveObservationId", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_OBSERVATION_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveObservation target) { + + } + + @Override + protected void updateToPass(AdvanceDirectiveObservation target) { + target.init(); + + II ii = DatatypesFactory.eINSTANCE.createII(); + target.getIds().add(ii); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveObservationOperations.validateAdvanceDirectiveObservationId( + (AdvanceDirectiveObservation) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveObservationIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAdvanceDirectiveObservationStatusCode() { + OperationsTestCase validateAdvanceDirectiveObservationStatusCodeTestCase = new OperationsTestCase( + "validateAdvanceDirectiveObservationStatusCode", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_OBSERVATION_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveObservation target) { + + } + + @Override + protected void updateToPass(AdvanceDirectiveObservation target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveObservationOperations.validateAdvanceDirectiveObservationStatusCode( + (AdvanceDirectiveObservation) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveObservationStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAdvanceDirectiveObservationEffectiveTime() { + OperationsTestCase validateAdvanceDirectiveObservationEffectiveTimeTestCase = new OperationsTestCase( + "validateAdvanceDirectiveObservationEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_OBSERVATION_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveObservation target) { + + } + + @Override + protected void updateToPass(AdvanceDirectiveObservation target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveObservationOperations.validateAdvanceDirectiveObservationEffectiveTime( + (AdvanceDirectiveObservation) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveObservationEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAdvanceDirectiveObservationCode() { + OperationsTestCase validateAdvanceDirectiveObservationCodeTestCase = new OperationsTestCase( + "validateAdvanceDirectiveObservationCode", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveObservation target) { + + } + + @Override + protected void updateToPass(AdvanceDirectiveObservation target) { + target.init(); + + CD cd = DatatypesFactory.eINSTANCE.createCD(); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveObservationOperations.validateAdvanceDirectiveObservationCode( + (AdvanceDirectiveObservation) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAdvanceDirectiveObservationAdvanceDirectiveVerification() { + OperationsTestCase validateAdvanceDirectiveObservationAdvanceDirectiveVerificationTestCase = new OperationsTestCase( + "validateAdvanceDirectiveObservationAdvanceDirectiveVerification", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_OBSERVATION_ADVANCE_DIRECTIVE_VERIFICATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveObservation target) { + target.init(); + } + + @Override + protected void updateToPass(AdvanceDirectiveObservation target) { + target.getParticipants().add(CCDFactory.eINSTANCE.createAdvanceDirectiveVerification().init()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveObservationOperations.validateAdvanceDirectiveObservationAdvanceDirectiveVerification( + (AdvanceDirectiveObservation) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveObservationAdvanceDirectiveVerificationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAdvanceDirectiveObservationAdvanceDirectiveStatusObservation() { + OperationsTestCase validateAdvanceDirectiveObservationAdvanceDirectiveStatusObservationTestCase = new OperationsTestCase( + "validateAdvanceDirectiveObservationAdvanceDirectiveStatusObservation", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_OBSERVATION_ADVANCE_DIRECTIVE_STATUS_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveObservation target) { + + } + + @Override + protected void updateToPass(AdvanceDirectiveObservation target) { + target.init(); + target.addObservation(CCDFactory.eINSTANCE.createAdvanceDirectiveStatusObservation()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveObservationOperations.validateAdvanceDirectiveObservationAdvanceDirectiveStatusObservation( + (AdvanceDirectiveObservation) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveObservationAdvanceDirectiveStatusObservationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAdvanceDirectiveObservationAdvanceDirectiveReference() { + OperationsTestCase validateAdvanceDirectiveObservationAdvanceDirectiveReferenceTestCase = new OperationsTestCase( + "validateAdvanceDirectiveObservationAdvanceDirectiveReference", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_OBSERVATION_ADVANCE_DIRECTIVE_REFERENCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveObservation target) { + target.init(); + } + + @Override + protected void updateToPass(AdvanceDirectiveObservation target) { + target.getReferences().add(CCDFactory.eINSTANCE.createAdvanceDirectiveReference().init()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveObservationOperations.validateAdvanceDirectiveObservationAdvanceDirectiveReference( + (AdvanceDirectiveObservation) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveObservationAdvanceDirectiveReferenceTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetAdvanceDirectiveStatusObservation() { + + AdvanceDirectiveObservation target = objectFactory.create(); + target.getAdvanceDirectiveStatusObservation(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends AdvanceDirectiveObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public AdvanceDirectiveObservation create() { + return CCDFactory.eINSTANCE.createAdvanceDirectiveObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends AdvanceDirectiveObservationOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // AdvanceDirectiveObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/AdvanceDirectiveReferenceTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/AdvanceDirectiveReferenceTest.java new file mode 100644 index 000000000..f6657290d --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/AdvanceDirectiveReferenceTest.java @@ -0,0 +1,343 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.ExternalDocument; +import org.openhealthtools.mdht.uml.cda.ccd.AdvanceDirectiveReference; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.operations.AdvanceDirectiveReferenceOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; +import org.openhealthtools.mdht.uml.hl7.datatypes.TEL; + +/** + * + * A static utility class that provides operations related to 'Advance Directive Reference' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.AdvanceDirectiveReference#validateAdvanceDirectiveReferenceHasURL(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directive Reference Has URL}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.AdvanceDirectiveReference#validateAdvanceDirectiveReferenceHasMIMEType(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directive Reference Has MIME Type}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.AdvanceDirectiveReference#validateAdvanceDirectiveReferenceExternalDocumentHasId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directive Reference External Document Has Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.AdvanceDirectiveReference#validateAdvanceDirectiveReferenceTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directive Reference Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.AdvanceDirectiveReference#validateAdvanceDirectiveReferenceTypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directive Reference Type Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.AdvanceDirectiveReference#validateAdvanceDirectiveReferenceExternalDocument(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directive Reference External Document}
  • + *
+ *

+ * + * @generated + */ + +public class AdvanceDirectiveReferenceTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateAdvanceDirectiveReferenceHasURL() { + OperationsTestCase validateAdvanceDirectiveReferenceHasURLTestCase = new OperationsTestCase( + "validateAdvanceDirectiveReferenceHasURL", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_REFERENCE_HAS_URL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveReference target) { + + } + + @Override + protected void updateToPass(AdvanceDirectiveReference target) { + + target.init(); + ExternalDocument externalDocument = CDAFactory.eINSTANCE.createExternalDocument(); + + ED ed = DatatypesFactory.eINSTANCE.createED("sometext"); + + ed.setMediaType("mediatype"); + + TEL tel = DatatypesFactory.eINSTANCE.createTEL("value"); + ed.setReference(tel); + + externalDocument.setText(ed); + target.setExternalDocument(externalDocument); + target.getExternalDocument().getIds().add(DatatypesFactory.eINSTANCE.createII()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveReferenceOperations.validateAdvanceDirectiveReferenceHasURL( + (AdvanceDirectiveReference) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveReferenceHasURLTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAdvanceDirectiveReferenceHasMIMEType() { + OperationsTestCase validateAdvanceDirectiveReferenceHasMIMETypeTestCase = new OperationsTestCase( + "validateAdvanceDirectiveReferenceHasMIMEType", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_REFERENCE_HAS_MIME_TYPE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveReference target) { + + } + + @Override + protected void updateToPass(AdvanceDirectiveReference target) { + target.init(); + ExternalDocument externalDocument = CDAFactory.eINSTANCE.createExternalDocument(); + + ED ed = DatatypesFactory.eINSTANCE.createED("sometext"); + + ed.setMediaType("mediatype"); + + externalDocument.setText(ed); + target.setExternalDocument(externalDocument); + target.getExternalDocument().getIds().add(DatatypesFactory.eINSTANCE.createII()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveReferenceOperations.validateAdvanceDirectiveReferenceHasMIMEType( + (AdvanceDirectiveReference) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveReferenceHasMIMETypeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAdvanceDirectiveReferenceExternalDocumentHasId() { + OperationsTestCase validateAdvanceDirectiveReferenceExternalDocumentHasIdTestCase = new OperationsTestCase( + "validateAdvanceDirectiveReferenceExternalDocumentHasId", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_REFERENCE_EXTERNAL_DOCUMENT_HAS_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveReference target) { + + } + + @Override + protected void updateToPass(AdvanceDirectiveReference target) { + target.init(); + target.setExternalDocument(CDAFactory.eINSTANCE.createExternalDocument()); + target.getExternalDocument().getIds().add(DatatypesFactory.eINSTANCE.createII()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveReferenceOperations.validateAdvanceDirectiveReferenceExternalDocumentHasId( + (AdvanceDirectiveReference) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveReferenceExternalDocumentHasIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAdvanceDirectiveReferenceTemplateId() { + OperationsTestCase validateAdvanceDirectiveReferenceTemplateIdTestCase = new OperationsTestCase( + "validateAdvanceDirectiveReferenceTemplateId", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_REFERENCE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveReference target) { + + } + + @Override + protected void updateToPass(AdvanceDirectiveReference target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveReferenceOperations.validateAdvanceDirectiveReferenceTemplateId( + (AdvanceDirectiveReference) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveReferenceTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAdvanceDirectiveReferenceTypeCode() { + OperationsTestCase validateAdvanceDirectiveReferenceTypeCodeTestCase = new OperationsTestCase( + "validateAdvanceDirectiveReferenceTypeCode", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_REFERENCE_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveReference target) { + + } + + @Override + protected void updateToPass(AdvanceDirectiveReference target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveReferenceOperations.validateAdvanceDirectiveReferenceTypeCode( + (AdvanceDirectiveReference) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveReferenceTypeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAdvanceDirectiveReferenceExternalDocument() { + OperationsTestCase validateAdvanceDirectiveReferenceExternalDocumentTestCase = new OperationsTestCase( + "validateAdvanceDirectiveReferenceExternalDocument", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_REFERENCE_EXTERNAL_DOCUMENT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveReference target) { + target.init(); + } + + @Override + protected void updateToPass(AdvanceDirectiveReference target) { + target.setExternalDocument(CDAFactory.eINSTANCE.createExternalDocument()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveReferenceOperations.validateAdvanceDirectiveReferenceExternalDocument( + (AdvanceDirectiveReference) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveReferenceExternalDocumentTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends AdvanceDirectiveReferenceOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public AdvanceDirectiveReference create() { + return CCDFactory.eINSTANCE.createAdvanceDirectiveReference(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends AdvanceDirectiveReferenceOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // AdvanceDirectiveReferenceOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/AdvanceDirectiveStatusObservationTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/AdvanceDirectiveStatusObservationTest.java new file mode 100644 index 000000000..7f7e7b564 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/AdvanceDirectiveStatusObservationTest.java @@ -0,0 +1,140 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ccd.AdvanceDirectiveStatusObservation; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.operations.AdvanceDirectiveStatusObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Advance Directive Status Observation' model + * objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.AdvanceDirectiveStatusObservation#validateStatusObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Status Observation Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class AdvanceDirectiveStatusObservationTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateStatusObservationTemplateId() { + OperationsTestCase validateStatusObservationTemplateIdTestCase = new OperationsTestCase( + "validateStatusObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_STATUS_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveStatusObservation target) { + + } + + @Override + protected void updateToPass(AdvanceDirectiveStatusObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveStatusObservationOperations.validateStatusObservationTemplateId( + (AdvanceDirectiveStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateStatusObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends AdvanceDirectiveStatusObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public AdvanceDirectiveStatusObservation create() { + return CCDFactory.eINSTANCE.createAdvanceDirectiveStatusObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends AdvanceDirectiveStatusObservationOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // AdvanceDirectiveStatusObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/AdvanceDirectiveVerificationTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/AdvanceDirectiveVerificationTest.java new file mode 100644 index 000000000..8829ee173 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/AdvanceDirectiveVerificationTest.java @@ -0,0 +1,211 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ccd.AdvanceDirectiveVerification; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.operations.AdvanceDirectiveVerificationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; + +/** + * A static utility class that provides operations + * related to 'Advance Directive Verification' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.AdvanceDirectiveVerification#validateAdvanceDirectiveVerificationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directive Verification Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.AdvanceDirectiveVerification#validateAdvanceDirectiveVerificationTypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directive Verification Type Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.AdvanceDirectiveVerification#validateAdvanceDirectiveVerificationTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directive Verification Time}
  • + *
+ *

+ * + * @generated + */ + +public class AdvanceDirectiveVerificationTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateAdvanceDirectiveVerificationTemplateId() { + OperationsTestCase validateAdvanceDirectiveVerificationTemplateIdTestCase = new OperationsTestCase( + "validateAdvanceDirectiveVerificationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_VERIFICATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveVerification target) { + + } + + @Override + protected void updateToPass(AdvanceDirectiveVerification target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveVerificationOperations.validateAdvanceDirectiveVerificationTemplateId( + (AdvanceDirectiveVerification) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveVerificationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAdvanceDirectiveVerificationTypeCode() { + OperationsTestCase validateAdvanceDirectiveVerificationTypeCodeTestCase = new OperationsTestCase( + "validateAdvanceDirectiveVerificationTypeCode", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_VERIFICATION_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveVerification target) { + + } + + @Override + protected void updateToPass(AdvanceDirectiveVerification target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveVerificationOperations.validateAdvanceDirectiveVerificationTypeCode( + (AdvanceDirectiveVerification) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveVerificationTypeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAdvanceDirectiveVerificationTime() { + OperationsTestCase validateAdvanceDirectiveVerificationTimeTestCase = new OperationsTestCase( + "validateAdvanceDirectiveVerificationTime", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_VERIFICATION_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveVerification target) { + + } + + @Override + protected void updateToPass(AdvanceDirectiveVerification target) { + target.init(); + target.setTime(DatatypesFactory.eINSTANCE.createIVL_TS()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveVerificationOperations.validateAdvanceDirectiveVerificationTime( + (AdvanceDirectiveVerification) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveVerificationTimeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends AdvanceDirectiveVerificationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public AdvanceDirectiveVerification create() { + return CCDFactory.eINSTANCE.createAdvanceDirectiveVerification(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends AdvanceDirectiveVerificationOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // AdvanceDirectiveVerificationOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/AdvanceDirectivesSectionTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/AdvanceDirectivesSectionTest.java new file mode 100644 index 000000000..02f8c53d5 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/AdvanceDirectivesSectionTest.java @@ -0,0 +1,303 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.ccd.AdvanceDirectivesSection; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.operations.AdvanceDirectivesSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * A static utility class that provides operations + * related to 'Advance Directives Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.AdvanceDirectivesSection#validateAdvanceDirectivesSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directives Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.AdvanceDirectivesSection#validateAdvanceDirectivesSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directives Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.AdvanceDirectivesSection#validateAdvanceDirectivesSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directives Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.AdvanceDirectivesSection#validateAdvanceDirectivesSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directives Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.AdvanceDirectivesSection#validateAdvanceDirectivesSectionAdvanceDirectiveObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directives Section Advance Directive Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.AdvanceDirectivesSection#getAdvanceDirectiveObservations() Get Advance Directive Observations}
  • + *
+ *

+ * + * @generated + */ + +public class AdvanceDirectivesSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateAdvanceDirectivesSectionTemplateId() { + OperationsTestCase validateAdvanceDirectivesSectionTemplateIdTestCase = new OperationsTestCase( + "validateAdvanceDirectivesSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVES_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectivesSection target) { + + } + + @Override + protected void updateToPass(AdvanceDirectivesSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectivesSectionOperations.validateAdvanceDirectivesSectionTemplateId( + (AdvanceDirectivesSection) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectivesSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAdvanceDirectivesSectionCode() { + OperationsTestCase validateAdvanceDirectivesSectionCodeTestCase = new OperationsTestCase( + "validateAdvanceDirectivesSectionCode", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVES_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectivesSection target) { + + } + + @Override + protected void updateToPass(AdvanceDirectivesSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectivesSectionOperations.validateAdvanceDirectivesSectionCode( + (AdvanceDirectivesSection) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectivesSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAdvanceDirectivesSectionTitle() { + OperationsTestCase validateAdvanceDirectivesSectionTitleTestCase = new OperationsTestCase( + "validateAdvanceDirectivesSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVES_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectivesSection target) { + + } + + @Override + protected void updateToPass(AdvanceDirectivesSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectivesSectionOperations.validateAdvanceDirectivesSectionTitle( + (AdvanceDirectivesSection) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectivesSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAdvanceDirectivesSectionText() { + OperationsTestCase validateAdvanceDirectivesSectionTextTestCase = new OperationsTestCase( + "validateAdvanceDirectivesSectionText", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVES_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectivesSection target) { + + } + + @Override + protected void updateToPass(AdvanceDirectivesSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectivesSectionOperations.validateAdvanceDirectivesSectionText( + (AdvanceDirectivesSection) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectivesSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAdvanceDirectivesSectionAdvanceDirectiveObservation() { + OperationsTestCase validateAdvanceDirectivesSectionAdvanceDirectiveObservationTestCase = new OperationsTestCase( + "validateAdvanceDirectivesSectionAdvanceDirectiveObservation", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVES_SECTION_ADVANCE_DIRECTIVE_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectivesSection target) { + + } + + @Override + protected void updateToPass(AdvanceDirectivesSection target) { + target.init(); + target.addObservation(CCDFactory.eINSTANCE.createAdvanceDirectiveObservation()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectivesSectionOperations.validateAdvanceDirectivesSectionAdvanceDirectiveObservation( + (AdvanceDirectivesSection) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectivesSectionAdvanceDirectiveObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetAdvanceDirectiveObservations() { + + AdvanceDirectivesSection target = objectFactory.create(); + target.getAdvanceDirectiveObservations(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends AdvanceDirectivesSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public AdvanceDirectivesSection create() { + return CCDFactory.eINSTANCE.createAdvanceDirectivesSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends AdvanceDirectivesSectionOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // AdvanceDirectivesSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/AgeObservationTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/AgeObservationTest.java new file mode 100644 index 000000000..9b45d2e9a --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/AgeObservationTest.java @@ -0,0 +1,344 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ccd.AgeObservation; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.operations.AgeObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; + +/** + * A static utility class that provides operations + * related to 'Age Observation' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.AgeObservation#validateAgeObservationRelatedSubjectBirthTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Age Observation Related Subject Birth Time}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.AgeObservation#validateAgeObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Age Observation Template Id}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.AgeObservation#validateAgeObservationClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Age Observation Class Code}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.AgeObservation#validateAgeObservationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Age Observation Mood Code}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.AgeObservation#validateAgeObservationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Age Observation Code}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.AgeObservation#validateAgeObservationStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Age Observation Status Code}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.AgeObservation#validateAgeObservationValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Age Observation Value}
  • + *
+ *

+ * + * @generated + */ + +public class AgeObservationTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateAgeObservationTemplateId() { + OperationsTestCase validateAgeObservationTemplateIdTestCase = new OperationsTestCase( + "validateAgeObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_AGE_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AgeObservation target) { + + } + + @Override + protected void updateToPass(AgeObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AgeObservationOperations.validateAgeObservationTemplateId( + (AgeObservation) objectToTest, diagnostician, map); + } + + }; + + validateAgeObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAgeObservationClassCode() { + OperationsTestCase validateAgeObservationClassCodeTestCase = new OperationsTestCase( + "validateAgeObservationClassCode", + operationsForOCL.getOCLValue("VALIDATE_AGE_OBSERVATION_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AgeObservation target) { + + } + + @Override + protected void updateToPass(AgeObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AgeObservationOperations.validateAgeObservationClassCode( + (AgeObservation) objectToTest, diagnostician, map); + } + + }; + + validateAgeObservationClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAgeObservationMoodCode() { + OperationsTestCase validateAgeObservationMoodCodeTestCase = new OperationsTestCase( + "validateAgeObservationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_AGE_OBSERVATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AgeObservation target) { + + } + + @Override + protected void updateToPass(AgeObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AgeObservationOperations.validateAgeObservationMoodCode( + (AgeObservation) objectToTest, diagnostician, map); + } + + }; + + validateAgeObservationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAgeObservationCode() { + OperationsTestCase validateAgeObservationCodeTestCase = new OperationsTestCase( + "validateAgeObservationCode", + operationsForOCL.getOCLValue("VALIDATE_AGE_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AgeObservation target) { + + } + + @Override + protected void updateToPass(AgeObservation target) { + target.init(); + + CD cd = DatatypesFactory.eINSTANCE.createCD(); + cd.setCode("397659008"); + cd.setCodeSystem("2.16.840.1.113883.6.96"); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AgeObservationOperations.validateAgeObservationCode( + (AgeObservation) objectToTest, diagnostician, map); + } + + }; + + validateAgeObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAgeObservationStatusCode() { + OperationsTestCase validateAgeObservationStatusCodeTestCase = new OperationsTestCase( + "validateAgeObservationStatusCode", + operationsForOCL.getOCLValue("VALIDATE_AGE_OBSERVATION_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AgeObservation target) { + + } + + @Override + protected void updateToPass(AgeObservation target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AgeObservationOperations.validateAgeObservationStatusCode( + (AgeObservation) objectToTest, diagnostician, map); + } + + }; + + validateAgeObservationStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAgeObservationValue() { + OperationsTestCase validateAgeObservationValueTestCase = new OperationsTestCase( + "validateAgeObservationValue", + operationsForOCL.getOCLValue("VALIDATE_AGE_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AgeObservation target) { + + } + + @Override + protected void updateToPass(AgeObservation target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD(); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AgeObservationOperations.validateAgeObservationValue( + (AgeObservation) objectToTest, diagnostician, map); + } + + }; + + validateAgeObservationValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends AgeObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public AgeObservation create() { + return CCDFactory.eINSTANCE.createAgeObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends AgeObservationOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // AgeObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/AlertObservationTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/AlertObservationTest.java new file mode 100644 index 000000000..b259eb74b --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/AlertObservationTest.java @@ -0,0 +1,704 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.Informant12; +import org.openhealthtools.mdht.uml.cda.Participant2; +import org.openhealthtools.mdht.uml.cda.ParticipantRole; +import org.openhealthtools.mdht.uml.cda.PlayingEntity; +import org.openhealthtools.mdht.uml.cda.ccd.AlertObservation; +import org.openhealthtools.mdht.uml.cda.ccd.AlertStatusObservation; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.ReactionObservation; +import org.openhealthtools.mdht.uml.cda.ccd.operations.AlertObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.vocab.EntityClassRoot; +import org.openhealthtools.mdht.uml.hl7.vocab.ParticipationType; +import org.openhealthtools.mdht.uml.hl7.vocab.RoleClassRoot; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * A static utility class that provides operations + * related to 'Alert Observation' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.AlertObservation#validateAlertObservationInformationSource(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Alert Observation Information Source}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.AlertObservation#validateAlertObservationAgentRepresentation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Alert Observation Agent Representation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.AlertObservation#validateAlertObservationPlayingEntityRequired(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Alert Observation Playing Entity Required}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.AlertObservation#validateAlertObservationAgentRepresentationVocab(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Alert Observation Agent Representation Vocab}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.AlertObservation#validateAlertObservationParticipantRoleClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Alert Observation Participant Role Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.AlertObservation#validateAlertObservationPlayingEntityClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Alert Observation Playing Entity Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.AlertObservation#validateAlertObservationPlayingEntityCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Alert Observation Playing Entity Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.AlertObservation#validateAlertObservationPlayingEntityCodeVocab(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Alert Observation Playing Entity Code Vocab}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.AlertObservation#validateAlertObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Alert Observation Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.AlertObservation#validateAlertObservationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Alert Observation Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.AlertObservation#validateAlertObservationStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Alert Observation Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.AlertObservation#validateAlertObservationEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Alert Observation Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.AlertObservation#validateAlertObservationAlertStatusObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Alert Observation Alert Status Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.AlertObservation#validateAlertObservationReactionObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Alert Observation Reaction Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.AlertObservation#getAlertStatusObservation() Get Alert Status Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.AlertObservation#getReactionObservations() Get Reaction Observations}
  • + *
+ *

+ * + * @generated + */ + +public class AlertObservationTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateAlertObservationInformationSource() { + OperationsTestCase validateAlertObservationInformationSourceTestCase = new OperationsTestCase( + "validateAlertObservationInformationSource", + operationsForOCL.getOCLValue("VALIDATE_ALERT_OBSERVATION_INFORMATION_SOURCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AlertObservation target) { + + } + + @Override + protected void updateToPass(AlertObservation target) { + target.init(); + + Informant12 inf = CDAFactory.eINSTANCE.createInformant12(); + target.getInformants().add(inf); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AlertObservationOperations.validateAlertObservationInformationSource( + (AlertObservation) objectToTest, diagnostician, map); + } + + }; + + validateAlertObservationInformationSourceTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAlertObservationAgentRepresentation() { + OperationsTestCase validateAlertObservationAgentRepresentationTestCase = new OperationsTestCase( + "validateAlertObservationAgentRepresentation", + operationsForOCL.getOCLValue("VALIDATE_ALERT_OBSERVATION_AGENT_REPRESENTATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AlertObservation target) { + + } + + @Override + protected void updateToPass(AlertObservation target) { + + target.init(); + Participant2 e = CDAFactory.eINSTANCE.createParticipant2(); + ParticipationType value = ParticipationType.CSM; + e.setTypeCode(value); + target.getParticipants().add(e); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AlertObservationOperations.validateAlertObservationAgentRepresentation( + (AlertObservation) objectToTest, diagnostician, map); + } + + }; + + validateAlertObservationAgentRepresentationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAlertObservationPlayingEntityRequired() { + OperationsTestCase validateAlertObservationPlayingEntityRequiredTestCase = new OperationsTestCase( + "validateAlertObservationPlayingEntityRequired", + operationsForOCL.getOCLValue("VALIDATE_ALERT_OBSERVATION_PLAYING_ENTITY_REQUIRED__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AlertObservation target) { + + } + + @Override + protected void updateToPass(AlertObservation target) { + target.init(); + Participant2 p2 = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole value = CDAFactory.eINSTANCE.createParticipantRole(); + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + value.setPlayingEntity(pe); + p2.setParticipantRole(value); + target.getParticipants().add(p2); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AlertObservationOperations.validateAlertObservationPlayingEntityRequired( + (AlertObservation) objectToTest, diagnostician, map); + } + + }; + + validateAlertObservationPlayingEntityRequiredTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAlertObservationAgentRepresentationVocab() { + OperationsTestCase validateAlertObservationAgentRepresentationVocabTestCase = new OperationsTestCase( + "validateAlertObservationAgentRepresentationVocab", + operationsForOCL.getOCLValue("VALIDATE_ALERT_OBSERVATION_AGENT_REPRESENTATION_VOCAB__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AlertObservation target) { + + } + + @Override + protected void updateToPass(AlertObservation target) { + target.init(); + Participant2 e = CDAFactory.eINSTANCE.createParticipant2(); + ParticipationType value = ParticipationType.CSM; + e.setTypeCode(value); + target.getParticipants().add(e); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AlertObservationOperations.validateAlertObservationAgentRepresentationVocab( + (AlertObservation) objectToTest, diagnostician, map); + } + + }; + + validateAlertObservationAgentRepresentationVocabTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAlertObservationParticipantRoleClassCode() { + OperationsTestCase validateAlertObservationParticipantRoleClassCodeTestCase = new OperationsTestCase( + "validateAlertObservationParticipantRoleClassCode", + operationsForOCL.getOCLValue("VALIDATE_ALERT_OBSERVATION_PARTICIPANT_ROLE_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AlertObservation target) { + + } + + @Override + protected void updateToPass(AlertObservation target) { + target.init(); + Participant2 p2 = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + pr.setClassCode(RoleClassRoot.MANU); + p2.setParticipantRole(pr); + target.getParticipants().add(p2); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AlertObservationOperations.validateAlertObservationParticipantRoleClassCode( + (AlertObservation) objectToTest, diagnostician, map); + } + + }; + + validateAlertObservationParticipantRoleClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAlertObservationPlayingEntityClassCode() { + OperationsTestCase validateAlertObservationPlayingEntityClassCodeTestCase = new OperationsTestCase( + "validateAlertObservationPlayingEntityClassCode", + operationsForOCL.getOCLValue("VALIDATE_ALERT_OBSERVATION_PLAYING_ENTITY_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AlertObservation target) { + + } + + @Override + protected void updateToPass(AlertObservation target) { + target.init(); + Participant2 p2 = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + pe.setClassCode(EntityClassRoot.MMAT); + CE code = DatatypesFactory.eINSTANCE.createCE(); + code.setCode("test"); + pe.setCode(code); + p2.setParticipantRole(pr); + pr.setPlayingEntity(pe); + target.getParticipants().add(p2); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AlertObservationOperations.validateAlertObservationPlayingEntityClassCode( + (AlertObservation) objectToTest, diagnostician, map); + } + + }; + + validateAlertObservationPlayingEntityClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAlertObservationPlayingEntityCode() { + OperationsTestCase validateAlertObservationPlayingEntityCodeTestCase = new OperationsTestCase( + "validateAlertObservationPlayingEntityCode", + operationsForOCL.getOCLValue("VALIDATE_ALERT_OBSERVATION_PLAYING_ENTITY_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AlertObservation target) { + + } + + @Override + protected void updateToPass(AlertObservation target) { + target.init(); + Participant2 p2 = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + CE code = DatatypesFactory.eINSTANCE.createCE(); + code.setCode("test"); + pe.setCode(code); + p2.setParticipantRole(pr); + pr.setPlayingEntity(pe); + target.getParticipants().add(p2); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AlertObservationOperations.validateAlertObservationPlayingEntityCode( + (AlertObservation) objectToTest, diagnostician, map); + } + + }; + + validateAlertObservationPlayingEntityCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAlertObservationPlayingEntityCodeVocab() { + OperationsTestCase validateAlertObservationPlayingEntityCodeVocabTestCase = new OperationsTestCase( + "validateAlertObservationPlayingEntityCodeVocab", + operationsForOCL.getOCLValue("VALIDATE_ALERT_OBSERVATION_PLAYING_ENTITY_CODE_VOCAB__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AlertObservation target) { + + } + + @Override + protected void updateToPass(AlertObservation target) { + target.init(); + Participant2 p2 = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + CE code = DatatypesFactory.eINSTANCE.createCE(); + code.setCode("test"); + code.setCodeSystem("2.16.840.1.113883.6.88"); + pe.setCode(code); + p2.setParticipantRole(pr); + pr.setPlayingEntity(pe); + target.getParticipants().add(p2); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AlertObservationOperations.validateAlertObservationPlayingEntityCodeVocab( + (AlertObservation) objectToTest, diagnostician, map); + } + + }; + + validateAlertObservationPlayingEntityCodeVocabTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAlertObservationTemplateId() { + OperationsTestCase validateAlertObservationTemplateIdTestCase = new OperationsTestCase( + "validateAlertObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_ALERT_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AlertObservation target) { + + } + + @Override + protected void updateToPass(AlertObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AlertObservationOperations.validateAlertObservationTemplateId( + (AlertObservation) objectToTest, diagnostician, map); + } + + }; + + validateAlertObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAlertObservationMoodCode() { + OperationsTestCase validateAlertObservationMoodCodeTestCase = new OperationsTestCase( + "validateAlertObservationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_ALERT_OBSERVATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AlertObservation target) { + + } + + @Override + protected void updateToPass(AlertObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AlertObservationOperations.validateAlertObservationMoodCode( + (AlertObservation) objectToTest, diagnostician, map); + } + + }; + + validateAlertObservationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAlertObservationStatusCode() { + OperationsTestCase validateAlertObservationStatusCodeTestCase = new OperationsTestCase( + "validateAlertObservationStatusCode", + operationsForOCL.getOCLValue("VALIDATE_ALERT_OBSERVATION_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AlertObservation target) { + + } + + @Override + protected void updateToPass(AlertObservation target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AlertObservationOperations.validateAlertObservationStatusCode( + (AlertObservation) objectToTest, diagnostician, map); + } + + }; + + validateAlertObservationStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAlertObservationEffectiveTime() { + OperationsTestCase validateAlertObservationEffectiveTimeTestCase = new OperationsTestCase( + "validateAlertObservationEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_ALERT_OBSERVATION_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AlertObservation target) { + + } + + @Override + protected void updateToPass(AlertObservation target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AlertObservationOperations.validateAlertObservationEffectiveTime( + (AlertObservation) objectToTest, diagnostician, map); + } + + }; + + validateAlertObservationEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAlertObservationAlertStatusObservation() { + OperationsTestCase validateAlertObservationAlertStatusObservationTestCase = new OperationsTestCase( + "validateAlertObservationAlertStatusObservation", + operationsForOCL.getOCLValue("VALIDATE_ALERT_OBSERVATION_ALERT_STATUS_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AlertObservation target) { + + } + + @Override + protected void updateToPass(AlertObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + AlertStatusObservation so = CCDFactory.eINSTANCE.createAlertStatusObservation(); + er.setObservation(so); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AlertObservationOperations.validateAlertObservationAlertStatusObservation( + (AlertObservation) objectToTest, diagnostician, map); + } + + }; + + validateAlertObservationAlertStatusObservationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAlertObservationReactionObservation() { + OperationsTestCase validateAlertObservationReactionObservationTestCase = new OperationsTestCase( + "validateAlertObservationReactionObservation", + operationsForOCL.getOCLValue("VALIDATE_ALERT_OBSERVATION_REACTION_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AlertObservation target) { + + } + + @Override + protected void updateToPass(AlertObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + ReactionObservation ro = CCDFactory.eINSTANCE.createReactionObservation(); + er.setTypeCode(x_ActRelationshipEntryRelationship.MFST); + er.setObservation(ro); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AlertObservationOperations.validateAlertObservationReactionObservation( + (AlertObservation) objectToTest, diagnostician, map); + } + + }; + + validateAlertObservationReactionObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetAlertStatusObservation() { + + AlertObservation target = objectFactory.create(); + target.getAlertStatusObservation(); + + } + + /** + * + * @generated + */ + @Test + public void testGetReactionObservations() { + + AlertObservation target = objectFactory.create(); + target.getReactionObservations(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends AlertObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public AlertObservation create() { + return CCDFactory.eINSTANCE.createAlertObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends AlertObservationOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // AlertObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/AlertStatusObservationTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/AlertStatusObservationTest.java new file mode 100644 index 000000000..bbd0e34a0 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/AlertStatusObservationTest.java @@ -0,0 +1,140 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ccd.AlertStatusObservation; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.operations.AlertStatusObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Alert Status Observation' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.AlertStatusObservation#validateStatusObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Status Observation Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class AlertStatusObservationTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateStatusObservationTemplateId() { + OperationsTestCase validateStatusObservationTemplateIdTestCase = new OperationsTestCase( + "validateStatusObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_STATUS_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AlertStatusObservation target) { + + } + + @Override + protected void updateToPass(AlertStatusObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AlertStatusObservationOperations.validateStatusObservationTemplateId( + (AlertStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateStatusObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends AlertStatusObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public AlertStatusObservation create() { + return CCDFactory.eINSTANCE.createAlertStatusObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends AlertStatusObservationOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // AlertStatusObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/AlertsSectionTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/AlertsSectionTest.java new file mode 100644 index 000000000..7411d6485 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/AlertsSectionTest.java @@ -0,0 +1,316 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.ccd.AlertsSection; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.operations.AlertsSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * A static utility class that provides operations + * related to 'Alerts Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.AlertsSection#validateAlertsSectionTitleValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Alerts Section Title Value}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.AlertsSection#validateAlertsSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Alerts Section Template Id}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.AlertsSection#validateAlertsSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Alerts Section Code}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.AlertsSection#validateAlertsSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Alerts Section Title}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.AlertsSection#validateAlertsSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Alerts Section Text}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.AlertsSection#validateAlertsSectionProblemAct(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Alerts Section Problem Act}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.AlertsSection#getProblemActs() + * Get Problem Acts}
  • + *
+ *

+ * + * @generated + */ + +public class AlertsSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateAlertsSectionTemplateId() { + OperationsTestCase validateAlertsSectionTemplateIdTestCase = new OperationsTestCase( + "validateAlertsSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_ALERTS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AlertsSection target) { + + } + + @Override + protected void updateToPass(AlertsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AlertsSectionOperations.validateAlertsSectionTemplateId( + (AlertsSection) objectToTest, diagnostician, map); + } + + }; + + validateAlertsSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAlertsSectionCode() { + OperationsTestCase validateAlertsSectionCodeTestCase = new OperationsTestCase( + "validateAlertsSectionCode", + operationsForOCL.getOCLValue("VALIDATE_ALERTS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(AlertsSection target) { + + } + + @Override + protected void updateToPass(AlertsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AlertsSectionOperations.validateAlertsSectionCode( + (AlertsSection) objectToTest, diagnostician, map); + } + + }; + + validateAlertsSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAlertsSectionTitle() { + OperationsTestCase validateAlertsSectionTitleTestCase = new OperationsTestCase( + "validateAlertsSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_ALERTS_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AlertsSection target) { + + } + + @Override + protected void updateToPass(AlertsSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AlertsSectionOperations.validateAlertsSectionTitle( + (AlertsSection) objectToTest, diagnostician, map); + } + + }; + + validateAlertsSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAlertsSectionText() { + OperationsTestCase validateAlertsSectionTextTestCase = new OperationsTestCase( + "validateAlertsSectionText", + operationsForOCL.getOCLValue("VALIDATE_ALERTS_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(AlertsSection target) { + + } + + @Override + protected void updateToPass(AlertsSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AlertsSectionOperations.validateAlertsSectionText( + (AlertsSection) objectToTest, diagnostician, map); + } + + }; + + validateAlertsSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAlertsSectionProblemAct() { + OperationsTestCase validateAlertsSectionProblemActTestCase = new OperationsTestCase( + "validateAlertsSectionProblemAct", + operationsForOCL.getOCLValue("VALIDATE_ALERTS_SECTION_PROBLEM_ACT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AlertsSection target) { + + } + + @Override + protected void updateToPass(AlertsSection target) { + target.init(); + target.addAct(CCDFactory.eINSTANCE.createProblemAct()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AlertsSectionOperations.validateAlertsSectionProblemAct( + (AlertsSection) objectToTest, diagnostician, map); + } + + }; + + validateAlertsSectionProblemActTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemActs() { + + AlertsSection target = objectFactory.create(); + target.getProblemActs(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends AlertsSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public AlertsSection create() { + return CCDFactory.eINSTANCE.createAlertsSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends AlertsSectionOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // AlertsSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/AuthorizationActivityTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/AuthorizationActivityTest.java new file mode 100644 index 000000000..2683f1f85 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/AuthorizationActivityTest.java @@ -0,0 +1,627 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.Act; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Encounter; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.Observation; +import org.openhealthtools.mdht.uml.cda.ObservationMedia; +import org.openhealthtools.mdht.uml.cda.Organizer; +import org.openhealthtools.mdht.uml.cda.Procedure; +import org.openhealthtools.mdht.uml.cda.RegionOfInterest; +import org.openhealthtools.mdht.uml.cda.SubstanceAdministration; +import org.openhealthtools.mdht.uml.cda.Supply; +import org.openhealthtools.mdht.uml.cda.ccd.AuthorizationActivity; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.operations.AuthorizationActivityOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.vocab.ActMood; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActMoodDocumentObservation; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; +import org.openhealthtools.mdht.uml.hl7.vocab.x_DocumentActMood; +import org.openhealthtools.mdht.uml.hl7.vocab.x_DocumentEncounterMood; +import org.openhealthtools.mdht.uml.hl7.vocab.x_DocumentProcedureMood; +import org.openhealthtools.mdht.uml.hl7.vocab.x_DocumentSubstanceMood; + +/** + * A static utility class that provides operations + * related to 'Authorization Activity' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.AuthorizationActivity#validateAuthorizationActivityEntryRelationshipTypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Authorization Activity Entry Relationship Type Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.AuthorizationActivity#validateAuthorizationActivityEntryRelationshipTarget(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Authorization Activity Entry Relationship Target}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.AuthorizationActivity#validateAuthorizationActivityHasPerformers(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Authorization Activity Has Performers}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.AuthorizationActivity#validateAuthorizationActivityTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Authorization Activity Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.AuthorizationActivity#validateAuthorizationActivityClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Authorization Activity Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.AuthorizationActivity#validateAuthorizationActivityMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Authorization Activity Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.AuthorizationActivity#validateAuthorizationActivityId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Authorization Activity Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.AuthorizationActivity#validateAuthorizationActivityEntryRelationship(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Authorization Activity Entry Relationship}
  • + *
+ *

+ * + * @generated + */ + +public class AuthorizationActivityTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateAuthorizationActivityEntryRelationshipTypeCode() { + OperationsTestCase validateAuthorizationActivityEntryRelationshipTypeCodeTestCase = new OperationsTestCase( + "validateAuthorizationActivityEntryRelationshipTypeCode", + operationsForOCL.getOCLValue("VALIDATE_AUTHORIZATION_ACTIVITY_ENTRY_RELATIONSHIP_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AuthorizationActivity target) { + + } + + @Override + protected void updateToPass(AuthorizationActivity target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AuthorizationActivityOperations.validateAuthorizationActivityEntryRelationshipTypeCode( + (AuthorizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateAuthorizationActivityEntryRelationshipTypeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAuthorizationActivityEntryRelationshipTarget() { + OperationsTestCase validateAuthorizationActivityEntryRelationshipTargetTestCase = new OperationsTestCase( + "validateAuthorizationActivityEntryRelationshipTarget", + operationsForOCL.getOCLValue("VALIDATE_AUTHORIZATION_ACTIVITY_ENTRY_RELATIONSHIP_TARGET__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + // @Override + // protected void updateToFail(AuthorizationActivity target) { + // target.init(); + // Act act = CDAFactory.eINSTANCE.createAct(); + // act.setMoodCode(x_DocumentActMood.PRMS); + // target.addAct(act); + // } + + /* + * (non-Javadoc) + * + * @see org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest.OperationsTestCase#addFailTests() + */ + @Override + public void addFailTests() { + addFailTest(new FailTest() { + + @Override + public void updateToFail(AuthorizationActivity target) { + target.init(); + Act act = CDAFactory.eINSTANCE.createAct(); + + target.addAct(act); + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(AuthorizationActivity target) { + target.init(); + Encounter clinicalStatement = CDAFactory.eINSTANCE.createEncounter(); + + target.addEncounter(clinicalStatement); + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(AuthorizationActivity target) { + target.init(); + Observation clinicalStatement = CDAFactory.eINSTANCE.createObservation(); + + target.addObservation(clinicalStatement); + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(AuthorizationActivity target) { + target.init(); + ObservationMedia clinicalStatement = CDAFactory.eINSTANCE.createObservationMedia(); + + target.addObservationMedia(clinicalStatement); + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(AuthorizationActivity target) { + target.init(); + Organizer clinicalStatement = CDAFactory.eINSTANCE.createOrganizer(); + + target.addOrganizer(clinicalStatement); + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(AuthorizationActivity target) { + target.init(); + Procedure clinicalStatement = CDAFactory.eINSTANCE.createProcedure(); + + target.addProcedure(clinicalStatement); + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(AuthorizationActivity target) { + target.init(); + RegionOfInterest clinicalStatement = CDAFactory.eINSTANCE.createRegionOfInterest(); + + target.addRegionOfInterest(clinicalStatement); + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(AuthorizationActivity target) { + target.init(); + SubstanceAdministration clinicalStatement = CDAFactory.eINSTANCE.createSubstanceAdministration(); + + target.addSubstanceAdministration(clinicalStatement); + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(AuthorizationActivity target) { + target.init(); + Supply clinicalStatement = CDAFactory.eINSTANCE.createSupply(); + + target.addSupply(clinicalStatement); + } + }); + + } + + @Override + public void addPassTests() { + addPassTest(new PassTest() { + + @Override + public void updateToPass(AuthorizationActivity target) { + target.init(); + Act act = CDAFactory.eINSTANCE.createAct(); + act.setMoodCode(x_DocumentActMood.PRMS); + target.addAct(act); + } + }); + + addPassTest(new PassTest() { + + @Override + public void updateToPass(AuthorizationActivity target) { + target.init(); + Encounter clinicalStatement = CDAFactory.eINSTANCE.createEncounter(); + clinicalStatement.setMoodCode(x_DocumentEncounterMood.PRMS); + target.addEncounter(clinicalStatement); + } + }); + + addPassTest(new PassTest() { + + @Override + public void updateToPass(AuthorizationActivity target) { + target.init(); + Observation clinicalStatement = CDAFactory.eINSTANCE.createObservation(); + clinicalStatement.setMoodCode(x_ActMoodDocumentObservation.PRMS); + target.addObservation(clinicalStatement); + } + }); + + addPassTest(new PassTest() { + + @Override + public void updateToPass(AuthorizationActivity target) { + target.init(); + ObservationMedia clinicalStatement = CDAFactory.eINSTANCE.createObservationMedia(); + clinicalStatement.setMoodCode(ActMood.PRMS); + target.addObservationMedia(clinicalStatement); + } + }); + + addPassTest(new PassTest() { + + @Override + public void updateToPass(AuthorizationActivity target) { + target.init(); + Organizer clinicalStatement = CDAFactory.eINSTANCE.createOrganizer(); + clinicalStatement.setMoodCode(ActMood.PRMS); + target.addOrganizer(clinicalStatement); + } + }); + + addPassTest(new PassTest() { + + @Override + public void updateToPass(AuthorizationActivity target) { + target.init(); + Procedure clinicalStatement = CDAFactory.eINSTANCE.createProcedure(); + clinicalStatement.setMoodCode(x_DocumentProcedureMood.PRMS); + target.addProcedure(clinicalStatement); + } + }); + + addPassTest(new PassTest() { + + @Override + public void updateToPass(AuthorizationActivity target) { + target.init(); + RegionOfInterest clinicalStatement = CDAFactory.eINSTANCE.createRegionOfInterest(); + clinicalStatement.setMoodCode(ActMood.PRMS); + target.addRegionOfInterest(clinicalStatement); + } + }); + + addPassTest(new PassTest() { + + @Override + public void updateToPass(AuthorizationActivity target) { + target.init(); + SubstanceAdministration clinicalStatement = CDAFactory.eINSTANCE.createSubstanceAdministration(); + clinicalStatement.setMoodCode(x_DocumentSubstanceMood.PRMS); + target.addSubstanceAdministration(clinicalStatement); + } + }); + + addPassTest(new PassTest() { + + @Override + public void updateToPass(AuthorizationActivity target) { + target.init(); + Supply clinicalStatement = CDAFactory.eINSTANCE.createSupply(); + clinicalStatement.setMoodCode(x_DocumentSubstanceMood.PRMS); + target.addSupply(clinicalStatement); + } + }); + + } + + // @Override + // protected void updateToPass(AuthorizationActivity target) { + // + // for (Act act : target.getActs()) { + // // act.setMoodCode(x_DocumentActMood.PRMS); + // } + // + // } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AuthorizationActivityOperations.validateAuthorizationActivityEntryRelationshipTarget( + (AuthorizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateAuthorizationActivityEntryRelationshipTargetTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAuthorizationActivityHasPerformers() { + OperationsTestCase validateAuthorizationActivityHasPerformersTestCase = new OperationsTestCase( + "validateAuthorizationActivityHasPerformers", + operationsForOCL.getOCLValue("VALIDATE_AUTHORIZATION_ACTIVITY_HAS_PERFORMERS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AuthorizationActivity target) { + target.init(); + target.addAct(CDAFactory.eINSTANCE.createAct()); + } + + @Override + protected void updateToPass(AuthorizationActivity target) { + + for (Act act : target.getActs()) { + act.getPerformers().add(CDAFactory.eINSTANCE.createPerformer2()); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AuthorizationActivityOperations.validateAuthorizationActivityHasPerformers( + (AuthorizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateAuthorizationActivityHasPerformersTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAuthorizationActivityTemplateId() { + OperationsTestCase validateAuthorizationActivityTemplateIdTestCase = new OperationsTestCase( + "validateAuthorizationActivityTemplateId", + operationsForOCL.getOCLValue("VALIDATE_AUTHORIZATION_ACTIVITY_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AuthorizationActivity target) { + + } + + @Override + protected void updateToPass(AuthorizationActivity target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AuthorizationActivityOperations.validateAuthorizationActivityTemplateId( + (AuthorizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateAuthorizationActivityTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAuthorizationActivityClassCode() { + OperationsTestCase validateAuthorizationActivityClassCodeTestCase = new OperationsTestCase( + "validateAuthorizationActivityClassCode", + operationsForOCL.getOCLValue("VALIDATE_AUTHORIZATION_ACTIVITY_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AuthorizationActivity target) { + + } + + @Override + protected void updateToPass(AuthorizationActivity target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AuthorizationActivityOperations.validateAuthorizationActivityClassCode( + (AuthorizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateAuthorizationActivityClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAuthorizationActivityMoodCode() { + OperationsTestCase validateAuthorizationActivityMoodCodeTestCase = new OperationsTestCase( + "validateAuthorizationActivityMoodCode", + operationsForOCL.getOCLValue("VALIDATE_AUTHORIZATION_ACTIVITY_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AuthorizationActivity target) { + + } + + @Override + protected void updateToPass(AuthorizationActivity target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AuthorizationActivityOperations.validateAuthorizationActivityMoodCode( + (AuthorizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateAuthorizationActivityMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAuthorizationActivityId() { + OperationsTestCase validateAuthorizationActivityIdTestCase = new OperationsTestCase( + "validateAuthorizationActivityId", + operationsForOCL.getOCLValue("VALIDATE_AUTHORIZATION_ACTIVITY_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AuthorizationActivity target) { + + } + + @Override + protected void updateToPass(AuthorizationActivity target) { + target.init(); + target.getIds().add(DatatypesFactory.eINSTANCE.createII()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AuthorizationActivityOperations.validateAuthorizationActivityId( + (AuthorizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateAuthorizationActivityIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAuthorizationActivityEntryRelationship() { + OperationsTestCase validateAuthorizationActivityEntryRelationshipTestCase = new OperationsTestCase( + "validateAuthorizationActivityEntryRelationship", + operationsForOCL.getOCLValue("VALIDATE_AUTHORIZATION_ACTIVITY_ENTRY_RELATIONSHIP__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AuthorizationActivity target) { + target.init(); + } + + @Override + protected void updateToPass(AuthorizationActivity target) { + target.getEntryRelationships().add(CDAFactory.eINSTANCE.createEntryRelationship()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AuthorizationActivityOperations.validateAuthorizationActivityEntryRelationship( + (AuthorizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateAuthorizationActivityEntryRelationshipTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends AuthorizationActivityOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public AuthorizationActivity create() { + return CCDFactory.eINSTANCE.createAuthorizationActivity(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends AuthorizationActivityOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // AuthorizationActivityOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/CCDAllTests.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/CCDAllTests.java new file mode 100644 index 000000000..f6543c71a --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/CCDAllTests.java @@ -0,0 +1,54 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import junit.framework.Test; +import junit.framework.TestSuite; +import junit.textui.TestRunner; + +/** + * + * A test suite for the 'CCD' model. + * + * @generated + */ +public class CCDAllTests extends TestSuite { + + /** + * + * + * @generated + */ + public static void main(String[] args) { + TestRunner.run(suite()); + } + + /** + * + * + * @generated + */ + public static Test suite() { + TestSuite suite = new CCDAllTests("CCD Tests"); + suite.addTest(CCDTests.suite()); + return suite; + } + + /** + * + * + * @generated + */ + public CCDAllTests(String name) { + super(name); + } + +} // CCDAllTests diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/CCDExample.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/CCDExample.java new file mode 100644 index 000000000..f74b1539c --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/CCDExample.java @@ -0,0 +1,116 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.io.File; +import java.io.IOException; + +import org.eclipse.emf.common.util.Diagnostic; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; +import org.eclipse.emf.ecore.util.Diagnostician; +import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.CCDPackage; +import org.openhealthtools.mdht.uml.cda.ccd.MedicationsSection; + +/** + * A sample utility for the 'ccd' + * package. + * @generated + */ +public class CCDExample { + /** + * Load all the argument file paths or URIs as + * instances of the model. + * @param args the file paths or URIs. + * @generated + */ + public static void main(String[] args) { + // Create a resource set to hold the resources. + // + ResourceSet resourceSet = new ResourceSetImpl(); + + // Register the appropriate resource factory to handle all file extensions. + // + resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put( + Resource.Factory.Registry.DEFAULT_EXTENSION, new XMIResourceFactoryImpl()); + + // Register the package to ensure it is available during loading. + // + resourceSet.getPackageRegistry().put(CCDPackage.eNS_URI, CCDPackage.eINSTANCE); + + // If there are no arguments, emit an appropriate usage message. + // + if (args.length == 0) { + System.out.println("Enter a list of file paths or URIs that have content like this:"); + try { + Resource resource = resourceSet.createResource(URI.createURI("http:///My.ccd")); + MedicationsSection root = CCDFactory.eINSTANCE.createMedicationsSection(); + resource.getContents().add(root); + resource.save(System.out, null); + } catch (IOException exception) { + exception.printStackTrace(); + } + } else { + // Iterate over all the arguments. + // + for (int i = 0; i < args.length; ++i) { + // Construct the URI for the instance file. + // The argument is treated as a file path only if it denotes an existing file. + // Otherwise, it's directly treated as a URL. + // + File file = new File(args[i]); + URI uri = file.isFile() + ? URI.createFileURI(file.getAbsolutePath()) + : URI.createURI(args[i]); + + try { + // Demand load resource for this file. + // + Resource resource = resourceSet.getResource(uri, true); + System.out.println("Loaded " + uri); + + // Validate the contents of the loaded resource. + // + for (EObject eObject : resource.getContents()) { + Diagnostic diagnostic = Diagnostician.INSTANCE.validate(eObject); + if (diagnostic.getSeverity() != Diagnostic.OK) { + printDiagnostic(diagnostic, ""); + } + } + } catch (RuntimeException exception) { + System.out.println("Problem loading " + uri); + exception.printStackTrace(); + } + } + } + } + + /** + * Prints diagnostics with indentation. + * @param diagnostic the diagnostic to print. + * @param indent the indentation for printing. + * @generated + */ + protected static void printDiagnostic(Diagnostic diagnostic, String indent) { + System.out.print(indent); + System.out.println(diagnostic.getMessage()); + for (Diagnostic child : diagnostic.getChildren()) { + printDiagnostic(child, indent + " "); + } + } + +} // CCDExample diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/CCDRegistryDelegateTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/CCDRegistryDelegateTest.java new file mode 100644 index 000000000..6d6ca6a7d --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/CCDRegistryDelegateTest.java @@ -0,0 +1,112 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.CCDRegistryDelegate; +import org.openhealthtools.mdht.uml.cda.ccd.operations.CCDRegistryDelegateOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Registry Delegate' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.RegistryDelegate#getEClass(java.lang.String, java.lang.Object) Get EClass}
  • + *
+ *

+ * + * @generated + */ + +public class CCDRegistryDelegateTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testGetEClass() { + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends CCDRegistryDelegateOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public CCDRegistryDelegate create() { + return CCDFactory.eINSTANCE.createCCDRegistryDelegate(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends CCDRegistryDelegateOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // CCDRegistryDelegateOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/CCDTests.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/CCDTests.java new file mode 100644 index 000000000..0ea3b55e8 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/CCDTests.java @@ -0,0 +1,64 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import junit.framework.JUnit4TestAdapter; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +/** + * + * A test suite for the 'ccd' package. + * + * + + * @generated + */ +@RunWith(Suite.class) +@Suite.SuiteClasses({ + MedicationsSectionTest.class, MedicationActivityTest.class, MedicationSeriesNumberObservationTest.class, + MedicationStatusObservationTest.class, StatusObservationTest.class, PatientInstructionTest.class, + ReactionObservationTest.class, SeverityObservationTest.class, ProductInstanceTest.class, + SupplyActivityTest.class, FulfillmentInstructionTest.class, ContinuityOfCareDocumentTest.class, + ProblemSectionTest.class, ProblemActTest.class, EpisodeObservationTest.class, FamilyHistorySectionTest.class, + FamilyHistoryOrganizerTest.class, FamilyHistoryObservationTest.class, + FamilyHistoryCauseOfDeathObservationTest.class, AgeObservationTest.class, ProblemStatusObservationTest.class, + CauseOfDeathObservationTest.class, SocialHistorySectionTest.class, SocialHistoryObservationTest.class, + SocialHistoryStatusObservationTest.class, AlertsSectionTest.class, ResultsSectionTest.class, + ResultOrganizerTest.class, ResultObservationTest.class, ProceduresSectionTest.class, + EncountersSectionTest.class, EncountersActivityTest.class, PlanOfCareSectionTest.class, + PlanOfCareActivityActTest.class, PlanOfCareActivityEncounterTest.class, + PlanOfCareActivityObservationTest.class, PlanOfCareActivityProcedureTest.class, + PlanOfCareActivitySubstanceAdministrationTest.class, PlanOfCareActivitySupplyTest.class, + ImmunizationsSectionTest.class, VitalSignsSectionTest.class, VitalSignsOrganizerTest.class, + MedicalEquipmentSectionTest.class, FunctionalStatusSectionTest.class, AdvanceDirectivesSectionTest.class, + AdvanceDirectiveObservationTest.class, AdvanceDirectiveStatusObservationTest.class, + AdvanceDirectiveReferenceTest.class, PayersSectionTest.class, CoverageActivityTest.class, + PolicyActivityTest.class, PurposeSectionTest.class, PurposeActivityTest.class, ProblemObservationTest.class, + ProblemHealthStatusObservationTest.class, PatientAwarenessTest.class, AlertObservationTest.class, + AlertStatusObservationTest.class, EncounterLocationTest.class, ProductTest.class, + AdvanceDirectiveVerificationTest.class, AuthorizationActivityTest.class, FunctionalStatusObservationTest.class, + ProcedureActivityActTest.class, ProcedureActivityObservationTest.class, ProcedureActivityProcedureTest.class, + PayerEntityTest.class, CoveredPartyTest.class, PolicySubscriberTest.class, CoveragePlanDescriptionTest.class, + SupportParticipantTest.class, SupportGuardianTest.class, CommentTest.class, CCDRegistryDelegateTest.class }) +public class CCDTests { + + /** + * + * + * @generated + */ + public static junit.framework.Test suite() { + return new JUnit4TestAdapter(CCDTests.class); + } + +} // CCDTests diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/CauseOfDeathObservationTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/CauseOfDeathObservationTest.java new file mode 100644 index 000000000..8b1059d0b --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/CauseOfDeathObservationTest.java @@ -0,0 +1,140 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.CauseOfDeathObservation; +import org.openhealthtools.mdht.uml.cda.ccd.operations.CauseOfDeathObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Cause Of Death Observation' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.CauseOfDeathObservation#validateFamilyHistoryObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Observation Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class CauseOfDeathObservationTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateFamilyHistoryObservationTemplateId() { + OperationsTestCase validateFamilyHistoryObservationTemplateIdTestCase = new OperationsTestCase( + "validateFamilyHistoryObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CauseOfDeathObservation target) { + + } + + @Override + protected void updateToPass(CauseOfDeathObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CauseOfDeathObservationOperations.validateFamilyHistoryObservationTemplateId( + (CauseOfDeathObservation) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends CauseOfDeathObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public CauseOfDeathObservation create() { + return CCDFactory.eINSTANCE.createCauseOfDeathObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends CauseOfDeathObservationOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // CauseOfDeathObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/CommentTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/CommentTest.java new file mode 100644 index 000000000..5c44d1f4d --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/CommentTest.java @@ -0,0 +1,236 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.Comment; +import org.openhealthtools.mdht.uml.cda.ccd.operations.CommentOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Comment' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.Comment#validateCommentTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Comment Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.Comment#validateCommentClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Comment Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.Comment#validateCommentMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Comment Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.Comment#validateCommentCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Comment Code}
  • + *
+ *

+ * + * @generated + */ + +public class CommentTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateCommentTemplateId() { + OperationsTestCase validateCommentTemplateIdTestCase = new OperationsTestCase( + "validateCommentTemplateId", + operationsForOCL.getOCLValue("VALIDATE_COMMENT_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(Comment target) { + + } + + @Override + protected void updateToPass(Comment target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CommentOperations.validateCommentTemplateId((Comment) objectToTest, diagnostician, map); + } + + }; + + validateCommentTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCommentClassCode() { + OperationsTestCase validateCommentClassCodeTestCase = new OperationsTestCase( + "validateCommentClassCode", + operationsForOCL.getOCLValue("VALIDATE_COMMENT_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(Comment target) { + + } + + @Override + protected void updateToPass(Comment target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CommentOperations.validateCommentClassCode((Comment) objectToTest, diagnostician, map); + } + + }; + + validateCommentClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCommentMoodCode() { + OperationsTestCase validateCommentMoodCodeTestCase = new OperationsTestCase( + "validateCommentMoodCode", + operationsForOCL.getOCLValue("VALIDATE_COMMENT_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(Comment target) { + + } + + @Override + protected void updateToPass(Comment target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CommentOperations.validateCommentMoodCode((Comment) objectToTest, diagnostician, map); + } + + }; + + validateCommentMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCommentCode() { + OperationsTestCase validateCommentCodeTestCase = new OperationsTestCase( + "validateCommentCode", + operationsForOCL.getOCLValue("VALIDATE_COMMENT_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(Comment target) { + + } + + @Override + protected void updateToPass(Comment target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CommentOperations.validateCommentCode((Comment) objectToTest, diagnostician, map); + } + + }; + + validateCommentCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends CommentOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public Comment create() { + return CCDFactory.eINSTANCE.createComment(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends CommentOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // CommentOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ContinuityOfCareDocumentTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ContinuityOfCareDocumentTest.java new file mode 100644 index 000000000..ee2e22b89 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ContinuityOfCareDocumentTest.java @@ -0,0 +1,1646 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.AssignedAuthor; +import org.openhealthtools.mdht.uml.cda.Author; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.DocumentationOf; +import org.openhealthtools.mdht.uml.cda.Organization; +import org.openhealthtools.mdht.uml.cda.ServiceEvent; +import org.openhealthtools.mdht.uml.cda.ccd.AdvanceDirectivesSection; +import org.openhealthtools.mdht.uml.cda.ccd.AlertsSection; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.ContinuityOfCareDocument; +import org.openhealthtools.mdht.uml.cda.ccd.EncountersSection; +import org.openhealthtools.mdht.uml.cda.ccd.FamilyHistorySection; +import org.openhealthtools.mdht.uml.cda.ccd.FunctionalStatusSection; +import org.openhealthtools.mdht.uml.cda.ccd.ImmunizationsSection; +import org.openhealthtools.mdht.uml.cda.ccd.MedicalEquipmentSection; +import org.openhealthtools.mdht.uml.cda.ccd.MedicationsSection; +import org.openhealthtools.mdht.uml.cda.ccd.PayersSection; +import org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareSection; +import org.openhealthtools.mdht.uml.cda.ccd.ProblemSection; +import org.openhealthtools.mdht.uml.cda.ccd.ProceduresSection; +import org.openhealthtools.mdht.uml.cda.ccd.PurposeSection; +import org.openhealthtools.mdht.uml.cda.ccd.ResultsSection; +import org.openhealthtools.mdht.uml.cda.ccd.SocialHistorySection; +import org.openhealthtools.mdht.uml.cda.ccd.VitalSignsSection; +import org.openhealthtools.mdht.uml.cda.ccd.operations.ContinuityOfCareDocumentOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.datatypes.TS; +import org.openhealthtools.mdht.uml.hl7.vocab.ActClassRoot; +import org.openhealthtools.mdht.uml.hl7.vocab.NullFlavor; + +/** + * A static utility class that provides operations + * related to 'Continuity Of Care Document' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ContinuityOfCareDocument#validateContinuityOfCareDocumentServiceEventRequired(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Service Event Required}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ContinuityOfCareDocument#validateContinuityOfCareDocumentServiceEventClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Service Event Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ContinuityOfCareDocument#validateContinuityOfCareDocumentServiceEventEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Service Event Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ContinuityOfCareDocument#validateContinuityOfCareDocumentLanguageCodeFormat(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Language Code Format}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ContinuityOfCareDocument#validateContinuityOfCareDocumentNoTemplateIdExtension(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document No Template Id Extension}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ContinuityOfCareDocument#validateContinuityOfCareDocumentHasEffectiveTimeSeconds(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Has Effective Time Seconds}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ContinuityOfCareDocument#validateContinuityOfCareDocumentHasEffectiveTimeZone(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Has Effective Time Zone}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ContinuityOfCareDocument#validateContinuityOfCareDocumentOneOrTwoRecordTarget(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document One Or Two Record Target}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ContinuityOfCareDocument#validateContinuityOfCareDocumentHasAssignedAuthor(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Has Assigned Author}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ContinuityOfCareDocument#validateContinuityOfCareDocumentHasAssignedAuthorNullFlavor(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Has Assigned Author Null Flavor}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ContinuityOfCareDocument#validateContinuityOfCareDocumentHasInformationRecipient(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Has Information Recipient}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ContinuityOfCareDocument#validateContinuityOfCareDocumentTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ContinuityOfCareDocument#validateContinuityOfCareDocumentCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ContinuityOfCareDocument#validateContinuityOfCareDocumentLanguageCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Language Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ContinuityOfCareDocument#validateContinuityOfCareDocumentProblemSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Problem Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ContinuityOfCareDocument#validateContinuityOfCareDocumentFamilyHistorySection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Family History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ContinuityOfCareDocument#validateContinuityOfCareDocumentSocialHistorySection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Social History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ContinuityOfCareDocument#validateContinuityOfCareDocumentAlertsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Alerts Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ContinuityOfCareDocument#validateContinuityOfCareDocumentMedicationsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Medications Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ContinuityOfCareDocument#validateContinuityOfCareDocumentResultsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Results Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ContinuityOfCareDocument#validateContinuityOfCareDocumentProceduresSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Procedures Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ContinuityOfCareDocument#validateContinuityOfCareDocumentEncountersSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Encounters Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ContinuityOfCareDocument#validateContinuityOfCareDocumentPlanOfCareSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Plan Of Care Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ContinuityOfCareDocument#validateContinuityOfCareDocumentImmunizationsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Immunizations Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ContinuityOfCareDocument#validateContinuityOfCareDocumentVitalSignsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Vital Signs Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ContinuityOfCareDocument#validateContinuityOfCareDocumentMedicalEquipmentSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Medical Equipment Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ContinuityOfCareDocument#validateContinuityOfCareDocumentFunctionalStatusSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Functional Status Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ContinuityOfCareDocument#validateContinuityOfCareDocumentAdvanceDirectivesSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Advance Directives Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ContinuityOfCareDocument#validateContinuityOfCareDocumentPayersSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Payers Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ContinuityOfCareDocument#validateContinuityOfCareDocumentPurposeSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Purpose Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ContinuityOfCareDocument#getProblemSection() Get Problem Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ContinuityOfCareDocument#getFamilyHistorySection() Get Family History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ContinuityOfCareDocument#getSocialHistorySection() Get Social History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ContinuityOfCareDocument#getAlertsSection() Get Alerts Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ContinuityOfCareDocument#getMedicationsSection() Get Medications Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ContinuityOfCareDocument#getResultsSection() Get Results Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ContinuityOfCareDocument#getProceduresSection() Get Procedures Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ContinuityOfCareDocument#getEncountersSection() Get Encounters Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ContinuityOfCareDocument#getPlanOfCareSection() Get Plan Of Care Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ContinuityOfCareDocument#getImmunizationsSection() Get Immunizations Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ContinuityOfCareDocument#getVitalSignsSection() Get Vital Signs Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ContinuityOfCareDocument#getMedicalEquipmentSection() Get Medical Equipment Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ContinuityOfCareDocument#getFunctionalStatusSection() Get Functional Status Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ContinuityOfCareDocument#getAdvanceDirectivesSection() Get Advance Directives Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ContinuityOfCareDocument#getPayersSection() Get Payers Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ContinuityOfCareDocument#getPurposeSection() Get Purpose Section}
  • + *
+ *

+ * + * @generated + */ + +public class ContinuityOfCareDocumentTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateContinuityOfCareDocumentServiceEventRequired() { + OperationsTestCase validateContinuityOfCareDocumentServiceEventRequiredTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentServiceEventRequired", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_SERVICE_EVENT_REQUIRED__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.init(); + + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + dof.setServiceEvent(CDAFactory.eINSTANCE.createServiceEvent()); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentServiceEventRequired( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentServiceEventRequiredTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateContinuityOfCareDocumentServiceEventClassCode() { + OperationsTestCase validateContinuityOfCareDocumentServiceEventClassCodeTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentServiceEventClassCode", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_SERVICE_EVENT_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + se.setClassCode(ActClassRoot.PCPR); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentServiceEventClassCode( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentServiceEventClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateContinuityOfCareDocumentServiceEventEffectiveTime() { + OperationsTestCase validateContinuityOfCareDocumentServiceEventEffectiveTimeTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentServiceEventEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_SERVICE_EVENT_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + se.setClassCode(ActClassRoot.PCPR); + ts.setLow(DatatypesFactory.eINSTANCE.createIVXB_TS()); + ts.setHigh(DatatypesFactory.eINSTANCE.createIVXB_TS()); + se.setEffectiveTime(ts); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentServiceEventEffectiveTime( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentServiceEventEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateContinuityOfCareDocumentLanguageCodeFormat() { + OperationsTestCase validateContinuityOfCareDocumentLanguageCodeFormatTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentLanguageCodeFormat", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_LANGUAGE_CODE_FORMAT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + public void addFailTests() { + + addFailTest(new FailTest() { + + @Override + public void updateToFail(ContinuityOfCareDocument target) { + // Do nothing should trigger + + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(ContinuityOfCareDocument target) { + target.setLanguageCode(DatatypesFactory.eINSTANCE.createCS("aaaa")); + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(ContinuityOfCareDocument target) { + target.setLanguageCode(DatatypesFactory.eINSTANCE.createCS("AAAA")); + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(ContinuityOfCareDocument target) { + target.setLanguageCode(DatatypesFactory.eINSTANCE.createCS("aa-aa")); + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(ContinuityOfCareDocument target) { + target.setLanguageCode(DatatypesFactory.eINSTANCE.createCS("AA-AA")); + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(ContinuityOfCareDocument target) { + target.setLanguageCode(DatatypesFactory.eINSTANCE.createCS("aaa")); + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(ContinuityOfCareDocument target) { + target.setLanguageCode(DatatypesFactory.eINSTANCE.createCS("a")); + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(ContinuityOfCareDocument target) { + target.setLanguageCode(DatatypesFactory.eINSTANCE.createCS("AA-aa")); + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(ContinuityOfCareDocument target) { + target.setLanguageCode(DatatypesFactory.eINSTANCE.createCS("AA-")); + } + }); + + } + + @Override + public void addPassTests() { + this.addPassTest(new PassTest() { + + @Override + public void updateToPass(ContinuityOfCareDocument target) { + target.setLanguageCode(DatatypesFactory.eINSTANCE.createCS("en")); + + } + }); + + this.addPassTest(new PassTest() { + + @Override + public void updateToPass(ContinuityOfCareDocument target) { + target.setLanguageCode(DatatypesFactory.eINSTANCE.createCS("en-US")); + + } + }); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentLanguageCodeFormat( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentLanguageCodeFormatTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateContinuityOfCareDocumentNoTemplateIdExtension() { + OperationsTestCase validateContinuityOfCareDocumentNoTemplateIdExtensionTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentNoTemplateIdExtension", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_NO_TEMPLATE_ID_EXTENSION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + + II te = DatatypesFactory.eINSTANCE.createII(); + te.setRoot("2.16.840.1.113883.10.20.1"); + te.setExtension("a"); + target.getTemplateIds().add(te); + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.getTemplateIds().clear(); + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentNoTemplateIdExtension( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentNoTemplateIdExtensionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateContinuityOfCareDocumentHasEffectiveTimeSeconds() { + OperationsTestCase validateContinuityOfCareDocumentHasEffectiveTimeSecondsTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentHasEffectiveTimeSeconds", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_HAS_EFFECTIVE_TIME_SECONDS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + target.init(); + TS ts = DatatypesFactory.eINSTANCE.createTS(); + ts.setValue("123"); + + target.setEffectiveTime(ts); + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + + TS ts = DatatypesFactory.eINSTANCE.createTS(); + ts.setValue("12345"); + + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentHasEffectiveTimeSeconds( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentHasEffectiveTimeSecondsTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateContinuityOfCareDocumentHasEffectiveTimeZone() { + OperationsTestCase validateContinuityOfCareDocumentHasEffectiveTimeZoneTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentHasEffectiveTimeZone", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_HAS_EFFECTIVE_TIME_ZONE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + target.init(); + TS ts = DatatypesFactory.eINSTANCE.createTS(); + ts.setValue("20071213155200"); + + target.setEffectiveTime(ts); + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + + TS ts = DatatypesFactory.eINSTANCE.createTS(); + ts.setValue("20071213155200-0500"); + + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentHasEffectiveTimeZone( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentHasEffectiveTimeZoneTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateContinuityOfCareDocumentOneOrTwoRecordTarget() { + OperationsTestCase validateContinuityOfCareDocumentOneOrTwoRecordTargetTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentOneOrTwoRecordTarget", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_ONE_OR_TWO_RECORD_TARGET__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.init(); + target.getRecordTargets().add(CDAFactory.eINSTANCE.createRecordTarget()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentOneOrTwoRecordTarget( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentOneOrTwoRecordTargetTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateContinuityOfCareDocumentHasAssignedAuthor() { + OperationsTestCase validateContinuityOfCareDocumentHasAssignedAuthorTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentHasAssignedAuthor", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_HAS_ASSIGNED_AUTHOR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.init(); + Author auth = CDAFactory.eINSTANCE.createAuthor(); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + aa.setAssignedPerson(CDAFactory.eINSTANCE.createPerson()); + auth.setAssignedAuthor(aa); + target.getAuthors().add(auth); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentHasAssignedAuthor( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentHasAssignedAuthorTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateContinuityOfCareDocumentHasAssignedAuthorNullFlavor() { + OperationsTestCase validateContinuityOfCareDocumentHasAssignedAuthorNullFlavorTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentHasAssignedAuthorNullFlavor", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_HAS_ASSIGNED_AUTHOR_NULL_FLAVOR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.init(); + Author auth = CDAFactory.eINSTANCE.createAuthor(); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + Organization org = CDAFactory.eINSTANCE.createOrganization(); + aa.setRepresentedOrganization(org); + II id = DatatypesFactory.eINSTANCE.createII(); + id.setNullFlavor(NullFlavor.NA); + aa.getIds().add(id); + auth.setAssignedAuthor(aa); + target.getAuthors().add(auth); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentHasAssignedAuthorNullFlavor( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentHasAssignedAuthorNullFlavorTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateContinuityOfCareDocumentHasInformationRecipient() { + OperationsTestCase validateContinuityOfCareDocumentHasInformationRecipientTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentHasInformationRecipient", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_HAS_INFORMATION_RECIPIENT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.init(); + target.getInformationRecipients().add(CDAFactory.eINSTANCE.createInformationRecipient()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentHasInformationRecipient( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentHasInformationRecipientTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateContinuityOfCareDocumentTemplateId() { + OperationsTestCase validateContinuityOfCareDocumentTemplateIdTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentTemplateId", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentTemplateId( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateContinuityOfCareDocumentCode() { + OperationsTestCase validateContinuityOfCareDocumentCodeTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentCode", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentCode( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateContinuityOfCareDocumentLanguageCode() { + OperationsTestCase validateContinuityOfCareDocumentLanguageCodeTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentLanguageCode", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_LANGUAGE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.init(); + target.setLanguageCode(DatatypesFactory.eINSTANCE.createCS()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentLanguageCode( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentLanguageCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateContinuityOfCareDocumentProblemSection() { + OperationsTestCase validateContinuityOfCareDocumentProblemSectionTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentProblemSection", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_PROBLEM_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.init(); + + /* ProblemSection */ + ProblemSection section = + + CCDFactory.eINSTANCE.createProblemSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentProblemSection( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentProblemSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateContinuityOfCareDocumentFamilyHistorySection() { + OperationsTestCase validateContinuityOfCareDocumentFamilyHistorySectionTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentFamilyHistorySection", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_FAMILY_HISTORY_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.init(); + + /* FamilyHistorySection */ + FamilyHistorySection section = + + CCDFactory.eINSTANCE.createFamilyHistorySection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentFamilyHistorySection( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentFamilyHistorySectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateContinuityOfCareDocumentSocialHistorySection() { + OperationsTestCase validateContinuityOfCareDocumentSocialHistorySectionTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentSocialHistorySection", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_SOCIAL_HISTORY_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.init(); + + /* SocialHistorySection */ + SocialHistorySection section = + + CCDFactory.eINSTANCE.createSocialHistorySection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentSocialHistorySection( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentSocialHistorySectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateContinuityOfCareDocumentAlertsSection() { + OperationsTestCase validateContinuityOfCareDocumentAlertsSectionTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentAlertsSection", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_ALERTS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.init(); + + /* AlertsSection */ + AlertsSection section = + + CCDFactory.eINSTANCE.createAlertsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentAlertsSection( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentAlertsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateContinuityOfCareDocumentMedicationsSection() { + OperationsTestCase validateContinuityOfCareDocumentMedicationsSectionTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentMedicationsSection", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_MEDICATIONS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.init(); + + /* MedicationsSection */ + MedicationsSection section = + + CCDFactory.eINSTANCE.createMedicationsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentMedicationsSection( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentMedicationsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateContinuityOfCareDocumentResultsSection() { + OperationsTestCase validateContinuityOfCareDocumentResultsSectionTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentResultsSection", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_RESULTS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.init(); + + /* ResultsSection */ + ResultsSection section = + + CCDFactory.eINSTANCE.createResultsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentResultsSection( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentResultsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateContinuityOfCareDocumentProceduresSection() { + OperationsTestCase validateContinuityOfCareDocumentProceduresSectionTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentProceduresSection", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_PROCEDURES_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.init(); + + /* ProceduresSection */ + ProceduresSection section = + + CCDFactory.eINSTANCE.createProceduresSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentProceduresSection( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentProceduresSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateContinuityOfCareDocumentEncountersSection() { + OperationsTestCase validateContinuityOfCareDocumentEncountersSectionTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentEncountersSection", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_ENCOUNTERS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.init(); + + /* EncountersSection */ + EncountersSection section = + + CCDFactory.eINSTANCE.createEncountersSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentEncountersSection( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentEncountersSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateContinuityOfCareDocumentPlanOfCareSection() { + OperationsTestCase validateContinuityOfCareDocumentPlanOfCareSectionTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentPlanOfCareSection", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_PLAN_OF_CARE_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.init(); + + /* PlanOfCareSection */ + PlanOfCareSection section = + + CCDFactory.eINSTANCE.createPlanOfCareSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentPlanOfCareSection( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentPlanOfCareSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateContinuityOfCareDocumentImmunizationsSection() { + OperationsTestCase validateContinuityOfCareDocumentImmunizationsSectionTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentImmunizationsSection", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_IMMUNIZATIONS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.init(); + + /* ImmunizationsSection */ + ImmunizationsSection section = + + CCDFactory.eINSTANCE.createImmunizationsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentImmunizationsSection( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentImmunizationsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateContinuityOfCareDocumentVitalSignsSection() { + OperationsTestCase validateContinuityOfCareDocumentVitalSignsSectionTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentVitalSignsSection", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_VITAL_SIGNS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.init(); + + /* VitalSignsSection */ + VitalSignsSection section = + + CCDFactory.eINSTANCE.createVitalSignsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentVitalSignsSection( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentVitalSignsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateContinuityOfCareDocumentMedicalEquipmentSection() { + OperationsTestCase validateContinuityOfCareDocumentMedicalEquipmentSectionTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentMedicalEquipmentSection", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_MEDICAL_EQUIPMENT_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.init(); + + /* MedicalEquipmentSection */ + MedicalEquipmentSection section = + + CCDFactory.eINSTANCE.createMedicalEquipmentSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentMedicalEquipmentSection( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentMedicalEquipmentSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateContinuityOfCareDocumentFunctionalStatusSection() { + OperationsTestCase validateContinuityOfCareDocumentFunctionalStatusSectionTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentFunctionalStatusSection", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_FUNCTIONAL_STATUS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.init(); + + /* FunctionalStatusSection */ + FunctionalStatusSection section = + + CCDFactory.eINSTANCE.createFunctionalStatusSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentFunctionalStatusSection( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentFunctionalStatusSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateContinuityOfCareDocumentAdvanceDirectivesSection() { + OperationsTestCase validateContinuityOfCareDocumentAdvanceDirectivesSectionTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentAdvanceDirectivesSection", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_ADVANCE_DIRECTIVES_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.init(); + + /* AdvanceDirectivesSection */ + AdvanceDirectivesSection section = + + CCDFactory.eINSTANCE.createAdvanceDirectivesSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentAdvanceDirectivesSection( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentAdvanceDirectivesSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateContinuityOfCareDocumentPayersSection() { + OperationsTestCase validateContinuityOfCareDocumentPayersSectionTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentPayersSection", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_PAYERS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.init(); + + /* PayersSection */ + PayersSection section = + + CCDFactory.eINSTANCE.createPayersSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentPayersSection( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentPayersSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateContinuityOfCareDocumentPurposeSection() { + OperationsTestCase validateContinuityOfCareDocumentPurposeSectionTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentPurposeSection", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_PURPOSE_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.init(); + + /* PurposeSection */ + PurposeSection section = + + CCDFactory.eINSTANCE.createPurposeSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentPurposeSection( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentPurposeSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemSection() { + + ContinuityOfCareDocument target = objectFactory.create(); + target.getProblemSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetFamilyHistorySection() { + + ContinuityOfCareDocument target = objectFactory.create(); + target.getFamilyHistorySection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetSocialHistorySection() { + + ContinuityOfCareDocument target = objectFactory.create(); + target.getSocialHistorySection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetAlertsSection() { + + ContinuityOfCareDocument target = objectFactory.create(); + target.getAlertsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetMedicationsSection() { + + ContinuityOfCareDocument target = objectFactory.create(); + target.getMedicationsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetResultsSection() { + + ContinuityOfCareDocument target = objectFactory.create(); + target.getResultsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProceduresSection() { + + ContinuityOfCareDocument target = objectFactory.create(); + target.getProceduresSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetEncountersSection() { + + ContinuityOfCareDocument target = objectFactory.create(); + target.getEncountersSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPlanOfCareSection() { + + ContinuityOfCareDocument target = objectFactory.create(); + target.getPlanOfCareSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetImmunizationsSection() { + + ContinuityOfCareDocument target = objectFactory.create(); + target.getImmunizationsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetVitalSignsSection() { + + ContinuityOfCareDocument target = objectFactory.create(); + target.getVitalSignsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetMedicalEquipmentSection() { + + ContinuityOfCareDocument target = objectFactory.create(); + target.getMedicalEquipmentSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetFunctionalStatusSection() { + + ContinuityOfCareDocument target = objectFactory.create(); + target.getFunctionalStatusSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetAdvanceDirectivesSection() { + + ContinuityOfCareDocument target = objectFactory.create(); + target.getAdvanceDirectivesSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPayersSection() { + + ContinuityOfCareDocument target = objectFactory.create(); + target.getPayersSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPurposeSection() { + + ContinuityOfCareDocument target = objectFactory.create(); + target.getPurposeSection(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ContinuityOfCareDocumentOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ContinuityOfCareDocument create() { + return CCDFactory.eINSTANCE.createContinuityOfCareDocument(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ContinuityOfCareDocumentOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ContinuityOfCareDocumentOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/CoverageActivityTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/CoverageActivityTest.java new file mode 100644 index 000000000..a7f9d7fbd --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/CoverageActivityTest.java @@ -0,0 +1,459 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.Informant12; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.CoverageActivity; +import org.openhealthtools.mdht.uml.cda.ccd.PolicyActivity; +import org.openhealthtools.mdht.uml.cda.ccd.operations.CoverageActivityOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.datatypes.INT; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * A static utility class that provides operations + * related to 'Coverage Activity' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.CoverageActivity#validateCoverageActivityInformationSource(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Coverage Activity Information Source}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.CoverageActivity#validateCoverageActivitySequenceNumber(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Coverage Activity Sequence Number}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.CoverageActivity#validateCoverageActivityTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Coverage Activity Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.CoverageActivity#validateCoverageActivityClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Coverage Activity Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.CoverageActivity#validateCoverageActivityMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Coverage Activity Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.CoverageActivity#validateCoverageActivityId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Coverage Activity Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.CoverageActivity#validateCoverageActivityStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Coverage Activity Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.CoverageActivity#validateCoverageActivityCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Coverage Activity Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.CoverageActivity#validateCoverageActivityPolicyActivity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Coverage Activity Policy Activity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.CoverageActivity#getPolicyActivities() Get Policy Activities}
  • + *
+ *

+ * + * @generated + */ + +public class CoverageActivityTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateCoverageActivityInformationSource() { + OperationsTestCase validateCoverageActivityInformationSourceTestCase = new OperationsTestCase( + "validateCoverageActivityInformationSource", + operationsForOCL.getOCLValue("VALIDATE_COVERAGE_ACTIVITY_INFORMATION_SOURCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CoverageActivity target) { + + } + + @Override + protected void updateToPass(CoverageActivity target) { + target.init(); + + Informant12 inf = CDAFactory.eINSTANCE.createInformant12(); + target.getInformants().add(inf); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CoverageActivityOperations.validateCoverageActivityInformationSource( + (CoverageActivity) objectToTest, diagnostician, map); + } + + }; + + validateCoverageActivityInformationSourceTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateCoverageActivitySequenceNumber() { + OperationsTestCase validateCoverageActivitySequenceNumberTestCase = new OperationsTestCase( + "validateCoverageActivitySequenceNumber", + operationsForOCL.getOCLValue("VALIDATE_COVERAGE_ACTIVITY_SEQUENCE_NUMBER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CoverageActivity target) { + + } + + @Override + protected void updateToPass(CoverageActivity target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + INT value = DatatypesFactory.eINSTANCE.createINT(); + er.setSequenceNumber(value); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CoverageActivityOperations.validateCoverageActivitySequenceNumber( + (CoverageActivity) objectToTest, diagnostician, map); + } + + }; + + validateCoverageActivitySequenceNumberTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCoverageActivityTemplateId() { + OperationsTestCase validateCoverageActivityTemplateIdTestCase = new OperationsTestCase( + "validateCoverageActivityTemplateId", + operationsForOCL.getOCLValue("VALIDATE_COVERAGE_ACTIVITY_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CoverageActivity target) { + + } + + @Override + protected void updateToPass(CoverageActivity target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CoverageActivityOperations.validateCoverageActivityTemplateId( + (CoverageActivity) objectToTest, diagnostician, map); + } + + }; + + validateCoverageActivityTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCoverageActivityClassCode() { + OperationsTestCase validateCoverageActivityClassCodeTestCase = new OperationsTestCase( + "validateCoverageActivityClassCode", + operationsForOCL.getOCLValue("VALIDATE_COVERAGE_ACTIVITY_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CoverageActivity target) { + + } + + @Override + protected void updateToPass(CoverageActivity target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CoverageActivityOperations.validateCoverageActivityClassCode( + (CoverageActivity) objectToTest, diagnostician, map); + } + + }; + + validateCoverageActivityClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCoverageActivityMoodCode() { + OperationsTestCase validateCoverageActivityMoodCodeTestCase = new OperationsTestCase( + "validateCoverageActivityMoodCode", + operationsForOCL.getOCLValue("VALIDATE_COVERAGE_ACTIVITY_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CoverageActivity target) { + + } + + @Override + protected void updateToPass(CoverageActivity target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CoverageActivityOperations.validateCoverageActivityMoodCode( + (CoverageActivity) objectToTest, diagnostician, map); + } + + }; + + validateCoverageActivityMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateCoverageActivityId() { + OperationsTestCase validateCoverageActivityIdTestCase = new OperationsTestCase( + "validateCoverageActivityId", + operationsForOCL.getOCLValue("VALIDATE_COVERAGE_ACTIVITY_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CoverageActivity target) { + + } + + @Override + protected void updateToPass(CoverageActivity target) { + target.init(); + II e = DatatypesFactory.eINSTANCE.createII(); + target.getIds().add(e); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CoverageActivityOperations.validateCoverageActivityId( + (CoverageActivity) objectToTest, diagnostician, map); + } + + }; + + validateCoverageActivityIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCoverageActivityStatusCode() { + OperationsTestCase validateCoverageActivityStatusCodeTestCase = new OperationsTestCase( + "validateCoverageActivityStatusCode", + operationsForOCL.getOCLValue("VALIDATE_COVERAGE_ACTIVITY_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CoverageActivity target) { + + } + + @Override + protected void updateToPass(CoverageActivity target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CoverageActivityOperations.validateCoverageActivityStatusCode( + (CoverageActivity) objectToTest, diagnostician, map); + } + + }; + + validateCoverageActivityStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCoverageActivityCode() { + OperationsTestCase validateCoverageActivityCodeTestCase = new OperationsTestCase( + "validateCoverageActivityCode", + operationsForOCL.getOCLValue("VALIDATE_COVERAGE_ACTIVITY_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CoverageActivity target) { + + } + + @Override + protected void updateToPass(CoverageActivity target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CoverageActivityOperations.validateCoverageActivityCode( + (CoverageActivity) objectToTest, diagnostician, map); + } + + }; + + validateCoverageActivityCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateCoverageActivityPolicyActivity() { + OperationsTestCase validateCoverageActivityPolicyActivityTestCase = new OperationsTestCase( + "validateCoverageActivityPolicyActivity", + operationsForOCL.getOCLValue("VALIDATE_COVERAGE_ACTIVITY_POLICY_ACTIVITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CoverageActivity target) { + + } + + @Override + protected void updateToPass(CoverageActivity target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + PolicyActivity pa = CCDFactory.eINSTANCE.createPolicyActivity().init(); + er.setAct(pa); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CoverageActivityOperations.validateCoverageActivityPolicyActivity( + (CoverageActivity) objectToTest, diagnostician, map); + } + + }; + + validateCoverageActivityPolicyActivityTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetPolicyActivities() { + + CoverageActivity target = objectFactory.create(); + target.getPolicyActivities(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends CoverageActivityOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public CoverageActivity create() { + return CCDFactory.eINSTANCE.createCoverageActivity(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends CoverageActivityOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // CoverageActivityOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/CoveragePlanDescriptionTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/CoveragePlanDescriptionTest.java new file mode 100644 index 000000000..c3418867a --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/CoveragePlanDescriptionTest.java @@ -0,0 +1,211 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.CoveragePlanDescription; +import org.openhealthtools.mdht.uml.cda.ccd.operations.CoveragePlanDescriptionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; + +/** + * A static utility class that provides operations + * related to 'Coverage Plan Description' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.CoveragePlanDescription#validateCoveragePlanDescriptionClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Coverage Plan Description Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.CoveragePlanDescription#validateCoveragePlanDescriptionId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Coverage Plan Description Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.CoveragePlanDescription#validateCoveragePlanDescriptionMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Coverage Plan Description Mood Code}
  • + *
+ *

+ * + * @generated + */ + +public class CoveragePlanDescriptionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateCoveragePlanDescriptionClassCode() { + OperationsTestCase validateCoveragePlanDescriptionClassCodeTestCase = new OperationsTestCase( + "validateCoveragePlanDescriptionClassCode", + operationsForOCL.getOCLValue("VALIDATE_COVERAGE_PLAN_DESCRIPTION_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CoveragePlanDescription target) { + + } + + @Override + protected void updateToPass(CoveragePlanDescription target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CoveragePlanDescriptionOperations.validateCoveragePlanDescriptionClassCode( + (CoveragePlanDescription) objectToTest, diagnostician, map); + } + + }; + + validateCoveragePlanDescriptionClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateCoveragePlanDescriptionId() { + OperationsTestCase validateCoveragePlanDescriptionIdTestCase = new OperationsTestCase( + "validateCoveragePlanDescriptionId", + operationsForOCL.getOCLValue("VALIDATE_COVERAGE_PLAN_DESCRIPTION_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CoveragePlanDescription target) { + + } + + @Override + protected void updateToPass(CoveragePlanDescription target) { + target.init(); + target.getIds().add(DatatypesFactory.eINSTANCE.createII()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CoveragePlanDescriptionOperations.validateCoveragePlanDescriptionId( + (CoveragePlanDescription) objectToTest, diagnostician, map); + } + + }; + + validateCoveragePlanDescriptionIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCoveragePlanDescriptionMoodCode() { + OperationsTestCase validateCoveragePlanDescriptionMoodCodeTestCase = new OperationsTestCase( + "validateCoveragePlanDescriptionMoodCode", + operationsForOCL.getOCLValue("VALIDATE_COVERAGE_PLAN_DESCRIPTION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CoveragePlanDescription target) { + + } + + @Override + protected void updateToPass(CoveragePlanDescription target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CoveragePlanDescriptionOperations.validateCoveragePlanDescriptionMoodCode( + (CoveragePlanDescription) objectToTest, diagnostician, map); + } + + }; + + validateCoveragePlanDescriptionMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends CoveragePlanDescriptionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public CoveragePlanDescription create() { + return CCDFactory.eINSTANCE.createCoveragePlanDescription(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends CoveragePlanDescriptionOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // CoveragePlanDescriptionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/CoveredPartyTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/CoveredPartyTest.java new file mode 100644 index 000000000..9a316d916 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/CoveredPartyTest.java @@ -0,0 +1,179 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.CoveredParty; +import org.openhealthtools.mdht.uml.cda.ccd.operations.CoveredPartyOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; + +/** + * A static utility class that provides operations + * related to 'Covered Party' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.CoveredParty#validateCoveredPartyId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Covered Party Id}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.CoveredParty#validateCoveredPartyCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Covered Party Code}
  • + *
+ *

+ * + * @generated + */ + +public class CoveredPartyTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateCoveredPartyId() { + OperationsTestCase validateCoveredPartyIdTestCase = new OperationsTestCase( + "validateCoveredPartyId", + operationsForOCL.getOCLValue("VALIDATE_COVERED_PARTY_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(CoveredParty target) { + + } + + @Override + protected void updateToPass(CoveredParty target) { + target.init(); + target.getIds().add(DatatypesFactory.eINSTANCE.createII()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CoveredPartyOperations.validateCoveredPartyId((CoveredParty) objectToTest, diagnostician, map); + } + + }; + + validateCoveredPartyIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateCoveredPartyCode() { + OperationsTestCase validateCoveredPartyCodeTestCase = new OperationsTestCase( + "validateCoveredPartyCode", + operationsForOCL.getOCLValue("VALIDATE_COVERED_PARTY_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(CoveredParty target) { + + } + + @Override + protected void updateToPass(CoveredParty target) { + target.init(); + CE ce = DatatypesFactory.eINSTANCE.createCE(); + target.setCode(ce); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CoveredPartyOperations.validateCoveredPartyCode((CoveredParty) objectToTest, diagnostician, map); + } + + }; + + validateCoveredPartyCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends CoveredPartyOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public CoveredParty create() { + return CCDFactory.eINSTANCE.createCoveredParty(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends CoveredPartyOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // CoveredPartyOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/EncounterLocationTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/EncounterLocationTest.java new file mode 100644 index 000000000..b975d4607 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/EncounterLocationTest.java @@ -0,0 +1,419 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.ParticipantRole; +import org.openhealthtools.mdht.uml.cda.PlayingEntity; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.EncounterLocation; +import org.openhealthtools.mdht.uml.cda.ccd.operations.EncounterLocationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.vocab.EntityClassRoot; +import org.openhealthtools.mdht.uml.hl7.vocab.RoleClassRoot; + +/** + * A static utility class that provides operations + * related to 'Encounter Location' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.EncounterLocation#validateEncounterLocationHasParticipantRole(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounter Location Has Participant Role}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.EncounterLocation#validateEncounterLocationHasParticipantRoleLocation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounter Location Has Participant Role Location}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.EncounterLocation#validateEncounterLocationHasParticipantRoleCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounter Location Has Participant Role Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.EncounterLocation#validateEncounterLocationHasParticipantRoleCodeVocab(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounter Location Has Participant Role Code Vocab}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.EncounterLocation#validateEncounterLocationHasPlayingEntity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounter Location Has Playing Entity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.EncounterLocation#validateEncounterLocationHasPlayingEntityPlace(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounter Location Has Playing Entity Place}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.EncounterLocation#validateEncounterLocationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounter Location Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.EncounterLocation#validateEncounterLocationTypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounter Location Type Code}
  • + *
+ *

+ * + * @generated + */ + +public class EncounterLocationTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateEncounterLocationHasParticipantRole() { + OperationsTestCase validateEncounterLocationHasParticipantRoleTestCase = new OperationsTestCase( + "validateEncounterLocationHasParticipantRole", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTER_LOCATION_HAS_PARTICIPANT_ROLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncounterLocation target) { + + } + + @Override + protected void updateToPass(EncounterLocation target) { + target.init(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + target.setParticipantRole(pr); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncounterLocationOperations.validateEncounterLocationHasParticipantRole( + (EncounterLocation) objectToTest, diagnostician, map); + } + + }; + + validateEncounterLocationHasParticipantRoleTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateEncounterLocationHasParticipantRoleLocation() { + OperationsTestCase validateEncounterLocationHasParticipantRoleLocationTestCase = new OperationsTestCase( + "validateEncounterLocationHasParticipantRoleLocation", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTER_LOCATION_HAS_PARTICIPANT_ROLE_LOCATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncounterLocation target) { + + } + + @Override + protected void updateToPass(EncounterLocation target) { + target.init(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + pr.setClassCode(RoleClassRoot.SDLOC); + target.setParticipantRole(pr); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncounterLocationOperations.validateEncounterLocationHasParticipantRoleLocation( + (EncounterLocation) objectToTest, diagnostician, map); + } + + }; + + validateEncounterLocationHasParticipantRoleLocationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateEncounterLocationHasParticipantRoleCode() { + OperationsTestCase validateEncounterLocationHasParticipantRoleCodeTestCase = new OperationsTestCase( + "validateEncounterLocationHasParticipantRoleCode", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTER_LOCATION_HAS_PARTICIPANT_ROLE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncounterLocation target) { + target.init(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + pr.setCode(null); + target.setParticipantRole(pr); + } + + @Override + protected void updateToPass(EncounterLocation target) { + target.init(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + CE code = DatatypesFactory.eINSTANCE.createCE(); + pr.setCode(code); + target.setParticipantRole(pr); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncounterLocationOperations.validateEncounterLocationHasParticipantRoleCode( + (EncounterLocation) objectToTest, diagnostician, map); + } + + }; + + validateEncounterLocationHasParticipantRoleCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateEncounterLocationHasParticipantRoleCodeVocab() { + OperationsTestCase validateEncounterLocationHasParticipantRoleCodeVocabTestCase = new OperationsTestCase( + "validateEncounterLocationHasParticipantRoleCodeVocab", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTER_LOCATION_HAS_PARTICIPANT_ROLE_CODE_VOCAB__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncounterLocation target) { + + } + + @Override + protected void updateToPass(EncounterLocation target) { + target.init(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + CE code = DatatypesFactory.eINSTANCE.createCE(); + code.setCodeSystem("2.16.840.1.113883.5.111"); + pr.setCode(code); + target.setParticipantRole(pr); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncounterLocationOperations.validateEncounterLocationHasParticipantRoleCodeVocab( + (EncounterLocation) objectToTest, diagnostician, map); + } + + }; + + validateEncounterLocationHasParticipantRoleCodeVocabTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateEncounterLocationHasPlayingEntity() { + OperationsTestCase validateEncounterLocationHasPlayingEntityTestCase = new OperationsTestCase( + "validateEncounterLocationHasPlayingEntity", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTER_LOCATION_HAS_PLAYING_ENTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncounterLocation target) { + target.init(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + pr.setPlayingEntity(null); + target.setParticipantRole(pr); + + } + + @Override + protected void updateToPass(EncounterLocation target) { + target.init(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + pr.setPlayingEntity(pe); + target.setParticipantRole(pr); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncounterLocationOperations.validateEncounterLocationHasPlayingEntity( + (EncounterLocation) objectToTest, diagnostician, map); + } + + }; + + validateEncounterLocationHasPlayingEntityTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateEncounterLocationHasPlayingEntityPlace() { + OperationsTestCase validateEncounterLocationHasPlayingEntityPlaceTestCase = new OperationsTestCase( + "validateEncounterLocationHasPlayingEntityPlace", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTER_LOCATION_HAS_PLAYING_ENTITY_PLACE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncounterLocation target) { + + } + + @Override + protected void updateToPass(EncounterLocation target) { + target.init(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + pe.setClassCode(EntityClassRoot.PLC); + pr.setPlayingEntity(pe); + target.setParticipantRole(pr); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncounterLocationOperations.validateEncounterLocationHasPlayingEntityPlace( + (EncounterLocation) objectToTest, diagnostician, map); + } + + }; + + validateEncounterLocationHasPlayingEntityPlaceTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateEncounterLocationTemplateId() { + OperationsTestCase validateEncounterLocationTemplateIdTestCase = new OperationsTestCase( + "validateEncounterLocationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTER_LOCATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncounterLocation target) { + + } + + @Override + protected void updateToPass(EncounterLocation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncounterLocationOperations.validateEncounterLocationTemplateId( + (EncounterLocation) objectToTest, diagnostician, map); + } + + }; + + validateEncounterLocationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateEncounterLocationTypeCode() { + OperationsTestCase validateEncounterLocationTypeCodeTestCase = new OperationsTestCase( + "validateEncounterLocationTypeCode", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTER_LOCATION_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncounterLocation target) { + + } + + @Override + protected void updateToPass(EncounterLocation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncounterLocationOperations.validateEncounterLocationTypeCode( + (EncounterLocation) objectToTest, diagnostician, map); + } + + }; + + validateEncounterLocationTypeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends EncounterLocationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public EncounterLocation create() { + return CCDFactory.eINSTANCE.createEncounterLocation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends EncounterLocationOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // EncounterLocationOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/EncountersActivityTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/EncountersActivityTest.java new file mode 100644 index 000000000..bea0405d3 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/EncountersActivityTest.java @@ -0,0 +1,542 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.AssignedEntity; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.Performer2; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.EncountersActivity; +import org.openhealthtools.mdht.uml.cda.ccd.operations.EncountersActivityOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * A static utility class that provides operations + * related to 'Encounters Activity' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.EncountersActivity#validateEncountersActivityHasIndications(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounters Activity Has Indications}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.EncountersActivity#validateEncountersActivityHasPractitioners(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounters Activity Has Practitioners}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.EncountersActivity#validateEncountersActivityPractitionerRole(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounters Activity Practitioner Role}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.EncountersActivity#validateEncountersActivityTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounters Activity Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.EncountersActivity#validateEncountersActivityClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounters Activity Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.EncountersActivity#validateEncountersActivityMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounters Activity Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.EncountersActivity#validateEncountersActivityId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounters Activity Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.EncountersActivity#validateEncountersActivityEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounters Activity Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.EncountersActivity#validateEncountersActivityPatientInstruction(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounters Activity Patient Instruction}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.EncountersActivity#validateEncountersActivityAgeObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounters Activity Age Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.EncountersActivity#validateEncountersActivityEncounterLocation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounters Activity Encounter Location}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.EncountersActivity#getPatientInstructions() Get Patient Instructions}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.EncountersActivity#getAgeObservation() Get Age Observation}
  • + *
+ *

+ * + * @generated + */ + +public class EncountersActivityTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateEncountersActivityHasIndications() { + OperationsTestCase validateEncountersActivityHasIndicationsTestCase = new OperationsTestCase( + "validateEncountersActivityHasIndications", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTERS_ACTIVITY_HAS_INDICATIONS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncountersActivity target) { + + } + + @Override + protected void updateToPass(EncountersActivity target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.RSON); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncountersActivityOperations.validateEncountersActivityHasIndications( + (EncountersActivity) objectToTest, diagnostician, map); + } + + }; + + validateEncountersActivityHasIndicationsTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateEncountersActivityHasPractitioners() { + OperationsTestCase validateEncountersActivityHasPractitionersTestCase = new OperationsTestCase( + "validateEncountersActivityHasPractitioners", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTERS_ACTIVITY_HAS_PRACTITIONERS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + { + this.skipFailsTest(); + } + + @Override + protected void updateToFail(EncountersActivity target) { + // AFAICT There is no way to make this constraint fail + // KP Sethi. + } + + @Override + protected void updateToPass(EncountersActivity target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncountersActivityOperations.validateEncountersActivityHasPractitioners( + (EncountersActivity) objectToTest, diagnostician, map); + } + + }; + + validateEncountersActivityHasPractitionersTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateEncountersActivityPractitionerRole() { + OperationsTestCase validateEncountersActivityPractitionerRoleTestCase = new OperationsTestCase( + "validateEncountersActivityPractitionerRole", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTERS_ACTIVITY_PRACTITIONER_ROLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncountersActivity target) { + + } + + @Override + protected void updateToPass(EncountersActivity target) { + target.init(); + + Performer2 performer = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + performer.setAssignedEntity(ae); + CE ce = DatatypesFactory.eINSTANCE.createCE(); + ae.setCode(ce); + target.getPerformers().add(performer); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncountersActivityOperations.validateEncountersActivityPractitionerRole( + (EncountersActivity) objectToTest, diagnostician, map); + } + + }; + + validateEncountersActivityPractitionerRoleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateEncountersActivityTemplateId() { + OperationsTestCase validateEncountersActivityTemplateIdTestCase = new OperationsTestCase( + "validateEncountersActivityTemplateId", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTERS_ACTIVITY_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncountersActivity target) { + + } + + @Override + protected void updateToPass(EncountersActivity target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncountersActivityOperations.validateEncountersActivityTemplateId( + (EncountersActivity) objectToTest, diagnostician, map); + } + + }; + + validateEncountersActivityTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateEncountersActivityClassCode() { + OperationsTestCase validateEncountersActivityClassCodeTestCase = new OperationsTestCase( + "validateEncountersActivityClassCode", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTERS_ACTIVITY_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncountersActivity target) { + + } + + @Override + protected void updateToPass(EncountersActivity target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncountersActivityOperations.validateEncountersActivityClassCode( + (EncountersActivity) objectToTest, diagnostician, map); + } + + }; + + validateEncountersActivityClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateEncountersActivityMoodCode() { + OperationsTestCase validateEncountersActivityMoodCodeTestCase = new OperationsTestCase( + "validateEncountersActivityMoodCode", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTERS_ACTIVITY_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncountersActivity target) { + + } + + @Override + protected void updateToPass(EncountersActivity target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncountersActivityOperations.validateEncountersActivityMoodCode( + (EncountersActivity) objectToTest, diagnostician, map); + } + + }; + + validateEncountersActivityMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateEncountersActivityId() { + OperationsTestCase validateEncountersActivityIdTestCase = new OperationsTestCase( + "validateEncountersActivityId", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTERS_ACTIVITY_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncountersActivity target) { + + } + + @Override + protected void updateToPass(EncountersActivity target) { + target.init(); + target.getIds().add(DatatypesFactory.eINSTANCE.createII()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncountersActivityOperations.validateEncountersActivityId( + (EncountersActivity) objectToTest, diagnostician, map); + } + + }; + + validateEncountersActivityIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateEncountersActivityEffectiveTime() { + OperationsTestCase validateEncountersActivityEffectiveTimeTestCase = new OperationsTestCase( + "validateEncountersActivityEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTERS_ACTIVITY_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncountersActivity target) { + + } + + @Override + protected void updateToPass(EncountersActivity target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncountersActivityOperations.validateEncountersActivityEffectiveTime( + (EncountersActivity) objectToTest, diagnostician, map); + } + + }; + + validateEncountersActivityEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateEncountersActivityPatientInstruction() { + OperationsTestCase validateEncountersActivityPatientInstructionTestCase = new OperationsTestCase( + "validateEncountersActivityPatientInstruction", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTERS_ACTIVITY_PATIENT_INSTRUCTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncountersActivity target) { + + } + + @Override + protected void updateToPass(EncountersActivity target) { + target.init(); + target.addAct(CCDFactory.eINSTANCE.createPatientInstruction()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncountersActivityOperations.validateEncountersActivityPatientInstruction( + (EncountersActivity) objectToTest, diagnostician, map); + } + + }; + + validateEncountersActivityPatientInstructionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateEncountersActivityAgeObservation() { + OperationsTestCase validateEncountersActivityAgeObservationTestCase = new OperationsTestCase( + "validateEncountersActivityAgeObservation", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTERS_ACTIVITY_AGE_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncountersActivity target) { + + } + + @Override + protected void updateToPass(EncountersActivity target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + er.setObservation(CCDFactory.eINSTANCE.createAgeObservation()); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncountersActivityOperations.validateEncountersActivityAgeObservation( + (EncountersActivity) objectToTest, diagnostician, map); + } + + }; + + validateEncountersActivityAgeObservationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateEncountersActivityEncounterLocation() { + OperationsTestCase validateEncountersActivityEncounterLocationTestCase = new OperationsTestCase( + "validateEncountersActivityEncounterLocation", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTERS_ACTIVITY_ENCOUNTER_LOCATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncountersActivity target) { + target.init(); + } + + @Override + protected void updateToPass(EncountersActivity target) { + target.getParticipants().add(CCDFactory.eINSTANCE.createEncounterLocation().init()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncountersActivityOperations.validateEncountersActivityEncounterLocation( + (EncountersActivity) objectToTest, diagnostician, map); + } + + }; + + validateEncountersActivityEncounterLocationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetPatientInstructions() { + + EncountersActivity target = objectFactory.create(); + target.getPatientInstructions(); + + } + + /** + * + * @generated + */ + @Test + public void testGetAgeObservation() { + + EncountersActivity target = objectFactory.create(); + target.getAgeObservation(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends EncountersActivityOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public EncountersActivity create() { + return CCDFactory.eINSTANCE.createEncountersActivity(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends EncountersActivityOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // EncountersActivityOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/EncountersSectionTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/EncountersSectionTest.java new file mode 100644 index 000000000..107e124fc --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/EncountersSectionTest.java @@ -0,0 +1,303 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.EncountersSection; +import org.openhealthtools.mdht.uml.cda.ccd.operations.EncountersSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * A static utility class that provides operations + * related to 'Encounters Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.EncountersSection#validateEncountersSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounters Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.EncountersSection#validateEncountersSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounters Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.EncountersSection#validateEncountersSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounters Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.EncountersSection#validateEncountersSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounters Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.EncountersSection#validateEncountersSectionEncountersActivity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounters Section Encounters Activity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.EncountersSection#getEncountersActivities() Get Encounters Activities}
  • + *
+ *

+ * + * @generated + */ + +public class EncountersSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateEncountersSectionTemplateId() { + OperationsTestCase validateEncountersSectionTemplateIdTestCase = new OperationsTestCase( + "validateEncountersSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTERS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncountersSection target) { + + } + + @Override + protected void updateToPass(EncountersSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncountersSectionOperations.validateEncountersSectionTemplateId( + (EncountersSection) objectToTest, diagnostician, map); + } + + }; + + validateEncountersSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateEncountersSectionCode() { + OperationsTestCase validateEncountersSectionCodeTestCase = new OperationsTestCase( + "validateEncountersSectionCode", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTERS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncountersSection target) { + + } + + @Override + protected void updateToPass(EncountersSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncountersSectionOperations.validateEncountersSectionCode( + (EncountersSection) objectToTest, diagnostician, map); + } + + }; + + validateEncountersSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateEncountersSectionTitle() { + OperationsTestCase validateEncountersSectionTitleTestCase = new OperationsTestCase( + "validateEncountersSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTERS_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncountersSection target) { + + } + + @Override + protected void updateToPass(EncountersSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncountersSectionOperations.validateEncountersSectionTitle( + (EncountersSection) objectToTest, diagnostician, map); + } + + }; + + validateEncountersSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateEncountersSectionText() { + OperationsTestCase validateEncountersSectionTextTestCase = new OperationsTestCase( + "validateEncountersSectionText", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTERS_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncountersSection target) { + + } + + @Override + protected void updateToPass(EncountersSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncountersSectionOperations.validateEncountersSectionText( + (EncountersSection) objectToTest, diagnostician, map); + } + + }; + + validateEncountersSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateEncountersSectionEncountersActivity() { + OperationsTestCase validateEncountersSectionEncountersActivityTestCase = new OperationsTestCase( + "validateEncountersSectionEncountersActivity", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTERS_SECTION_ENCOUNTERS_ACTIVITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncountersSection target) { + + } + + @Override + protected void updateToPass(EncountersSection target) { + target.init(); + target.addEncounter(CCDFactory.eINSTANCE.createEncountersActivity()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncountersSectionOperations.validateEncountersSectionEncountersActivity( + (EncountersSection) objectToTest, diagnostician, map); + } + + }; + + validateEncountersSectionEncountersActivityTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetEncountersActivities() { + + EncountersSection target = objectFactory.create(); + target.getEncountersActivities(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends EncountersSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public EncountersSection create() { + return CCDFactory.eINSTANCE.createEncountersSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends EncountersSectionOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // EncountersSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/EpisodeObservationTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/EpisodeObservationTest.java new file mode 100644 index 000000000..928b9abc2 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/EpisodeObservationTest.java @@ -0,0 +1,415 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.EpisodeObservation; +import org.openhealthtools.mdht.uml.cda.ccd.ProblemAct; +import org.openhealthtools.mdht.uml.cda.ccd.operations.EpisodeObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * A static utility class that provides operations + * related to 'Episode Observation' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.EpisodeObservation#validateEpisodeObservationOneEntryRelationshipSUBJ(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Episode Observation One Entry Relationship SUBJ}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.EpisodeObservation#validateEpisodeObservationExistsEntryRelationshipSAS(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Episode Observation Exists Entry Relationship SAS}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.EpisodeObservation#validateEpisodeObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Episode Observation Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.EpisodeObservation#validateEpisodeObservationClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Episode Observation Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.EpisodeObservation#validateEpisodeObservationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Episode Observation Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.EpisodeObservation#validateEpisodeObservationStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Episode Observation Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.EpisodeObservation#validateEpisodeObservationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Episode Observation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.EpisodeObservation#validateEpisodeObservationValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Episode Observation Value}
  • + *
+ *

+ * + * @generated + */ + +public class EpisodeObservationTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateEpisodeObservationOneEntryRelationshipSUBJ() { + OperationsTestCase validateEpisodeObservationOneEntryRelationshipSUBJTestCase = new OperationsTestCase( + "validateEpisodeObservationOneEntryRelationshipSUBJ", + operationsForOCL.getOCLValue("VALIDATE_EPISODE_OBSERVATION_ONE_ENTRY_RELATIONSHIP_SUBJ__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EpisodeObservation target) { + + } + + @Override + protected void updateToPass(EpisodeObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + ProblemAct pa = CCDFactory.eINSTANCE.createProblemAct(); + er.setAct(pa); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EpisodeObservationOperations.validateEpisodeObservationOneEntryRelationshipSUBJ( + (EpisodeObservation) objectToTest, diagnostician, map); + } + + }; + + validateEpisodeObservationOneEntryRelationshipSUBJTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateEpisodeObservationExistsEntryRelationshipSAS() { + OperationsTestCase validateEpisodeObservationExistsEntryRelationshipSASTestCase = new OperationsTestCase( + "validateEpisodeObservationExistsEntryRelationshipSAS", + operationsForOCL.getOCLValue("VALIDATE_EPISODE_OBSERVATION_EXISTS_ENTRY_RELATIONSHIP_SAS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EpisodeObservation target) { + + } + + @Override + protected void updateToPass(EpisodeObservation target) { + target.init(); + ProblemAct act = CCDFactory.eINSTANCE.createProblemAct().init(); + target.addAct(act); + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SAS); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EpisodeObservationOperations.validateEpisodeObservationExistsEntryRelationshipSAS( + (EpisodeObservation) objectToTest, diagnostician, map); + } + + }; + + validateEpisodeObservationExistsEntryRelationshipSASTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateEpisodeObservationTemplateId() { + OperationsTestCase validateEpisodeObservationTemplateIdTestCase = new OperationsTestCase( + "validateEpisodeObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_EPISODE_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EpisodeObservation target) { + + } + + @Override + protected void updateToPass(EpisodeObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EpisodeObservationOperations.validateEpisodeObservationTemplateId( + (EpisodeObservation) objectToTest, diagnostician, map); + } + + }; + + validateEpisodeObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateEpisodeObservationClassCode() { + OperationsTestCase validateEpisodeObservationClassCodeTestCase = new OperationsTestCase( + "validateEpisodeObservationClassCode", + operationsForOCL.getOCLValue("VALIDATE_EPISODE_OBSERVATION_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EpisodeObservation target) { + + } + + @Override + protected void updateToPass(EpisodeObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EpisodeObservationOperations.validateEpisodeObservationClassCode( + (EpisodeObservation) objectToTest, diagnostician, map); + } + + }; + + validateEpisodeObservationClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateEpisodeObservationMoodCode() { + OperationsTestCase validateEpisodeObservationMoodCodeTestCase = new OperationsTestCase( + "validateEpisodeObservationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_EPISODE_OBSERVATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EpisodeObservation target) { + + } + + @Override + protected void updateToPass(EpisodeObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EpisodeObservationOperations.validateEpisodeObservationMoodCode( + (EpisodeObservation) objectToTest, diagnostician, map); + } + + }; + + validateEpisodeObservationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateEpisodeObservationStatusCode() { + OperationsTestCase validateEpisodeObservationStatusCodeTestCase = new OperationsTestCase( + "validateEpisodeObservationStatusCode", + operationsForOCL.getOCLValue("VALIDATE_EPISODE_OBSERVATION_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EpisodeObservation target) { + + } + + @Override + protected void updateToPass(EpisodeObservation target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EpisodeObservationOperations.validateEpisodeObservationStatusCode( + (EpisodeObservation) objectToTest, diagnostician, map); + } + + }; + + validateEpisodeObservationStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateEpisodeObservationCode() { + OperationsTestCase validateEpisodeObservationCodeTestCase = new OperationsTestCase( + "validateEpisodeObservationCode", + operationsForOCL.getOCLValue("VALIDATE_EPISODE_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EpisodeObservation target) { + + } + + @Override + protected void updateToPass(EpisodeObservation target) { + target.init(); + + CD cd = DatatypesFactory.eINSTANCE.createCD(); + cd.setCode("ASSERTION"); + cd.setCodeSystem("2.16.840.1.113883.5.4"); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EpisodeObservationOperations.validateEpisodeObservationCode( + (EpisodeObservation) objectToTest, diagnostician, map); + } + + }; + + validateEpisodeObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateEpisodeObservationValue() { + OperationsTestCase validateEpisodeObservationValueTestCase = new OperationsTestCase( + "validateEpisodeObservationValue", + operationsForOCL.getOCLValue("VALIDATE_EPISODE_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EpisodeObservation target) { + + } + + @Override + protected void updateToPass(EpisodeObservation target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD(); + value.setCode("404684003"); + value.setCodeSystem("2.16.840.1.113883.6.96"); + + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EpisodeObservationOperations.validateEpisodeObservationValue( + (EpisodeObservation) objectToTest, diagnostician, map); + } + + }; + + validateEpisodeObservationValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends EpisodeObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public EpisodeObservation create() { + return CCDFactory.eINSTANCE.createEpisodeObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends EpisodeObservationOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // EpisodeObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/FamilyHistoryCauseOfDeathObservationTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/FamilyHistoryCauseOfDeathObservationTest.java new file mode 100644 index 000000000..4153c45ff --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/FamilyHistoryCauseOfDeathObservationTest.java @@ -0,0 +1,195 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.FamilyHistoryCauseOfDeathObservation; +import org.openhealthtools.mdht.uml.cda.ccd.operations.FamilyHistoryCauseOfDeathObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * + * A static utility class that provides operations related to 'Family History Cause Of Death Observation' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FamilyHistoryCauseOfDeathObservation#validateFamilyHistoryCauseOfDeathObservationCauseOfDeathObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Cause Of Death Observation Cause Of Death Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FamilyHistoryCauseOfDeathObservation#getCauseOfDeathObservations() Get Cause Of Death Observations}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FamilyHistoryCauseOfDeathObservation#validateFamilyHistoryObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Observation Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class FamilyHistoryCauseOfDeathObservationTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateFamilyHistoryCauseOfDeathObservationCauseOfDeathObservation() { + OperationsTestCase validateFamilyHistoryCauseOfDeathObservationCauseOfDeathObservationTestCase = new OperationsTestCase( + "validateFamilyHistoryCauseOfDeathObservationCauseOfDeathObservation", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_CAUSE_OF_DEATH_OBSERVATION_CAUSE_OF_DEATH_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryCauseOfDeathObservation target) { + target.init(); + target.addObservation(CDAFactory.eINSTANCE.createObservation()); + } + + @Override + protected void updateToPass(FamilyHistoryCauseOfDeathObservation target) { + target.getEntryRelationships().clear(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.CAUS); + er.setObservation(CCDFactory.eINSTANCE.createCauseOfDeathObservation().init()); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryCauseOfDeathObservationOperations.validateFamilyHistoryCauseOfDeathObservationCauseOfDeathObservation( + (FamilyHistoryCauseOfDeathObservation) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryCauseOfDeathObservationCauseOfDeathObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetCauseOfDeathObservations() { + + FamilyHistoryCauseOfDeathObservation target = objectFactory.create(); + target.getCauseOfDeathObservations(); + + } + + /** + * + * @generated + */ + @Test + public void testValidateFamilyHistoryObservationTemplateId() { + OperationsTestCase validateFamilyHistoryObservationTemplateIdTestCase = new OperationsTestCase( + "validateFamilyHistoryObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryCauseOfDeathObservation target) { + + } + + @Override + protected void updateToPass(FamilyHistoryCauseOfDeathObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryCauseOfDeathObservationOperations.validateFamilyHistoryObservationTemplateId( + (FamilyHistoryCauseOfDeathObservation) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends FamilyHistoryCauseOfDeathObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public FamilyHistoryCauseOfDeathObservation create() { + return CCDFactory.eINSTANCE.createFamilyHistoryCauseOfDeathObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends FamilyHistoryCauseOfDeathObservationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // FamilyHistoryCauseOfDeathObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/FamilyHistoryObservationTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/FamilyHistoryObservationTest.java new file mode 100644 index 000000000..df000862f --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/FamilyHistoryObservationTest.java @@ -0,0 +1,706 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.RelatedSubject; +import org.openhealthtools.mdht.uml.cda.Subject; +import org.openhealthtools.mdht.uml.cda.SubjectPerson; +import org.openhealthtools.mdht.uml.cda.ccd.AgeObservation; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.FamilyHistoryObservation; +import org.openhealthtools.mdht.uml.cda.ccd.operations.FamilyHistoryObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; +import org.openhealthtools.mdht.uml.hl7.vocab.x_DocumentSubject; + +/** + * A static utility class that provides operations + * related to 'Family History Observation' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FamilyHistoryObservation#validateFamilyHistoryObservationHasSubjectPatientRelationship(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Observation Has Subject Patient Relationship}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FamilyHistoryObservation#validateFamilyHistoryObservationRelationshipValueCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Observation Relationship Value Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FamilyHistoryObservation#validateFamilyHistoryObservationHasRelatedSubjectCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Observation Has Related Subject Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FamilyHistoryObservation#validateFamilyHistoryObservationRelatedSubjectCodeValueSet(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Observation Related Subject Code Value Set}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FamilyHistoryObservation#validateFamilyHistoryObservationHasRelatedSubjectSubject(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Observation Has Related Subject Subject}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FamilyHistoryObservation#validateFamilyHistoryObservationHasGenderCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Observation Has Gender Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FamilyHistoryObservation#validateFamilyHistoryObservationRelatedSubjectBirthTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Observation Related Subject Birth Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FamilyHistoryObservation#validateFamilyHistoryObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Observation Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FamilyHistoryObservation#validateFamilyHistoryObservationId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Observation Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FamilyHistoryObservation#validateFamilyHistoryObservationStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Observation Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FamilyHistoryObservation#validateFamilyHistoryObservationEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Observation Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FamilyHistoryObservation#validateFamilyHistoryObservationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Observation Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FamilyHistoryObservation#validateFamilyHistoryObservationAgeObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Observation Age Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FamilyHistoryObservation#validateFamilyHistoryObservationProblemStatusObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Observation Problem Status Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FamilyHistoryObservation#getAgeObservation() Get Age Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FamilyHistoryObservation#getProblemStatusObservation() Get Problem Status Observation}
  • + *
+ *

+ * + * @generated + */ + +public class FamilyHistoryObservationTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateFamilyHistoryObservationHasSubjectPatientRelationship() { + OperationsTestCase validateFamilyHistoryObservationHasSubjectPatientRelationshipTestCase = new OperationsTestCase( + "validateFamilyHistoryObservationHasSubjectPatientRelationship", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_OBSERVATION_HAS_SUBJECT_PATIENT_RELATIONSHIP__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryObservation target) { + target.init(); + Subject s = CDAFactory.eINSTANCE.createSubject(); + target.setSubject(s); + } + + @Override + protected void updateToPass(FamilyHistoryObservation target) { + + Subject s = CDAFactory.eINSTANCE.createSubject(); + s.setRelatedSubject(CDAFactory.eINSTANCE.createRelatedSubject()); + target.setSubject(s); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryObservationOperations.validateFamilyHistoryObservationHasSubjectPatientRelationship( + (FamilyHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryObservationHasSubjectPatientRelationshipTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateFamilyHistoryObservationRelationshipValueCode() { + OperationsTestCase validateFamilyHistoryObservationRelationshipValueCodeTestCase = new OperationsTestCase( + "validateFamilyHistoryObservationRelationshipValueCode", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_OBSERVATION_RELATIONSHIP_VALUE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryObservation target) { + target.init(); + Subject s = CDAFactory.eINSTANCE.createSubject(); + RelatedSubject rs = CDAFactory.eINSTANCE.createRelatedSubject(); + + s.setRelatedSubject(rs); + target.setSubject(s); + target.getSubject().getRelatedSubject().setClassCode(x_DocumentSubject.PAT); + } + + @Override + protected void updateToPass(FamilyHistoryObservation target) { + target.getSubject().getRelatedSubject().getClassCode(); + target.getSubject().getRelatedSubject().setClassCode(x_DocumentSubject.PRS); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryObservationOperations.validateFamilyHistoryObservationRelationshipValueCode( + (FamilyHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryObservationRelationshipValueCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateFamilyHistoryObservationHasRelatedSubjectCode() { + OperationsTestCase validateFamilyHistoryObservationHasRelatedSubjectCodeTestCase = new OperationsTestCase( + "validateFamilyHistoryObservationHasRelatedSubjectCode", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_OBSERVATION_HAS_RELATED_SUBJECT_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryObservation target) { + target.init(); + Subject s = CDAFactory.eINSTANCE.createSubject(); + RelatedSubject rs = CDAFactory.eINSTANCE.createRelatedSubject(); + s.setRelatedSubject(rs); + target.setSubject(s); + } + + @Override + protected void updateToPass(FamilyHistoryObservation target) { + Subject s = CDAFactory.eINSTANCE.createSubject(); + RelatedSubject rs = CDAFactory.eINSTANCE.createRelatedSubject(); + rs.setCode(DatatypesFactory.eINSTANCE.createCE()); + s.setRelatedSubject(rs); + target.setSubject(s); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryObservationOperations.validateFamilyHistoryObservationHasRelatedSubjectCode( + (FamilyHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryObservationHasRelatedSubjectCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateFamilyHistoryObservationRelatedSubjectCodeValueSet() { + OperationsTestCase validateFamilyHistoryObservationRelatedSubjectCodeValueSetTestCase = new OperationsTestCase( + "validateFamilyHistoryObservationRelatedSubjectCodeValueSet", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_OBSERVATION_RELATED_SUBJECT_CODE_VALUE_SET__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryObservation target) { + target.init(); + Subject s = CDAFactory.eINSTANCE.createSubject(); + RelatedSubject rs = CDAFactory.eINSTANCE.createRelatedSubject(); + s.setRelatedSubject(rs); + target.setSubject(s); + } + + @Override + protected void updateToPass(FamilyHistoryObservation target) { + + CE code = DatatypesFactory.eINSTANCE.createCE(); + code.setCodeSystem("2.16.840.1.113883.5.111"); + target.getSubject().getRelatedSubject().setCode(code); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryObservationOperations.validateFamilyHistoryObservationRelatedSubjectCodeValueSet( + (FamilyHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryObservationRelatedSubjectCodeValueSetTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateFamilyHistoryObservationHasRelatedSubjectSubject() { + OperationsTestCase validateFamilyHistoryObservationHasRelatedSubjectSubjectTestCase = new OperationsTestCase( + "validateFamilyHistoryObservationHasRelatedSubjectSubject", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_OBSERVATION_HAS_RELATED_SUBJECT_SUBJECT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryObservation target) { + target.init(); + Subject s = CDAFactory.eINSTANCE.createSubject(); + RelatedSubject rs = CDAFactory.eINSTANCE.createRelatedSubject(); + s.setRelatedSubject(rs); + target.setSubject(s); + } + + @Override + protected void updateToPass(FamilyHistoryObservation target) { + Subject s = CDAFactory.eINSTANCE.createSubject(); + RelatedSubject rs = CDAFactory.eINSTANCE.createRelatedSubject(); + rs.setSubject(CDAFactory.eINSTANCE.createSubjectPerson()); + s.setRelatedSubject(rs); + target.setSubject(s); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryObservationOperations.validateFamilyHistoryObservationHasRelatedSubjectSubject( + (FamilyHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryObservationHasRelatedSubjectSubjectTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateFamilyHistoryObservationHasGenderCode() { + OperationsTestCase validateFamilyHistoryObservationHasGenderCodeTestCase = new OperationsTestCase( + "validateFamilyHistoryObservationHasGenderCode", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_OBSERVATION_HAS_GENDER_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryObservation target) { + target.init(); + Subject s = CDAFactory.eINSTANCE.createSubject(); + RelatedSubject rs = CDAFactory.eINSTANCE.createRelatedSubject(); + SubjectPerson sp = CDAFactory.eINSTANCE.createSubjectPerson(); + + rs.setSubject(sp); + s.setRelatedSubject(rs); + target.setSubject(s); + } + + @Override + protected void updateToPass(FamilyHistoryObservation target) { + Subject s = CDAFactory.eINSTANCE.createSubject(); + RelatedSubject rs = CDAFactory.eINSTANCE.createRelatedSubject(); + SubjectPerson sp = CDAFactory.eINSTANCE.createSubjectPerson(); + sp.setAdministrativeGenderCode(DatatypesFactory.eINSTANCE.createCE()); + rs.setSubject(sp); + s.setRelatedSubject(rs); + target.setSubject(s); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryObservationOperations.validateFamilyHistoryObservationHasGenderCode( + (FamilyHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryObservationHasGenderCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateFamilyHistoryObservationRelatedSubjectBirthTime() { + OperationsTestCase validateFamilyHistoryObservationRelatedSubjectBirthTimeTestCase = new OperationsTestCase( + "validateFamilyHistoryObservationRelatedSubjectBirthTime", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_OBSERVATION_RELATED_SUBJECT_BIRTH_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryObservation target) { + target.init(); + Subject s = CDAFactory.eINSTANCE.createSubject(); + RelatedSubject rs = CDAFactory.eINSTANCE.createRelatedSubject(); + SubjectPerson sp = CDAFactory.eINSTANCE.createSubjectPerson(); + + rs.setSubject(sp); + s.setRelatedSubject(rs); + target.setSubject(s); + } + + @Override + protected void updateToPass(FamilyHistoryObservation target) { + Subject s = CDAFactory.eINSTANCE.createSubject(); + RelatedSubject rs = CDAFactory.eINSTANCE.createRelatedSubject(); + SubjectPerson sp = CDAFactory.eINSTANCE.createSubjectPerson(); + sp.setBirthTime(DatatypesFactory.eINSTANCE.createTS()); + rs.setSubject(sp); + s.setRelatedSubject(rs); + target.setSubject(s); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryObservationOperations.validateFamilyHistoryObservationRelatedSubjectBirthTime( + (FamilyHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryObservationRelatedSubjectBirthTimeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFamilyHistoryObservationTemplateId() { + OperationsTestCase validateFamilyHistoryObservationTemplateIdTestCase = new OperationsTestCase( + "validateFamilyHistoryObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryObservation target) { + + } + + @Override + protected void updateToPass(FamilyHistoryObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryObservationOperations.validateFamilyHistoryObservationTemplateId( + (FamilyHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFamilyHistoryObservationId() { + OperationsTestCase validateFamilyHistoryObservationIdTestCase = new OperationsTestCase( + "validateFamilyHistoryObservationId", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_OBSERVATION_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryObservation target) { + + } + + @Override + protected void updateToPass(FamilyHistoryObservation target) { + target.init(); + + II ii = DatatypesFactory.eINSTANCE.createII(); + target.getIds().add(ii); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryObservationOperations.validateFamilyHistoryObservationId( + (FamilyHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryObservationIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFamilyHistoryObservationStatusCode() { + OperationsTestCase validateFamilyHistoryObservationStatusCodeTestCase = new OperationsTestCase( + "validateFamilyHistoryObservationStatusCode", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_OBSERVATION_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryObservation target) { + + } + + @Override + protected void updateToPass(FamilyHistoryObservation target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryObservationOperations.validateFamilyHistoryObservationStatusCode( + (FamilyHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryObservationStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFamilyHistoryObservationEffectiveTime() { + OperationsTestCase validateFamilyHistoryObservationEffectiveTimeTestCase = new OperationsTestCase( + "validateFamilyHistoryObservationEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_OBSERVATION_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryObservation target) { + + } + + @Override + protected void updateToPass(FamilyHistoryObservation target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryObservationOperations.validateFamilyHistoryObservationEffectiveTime( + (FamilyHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryObservationEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFamilyHistoryObservationMoodCode() { + OperationsTestCase validateFamilyHistoryObservationMoodCodeTestCase = new OperationsTestCase( + "validateFamilyHistoryObservationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_OBSERVATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryObservation target) { + + } + + @Override + protected void updateToPass(FamilyHistoryObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryObservationOperations.validateFamilyHistoryObservationMoodCode( + (FamilyHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryObservationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateFamilyHistoryObservationAgeObservation() { + OperationsTestCase validateFamilyHistoryObservationAgeObservationTestCase = new OperationsTestCase( + "validateFamilyHistoryObservationAgeObservation", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_OBSERVATION_AGE_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryObservation target) { + + } + + @Override + protected void updateToPass(FamilyHistoryObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + AgeObservation ao = CCDFactory.eINSTANCE.createAgeObservation(); + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + er.setObservation(ao); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryObservationOperations.validateFamilyHistoryObservationAgeObservation( + (FamilyHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryObservationAgeObservationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateFamilyHistoryObservationProblemStatusObservation() { + OperationsTestCase validateFamilyHistoryObservationProblemStatusObservationTestCase = new OperationsTestCase( + "validateFamilyHistoryObservationProblemStatusObservation", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_OBSERVATION_PROBLEM_STATUS_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryObservation target) { + + } + + @Override + protected void updateToPass(FamilyHistoryObservation target) { + target.init(); + target.addObservation(CCDFactory.eINSTANCE.createProblemStatusObservation()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryObservationOperations.validateFamilyHistoryObservationProblemStatusObservation( + (FamilyHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryObservationProblemStatusObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetAgeObservation() { + + FamilyHistoryObservation target = objectFactory.create(); + target.getAgeObservation(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProblemStatusObservation() { + + FamilyHistoryObservation target = objectFactory.create(); + target.getProblemStatusObservation(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends FamilyHistoryObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public FamilyHistoryObservation create() { + return CCDFactory.eINSTANCE.createFamilyHistoryObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends FamilyHistoryObservationOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // FamilyHistoryObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/FamilyHistoryOrganizerTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/FamilyHistoryOrganizerTest.java new file mode 100644 index 000000000..5ec851b76 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/FamilyHistoryOrganizerTest.java @@ -0,0 +1,715 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.RelatedSubject; +import org.openhealthtools.mdht.uml.cda.Subject; +import org.openhealthtools.mdht.uml.cda.SubjectPerson; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.FamilyHistoryOrganizer; +import org.openhealthtools.mdht.uml.cda.ccd.operations.FamilyHistoryOrganizerOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.vocab.x_DocumentSubject; + +/** + * A static utility class that provides operations + * related to 'Family History Organizer' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FamilyHistoryOrganizer#validateFamilyHistoryOrganizerHasComponent(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Organizer Has Component}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FamilyHistoryOrganizer#validateFamilyHistoryOrganizerHasFamilyHistoryObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Organizer Has Family History Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FamilyHistoryOrganizer#validateFamilyHistoryOrganizerHasSubject(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Organizer Has Subject}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FamilyHistoryOrganizer#validateFamilyHistoryOrganizerHasSubjectPatientRelationship(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Organizer Has Subject Patient Relationship}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FamilyHistoryOrganizer#validateFamilyHistoryOrganizerRelationshipValueCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Organizer Relationship Value Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FamilyHistoryOrganizer#validateFamilyHistoryOrganizerHasRelatedSubjectCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Organizer Has Related Subject Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FamilyHistoryOrganizer#validateFamilyHistoryOrganizerRelatedSubjectCodeValueSet(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Organizer Related Subject Code Value Set}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FamilyHistoryOrganizer#validateFamilyHistoryOrganizerHasRelatedSubjectSubject(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Organizer Has Related Subject Subject}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FamilyHistoryOrganizer#validateFamilyHistoryOrganizerHasGenderCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Organizer Has Gender Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FamilyHistoryOrganizer#validateFamilyHistoryOrganizerRelatedSubjectBirthTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Organizer Related Subject Birth Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FamilyHistoryOrganizer#validateFamilyHistoryOrganizerTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Organizer Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FamilyHistoryOrganizer#validateFamilyHistoryOrganizerStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Organizer Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FamilyHistoryOrganizer#validateFamilyHistoryOrganizerClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Organizer Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FamilyHistoryOrganizer#validateFamilyHistoryOrganizerMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Organizer Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FamilyHistoryOrganizer#validateFamilyHistoryOrganizerFamilyHistoryObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Organizer Family History Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FamilyHistoryOrganizer#getFamilyHistoryObservations() Get Family History Observations}
  • + *
+ *

+ * + * @generated + */ + +public class FamilyHistoryOrganizerTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateFamilyHistoryOrganizerHasComponent() { + OperationsTestCase validateFamilyHistoryOrganizerHasComponentTestCase = new OperationsTestCase( + "validateFamilyHistoryOrganizerHasComponent", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_ORGANIZER_HAS_COMPONENT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryOrganizer target) { + + } + + @Override + protected void updateToPass(FamilyHistoryOrganizer target) { + target.init(); + target.addObservation(CCDFactory.eINSTANCE.createFamilyHistoryObservation()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryOrganizerOperations.validateFamilyHistoryOrganizerHasComponent( + (FamilyHistoryOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryOrganizerHasComponentTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateFamilyHistoryOrganizerHasFamilyHistoryObservation() { + OperationsTestCase validateFamilyHistoryOrganizerHasFamilyHistoryObservationTestCase = new OperationsTestCase( + "validateFamilyHistoryOrganizerHasFamilyHistoryObservation", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_ORGANIZER_HAS_FAMILY_HISTORY_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryOrganizer target) { + + } + + @Override + protected void updateToPass(FamilyHistoryOrganizer target) { + target.init(); + target.addObservation(CCDFactory.eINSTANCE.createFamilyHistoryObservation()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryOrganizerOperations.validateFamilyHistoryOrganizerHasFamilyHistoryObservation( + (FamilyHistoryOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryOrganizerHasFamilyHistoryObservationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateFamilyHistoryOrganizerHasSubject() { + OperationsTestCase validateFamilyHistoryOrganizerHasSubjectTestCase = new OperationsTestCase( + "validateFamilyHistoryOrganizerHasSubject", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_ORGANIZER_HAS_SUBJECT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryOrganizer target) { + + } + + @Override + protected void updateToPass(FamilyHistoryOrganizer target) { + target.init(); + target.setSubject(CDAFactory.eINSTANCE.createSubject()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryOrganizerOperations.validateFamilyHistoryOrganizerHasSubject( + (FamilyHistoryOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryOrganizerHasSubjectTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateFamilyHistoryOrganizerHasSubjectPatientRelationship() { + OperationsTestCase validateFamilyHistoryOrganizerHasSubjectPatientRelationshipTestCase = new OperationsTestCase( + "validateFamilyHistoryOrganizerHasSubjectPatientRelationship", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_ORGANIZER_HAS_SUBJECT_PATIENT_RELATIONSHIP__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryOrganizer target) { + target.init(); + Subject s = CDAFactory.eINSTANCE.createSubject(); + target.setSubject(s); + } + + @Override + protected void updateToPass(FamilyHistoryOrganizer target) { + Subject s = CDAFactory.eINSTANCE.createSubject(); + s.setRelatedSubject(CDAFactory.eINSTANCE.createRelatedSubject()); + target.setSubject(s); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryOrganizerOperations.validateFamilyHistoryOrganizerHasSubjectPatientRelationship( + (FamilyHistoryOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryOrganizerHasSubjectPatientRelationshipTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateFamilyHistoryOrganizerRelationshipValueCode() { + OperationsTestCase validateFamilyHistoryOrganizerRelationshipValueCodeTestCase = new OperationsTestCase( + "validateFamilyHistoryOrganizerRelationshipValueCode", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_ORGANIZER_RELATIONSHIP_VALUE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryOrganizer target) { + + } + + @Override + protected void updateToPass(FamilyHistoryOrganizer target) { + + target.init(); + Subject s = CDAFactory.eINSTANCE.createSubject(); + RelatedSubject rs = CDAFactory.eINSTANCE.createRelatedSubject(); + rs.setClassCode(x_DocumentSubject.PRS); + s.setRelatedSubject(rs); + target.setSubject(s); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryOrganizerOperations.validateFamilyHistoryOrganizerRelationshipValueCode( + (FamilyHistoryOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryOrganizerRelationshipValueCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateFamilyHistoryOrganizerHasRelatedSubjectCode() { + OperationsTestCase validateFamilyHistoryOrganizerHasRelatedSubjectCodeTestCase = new OperationsTestCase( + "validateFamilyHistoryOrganizerHasRelatedSubjectCode", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_ORGANIZER_HAS_RELATED_SUBJECT_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryOrganizer target) { + target.init(); + Subject s = CDAFactory.eINSTANCE.createSubject(); + RelatedSubject rs = CDAFactory.eINSTANCE.createRelatedSubject(); + s.setRelatedSubject(rs); + target.setSubject(s); + } + + @Override + protected void updateToPass(FamilyHistoryOrganizer target) { + Subject s = CDAFactory.eINSTANCE.createSubject(); + RelatedSubject rs = CDAFactory.eINSTANCE.createRelatedSubject(); + rs.setCode(DatatypesFactory.eINSTANCE.createCE()); + s.setRelatedSubject(rs); + target.setSubject(s); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryOrganizerOperations.validateFamilyHistoryOrganizerHasRelatedSubjectCode( + (FamilyHistoryOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryOrganizerHasRelatedSubjectCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateFamilyHistoryOrganizerRelatedSubjectCodeValueSet() { + OperationsTestCase validateFamilyHistoryOrganizerRelatedSubjectCodeValueSetTestCase = new OperationsTestCase( + "validateFamilyHistoryOrganizerRelatedSubjectCodeValueSet", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_ORGANIZER_RELATED_SUBJECT_CODE_VALUE_SET__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryOrganizer target) { + + } + + @Override + protected void updateToPass(FamilyHistoryOrganizer target) { + target.init(); + Subject s = CDAFactory.eINSTANCE.createSubject(); + RelatedSubject rs = CDAFactory.eINSTANCE.createRelatedSubject(); + CE code = DatatypesFactory.eINSTANCE.createCE(); + code.setCodeSystem("2.16.840.1.113883.1.11.19579"); + rs.setCode(code); + s.setRelatedSubject(rs); + target.setSubject(s); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryOrganizerOperations.validateFamilyHistoryOrganizerRelatedSubjectCodeValueSet( + (FamilyHistoryOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryOrganizerRelatedSubjectCodeValueSetTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateFamilyHistoryOrganizerHasRelatedSubjectSubject() { + OperationsTestCase validateFamilyHistoryOrganizerHasRelatedSubjectSubjectTestCase = new OperationsTestCase( + "validateFamilyHistoryOrganizerHasRelatedSubjectSubject", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_ORGANIZER_HAS_RELATED_SUBJECT_SUBJECT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryOrganizer target) { + target.init(); + Subject s = CDAFactory.eINSTANCE.createSubject(); + RelatedSubject rs = CDAFactory.eINSTANCE.createRelatedSubject(); + s.setRelatedSubject(rs); + target.setSubject(s); + } + + @Override + protected void updateToPass(FamilyHistoryOrganizer target) { + Subject s = CDAFactory.eINSTANCE.createSubject(); + RelatedSubject rs = CDAFactory.eINSTANCE.createRelatedSubject(); + rs.setSubject(CDAFactory.eINSTANCE.createSubjectPerson()); + s.setRelatedSubject(rs); + target.setSubject(s); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryOrganizerOperations.validateFamilyHistoryOrganizerHasRelatedSubjectSubject( + (FamilyHistoryOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryOrganizerHasRelatedSubjectSubjectTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateFamilyHistoryOrganizerHasGenderCode() { + OperationsTestCase validateFamilyHistoryOrganizerHasGenderCodeTestCase = new OperationsTestCase( + "validateFamilyHistoryOrganizerHasGenderCode", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_ORGANIZER_HAS_GENDER_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryOrganizer target) { + target.init(); + Subject s = CDAFactory.eINSTANCE.createSubject(); + RelatedSubject rs = CDAFactory.eINSTANCE.createRelatedSubject(); + SubjectPerson sp = CDAFactory.eINSTANCE.createSubjectPerson(); + + rs.setSubject(sp); + s.setRelatedSubject(rs); + target.setSubject(s); + } + + @Override + protected void updateToPass(FamilyHistoryOrganizer target) { + Subject s = CDAFactory.eINSTANCE.createSubject(); + RelatedSubject rs = CDAFactory.eINSTANCE.createRelatedSubject(); + SubjectPerson sp = CDAFactory.eINSTANCE.createSubjectPerson(); + sp.setAdministrativeGenderCode(DatatypesFactory.eINSTANCE.createCE()); + rs.setSubject(sp); + s.setRelatedSubject(rs); + target.setSubject(s); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryOrganizerOperations.validateFamilyHistoryOrganizerHasGenderCode( + (FamilyHistoryOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryOrganizerHasGenderCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateFamilyHistoryOrganizerRelatedSubjectBirthTime() { + OperationsTestCase validateFamilyHistoryOrganizerRelatedSubjectBirthTimeTestCase = new OperationsTestCase( + "validateFamilyHistoryOrganizerRelatedSubjectBirthTime", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_ORGANIZER_RELATED_SUBJECT_BIRTH_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryOrganizer target) { + target.init(); + Subject s = CDAFactory.eINSTANCE.createSubject(); + RelatedSubject rs = CDAFactory.eINSTANCE.createRelatedSubject(); + SubjectPerson sp = CDAFactory.eINSTANCE.createSubjectPerson(); + + rs.setSubject(sp); + s.setRelatedSubject(rs); + target.setSubject(s); + } + + @Override + protected void updateToPass(FamilyHistoryOrganizer target) { + Subject s = CDAFactory.eINSTANCE.createSubject(); + RelatedSubject rs = CDAFactory.eINSTANCE.createRelatedSubject(); + SubjectPerson sp = CDAFactory.eINSTANCE.createSubjectPerson(); + sp.setBirthTime(DatatypesFactory.eINSTANCE.createTS()); + rs.setSubject(sp); + s.setRelatedSubject(rs); + target.setSubject(s); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryOrganizerOperations.validateFamilyHistoryOrganizerRelatedSubjectBirthTime( + (FamilyHistoryOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryOrganizerRelatedSubjectBirthTimeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFamilyHistoryOrganizerTemplateId() { + OperationsTestCase validateFamilyHistoryOrganizerTemplateIdTestCase = new OperationsTestCase( + "validateFamilyHistoryOrganizerTemplateId", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_ORGANIZER_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryOrganizer target) { + + } + + @Override + protected void updateToPass(FamilyHistoryOrganizer target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryOrganizerOperations.validateFamilyHistoryOrganizerTemplateId( + (FamilyHistoryOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryOrganizerTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFamilyHistoryOrganizerStatusCode() { + OperationsTestCase validateFamilyHistoryOrganizerStatusCodeTestCase = new OperationsTestCase( + "validateFamilyHistoryOrganizerStatusCode", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_ORGANIZER_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryOrganizer target) { + + } + + @Override + protected void updateToPass(FamilyHistoryOrganizer target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryOrganizerOperations.validateFamilyHistoryOrganizerStatusCode( + (FamilyHistoryOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryOrganizerStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFamilyHistoryOrganizerClassCode() { + OperationsTestCase validateFamilyHistoryOrganizerClassCodeTestCase = new OperationsTestCase( + "validateFamilyHistoryOrganizerClassCode", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_ORGANIZER_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryOrganizer target) { + + } + + @Override + protected void updateToPass(FamilyHistoryOrganizer target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryOrganizerOperations.validateFamilyHistoryOrganizerClassCode( + (FamilyHistoryOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryOrganizerClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFamilyHistoryOrganizerMoodCode() { + OperationsTestCase validateFamilyHistoryOrganizerMoodCodeTestCase = new OperationsTestCase( + "validateFamilyHistoryOrganizerMoodCode", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_ORGANIZER_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryOrganizer target) { + + } + + @Override + protected void updateToPass(FamilyHistoryOrganizer target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryOrganizerOperations.validateFamilyHistoryOrganizerMoodCode( + (FamilyHistoryOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryOrganizerMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateFamilyHistoryOrganizerFamilyHistoryObservation() { + OperationsTestCase validateFamilyHistoryOrganizerFamilyHistoryObservationTestCase = new OperationsTestCase( + "validateFamilyHistoryOrganizerFamilyHistoryObservation", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_ORGANIZER_FAMILY_HISTORY_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryOrganizer target) { + + } + + @Override + protected void updateToPass(FamilyHistoryOrganizer target) { + target.init(); + target.addObservation(CCDFactory.eINSTANCE.createFamilyHistoryObservation()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryOrganizerOperations.validateFamilyHistoryOrganizerFamilyHistoryObservation( + (FamilyHistoryOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryOrganizerFamilyHistoryObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetFamilyHistoryObservations() { + + FamilyHistoryOrganizer target = objectFactory.create(); + target.getFamilyHistoryObservations(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends FamilyHistoryOrganizerOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public FamilyHistoryOrganizer create() { + return CCDFactory.eINSTANCE.createFamilyHistoryOrganizer(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends FamilyHistoryOrganizerOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // FamilyHistoryOrganizerOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/FamilyHistorySectionTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/FamilyHistorySectionTest.java new file mode 100644 index 000000000..f4d53a1f1 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/FamilyHistorySectionTest.java @@ -0,0 +1,374 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.FamilyHistorySection; +import org.openhealthtools.mdht.uml.cda.ccd.operations.FamilyHistorySectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * A static utility class that provides operations + * related to 'Family History Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FamilyHistorySection#validateFamilyHistorySectionFamilyHistoryObsOrgs(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Section Family History Obs Orgs}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FamilyHistorySection#validateFamilyHistorySectionNoSubject(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Section No Subject}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FamilyHistorySection#validateFamilyHistorySectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FamilyHistorySection#validateFamilyHistorySectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FamilyHistorySection#validateFamilyHistorySectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FamilyHistorySection#validateFamilyHistorySectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FamilyHistorySection#validateFamilyHistorySectionFamilyHistoryOrganizer(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Section Family History Organizer}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FamilyHistorySection#getFamilyHistoryOrganizers() Get Family History Organizers}
  • + *
+ *

+ * + * @generated + */ + +public class FamilyHistorySectionTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateFamilyHistorySectionFamilyHistoryObsOrgs() { + OperationsTestCase validateFamilyHistorySectionFamilyHistoryObsOrgsTestCase = new OperationsTestCase( + "validateFamilyHistorySectionFamilyHistoryObsOrgs", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_SECTION_FAMILY_HISTORY_OBS_ORGS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistorySection target) { + + } + + @Override + protected void updateToPass(FamilyHistorySection target) { + target.init(); + target.addOrganizer(CCDFactory.eINSTANCE.createFamilyHistoryOrganizer()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistorySectionOperations.validateFamilyHistorySectionFamilyHistoryObsOrgs( + (FamilyHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistorySectionFamilyHistoryObsOrgsTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateFamilyHistorySectionNoSubject() { + OperationsTestCase validateFamilyHistorySectionNoSubjectTestCase = new OperationsTestCase( + "validateFamilyHistorySectionNoSubject", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_SECTION_NO_SUBJECT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistorySection target) { + target.init(); + target.setSubject(CDAFactory.eINSTANCE.createSubject()); + } + + @Override + protected void updateToPass(FamilyHistorySection target) { + target.setSubject(null); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistorySectionOperations.validateFamilyHistorySectionNoSubject( + (FamilyHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistorySectionNoSubjectTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFamilyHistorySectionTemplateId() { + OperationsTestCase validateFamilyHistorySectionTemplateIdTestCase = new OperationsTestCase( + "validateFamilyHistorySectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistorySection target) { + + } + + @Override + protected void updateToPass(FamilyHistorySection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistorySectionOperations.validateFamilyHistorySectionTemplateId( + (FamilyHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistorySectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFamilyHistorySectionCode() { + OperationsTestCase validateFamilyHistorySectionCodeTestCase = new OperationsTestCase( + "validateFamilyHistorySectionCode", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistorySection target) { + + } + + @Override + protected void updateToPass(FamilyHistorySection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistorySectionOperations.validateFamilyHistorySectionCode( + (FamilyHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistorySectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFamilyHistorySectionTitle() { + OperationsTestCase validateFamilyHistorySectionTitleTestCase = new OperationsTestCase( + "validateFamilyHistorySectionTitle", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistorySection target) { + + } + + @Override + protected void updateToPass(FamilyHistorySection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistorySectionOperations.validateFamilyHistorySectionTitle( + (FamilyHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistorySectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFamilyHistorySectionText() { + OperationsTestCase validateFamilyHistorySectionTextTestCase = new OperationsTestCase( + "validateFamilyHistorySectionText", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistorySection target) { + + } + + @Override + protected void updateToPass(FamilyHistorySection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistorySectionOperations.validateFamilyHistorySectionText( + (FamilyHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistorySectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateFamilyHistorySectionFamilyHistoryOrganizer() { + OperationsTestCase validateFamilyHistorySectionFamilyHistoryOrganizerTestCase = new OperationsTestCase( + "validateFamilyHistorySectionFamilyHistoryOrganizer", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_SECTION_FAMILY_HISTORY_ORGANIZER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistorySection target) { + + } + + @Override + protected void updateToPass(FamilyHistorySection target) { + target.init(); + target.addOrganizer(CCDFactory.eINSTANCE.createFamilyHistoryOrganizer()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistorySectionOperations.validateFamilyHistorySectionFamilyHistoryOrganizer( + (FamilyHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistorySectionFamilyHistoryOrganizerTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetFamilyHistoryOrganizers() { + + FamilyHistorySection target = objectFactory.create(); + target.getFamilyHistoryOrganizers(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends FamilyHistorySectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public FamilyHistorySection create() { + return CCDFactory.eINSTANCE.createFamilyHistorySection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends FamilyHistorySectionOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // FamilyHistorySectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/FulfillmentInstructionTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/FulfillmentInstructionTest.java new file mode 100644 index 000000000..dfe13e8dd --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/FulfillmentInstructionTest.java @@ -0,0 +1,175 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.FulfillmentInstruction; +import org.openhealthtools.mdht.uml.cda.ccd.operations.FulfillmentInstructionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Fulfillment Instruction' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FulfillmentInstruction#validateFulfillmentInstructionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Fulfillment Instruction Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FulfillmentInstruction#validateFulfillmentInstructionMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Fulfillment Instruction Mood Code}
  • + *
+ *

+ * + * @generated + */ + +public class FulfillmentInstructionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateFulfillmentInstructionTemplateId() { + OperationsTestCase validateFulfillmentInstructionTemplateIdTestCase = new OperationsTestCase( + "validateFulfillmentInstructionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_FULFILLMENT_INSTRUCTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FulfillmentInstruction target) { + + } + + @Override + protected void updateToPass(FulfillmentInstruction target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FulfillmentInstructionOperations.validateFulfillmentInstructionTemplateId( + (FulfillmentInstruction) objectToTest, diagnostician, map); + } + + }; + + validateFulfillmentInstructionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFulfillmentInstructionMoodCode() { + OperationsTestCase validateFulfillmentInstructionMoodCodeTestCase = new OperationsTestCase( + "validateFulfillmentInstructionMoodCode", + operationsForOCL.getOCLValue("VALIDATE_FULFILLMENT_INSTRUCTION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FulfillmentInstruction target) { + + } + + @Override + protected void updateToPass(FulfillmentInstruction target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FulfillmentInstructionOperations.validateFulfillmentInstructionMoodCode( + (FulfillmentInstruction) objectToTest, diagnostician, map); + } + + }; + + validateFulfillmentInstructionMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends FulfillmentInstructionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public FulfillmentInstruction create() { + return CCDFactory.eINSTANCE.createFulfillmentInstruction(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends FulfillmentInstructionOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // FulfillmentInstructionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/FunctionalStatusObservationTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/FunctionalStatusObservationTest.java new file mode 100644 index 000000000..4fb829ed1 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/FunctionalStatusObservationTest.java @@ -0,0 +1,140 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.FunctionalStatusObservation; +import org.openhealthtools.mdht.uml.cda.ccd.operations.FunctionalStatusObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Functional Status Observation' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FunctionalStatusObservation#validateStatusObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Status Observation Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class FunctionalStatusObservationTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateStatusObservationTemplateId() { + OperationsTestCase validateStatusObservationTemplateIdTestCase = new OperationsTestCase( + "validateStatusObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_STATUS_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusObservation target) { + + } + + @Override + protected void updateToPass(FunctionalStatusObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusObservationOperations.validateStatusObservationTemplateId( + (FunctionalStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateStatusObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends FunctionalStatusObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public FunctionalStatusObservation create() { + return CCDFactory.eINSTANCE.createFunctionalStatusObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends FunctionalStatusObservationOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // FunctionalStatusObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/FunctionalStatusSectionTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/FunctionalStatusSectionTest.java new file mode 100644 index 000000000..eb3da5ac6 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/FunctionalStatusSectionTest.java @@ -0,0 +1,549 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Observation; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.FunctionalStatusObservation; +import org.openhealthtools.mdht.uml.cda.ccd.FunctionalStatusSection; +import org.openhealthtools.mdht.uml.cda.ccd.ProblemObservation; +import org.openhealthtools.mdht.uml.cda.ccd.ResultObservation; +import org.openhealthtools.mdht.uml.cda.ccd.operations.FunctionalStatusSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * A static utility class that provides operations + * related to 'Functional Status Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FunctionalStatusSection#validateFunctionalStatusSectionClinicalStatements(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Section Clinical Statements}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FunctionalStatusSection#validateFunctionalStatusSectionObservationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Section Observation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FunctionalStatusSection#validateFunctionalStatusSectionObservationCodeValueSet(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Section Observation Code Value Set}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FunctionalStatusSection#validateFunctionalStatusSectionValueDatatype(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Section Value Datatype}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FunctionalStatusSection#validateFunctionalStatusSectionIcfCodeSystem(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Section Icf Code System}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FunctionalStatusSection#validateFunctionalStatusSectionProblemStatusObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Section Problem Status Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FunctionalStatusSection#validateFunctionalStatusSectionResultStatusObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Section Result Status Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FunctionalStatusSection#validateFunctionalStatusSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FunctionalStatusSection#validateFunctionalStatusSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FunctionalStatusSection#validateFunctionalStatusSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.FunctionalStatusSection#validateFunctionalStatusSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Section Text}
  • + *
+ *

+ * + * @generated + */ + +public class FunctionalStatusSectionTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateFunctionalStatusSectionClinicalStatements() { + OperationsTestCase validateFunctionalStatusSectionClinicalStatementsTestCase = new OperationsTestCase( + "validateFunctionalStatusSectionClinicalStatements", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_SECTION_CLINICAL_STATEMENTS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusSection target) { + + } + + @Override + protected void updateToPass(FunctionalStatusSection target) { + target.init(); + target.addAct(CCDFactory.eINSTANCE.createProblemAct()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusSectionOperations.validateFunctionalStatusSectionClinicalStatements( + (FunctionalStatusSection) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusSectionClinicalStatementsTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateFunctionalStatusSectionObservationCode() { + OperationsTestCase validateFunctionalStatusSectionObservationCodeTestCase = new OperationsTestCase( + "validateFunctionalStatusSectionObservationCode", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_SECTION_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusSection target) { + target.init(); + target.addObservation(CCDFactory.eINSTANCE.createProblemObservation()); + } + + @Override + protected void updateToPass(FunctionalStatusSection target) { + target.getEntries().clear(); + CE ce = DatatypesFactory.eINSTANCE.createCE(); + ProblemObservation po = CCDFactory.eINSTANCE.createProblemObservation(); + po.setCode(ce); + target.addObservation(po); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusSectionOperations.validateFunctionalStatusSectionObservationCode( + (FunctionalStatusSection) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusSectionObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateFunctionalStatusSectionObservationCodeValueSet() { + OperationsTestCase validateFunctionalStatusSectionObservationCodeValueSetTestCase = new OperationsTestCase( + "validateFunctionalStatusSectionObservationCodeValueSet", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_SECTION_OBSERVATION_CODE_VALUE_SET__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusSection target) { + target.init(); + target.addObservation(CCDFactory.eINSTANCE.createProblemObservation()); + } + + @Override + protected void updateToPass(FunctionalStatusSection target) { + target.getEntries().clear(); + CE ce = DatatypesFactory.eINSTANCE.createCE(); + ce.setCodeSystem("2.16.840.1.113883.6.96"); + ProblemObservation po = CCDFactory.eINSTANCE.createProblemObservation(); + po.setCode(ce); + target.addObservation(po); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusSectionOperations.validateFunctionalStatusSectionObservationCodeValueSet( + (FunctionalStatusSection) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusSectionObservationCodeValueSetTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateFunctionalStatusSectionValueDatatype() { + OperationsTestCase validateFunctionalStatusSectionValueDatatypeTestCase = new OperationsTestCase( + "validateFunctionalStatusSectionValueDatatype", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_SECTION_VALUE_DATATYPE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusSection target) { + Observation observation = CDAFactory.eINSTANCE.createObservation(); + ED ed = DatatypesFactory.eINSTANCE.createED(); + observation.getValues().add(ed); + + target.addObservation(observation); + + } + + @Override + protected void updateToPass(FunctionalStatusSection target) { + target.init(); + for (Observation observation : target.getObservations()) { + observation.getValues().clear(); + observation.getValues().add(DatatypesFactory.eINSTANCE.createCE()); + observation.getValues().add(DatatypesFactory.eINSTANCE.createCD()); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusSectionOperations.validateFunctionalStatusSectionValueDatatype( + (FunctionalStatusSection) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusSectionValueDatatypeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateFunctionalStatusSectionIcfCodeSystem() { + OperationsTestCase validateFunctionalStatusSectionIcfCodeSystemTestCase = new OperationsTestCase( + "validateFunctionalStatusSectionIcfCodeSystem", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_SECTION_ICF_CODE_SYSTEM__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusSection target) { + target.init(); + Observation observation = CDAFactory.eINSTANCE.createObservation(); + DatatypesFactory.eINSTANCE.createED(); + CD cd = DatatypesFactory.eINSTANCE.createCD(); + cd.setCodeSystem("fffff"); + observation.setCode(cd); + + target.addObservation(observation); + + } + + @Override + protected void updateToPass(FunctionalStatusSection target) { + + for (Observation observation : target.getObservations()) { + + observation.getCode().setCodeSystem("2.16.840.1.113883.6.254"); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusSectionOperations.validateFunctionalStatusSectionIcfCodeSystem( + (FunctionalStatusSection) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusSectionIcfCodeSystemTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateFunctionalStatusSectionProblemStatusObservation() { + OperationsTestCase validateFunctionalStatusSectionProblemStatusObservationTestCase = new OperationsTestCase( + "validateFunctionalStatusSectionProblemStatusObservation", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_SECTION_PROBLEM_STATUS_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusSection target) { + target.init(); + target.addObservation(CCDFactory.eINSTANCE.createProblemObservation()); + } + + @Override + protected void updateToPass(FunctionalStatusSection target) { + target.getEntries().clear(); + ProblemObservation po = CCDFactory.eINSTANCE.createProblemObservation(); + FunctionalStatusObservation fso = CCDFactory.eINSTANCE.createFunctionalStatusObservation(); + po.addObservation(fso); + target.addObservation(po); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusSectionOperations.validateFunctionalStatusSectionProblemStatusObservation( + (FunctionalStatusSection) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusSectionProblemStatusObservationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateFunctionalStatusSectionResultStatusObservation() { + OperationsTestCase validateFunctionalStatusSectionResultStatusObservationTestCase = new OperationsTestCase( + "validateFunctionalStatusSectionResultStatusObservation", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_SECTION_RESULT_STATUS_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusSection target) { + target.init(); + target.addObservation(CCDFactory.eINSTANCE.createResultObservation()); + } + + @Override + protected void updateToPass(FunctionalStatusSection target) { + target.getEntries().clear(); + ResultObservation ro = CCDFactory.eINSTANCE.createResultObservation(); + FunctionalStatusObservation fso = CCDFactory.eINSTANCE.createFunctionalStatusObservation(); + ro.addObservation(fso); + target.addObservation(ro); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusSectionOperations.validateFunctionalStatusSectionResultStatusObservation( + (FunctionalStatusSection) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusSectionResultStatusObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFunctionalStatusSectionTemplateId() { + OperationsTestCase validateFunctionalStatusSectionTemplateIdTestCase = new OperationsTestCase( + "validateFunctionalStatusSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusSection target) { + + } + + @Override + protected void updateToPass(FunctionalStatusSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusSectionOperations.validateFunctionalStatusSectionTemplateId( + (FunctionalStatusSection) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFunctionalStatusSectionCode() { + OperationsTestCase validateFunctionalStatusSectionCodeTestCase = new OperationsTestCase( + "validateFunctionalStatusSectionCode", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusSection target) { + + } + + @Override + protected void updateToPass(FunctionalStatusSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusSectionOperations.validateFunctionalStatusSectionCode( + (FunctionalStatusSection) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFunctionalStatusSectionTitle() { + OperationsTestCase validateFunctionalStatusSectionTitleTestCase = new OperationsTestCase( + "validateFunctionalStatusSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusSection target) { + + } + + @Override + protected void updateToPass(FunctionalStatusSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusSectionOperations.validateFunctionalStatusSectionTitle( + (FunctionalStatusSection) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFunctionalStatusSectionText() { + OperationsTestCase validateFunctionalStatusSectionTextTestCase = new OperationsTestCase( + "validateFunctionalStatusSectionText", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusSection target) { + + } + + @Override + protected void updateToPass(FunctionalStatusSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusSectionOperations.validateFunctionalStatusSectionText( + (FunctionalStatusSection) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends FunctionalStatusSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public FunctionalStatusSection create() { + return CCDFactory.eINSTANCE.createFunctionalStatusSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends FunctionalStatusSectionOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // FunctionalStatusSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ImmunizationsSectionTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ImmunizationsSectionTest.java new file mode 100644 index 000000000..812bc7363 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ImmunizationsSectionTest.java @@ -0,0 +1,387 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.ImmunizationsSection; +import org.openhealthtools.mdht.uml.cda.ccd.operations.ImmunizationsSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * A static utility class that provides operations + * related to 'Immunizations Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ImmunizationsSection#validateImmunizationsSectionHasMedicationOrSupplyActivity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunizations Section Has Medication Or Supply Activity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ImmunizationsSection#validateImmunizationsSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunizations Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ImmunizationsSection#validateImmunizationsSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunizations Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ImmunizationsSection#validateImmunizationsSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunizations Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ImmunizationsSection#validateImmunizationsSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunizations Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ImmunizationsSection#validateImmunizationsSectionMedicationActivity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunizations Section Medication Activity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ImmunizationsSection#validateImmunizationsSectionSupplyActivity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunizations Section Supply Activity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ImmunizationsSection#getMedicationActivities() Get Medication Activities}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ImmunizationsSection#getSupplyActivities() Get Supply Activities}
  • + *
+ *

+ * + * @generated + */ + +public class ImmunizationsSectionTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateImmunizationsSectionHasMedicationOrSupplyActivity() { + OperationsTestCase validateImmunizationsSectionHasMedicationOrSupplyActivityTestCase = new OperationsTestCase( + "validateImmunizationsSectionHasMedicationOrSupplyActivity", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATIONS_SECTION_HAS_MEDICATION_OR_SUPPLY_ACTIVITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationsSection target) { + target.init(); + } + + @Override + protected void updateToPass(ImmunizationsSection target) { + + target.addSubstanceAdministration(CCDFactory.eINSTANCE.createMedicationActivity().init()); + target.addSupply(CCDFactory.eINSTANCE.createSupplyActivity().init()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationsSectionOperations.validateImmunizationsSectionHasMedicationOrSupplyActivity( + (ImmunizationsSection) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationsSectionHasMedicationOrSupplyActivityTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateImmunizationsSectionTemplateId() { + OperationsTestCase validateImmunizationsSectionTemplateIdTestCase = new OperationsTestCase( + "validateImmunizationsSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATIONS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationsSection target) { + + } + + @Override + protected void updateToPass(ImmunizationsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationsSectionOperations.validateImmunizationsSectionTemplateId( + (ImmunizationsSection) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationsSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateImmunizationsSectionCode() { + OperationsTestCase validateImmunizationsSectionCodeTestCase = new OperationsTestCase( + "validateImmunizationsSectionCode", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATIONS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationsSection target) { + + } + + @Override + protected void updateToPass(ImmunizationsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationsSectionOperations.validateImmunizationsSectionCode( + (ImmunizationsSection) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationsSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateImmunizationsSectionTitle() { + OperationsTestCase validateImmunizationsSectionTitleTestCase = new OperationsTestCase( + "validateImmunizationsSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATIONS_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationsSection target) { + + } + + @Override + protected void updateToPass(ImmunizationsSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationsSectionOperations.validateImmunizationsSectionTitle( + (ImmunizationsSection) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationsSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateImmunizationsSectionText() { + OperationsTestCase validateImmunizationsSectionTextTestCase = new OperationsTestCase( + "validateImmunizationsSectionText", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATIONS_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationsSection target) { + + } + + @Override + protected void updateToPass(ImmunizationsSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationsSectionOperations.validateImmunizationsSectionText( + (ImmunizationsSection) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationsSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateImmunizationsSectionMedicationActivity() { + OperationsTestCase validateImmunizationsSectionMedicationActivityTestCase = new OperationsTestCase( + "validateImmunizationsSectionMedicationActivity", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATIONS_SECTION_MEDICATION_ACTIVITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationsSection target) { + target.init(); + } + + @Override + protected void updateToPass(ImmunizationsSection target) { + + target.addSubstanceAdministration(CCDFactory.eINSTANCE.createMedicationActivity().init()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationsSectionOperations.validateImmunizationsSectionMedicationActivity( + (ImmunizationsSection) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationsSectionMedicationActivityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateImmunizationsSectionSupplyActivity() { + OperationsTestCase validateImmunizationsSectionSupplyActivityTestCase = new OperationsTestCase( + "validateImmunizationsSectionSupplyActivity", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATIONS_SECTION_SUPPLY_ACTIVITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationsSection target) { + target.init(); + } + + @Override + protected void updateToPass(ImmunizationsSection target) { + target.addSupply(CCDFactory.eINSTANCE.createSupplyActivity().init()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationsSectionOperations.validateImmunizationsSectionSupplyActivity( + (ImmunizationsSection) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationsSectionSupplyActivityTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetMedicationActivities() { + + ImmunizationsSection target = objectFactory.create(); + target.getMedicationActivities(); + + } + + /** + * + * @generated + */ + @Test + public void testGetSupplyActivities() { + + ImmunizationsSection target = objectFactory.create(); + target.getSupplyActivities(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ImmunizationsSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ImmunizationsSection create() { + return CCDFactory.eINSTANCE.createImmunizationsSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ImmunizationsSectionOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ImmunizationsSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/MedicalEquipmentSectionTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/MedicalEquipmentSectionTest.java new file mode 100644 index 000000000..2d99daa30 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/MedicalEquipmentSectionTest.java @@ -0,0 +1,351 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.MedicalEquipmentSection; +import org.openhealthtools.mdht.uml.cda.ccd.operations.MedicalEquipmentSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * A static utility class that provides operations + * related to 'Medical Equipment Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicalEquipmentSection#validateMedicalEquipmentSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medical Equipment Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicalEquipmentSection#validateMedicalEquipmentSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medical Equipment Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicalEquipmentSection#validateMedicalEquipmentSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medical Equipment Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicalEquipmentSection#validateMedicalEquipmentSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medical Equipment Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicalEquipmentSection#validateMedicalEquipmentSectionSupplyActivity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medical Equipment Section Supply Activity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicalEquipmentSection#validateMedicalEquipmentSectionMedicationActivity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medical Equipment Section Medication Activity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicalEquipmentSection#getSupplyActivities() Get Supply Activities}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicalEquipmentSection#getMedicationActivities() Get Medication Activities}
  • + *
+ *

+ * + * @generated + */ + +public class MedicalEquipmentSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateMedicalEquipmentSectionTemplateId() { + OperationsTestCase validateMedicalEquipmentSectionTemplateIdTestCase = new OperationsTestCase( + "validateMedicalEquipmentSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_MEDICAL_EQUIPMENT_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicalEquipmentSection target) { + + } + + @Override + protected void updateToPass(MedicalEquipmentSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicalEquipmentSectionOperations.validateMedicalEquipmentSectionTemplateId( + (MedicalEquipmentSection) objectToTest, diagnostician, map); + } + + }; + + validateMedicalEquipmentSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicalEquipmentSectionCode() { + OperationsTestCase validateMedicalEquipmentSectionCodeTestCase = new OperationsTestCase( + "validateMedicalEquipmentSectionCode", + operationsForOCL.getOCLValue("VALIDATE_MEDICAL_EQUIPMENT_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicalEquipmentSection target) { + + } + + @Override + protected void updateToPass(MedicalEquipmentSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicalEquipmentSectionOperations.validateMedicalEquipmentSectionCode( + (MedicalEquipmentSection) objectToTest, diagnostician, map); + } + + }; + + validateMedicalEquipmentSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicalEquipmentSectionTitle() { + OperationsTestCase validateMedicalEquipmentSectionTitleTestCase = new OperationsTestCase( + "validateMedicalEquipmentSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_MEDICAL_EQUIPMENT_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicalEquipmentSection target) { + + } + + @Override + protected void updateToPass(MedicalEquipmentSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicalEquipmentSectionOperations.validateMedicalEquipmentSectionTitle( + (MedicalEquipmentSection) objectToTest, diagnostician, map); + } + + }; + + validateMedicalEquipmentSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicalEquipmentSectionText() { + OperationsTestCase validateMedicalEquipmentSectionTextTestCase = new OperationsTestCase( + "validateMedicalEquipmentSectionText", + operationsForOCL.getOCLValue("VALIDATE_MEDICAL_EQUIPMENT_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicalEquipmentSection target) { + + } + + @Override + protected void updateToPass(MedicalEquipmentSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicalEquipmentSectionOperations.validateMedicalEquipmentSectionText( + (MedicalEquipmentSection) objectToTest, diagnostician, map); + } + + }; + + validateMedicalEquipmentSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicalEquipmentSectionSupplyActivity() { + OperationsTestCase validateMedicalEquipmentSectionSupplyActivityTestCase = new OperationsTestCase( + "validateMedicalEquipmentSectionSupplyActivity", + operationsForOCL.getOCLValue("VALIDATE_MEDICAL_EQUIPMENT_SECTION_SUPPLY_ACTIVITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicalEquipmentSection target) { + + } + + @Override + protected void updateToPass(MedicalEquipmentSection target) { + target.init(); + target.addSupply(CCDFactory.eINSTANCE.createSupplyActivity()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicalEquipmentSectionOperations.validateMedicalEquipmentSectionSupplyActivity( + (MedicalEquipmentSection) objectToTest, diagnostician, map); + } + + }; + + validateMedicalEquipmentSectionSupplyActivityTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicalEquipmentSectionMedicationActivity() { + OperationsTestCase validateMedicalEquipmentSectionMedicationActivityTestCase = new OperationsTestCase( + "validateMedicalEquipmentSectionMedicationActivity", + operationsForOCL.getOCLValue("VALIDATE_MEDICAL_EQUIPMENT_SECTION_MEDICATION_ACTIVITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicalEquipmentSection target) { + + } + + @Override + protected void updateToPass(MedicalEquipmentSection target) { + target.init(); + target.addSubstanceAdministration(CCDFactory.eINSTANCE.createMedicationActivity()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicalEquipmentSectionOperations.validateMedicalEquipmentSectionMedicationActivity( + (MedicalEquipmentSection) objectToTest, diagnostician, map); + } + + }; + + validateMedicalEquipmentSectionMedicationActivityTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetSupplyActivities() { + + MedicalEquipmentSection target = objectFactory.create(); + target.getSupplyActivities(); + + } + + /** + * + * @generated + */ + @Test + public void testGetMedicationActivities() { + + MedicalEquipmentSection target = objectFactory.create(); + target.getMedicationActivities(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends MedicalEquipmentSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public MedicalEquipmentSection create() { + return CCDFactory.eINSTANCE.createMedicalEquipmentSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends MedicalEquipmentSectionOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // MedicalEquipmentSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/MedicationActivityTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/MedicationActivityTest.java new file mode 100644 index 000000000..49c1d9dfa --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/MedicationActivityTest.java @@ -0,0 +1,1065 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.Authorization; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Consent; +import org.openhealthtools.mdht.uml.cda.Consumable; +import org.openhealthtools.mdht.uml.cda.Criterion; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.Informant12; +import org.openhealthtools.mdht.uml.cda.ManufacturedProduct; +import org.openhealthtools.mdht.uml.cda.Participant2; +import org.openhealthtools.mdht.uml.cda.Precondition; +import org.openhealthtools.mdht.uml.cda.Section; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.ContinuityOfCareDocument; +import org.openhealthtools.mdht.uml.cda.ccd.EpisodeObservation; +import org.openhealthtools.mdht.uml.cda.ccd.MedicationActivity; +import org.openhealthtools.mdht.uml.cda.ccd.MedicationSeriesNumberObservation; +import org.openhealthtools.mdht.uml.cda.ccd.MedicationStatusObservation; +import org.openhealthtools.mdht.uml.cda.ccd.PatientInstruction; +import org.openhealthtools.mdht.uml.cda.ccd.ProblemAct; +import org.openhealthtools.mdht.uml.cda.ccd.ProductInstance; +import org.openhealthtools.mdht.uml.cda.ccd.ReactionObservation; +import org.openhealthtools.mdht.uml.cda.ccd.operations.MedicationActivityOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_PQ; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.datatypes.RTO_PQ_PQ; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; +import org.openhealthtools.mdht.uml.hl7.vocab.x_DocumentSubstanceMood; + +/** + * A static utility class that provides operations + * related to 'Medication Activity' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicationActivity#validateMedicationActivityMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicationActivity#validateMedicationActivityHasDoseQuantityOrRateQuantity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Has Dose Quantity Or Rate Quantity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicationActivity#validateMedicationActivityHasConsents(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Has Consents}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicationActivity#validateMedicationActivityInformationSource(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Information Source}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicationActivity#validateMedicationActivityHasPreconditionCriterion(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Has Precondition Criterion}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicationActivity#validateMedicationActivityHasReason(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Has Reason}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicationActivity#validateMedicationActivityHasReasonProblem(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Has Reason Problem}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicationActivity#validateMedicationActivityHasProduct(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Has Product}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicationActivity#validateMedicationActivityTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicationActivity#validateMedicationActivityId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicationActivity#validateMedicationActivityStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicationActivity#validateMedicationActivityEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicationActivity#validateMedicationActivityMaxDoseQuantity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Max Dose Quantity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicationActivity#validateMedicationActivityRouteCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Route Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicationActivity#validateMedicationActivityDoseQuantity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Dose Quantity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicationActivity#validateMedicationActivityRateQuantity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Rate Quantity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicationActivity#validateMedicationActivityMedicationSeriesNumberObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Medication Series Number Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicationActivity#validateMedicationActivityMedicationStatusObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Medication Status Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicationActivity#validateMedicationActivityPatientInstruction(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Patient Instruction}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicationActivity#validateMedicationActivityPerformer(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Performer}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicationActivity#validateMedicationActivityReactionObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Reaction Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicationActivity#validateMedicationActivityProductInstance(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Product Instance}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicationActivity#getMedicationSeriesNumberObservation() Get Medication Series Number Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicationActivity#getMedicationStatusObservation() Get Medication Status Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicationActivity#getPatientInstructions() Get Patient Instructions}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicationActivity#getReactionObservations() Get Reaction Observations}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicationActivity#getProductInstances() Get Product Instances}
  • + *
+ *

+ * + * @generated + */ + +public class MedicationActivityTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationActivityMoodCode() { + OperationsTestCase validateMedicationActivityMoodCodeTestCase = new OperationsTestCase( + "validateMedicationActivityMoodCode", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + + target.setMoodCode(x_DocumentSubstanceMood.PRP); + + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.init(); + + target.setMoodCode(x_DocumentSubstanceMood.EVN); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityMoodCode( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationActivityHasDoseQuantityOrRateQuantity() { + OperationsTestCase validateMedicationActivityHasDoseQuantityOrRateQuantityTestCase = new OperationsTestCase( + "validateMedicationActivityHasDoseQuantityOrRateQuantity", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_HAS_DOSE_QUANTITY_OR_RATE_QUANTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.init(); + IVL_PQ value = DatatypesFactory.eINSTANCE.createIVL_PQ(); + target.setRateQuantity(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityHasDoseQuantityOrRateQuantity( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityHasDoseQuantityOrRateQuantityTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationActivityHasConsents() { + OperationsTestCase validateMedicationActivityHasConsentsTestCase = new OperationsTestCase( + "validateMedicationActivityHasConsents", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_HAS_CONSENTS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.init(); + ContinuityOfCareDocument ccd = CCDFactory.eINSTANCE.createContinuityOfCareDocument(); + Authorization auth = CDAFactory.eINSTANCE.createAuthorization(); + Consent value = CDAFactory.eINSTANCE.createConsent(); + CE ce = DatatypesFactory.eINSTANCE.createCE(); + value.setCode(ce); + auth.setConsent(value); + ccd.getAuthorizations().add(auth); + Section section = CCDFactory.eINSTANCE.createMedicationsSection().init(); + section.addSubstanceAdministration(target); + ccd.addSection(section); + + // self.getClinicalDocument().authorization->size() > 0 and self.getClinicalDocument().authorization.consent->size() > 0 + // + // try { + // CDAUtil.save(target.getClinicalDocument(), System.out); + // + // for (Authorization authorization : target.getClinicalDocument().getAuthorizations()) { + // System.out.println(authorization.toString()); + // + // System.out.println(authorization.getConsent()); + // + // } + // + // } catch (Exception e1) { + // // TODO Auto-generated catch block + // e1.printStackTrace(); + // } + // + // try { + // + // CDAUtil.save(target.getClinicalDocument(), System.out); + // } catch (Exception e) { + // e.printStackTrace(); + // } + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityHasConsents( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityHasConsentsTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationActivityInformationSource() { + OperationsTestCase validateMedicationActivityInformationSourceTestCase = new OperationsTestCase( + "validateMedicationActivityInformationSource", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_INFORMATION_SOURCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.init(); + + Informant12 inf = CDAFactory.eINSTANCE.createInformant12(); + target.getInformants().add(inf); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityInformationSource( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityInformationSourceTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationActivityHasPreconditionCriterion() { + OperationsTestCase validateMedicationActivityHasPreconditionCriterionTestCase = new OperationsTestCase( + "validateMedicationActivityHasPreconditionCriterion", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_HAS_PRECONDITION_CRITERION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.init(); + Precondition precon = CDAFactory.eINSTANCE.createPrecondition(); + Criterion value = CDAFactory.eINSTANCE.createCriterion(); + precon.setCriterion(value); + target.getPreconditions().add(precon); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityHasPreconditionCriterion( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityHasPreconditionCriterionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationActivityHasReason() { + OperationsTestCase validateMedicationActivityHasReasonTestCase = new OperationsTestCase( + "validateMedicationActivityHasReason", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_HAS_REASON__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.RSON); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityHasReason( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityHasReasonTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationActivityHasReasonProblem() { + OperationsTestCase validateMedicationActivityHasReasonProblemTestCase = new OperationsTestCase( + "validateMedicationActivityHasReasonProblem", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_HAS_REASON_PROBLEM__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.RSON); + EpisodeObservation eo = CCDFactory.eINSTANCE.createEpisodeObservation(); + er.setObservation(eo); + target.getEntryRelationships().add(er); + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.init(); + target.getEntryRelationships().clear(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.RSON); + ProblemAct pa = CCDFactory.eINSTANCE.createProblemAct(); + er.setAct(pa); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityHasReasonProblem( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityHasReasonProblemTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationActivityHasProduct() { + OperationsTestCase validateMedicationActivityHasProductTestCase = new OperationsTestCase( + "validateMedicationActivityHasProduct", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_HAS_PRODUCT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + ManufacturedProduct prod = CDAFactory.eINSTANCE.createManufacturedProduct(); + Consumable value = CDAFactory.eINSTANCE.createConsumable(); + value.setManufacturedProduct(prod); + target.setConsumable(value); + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.init(); + org.openhealthtools.mdht.uml.cda.ccd.Product prod = CCDFactory.eINSTANCE.createProduct(); + target.getConsumable().setManufacturedProduct(prod); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityHasProduct( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityHasProductTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicationActivityTemplateId() { + OperationsTestCase validateMedicationActivityTemplateIdTestCase = new OperationsTestCase( + "validateMedicationActivityTemplateId", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityTemplateId( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationActivityId() { + OperationsTestCase validateMedicationActivityIdTestCase = new OperationsTestCase( + "validateMedicationActivityId", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.init(); + + II id = DatatypesFactory.eINSTANCE.createII(); + target.getIds().add(id); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityId( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicationActivityStatusCode() { + OperationsTestCase validateMedicationActivityStatusCodeTestCase = new OperationsTestCase( + "validateMedicationActivityStatusCode", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityStatusCode( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationActivityEffectiveTime() { + OperationsTestCase validateMedicationActivityEffectiveTimeTestCase = new OperationsTestCase( + "validateMedicationActivityEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.getEffectiveTimes().add(ts); + // target.setEffectiveTime(ts ); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityEffectiveTime( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationActivityMaxDoseQuantity() { + OperationsTestCase validateMedicationActivityMaxDoseQuantityTestCase = new OperationsTestCase( + "validateMedicationActivityMaxDoseQuantity", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_MAX_DOSE_QUANTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.init(); + + RTO_PQ_PQ mdq = DatatypesFactory.eINSTANCE.createRTO_PQ_PQ(); + target.setMaxDoseQuantity(mdq); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityMaxDoseQuantity( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityMaxDoseQuantityTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicationActivityRouteCode() { + OperationsTestCase validateMedicationActivityRouteCodeTestCase = new OperationsTestCase( + "validateMedicationActivityRouteCode", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_ROUTE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityRouteCode( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityRouteCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationActivityDoseQuantity() { + OperationsTestCase validateMedicationActivityDoseQuantityTestCase = new OperationsTestCase( + "validateMedicationActivityDoseQuantity", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_DOSE_QUANTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.init(); + target.setDoseQuantity(DatatypesFactory.eINSTANCE.createIVL_PQ()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityDoseQuantity( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityDoseQuantityTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationActivityRateQuantity() { + OperationsTestCase validateMedicationActivityRateQuantityTestCase = new OperationsTestCase( + "validateMedicationActivityRateQuantity", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_RATE_QUANTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.init(); + target.setRateQuantity(DatatypesFactory.eINSTANCE.createIVL_PQ()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityRateQuantity( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityRateQuantityTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationActivityMedicationSeriesNumberObservation() { + OperationsTestCase validateMedicationActivityMedicationSeriesNumberObservationTestCase = new OperationsTestCase( + "validateMedicationActivityMedicationSeriesNumberObservation", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_MEDICATION_SERIES_NUMBER_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + MedicationSeriesNumberObservation medseries = CCDFactory.eINSTANCE.createMedicationSeriesNumberObservation(); + er.setObservation(medseries); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityMedicationSeriesNumberObservation( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityMedicationSeriesNumberObservationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationActivityMedicationStatusObservation() { + OperationsTestCase validateMedicationActivityMedicationStatusObservationTestCase = new OperationsTestCase( + "validateMedicationActivityMedicationStatusObservation", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_MEDICATION_STATUS_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + MedicationStatusObservation medstatus = CCDFactory.eINSTANCE.createMedicationStatusObservation(); + er.setObservation(medstatus); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityMedicationStatusObservation( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityMedicationStatusObservationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationActivityPatientInstruction() { + OperationsTestCase validateMedicationActivityPatientInstructionTestCase = new OperationsTestCase( + "validateMedicationActivityPatientInstruction", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_PATIENT_INSTRUCTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + PatientInstruction pi = CCDFactory.eINSTANCE.createPatientInstruction(); + er.setAct(pi); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityPatientInstruction( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityPatientInstructionTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationActivityPerformer() { + OperationsTestCase validateMedicationActivityPerformerTestCase = new OperationsTestCase( + "validateMedicationActivityPerformer", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_PERFORMER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.init(); + target.getPerformers().add(CDAFactory.eINSTANCE.createPerformer2()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityPerformer( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityPerformerTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationActivityReactionObservation() { + OperationsTestCase validateMedicationActivityReactionObservationTestCase = new OperationsTestCase( + "validateMedicationActivityReactionObservation", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_REACTION_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.CAUS); + ReactionObservation ro = CCDFactory.eINSTANCE.createReactionObservation(); + er.setObservation(ro); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityReactionObservation( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityReactionObservationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationActivityProductInstance() { + OperationsTestCase validateMedicationActivityProductInstanceTestCase = new OperationsTestCase( + "validateMedicationActivityProductInstance", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_PRODUCT_INSTANCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.init(); + + Participant2 p2 = CDAFactory.eINSTANCE.createParticipant2(); + ProductInstance pi = CCDFactory.eINSTANCE.createProductInstance(); + p2.setParticipantRole(pi); + target.getParticipants().add(p2); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityProductInstance( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityProductInstanceTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetMedicationSeriesNumberObservation() { + + MedicationActivity target = objectFactory.create(); + target.getMedicationSeriesNumberObservation(); + + } + + /** + * + * @generated + */ + @Test + public void testGetMedicationStatusObservation() { + + MedicationActivity target = objectFactory.create(); + target.getMedicationStatusObservation(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPatientInstructions() { + + MedicationActivity target = objectFactory.create(); + target.getPatientInstructions(); + + } + + /** + * + * @generated + */ + @Test + public void testGetReactionObservations() { + + MedicationActivity target = objectFactory.create(); + target.getReactionObservations(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProductInstances() { + + MedicationActivity target = objectFactory.create(); + target.getProductInstances(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends MedicationActivityOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public MedicationActivity create() { + return CCDFactory.eINSTANCE.createMedicationActivity(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends MedicationActivityOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // MedicationActivityOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/MedicationSeriesNumberObservationTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/MedicationSeriesNumberObservationTest.java new file mode 100644 index 000000000..1bbb05966 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/MedicationSeriesNumberObservationTest.java @@ -0,0 +1,330 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.MedicationSeriesNumberObservation; +import org.openhealthtools.mdht.uml.cda.ccd.operations.MedicationSeriesNumberObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.INT; + +/** + * A static utility class that provides operations + * related to 'Medication Series Number Observation' model + * objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicationSeriesNumberObservation#validateMedicationSeriesNumberObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Series Number Observation Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicationSeriesNumberObservation#validateMedicationSeriesNumberObservationClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Series Number Observation Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicationSeriesNumberObservation#validateMedicationSeriesNumberObservationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Series Number Observation Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicationSeriesNumberObservation#validateMedicationSeriesNumberObservationStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Series Number Observation Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicationSeriesNumberObservation#validateMedicationSeriesNumberObservationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Series Number Observation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicationSeriesNumberObservation#validateMedicationSeriesNumberObservationValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Series Number Observation Value}
  • + *
+ *

+ * + * @generated + */ + +public class MedicationSeriesNumberObservationTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateMedicationSeriesNumberObservationTemplateId() { + OperationsTestCase validateMedicationSeriesNumberObservationTemplateIdTestCase = new OperationsTestCase( + "validateMedicationSeriesNumberObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_SERIES_NUMBER_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationSeriesNumberObservation target) { + + } + + @Override + protected void updateToPass(MedicationSeriesNumberObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationSeriesNumberObservationOperations.validateMedicationSeriesNumberObservationTemplateId( + (MedicationSeriesNumberObservation) objectToTest, diagnostician, map); + } + + }; + + validateMedicationSeriesNumberObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicationSeriesNumberObservationClassCode() { + OperationsTestCase validateMedicationSeriesNumberObservationClassCodeTestCase = new OperationsTestCase( + "validateMedicationSeriesNumberObservationClassCode", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_SERIES_NUMBER_OBSERVATION_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationSeriesNumberObservation target) { + + } + + @Override + protected void updateToPass(MedicationSeriesNumberObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationSeriesNumberObservationOperations.validateMedicationSeriesNumberObservationClassCode( + (MedicationSeriesNumberObservation) objectToTest, diagnostician, map); + } + + }; + + validateMedicationSeriesNumberObservationClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicationSeriesNumberObservationMoodCode() { + OperationsTestCase validateMedicationSeriesNumberObservationMoodCodeTestCase = new OperationsTestCase( + "validateMedicationSeriesNumberObservationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_SERIES_NUMBER_OBSERVATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationSeriesNumberObservation target) { + + } + + @Override + protected void updateToPass(MedicationSeriesNumberObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationSeriesNumberObservationOperations.validateMedicationSeriesNumberObservationMoodCode( + (MedicationSeriesNumberObservation) objectToTest, diagnostician, map); + } + + }; + + validateMedicationSeriesNumberObservationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicationSeriesNumberObservationStatusCode() { + OperationsTestCase validateMedicationSeriesNumberObservationStatusCodeTestCase = new OperationsTestCase( + "validateMedicationSeriesNumberObservationStatusCode", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_SERIES_NUMBER_OBSERVATION_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationSeriesNumberObservation target) { + + } + + @Override + protected void updateToPass(MedicationSeriesNumberObservation target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationSeriesNumberObservationOperations.validateMedicationSeriesNumberObservationStatusCode( + (MedicationSeriesNumberObservation) objectToTest, diagnostician, map); + } + + }; + + validateMedicationSeriesNumberObservationStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationSeriesNumberObservationCode() { + OperationsTestCase validateMedicationSeriesNumberObservationCodeTestCase = new OperationsTestCase( + "validateMedicationSeriesNumberObservationCode", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_SERIES_NUMBER_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationSeriesNumberObservation target) { + + } + + @Override + protected void updateToPass(MedicationSeriesNumberObservation target) { + target.init(); + + CD cd = DatatypesFactory.eINSTANCE.createCD(); + cd.setCode("30973-2"); + cd.setCodeSystem("2.16.840.1.113883.6.1"); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationSeriesNumberObservationOperations.validateMedicationSeriesNumberObservationCode( + (MedicationSeriesNumberObservation) objectToTest, diagnostician, map); + } + + }; + + validateMedicationSeriesNumberObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationSeriesNumberObservationValue() { + OperationsTestCase validateMedicationSeriesNumberObservationValueTestCase = new OperationsTestCase( + "validateMedicationSeriesNumberObservationValue", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_SERIES_NUMBER_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationSeriesNumberObservation target) { + + } + + @Override + protected void updateToPass(MedicationSeriesNumberObservation target) { + target.init(); + + INT value = DatatypesFactory.eINSTANCE.createINT(); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationSeriesNumberObservationOperations.validateMedicationSeriesNumberObservationValue( + (MedicationSeriesNumberObservation) objectToTest, diagnostician, map); + } + + }; + + validateMedicationSeriesNumberObservationValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends MedicationSeriesNumberObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public MedicationSeriesNumberObservation create() { + return CCDFactory.eINSTANCE.createMedicationSeriesNumberObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends MedicationSeriesNumberObservationOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // MedicationSeriesNumberObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/MedicationStatusObservationTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/MedicationStatusObservationTest.java new file mode 100644 index 000000000..c068cd219 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/MedicationStatusObservationTest.java @@ -0,0 +1,140 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.MedicationStatusObservation; +import org.openhealthtools.mdht.uml.cda.ccd.operations.MedicationStatusObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Medication Status Observation' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicationStatusObservation#validateStatusObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Status Observation Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class MedicationStatusObservationTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateStatusObservationTemplateId() { + OperationsTestCase validateStatusObservationTemplateIdTestCase = new OperationsTestCase( + "validateStatusObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_STATUS_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationStatusObservation target) { + + } + + @Override + protected void updateToPass(MedicationStatusObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationStatusObservationOperations.validateStatusObservationTemplateId( + (MedicationStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateStatusObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends MedicationStatusObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public MedicationStatusObservation create() { + return CCDFactory.eINSTANCE.createMedicationStatusObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends MedicationStatusObservationOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // MedicationStatusObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/MedicationsSectionTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/MedicationsSectionTest.java new file mode 100644 index 000000000..495b68438 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/MedicationsSectionTest.java @@ -0,0 +1,391 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.MedicationActivity; +import org.openhealthtools.mdht.uml.cda.ccd.MedicationsSection; +import org.openhealthtools.mdht.uml.cda.ccd.SupplyActivity; +import org.openhealthtools.mdht.uml.cda.ccd.operations.MedicationsSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * A static utility class that provides operations + * related to 'Medications Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicationsSection#validateMedicationsSectionHasMedicationOrSupplyActivity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medications Section Has Medication Or Supply Activity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicationsSection#validateMedicationsSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medications Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicationsSection#validateMedicationsSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medications Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicationsSection#validateMedicationsSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medications Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicationsSection#validateMedicationsSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medications Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicationsSection#validateMedicationsSectionMedicationActivity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medications Section Medication Activity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicationsSection#validateMedicationsSectionSupplyActivity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medications Section Supply Activity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicationsSection#getMedicationActivities() Get Medication Activities}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.MedicationsSection#getSupplyActivities() Get Supply Activities}
  • + *
+ *

+ * + * @generated + */ + +public class MedicationsSectionTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationsSectionHasMedicationOrSupplyActivity() { + OperationsTestCase validateMedicationsSectionHasMedicationOrSupplyActivityTestCase = new OperationsTestCase( + "validateMedicationsSectionHasMedicationOrSupplyActivity", + operationsForOCL.getOCLValue("VALIDATE_MEDICATIONS_SECTION_HAS_MEDICATION_OR_SUPPLY_ACTIVITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationsSection target) { + + } + + @Override + protected void updateToPass(MedicationsSection target) { + target.init(); + MedicationActivity sa = CCDFactory.eINSTANCE.createMedicationActivity(); + SupplyActivity sup = CCDFactory.eINSTANCE.createSupplyActivity(); + target.addSubstanceAdministration(sa); + target.addSupply(sup); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationsSectionOperations.validateMedicationsSectionHasMedicationOrSupplyActivity( + (MedicationsSection) objectToTest, diagnostician, map); + } + + }; + + validateMedicationsSectionHasMedicationOrSupplyActivityTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicationsSectionTemplateId() { + OperationsTestCase validateMedicationsSectionTemplateIdTestCase = new OperationsTestCase( + "validateMedicationsSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_MEDICATIONS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationsSection target) { + + } + + @Override + protected void updateToPass(MedicationsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationsSectionOperations.validateMedicationsSectionTemplateId( + (MedicationsSection) objectToTest, diagnostician, map); + } + + }; + + validateMedicationsSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicationsSectionCode() { + OperationsTestCase validateMedicationsSectionCodeTestCase = new OperationsTestCase( + "validateMedicationsSectionCode", + operationsForOCL.getOCLValue("VALIDATE_MEDICATIONS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationsSection target) { + + } + + @Override + protected void updateToPass(MedicationsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationsSectionOperations.validateMedicationsSectionCode( + (MedicationsSection) objectToTest, diagnostician, map); + } + + }; + + validateMedicationsSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicationsSectionTitle() { + OperationsTestCase validateMedicationsSectionTitleTestCase = new OperationsTestCase( + "validateMedicationsSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_MEDICATIONS_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationsSection target) { + + } + + @Override + protected void updateToPass(MedicationsSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationsSectionOperations.validateMedicationsSectionTitle( + (MedicationsSection) objectToTest, diagnostician, map); + } + + }; + + validateMedicationsSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicationsSectionText() { + OperationsTestCase validateMedicationsSectionTextTestCase = new OperationsTestCase( + "validateMedicationsSectionText", + operationsForOCL.getOCLValue("VALIDATE_MEDICATIONS_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationsSection target) { + + } + + @Override + protected void updateToPass(MedicationsSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationsSectionOperations.validateMedicationsSectionText( + (MedicationsSection) objectToTest, diagnostician, map); + } + + }; + + validateMedicationsSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationsSectionMedicationActivity() { + OperationsTestCase validateMedicationsSectionMedicationActivityTestCase = new OperationsTestCase( + "validateMedicationsSectionMedicationActivity", + operationsForOCL.getOCLValue("VALIDATE_MEDICATIONS_SECTION_MEDICATION_ACTIVITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationsSection target) { + + } + + @Override + protected void updateToPass(MedicationsSection target) { + target.init(); + target.addSubstanceAdministration(CCDFactory.eINSTANCE.createMedicationActivity()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationsSectionOperations.validateMedicationsSectionMedicationActivity( + (MedicationsSection) objectToTest, diagnostician, map); + } + + }; + + validateMedicationsSectionMedicationActivityTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationsSectionSupplyActivity() { + OperationsTestCase validateMedicationsSectionSupplyActivityTestCase = new OperationsTestCase( + "validateMedicationsSectionSupplyActivity", + operationsForOCL.getOCLValue("VALIDATE_MEDICATIONS_SECTION_SUPPLY_ACTIVITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationsSection target) { + + } + + @Override + protected void updateToPass(MedicationsSection target) { + target.init(); + target.addSupply(CCDFactory.eINSTANCE.createSupplyActivity()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationsSectionOperations.validateMedicationsSectionSupplyActivity( + (MedicationsSection) objectToTest, diagnostician, map); + } + + }; + + validateMedicationsSectionSupplyActivityTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetMedicationActivities() { + + MedicationsSection target = objectFactory.create(); + target.getMedicationActivities(); + + } + + /** + * + * @generated + */ + @Test + public void testGetSupplyActivities() { + + MedicationsSection target = objectFactory.create(); + target.getSupplyActivities(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends MedicationsSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public MedicationsSection create() { + return CCDFactory.eINSTANCE.createMedicationsSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends MedicationsSectionOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // MedicationsSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/PatientAwarenessTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/PatientAwarenessTest.java new file mode 100644 index 000000000..9a94d6ed3 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/PatientAwarenessTest.java @@ -0,0 +1,253 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.ParticipantRole; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.PatientAwareness; +import org.openhealthtools.mdht.uml.cda.ccd.operations.PatientAwarenessOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; + +/** + * A static utility class that provides operations + * related to 'Patient Awareness' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PatientAwareness#validatePatientAwarenessParticipantRoleId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Awareness Participant Role Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PatientAwareness#validatePatientAwarenessTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Awareness Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PatientAwareness#validatePatientAwarenessTypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Awareness Type Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PatientAwareness#validatePatientAwarenessAwarenessCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Awareness Awareness Code}
  • + *
+ *

+ * + * @generated + */ + +public class PatientAwarenessTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidatePatientAwarenessParticipantRoleId() { + OperationsTestCase validatePatientAwarenessParticipantRoleIdTestCase = new OperationsTestCase( + "validatePatientAwarenessParticipantRoleId", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_AWARENESS_PARTICIPANT_ROLE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PatientAwareness target) { + + } + + @Override + protected void updateToPass(PatientAwareness target) { + target.init(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + II id = DatatypesFactory.eINSTANCE.createII(); + id.setRoot("s"); + pr.getIds().add(id); + target.setParticipantRole(pr); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PatientAwarenessOperations.validatePatientAwarenessParticipantRoleId( + (PatientAwareness) objectToTest, diagnostician, map); + } + + }; + + validatePatientAwarenessParticipantRoleIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePatientAwarenessTemplateId() { + OperationsTestCase validatePatientAwarenessTemplateIdTestCase = new OperationsTestCase( + "validatePatientAwarenessTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_AWARENESS_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PatientAwareness target) { + + } + + @Override + protected void updateToPass(PatientAwareness target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PatientAwarenessOperations.validatePatientAwarenessTemplateId( + (PatientAwareness) objectToTest, diagnostician, map); + } + + }; + + validatePatientAwarenessTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePatientAwarenessTypeCode() { + OperationsTestCase validatePatientAwarenessTypeCodeTestCase = new OperationsTestCase( + "validatePatientAwarenessTypeCode", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_AWARENESS_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PatientAwareness target) { + + } + + @Override + protected void updateToPass(PatientAwareness target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PatientAwarenessOperations.validatePatientAwarenessTypeCode( + (PatientAwareness) objectToTest, diagnostician, map); + } + + }; + + validatePatientAwarenessTypeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePatientAwarenessAwarenessCode() { + OperationsTestCase validatePatientAwarenessAwarenessCodeTestCase = new OperationsTestCase( + "validatePatientAwarenessAwarenessCode", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_AWARENESS_AWARENESS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PatientAwareness target) { + + } + + @Override + protected void updateToPass(PatientAwareness target) { + target.init(); + target.setAwarenessCode(DatatypesFactory.eINSTANCE.createCE()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PatientAwarenessOperations.validatePatientAwarenessAwarenessCode( + (PatientAwareness) objectToTest, diagnostician, map); + } + + }; + + validatePatientAwarenessAwarenessCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PatientAwarenessOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public PatientAwareness create() { + return CCDFactory.eINSTANCE.createPatientAwareness(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PatientAwarenessOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PatientAwarenessOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/PatientInstructionTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/PatientInstructionTest.java new file mode 100644 index 000000000..3c56c03aa --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/PatientInstructionTest.java @@ -0,0 +1,175 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.PatientInstruction; +import org.openhealthtools.mdht.uml.cda.ccd.operations.PatientInstructionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Patient Instruction' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PatientInstruction#validatePatientInstructionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Instruction Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PatientInstruction#validatePatientInstructionMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Instruction Mood Code}
  • + *
+ *

+ * + * @generated + */ + +public class PatientInstructionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidatePatientInstructionTemplateId() { + OperationsTestCase validatePatientInstructionTemplateIdTestCase = new OperationsTestCase( + "validatePatientInstructionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_INSTRUCTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PatientInstruction target) { + + } + + @Override + protected void updateToPass(PatientInstruction target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PatientInstructionOperations.validatePatientInstructionTemplateId( + (PatientInstruction) objectToTest, diagnostician, map); + } + + }; + + validatePatientInstructionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePatientInstructionMoodCode() { + OperationsTestCase validatePatientInstructionMoodCodeTestCase = new OperationsTestCase( + "validatePatientInstructionMoodCode", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_INSTRUCTION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PatientInstruction target) { + + } + + @Override + protected void updateToPass(PatientInstruction target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PatientInstructionOperations.validatePatientInstructionMoodCode( + (PatientInstruction) objectToTest, diagnostician, map); + } + + }; + + validatePatientInstructionMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PatientInstructionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public PatientInstruction create() { + return CCDFactory.eINSTANCE.createPatientInstruction(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PatientInstructionOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PatientInstructionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/PayerEntityTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/PayerEntityTest.java new file mode 100644 index 000000000..13d67cc38 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/PayerEntityTest.java @@ -0,0 +1,144 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.PayerEntity; +import org.openhealthtools.mdht.uml.cda.ccd.operations.PayerEntityOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; + +/** + * A static utility class that provides operations + * related to 'Payer Entity' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.PayerEntity#validatePayerEntityId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Payer Entity Id}
  • + *
+ *

+ * + * @generated + */ + +public class PayerEntityTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidatePayerEntityId() { + OperationsTestCase validatePayerEntityIdTestCase = new OperationsTestCase( + "validatePayerEntityId", + operationsForOCL.getOCLValue("VALIDATE_PAYER_ENTITY_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(PayerEntity target) { + + } + + @Override + protected void updateToPass(PayerEntity target) { + target.init(); + II ii = DatatypesFactory.eINSTANCE.createII(); + target.getIds().add(ii); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PayerEntityOperations.validatePayerEntityId((PayerEntity) objectToTest, diagnostician, map); + } + + }; + + validatePayerEntityIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PayerEntityOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public PayerEntity create() { + return CCDFactory.eINSTANCE.createPayerEntity(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PayerEntityOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PayerEntityOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/PayersSectionTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/PayersSectionTest.java new file mode 100644 index 000000000..ae039b087 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/PayersSectionTest.java @@ -0,0 +1,316 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.PayersSection; +import org.openhealthtools.mdht.uml.cda.ccd.operations.PayersSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * A static utility class that provides operations + * related to 'Payers Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.PayersSection#validatePayersSectionTitleValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Payers Section Title Value}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.PayersSection#validatePayersSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Payers Section Template Id}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.PayersSection#validatePayersSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Payers Section Code}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.PayersSection#validatePayersSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Payers Section Title}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.PayersSection#validatePayersSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Payers Section Text}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.PayersSection#validatePayersSectionCoverageActivity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Payers Section Coverage Activity}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.PayersSection#getCoverageActivities() + * Get Coverage Activities}
  • + *
+ *

+ * + * @generated + */ + +public class PayersSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidatePayersSectionTemplateId() { + OperationsTestCase validatePayersSectionTemplateIdTestCase = new OperationsTestCase( + "validatePayersSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PAYERS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PayersSection target) { + + } + + @Override + protected void updateToPass(PayersSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PayersSectionOperations.validatePayersSectionTemplateId( + (PayersSection) objectToTest, diagnostician, map); + } + + }; + + validatePayersSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePayersSectionCode() { + OperationsTestCase validatePayersSectionCodeTestCase = new OperationsTestCase( + "validatePayersSectionCode", + operationsForOCL.getOCLValue("VALIDATE_PAYERS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(PayersSection target) { + + } + + @Override + protected void updateToPass(PayersSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PayersSectionOperations.validatePayersSectionCode( + (PayersSection) objectToTest, diagnostician, map); + } + + }; + + validatePayersSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePayersSectionTitle() { + OperationsTestCase validatePayersSectionTitleTestCase = new OperationsTestCase( + "validatePayersSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_PAYERS_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PayersSection target) { + + } + + @Override + protected void updateToPass(PayersSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PayersSectionOperations.validatePayersSectionTitle( + (PayersSection) objectToTest, diagnostician, map); + } + + }; + + validatePayersSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePayersSectionText() { + OperationsTestCase validatePayersSectionTextTestCase = new OperationsTestCase( + "validatePayersSectionText", + operationsForOCL.getOCLValue("VALIDATE_PAYERS_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(PayersSection target) { + + } + + @Override + protected void updateToPass(PayersSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PayersSectionOperations.validatePayersSectionText( + (PayersSection) objectToTest, diagnostician, map); + } + + }; + + validatePayersSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePayersSectionCoverageActivity() { + OperationsTestCase validatePayersSectionCoverageActivityTestCase = new OperationsTestCase( + "validatePayersSectionCoverageActivity", + operationsForOCL.getOCLValue("VALIDATE_PAYERS_SECTION_COVERAGE_ACTIVITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PayersSection target) { + + } + + @Override + protected void updateToPass(PayersSection target) { + target.init(); + target.addAct(CCDFactory.eINSTANCE.createCoverageActivity()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PayersSectionOperations.validatePayersSectionCoverageActivity( + (PayersSection) objectToTest, diagnostician, map); + } + + }; + + validatePayersSectionCoverageActivityTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetCoverageActivities() { + + PayersSection target = objectFactory.create(); + target.getCoverageActivities(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PayersSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public PayersSection create() { + return CCDFactory.eINSTANCE.createPayersSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PayersSectionOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PayersSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/PlanOfCareActivityActTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/PlanOfCareActivityActTest.java new file mode 100644 index 000000000..5bfa060a4 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/PlanOfCareActivityActTest.java @@ -0,0 +1,247 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareActivityAct; +import org.openhealthtools.mdht.uml.cda.ccd.operations.PlanOfCareActivityActOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.vocab.x_DocumentActMood; + +/** + * A static utility class that provides operations + * related to 'Plan Of Care Activity Act' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareActivityAct#validatePlanOfCareActivityActMoodCodeValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Activity Act Mood Code Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareActivityAct#validatePlanOfCareActivityActTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Activity Act Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareActivityAct#validatePlanOfCareActivityActId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Activity Act Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareActivityAct#validatePlanOfCareActivityActMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Activity Act Mood Code}
  • + *
+ *

+ * + * @generated + */ + +public class PlanOfCareActivityActTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidatePlanOfCareActivityActMoodCodeValue() { + OperationsTestCase validatePlanOfCareActivityActMoodCodeValueTestCase = new OperationsTestCase( + "validatePlanOfCareActivityActMoodCodeValue", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_ACTIVITY_ACT_MOOD_CODE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareActivityAct target) { + + } + + @Override + protected void updateToPass(PlanOfCareActivityAct target) { + target.init(); + target.setMoodCode(x_DocumentActMood.INT); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareActivityActOperations.validatePlanOfCareActivityActMoodCodeValue( + (PlanOfCareActivityAct) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareActivityActMoodCodeValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePlanOfCareActivityActTemplateId() { + OperationsTestCase validatePlanOfCareActivityActTemplateIdTestCase = new OperationsTestCase( + "validatePlanOfCareActivityActTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_ACTIVITY_ACT_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareActivityAct target) { + + } + + @Override + protected void updateToPass(PlanOfCareActivityAct target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareActivityActOperations.validatePlanOfCareActivityActTemplateId( + (PlanOfCareActivityAct) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareActivityActTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePlanOfCareActivityActId() { + OperationsTestCase validatePlanOfCareActivityActIdTestCase = new OperationsTestCase( + "validatePlanOfCareActivityActId", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_ACTIVITY_ACT_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareActivityAct target) { + + } + + @Override + protected void updateToPass(PlanOfCareActivityAct target) { + target.init(); + target.getIds().add(DatatypesFactory.eINSTANCE.createII()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareActivityActOperations.validatePlanOfCareActivityActId( + (PlanOfCareActivityAct) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareActivityActIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePlanOfCareActivityActMoodCode() { + OperationsTestCase validatePlanOfCareActivityActMoodCodeTestCase = new OperationsTestCase( + "validatePlanOfCareActivityActMoodCode", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_ACTIVITY_ACT_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareActivityAct target) { + + } + + @Override + protected void updateToPass(PlanOfCareActivityAct target) { + target.init(); + target.setMoodCode(x_DocumentActMood.INT); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareActivityActOperations.validatePlanOfCareActivityActMoodCode( + (PlanOfCareActivityAct) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareActivityActMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PlanOfCareActivityActOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public PlanOfCareActivityAct create() { + return CCDFactory.eINSTANCE.createPlanOfCareActivityAct(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PlanOfCareActivityActOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PlanOfCareActivityActOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/PlanOfCareActivityEncounterTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/PlanOfCareActivityEncounterTest.java new file mode 100644 index 000000000..8a1b6b023 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/PlanOfCareActivityEncounterTest.java @@ -0,0 +1,247 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareActivityEncounter; +import org.openhealthtools.mdht.uml.cda.ccd.operations.PlanOfCareActivityEncounterOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.vocab.x_DocumentEncounterMood; + +/** + * A static utility class that provides operations + * related to 'Plan Of Care Activity Encounter' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareActivityEncounter#validatePlanOfCareActivityEncounterMoodCodeValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Activity Encounter Mood Code Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareActivityEncounter#validatePlanOfCareActivityEncounterTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Activity Encounter Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareActivityEncounter#validatePlanOfCareActivityEncounterId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Activity Encounter Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareActivityEncounter#validatePlanOfCareActivityEncounterMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Activity Encounter Mood Code}
  • + *
+ *

+ * + * @generated + */ + +public class PlanOfCareActivityEncounterTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidatePlanOfCareActivityEncounterMoodCodeValue() { + OperationsTestCase validatePlanOfCareActivityEncounterMoodCodeValueTestCase = new OperationsTestCase( + "validatePlanOfCareActivityEncounterMoodCodeValue", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_ACTIVITY_ENCOUNTER_MOOD_CODE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareActivityEncounter target) { + + } + + @Override + protected void updateToPass(PlanOfCareActivityEncounter target) { + target.init(); + target.setMoodCode(x_DocumentEncounterMood.INT); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareActivityEncounterOperations.validatePlanOfCareActivityEncounterMoodCodeValue( + (PlanOfCareActivityEncounter) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareActivityEncounterMoodCodeValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePlanOfCareActivityEncounterTemplateId() { + OperationsTestCase validatePlanOfCareActivityEncounterTemplateIdTestCase = new OperationsTestCase( + "validatePlanOfCareActivityEncounterTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_ACTIVITY_ENCOUNTER_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareActivityEncounter target) { + + } + + @Override + protected void updateToPass(PlanOfCareActivityEncounter target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareActivityEncounterOperations.validatePlanOfCareActivityEncounterTemplateId( + (PlanOfCareActivityEncounter) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareActivityEncounterTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePlanOfCareActivityEncounterId() { + OperationsTestCase validatePlanOfCareActivityEncounterIdTestCase = new OperationsTestCase( + "validatePlanOfCareActivityEncounterId", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_ACTIVITY_ENCOUNTER_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareActivityEncounter target) { + + } + + @Override + protected void updateToPass(PlanOfCareActivityEncounter target) { + target.init(); + target.getIds().add(DatatypesFactory.eINSTANCE.createII()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareActivityEncounterOperations.validatePlanOfCareActivityEncounterId( + (PlanOfCareActivityEncounter) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareActivityEncounterIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePlanOfCareActivityEncounterMoodCode() { + OperationsTestCase validatePlanOfCareActivityEncounterMoodCodeTestCase = new OperationsTestCase( + "validatePlanOfCareActivityEncounterMoodCode", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_ACTIVITY_ENCOUNTER_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareActivityEncounter target) { + + } + + @Override + protected void updateToPass(PlanOfCareActivityEncounter target) { + target.init(); + target.setMoodCode(x_DocumentEncounterMood.INT); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareActivityEncounterOperations.validatePlanOfCareActivityEncounterMoodCode( + (PlanOfCareActivityEncounter) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareActivityEncounterMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PlanOfCareActivityEncounterOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public PlanOfCareActivityEncounter create() { + return CCDFactory.eINSTANCE.createPlanOfCareActivityEncounter(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PlanOfCareActivityEncounterOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PlanOfCareActivityEncounterOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/PlanOfCareActivityObservationTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/PlanOfCareActivityObservationTest.java new file mode 100644 index 000000000..7d5b113f7 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/PlanOfCareActivityObservationTest.java @@ -0,0 +1,253 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareActivityObservation; +import org.openhealthtools.mdht.uml.cda.ccd.operations.PlanOfCareActivityObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActMoodDocumentObservation; + +/** + * A static utility class that provides operations + * related to 'Plan Of Care Activity Observation' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareActivityObservation#validatePlanOfCareActivityObservationMoodCodeValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Activity Observation Mood Code Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareActivityObservation#validatePlanOfCareActivityObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Activity Observation Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareActivityObservation#validatePlanOfCareActivityObservationId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Activity Observation Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareActivityObservation#validatePlanOfCareActivityObservationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Activity Observation Mood Code}
  • + *
+ *

+ * + * @generated + */ + +public class PlanOfCareActivityObservationTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidatePlanOfCareActivityObservationMoodCodeValue() { + OperationsTestCase validatePlanOfCareActivityObservationMoodCodeValueTestCase = new OperationsTestCase( + "validatePlanOfCareActivityObservationMoodCodeValue", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_ACTIVITY_OBSERVATION_MOOD_CODE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareActivityObservation target) { + + } + + @Override + protected void updateToPass(PlanOfCareActivityObservation target) { + target.init(); + target.setMoodCode(x_ActMoodDocumentObservation.INT); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareActivityObservationOperations.validatePlanOfCareActivityObservationMoodCodeValue( + (PlanOfCareActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareActivityObservationMoodCodeValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePlanOfCareActivityObservationTemplateId() { + OperationsTestCase validatePlanOfCareActivityObservationTemplateIdTestCase = new OperationsTestCase( + "validatePlanOfCareActivityObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_ACTIVITY_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareActivityObservation target) { + + } + + @Override + protected void updateToPass(PlanOfCareActivityObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareActivityObservationOperations.validatePlanOfCareActivityObservationTemplateId( + (PlanOfCareActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareActivityObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePlanOfCareActivityObservationId() { + OperationsTestCase validatePlanOfCareActivityObservationIdTestCase = new OperationsTestCase( + "validatePlanOfCareActivityObservationId", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_ACTIVITY_OBSERVATION_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareActivityObservation target) { + + } + + @Override + protected void updateToPass(PlanOfCareActivityObservation target) { + target.init(); + + II ii = DatatypesFactory.eINSTANCE.createII(); + target.getIds().add(ii); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareActivityObservationOperations.validatePlanOfCareActivityObservationId( + (PlanOfCareActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareActivityObservationIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePlanOfCareActivityObservationMoodCode() { + OperationsTestCase validatePlanOfCareActivityObservationMoodCodeTestCase = new OperationsTestCase( + "validatePlanOfCareActivityObservationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_ACTIVITY_OBSERVATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareActivityObservation target) { + + } + + @Override + protected void updateToPass(PlanOfCareActivityObservation target) { + target.init(); + target.setMoodCode(x_ActMoodDocumentObservation.DEF); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareActivityObservationOperations.validatePlanOfCareActivityObservationMoodCode( + (PlanOfCareActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareActivityObservationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PlanOfCareActivityObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public PlanOfCareActivityObservation create() { + return CCDFactory.eINSTANCE.createPlanOfCareActivityObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PlanOfCareActivityObservationOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PlanOfCareActivityObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/PlanOfCareActivityProcedureTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/PlanOfCareActivityProcedureTest.java new file mode 100644 index 000000000..2cce664dd --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/PlanOfCareActivityProcedureTest.java @@ -0,0 +1,247 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareActivityProcedure; +import org.openhealthtools.mdht.uml.cda.ccd.operations.PlanOfCareActivityProcedureOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.vocab.x_DocumentProcedureMood; + +/** + * A static utility class that provides operations + * related to 'Plan Of Care Activity Procedure' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareActivityProcedure#validatePlanOfCareActivityProcedureMoodCodeValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Activity Procedure Mood Code Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareActivityProcedure#validatePlanOfCareActivityProcedureTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Activity Procedure Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareActivityProcedure#validatePlanOfCareActivityProcedureId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Activity Procedure Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareActivityProcedure#validatePlanOfCareActivityProcedureMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Activity Procedure Mood Code}
  • + *
+ *

+ * + * @generated + */ + +public class PlanOfCareActivityProcedureTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidatePlanOfCareActivityProcedureMoodCodeValue() { + OperationsTestCase validatePlanOfCareActivityProcedureMoodCodeValueTestCase = new OperationsTestCase( + "validatePlanOfCareActivityProcedureMoodCodeValue", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_ACTIVITY_PROCEDURE_MOOD_CODE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareActivityProcedure target) { + + } + + @Override + protected void updateToPass(PlanOfCareActivityProcedure target) { + target.init(); + target.setMoodCode(x_DocumentProcedureMood.INT); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareActivityProcedureOperations.validatePlanOfCareActivityProcedureMoodCodeValue( + (PlanOfCareActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareActivityProcedureMoodCodeValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePlanOfCareActivityProcedureTemplateId() { + OperationsTestCase validatePlanOfCareActivityProcedureTemplateIdTestCase = new OperationsTestCase( + "validatePlanOfCareActivityProcedureTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_ACTIVITY_PROCEDURE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareActivityProcedure target) { + + } + + @Override + protected void updateToPass(PlanOfCareActivityProcedure target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareActivityProcedureOperations.validatePlanOfCareActivityProcedureTemplateId( + (PlanOfCareActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareActivityProcedureTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePlanOfCareActivityProcedureId() { + OperationsTestCase validatePlanOfCareActivityProcedureIdTestCase = new OperationsTestCase( + "validatePlanOfCareActivityProcedureId", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_ACTIVITY_PROCEDURE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareActivityProcedure target) { + + } + + @Override + protected void updateToPass(PlanOfCareActivityProcedure target) { + target.init(); + target.getIds().add(DatatypesFactory.eINSTANCE.createII()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareActivityProcedureOperations.validatePlanOfCareActivityProcedureId( + (PlanOfCareActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareActivityProcedureIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePlanOfCareActivityProcedureMoodCode() { + OperationsTestCase validatePlanOfCareActivityProcedureMoodCodeTestCase = new OperationsTestCase( + "validatePlanOfCareActivityProcedureMoodCode", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_ACTIVITY_PROCEDURE_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareActivityProcedure target) { + + } + + @Override + protected void updateToPass(PlanOfCareActivityProcedure target) { + target.init(); + target.setMoodCode(x_DocumentProcedureMood.APT); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareActivityProcedureOperations.validatePlanOfCareActivityProcedureMoodCode( + (PlanOfCareActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareActivityProcedureMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PlanOfCareActivityProcedureOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public PlanOfCareActivityProcedure create() { + return CCDFactory.eINSTANCE.createPlanOfCareActivityProcedure(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PlanOfCareActivityProcedureOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PlanOfCareActivityProcedureOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/PlanOfCareActivitySubstanceAdministrationTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/PlanOfCareActivitySubstanceAdministrationTest.java new file mode 100644 index 000000000..288956e7b --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/PlanOfCareActivitySubstanceAdministrationTest.java @@ -0,0 +1,248 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareActivitySubstanceAdministration; +import org.openhealthtools.mdht.uml.cda.ccd.operations.PlanOfCareActivitySubstanceAdministrationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.vocab.x_DocumentSubstanceMood; + +/** + * A static utility class that provides operations + * related to 'Plan Of Care Activity Substance Administration' + * model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareActivitySubstanceAdministration#validatePlanOfCareActivitySubstanceAdministrationMoodCodeValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Activity Substance Administration Mood Code Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareActivitySubstanceAdministration#validatePlanOfCareActivitySubstanceAdministrationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Activity Substance Administration Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareActivitySubstanceAdministration#validatePlanOfCareActivitySubstanceAdministrationId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Activity Substance Administration Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareActivitySubstanceAdministration#validatePlanOfCareActivitySubstanceAdministrationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Activity Substance Administration Mood Code}
  • + *
+ *

+ * + * @generated + */ + +public class PlanOfCareActivitySubstanceAdministrationTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidatePlanOfCareActivitySubstanceAdministrationMoodCodeValue() { + OperationsTestCase validatePlanOfCareActivitySubstanceAdministrationMoodCodeValueTestCase = new OperationsTestCase( + "validatePlanOfCareActivitySubstanceAdministrationMoodCodeValue", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_ACTIVITY_SUBSTANCE_ADMINISTRATION_MOOD_CODE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareActivitySubstanceAdministration target) { + + } + + @Override + protected void updateToPass(PlanOfCareActivitySubstanceAdministration target) { + target.init(); + target.setMoodCode(x_DocumentSubstanceMood.INT); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareActivitySubstanceAdministrationOperations.validatePlanOfCareActivitySubstanceAdministrationMoodCodeValue( + (PlanOfCareActivitySubstanceAdministration) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareActivitySubstanceAdministrationMoodCodeValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePlanOfCareActivitySubstanceAdministrationTemplateId() { + OperationsTestCase validatePlanOfCareActivitySubstanceAdministrationTemplateIdTestCase = new OperationsTestCase( + "validatePlanOfCareActivitySubstanceAdministrationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_ACTIVITY_SUBSTANCE_ADMINISTRATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareActivitySubstanceAdministration target) { + + } + + @Override + protected void updateToPass(PlanOfCareActivitySubstanceAdministration target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareActivitySubstanceAdministrationOperations.validatePlanOfCareActivitySubstanceAdministrationTemplateId( + (PlanOfCareActivitySubstanceAdministration) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareActivitySubstanceAdministrationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePlanOfCareActivitySubstanceAdministrationId() { + OperationsTestCase validatePlanOfCareActivitySubstanceAdministrationIdTestCase = new OperationsTestCase( + "validatePlanOfCareActivitySubstanceAdministrationId", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_ACTIVITY_SUBSTANCE_ADMINISTRATION_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareActivitySubstanceAdministration target) { + + } + + @Override + protected void updateToPass(PlanOfCareActivitySubstanceAdministration target) { + target.init(); + target.getIds().add(DatatypesFactory.eINSTANCE.createII()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareActivitySubstanceAdministrationOperations.validatePlanOfCareActivitySubstanceAdministrationId( + (PlanOfCareActivitySubstanceAdministration) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareActivitySubstanceAdministrationIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePlanOfCareActivitySubstanceAdministrationMoodCode() { + OperationsTestCase validatePlanOfCareActivitySubstanceAdministrationMoodCodeTestCase = new OperationsTestCase( + "validatePlanOfCareActivitySubstanceAdministrationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_ACTIVITY_SUBSTANCE_ADMINISTRATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareActivitySubstanceAdministration target) { + + } + + @Override + protected void updateToPass(PlanOfCareActivitySubstanceAdministration target) { + target.init(); + + target.setMoodCode(x_DocumentSubstanceMood.EVN); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareActivitySubstanceAdministrationOperations.validatePlanOfCareActivitySubstanceAdministrationMoodCode( + (PlanOfCareActivitySubstanceAdministration) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareActivitySubstanceAdministrationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PlanOfCareActivitySubstanceAdministrationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public PlanOfCareActivitySubstanceAdministration create() { + return CCDFactory.eINSTANCE.createPlanOfCareActivitySubstanceAdministration(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PlanOfCareActivitySubstanceAdministrationOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PlanOfCareActivitySubstanceAdministrationOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/PlanOfCareActivitySupplyTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/PlanOfCareActivitySupplyTest.java new file mode 100644 index 000000000..324956466 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/PlanOfCareActivitySupplyTest.java @@ -0,0 +1,249 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareActivitySupply; +import org.openhealthtools.mdht.uml.cda.ccd.operations.PlanOfCareActivitySupplyOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.vocab.x_DocumentSubstanceMood; + +/** + * A static utility class that provides operations + * related to 'Plan Of Care Activity Supply' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareActivitySupply#validatePlanOfCareActivitySupplyMoodCodeValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Activity Supply Mood Code Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareActivitySupply#validatePlanOfCareActivitySupplyTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Activity Supply Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareActivitySupply#validatePlanOfCareActivitySupplyId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Activity Supply Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareActivitySupply#validatePlanOfCareActivitySupplyMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Activity Supply Mood Code}
  • + *
+ *

+ * + * @generated + */ + +public class PlanOfCareActivitySupplyTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidatePlanOfCareActivitySupplyMoodCodeValue() { + OperationsTestCase validatePlanOfCareActivitySupplyMoodCodeValueTestCase = new OperationsTestCase( + "validatePlanOfCareActivitySupplyMoodCodeValue", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_ACTIVITY_SUPPLY_MOOD_CODE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareActivitySupply target) { + + } + + @Override + protected void updateToPass(PlanOfCareActivitySupply target) { + target.init(); + target.setMoodCode(x_DocumentSubstanceMood.INT); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareActivitySupplyOperations.validatePlanOfCareActivitySupplyMoodCodeValue( + (PlanOfCareActivitySupply) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareActivitySupplyMoodCodeValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePlanOfCareActivitySupplyTemplateId() { + OperationsTestCase validatePlanOfCareActivitySupplyTemplateIdTestCase = new OperationsTestCase( + "validatePlanOfCareActivitySupplyTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_ACTIVITY_SUPPLY_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareActivitySupply target) { + + } + + @Override + protected void updateToPass(PlanOfCareActivitySupply target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareActivitySupplyOperations.validatePlanOfCareActivitySupplyTemplateId( + (PlanOfCareActivitySupply) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareActivitySupplyTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePlanOfCareActivitySupplyId() { + OperationsTestCase validatePlanOfCareActivitySupplyIdTestCase = new OperationsTestCase( + "validatePlanOfCareActivitySupplyId", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_ACTIVITY_SUPPLY_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareActivitySupply target) { + + } + + @Override + protected void updateToPass(PlanOfCareActivitySupply target) { + target.init(); + target.getIds().add(DatatypesFactory.eINSTANCE.createII()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareActivitySupplyOperations.validatePlanOfCareActivitySupplyId( + (PlanOfCareActivitySupply) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareActivitySupplyIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePlanOfCareActivitySupplyMoodCode() { + OperationsTestCase validatePlanOfCareActivitySupplyMoodCodeTestCase = new OperationsTestCase( + "validatePlanOfCareActivitySupplyMoodCode", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_ACTIVITY_SUPPLY_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareActivitySupply target) { + + } + + @Override + protected void updateToPass(PlanOfCareActivitySupply target) { + target.init(); + target.setMoodCode(x_DocumentSubstanceMood.EVN); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareActivitySupplyOperations.validatePlanOfCareActivitySupplyMoodCode( + (PlanOfCareActivitySupply) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareActivitySupplyMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PlanOfCareActivitySupplyOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public PlanOfCareActivitySupply create() { + return CCDFactory.eINSTANCE.createPlanOfCareActivitySupply(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PlanOfCareActivitySupplyOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PlanOfCareActivitySupplyOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/PlanOfCareActivityTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/PlanOfCareActivityTest.java new file mode 100644 index 000000000..c7bcb1009 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/PlanOfCareActivityTest.java @@ -0,0 +1,45 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Plan Of Care Activity' model objects. + * + * + * @generated + */ + +public class PlanOfCareActivityTest extends CDAValidationTest { + + /** + * No Operations Test + * @generated + */ + @Test + public void testNoOperations() { + } + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PlanOfCareActivityOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/PlanOfCareSectionTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/PlanOfCareSectionTest.java new file mode 100644 index 000000000..ca41e8ffa --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/PlanOfCareSectionTest.java @@ -0,0 +1,556 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareSection; +import org.openhealthtools.mdht.uml.cda.ccd.operations.PlanOfCareSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * A static utility class that provides operations + * related to 'Plan Of Care Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareSection#validatePlanOfCareSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareSection#validatePlanOfCareSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareSection#validatePlanOfCareSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareSection#validatePlanOfCareSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareSection#validatePlanOfCareSectionPlanOfCareActivityAct(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Section Plan Of Care Activity Act}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareSection#validatePlanOfCareSectionPlanOfCareActivityEncounter(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Section Plan Of Care Activity Encounter}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareSection#validatePlanOfCareSectionPlanOfCareActivityObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Section Plan Of Care Activity Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareSection#validatePlanOfCareSectionPlanOfCareActivityProcedure(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Section Plan Of Care Activity Procedure}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareSection#validatePlanOfCareSectionPlanOfCareActivitySubstanceAdministration(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Section Plan Of Care Activity Substance Administration}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareSection#validatePlanOfCareSectionPlanOfCareActivitySupply(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Section Plan Of Care Activity Supply}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareSection#getPlanOfCareActivities() Get Plan Of Care Activities}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareSection#getPlanOfCareActivityAct() Get Plan Of Care Activity Act}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareSection#getPlanOfCareActivityEncounter() Get Plan Of Care Activity Encounter}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareSection#getPlanOfCareActivityObservation() Get Plan Of Care Activity Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareSection#getPlanOfCareActivityProcedure() Get Plan Of Care Activity Procedure}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareSection#getPlanOfCareActivitySubstanceAdministration() Get Plan Of Care Activity Substance Administration}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareSection#getPlanOfCareActivitySupply() Get Plan Of Care Activity Supply}
  • + *
+ *

+ * + * @generated + */ + +public class PlanOfCareSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidatePlanOfCareSectionTemplateId() { + OperationsTestCase validatePlanOfCareSectionTemplateIdTestCase = new OperationsTestCase( + "validatePlanOfCareSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareSection target) { + + } + + @Override + protected void updateToPass(PlanOfCareSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareSectionOperations.validatePlanOfCareSectionTemplateId( + (PlanOfCareSection) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePlanOfCareSectionCode() { + OperationsTestCase validatePlanOfCareSectionCodeTestCase = new OperationsTestCase( + "validatePlanOfCareSectionCode", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareSection target) { + + } + + @Override + protected void updateToPass(PlanOfCareSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareSectionOperations.validatePlanOfCareSectionCode( + (PlanOfCareSection) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePlanOfCareSectionTitle() { + OperationsTestCase validatePlanOfCareSectionTitleTestCase = new OperationsTestCase( + "validatePlanOfCareSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareSection target) { + + } + + @Override + protected void updateToPass(PlanOfCareSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareSectionOperations.validatePlanOfCareSectionTitle( + (PlanOfCareSection) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePlanOfCareSectionText() { + OperationsTestCase validatePlanOfCareSectionTextTestCase = new OperationsTestCase( + "validatePlanOfCareSectionText", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareSection target) { + + } + + @Override + protected void updateToPass(PlanOfCareSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareSectionOperations.validatePlanOfCareSectionText( + (PlanOfCareSection) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePlanOfCareSectionPlanOfCareActivityAct() { + OperationsTestCase validatePlanOfCareSectionPlanOfCareActivityActTestCase = new OperationsTestCase( + "validatePlanOfCareSectionPlanOfCareActivityAct", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_SECTION_PLAN_OF_CARE_ACTIVITY_ACT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareSection target) { + + } + + @Override + protected void updateToPass(PlanOfCareSection target) { + target.init(); + target.addAct(CCDFactory.eINSTANCE.createPlanOfCareActivityAct()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareSectionOperations.validatePlanOfCareSectionPlanOfCareActivityAct( + (PlanOfCareSection) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareSectionPlanOfCareActivityActTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePlanOfCareSectionPlanOfCareActivityEncounter() { + OperationsTestCase validatePlanOfCareSectionPlanOfCareActivityEncounterTestCase = new OperationsTestCase( + "validatePlanOfCareSectionPlanOfCareActivityEncounter", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_SECTION_PLAN_OF_CARE_ACTIVITY_ENCOUNTER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareSection target) { + + } + + @Override + protected void updateToPass(PlanOfCareSection target) { + target.init(); + target.addEncounter(CCDFactory.eINSTANCE.createPlanOfCareActivityEncounter()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareSectionOperations.validatePlanOfCareSectionPlanOfCareActivityEncounter( + (PlanOfCareSection) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareSectionPlanOfCareActivityEncounterTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePlanOfCareSectionPlanOfCareActivityObservation() { + OperationsTestCase validatePlanOfCareSectionPlanOfCareActivityObservationTestCase = new OperationsTestCase( + "validatePlanOfCareSectionPlanOfCareActivityObservation", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_SECTION_PLAN_OF_CARE_ACTIVITY_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareSection target) { + + } + + @Override + protected void updateToPass(PlanOfCareSection target) { + target.init(); + target.addObservation(CCDFactory.eINSTANCE.createPlanOfCareActivityObservation()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareSectionOperations.validatePlanOfCareSectionPlanOfCareActivityObservation( + (PlanOfCareSection) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareSectionPlanOfCareActivityObservationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePlanOfCareSectionPlanOfCareActivityProcedure() { + OperationsTestCase validatePlanOfCareSectionPlanOfCareActivityProcedureTestCase = new OperationsTestCase( + "validatePlanOfCareSectionPlanOfCareActivityProcedure", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_SECTION_PLAN_OF_CARE_ACTIVITY_PROCEDURE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareSection target) { + + } + + @Override + protected void updateToPass(PlanOfCareSection target) { + target.init(); + target.addProcedure(CCDFactory.eINSTANCE.createPlanOfCareActivityProcedure()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareSectionOperations.validatePlanOfCareSectionPlanOfCareActivityProcedure( + (PlanOfCareSection) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareSectionPlanOfCareActivityProcedureTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePlanOfCareSectionPlanOfCareActivitySubstanceAdministration() { + OperationsTestCase validatePlanOfCareSectionPlanOfCareActivitySubstanceAdministrationTestCase = new OperationsTestCase( + "validatePlanOfCareSectionPlanOfCareActivitySubstanceAdministration", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_SECTION_PLAN_OF_CARE_ACTIVITY_SUBSTANCE_ADMINISTRATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareSection target) { + + } + + @Override + protected void updateToPass(PlanOfCareSection target) { + target.init(); + target.addSubstanceAdministration(CCDFactory.eINSTANCE.createPlanOfCareActivitySubstanceAdministration()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareSectionOperations.validatePlanOfCareSectionPlanOfCareActivitySubstanceAdministration( + (PlanOfCareSection) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareSectionPlanOfCareActivitySubstanceAdministrationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePlanOfCareSectionPlanOfCareActivitySupply() { + OperationsTestCase validatePlanOfCareSectionPlanOfCareActivitySupplyTestCase = new OperationsTestCase( + "validatePlanOfCareSectionPlanOfCareActivitySupply", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_SECTION_PLAN_OF_CARE_ACTIVITY_SUPPLY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareSection target) { + + } + + @Override + protected void updateToPass(PlanOfCareSection target) { + target.init(); + target.addSupply(CCDFactory.eINSTANCE.createPlanOfCareActivitySupply()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareSectionOperations.validatePlanOfCareSectionPlanOfCareActivitySupply( + (PlanOfCareSection) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareSectionPlanOfCareActivitySupplyTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetPlanOfCareActivities() { + + PlanOfCareSection target = objectFactory.create(); + target.getPlanOfCareActivities(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPlanOfCareActivityAct() { + + PlanOfCareSection target = objectFactory.create(); + target.getPlanOfCareActivityAct(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPlanOfCareActivityEncounter() { + + PlanOfCareSection target = objectFactory.create(); + target.getPlanOfCareActivityEncounter(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPlanOfCareActivityObservation() { + + PlanOfCareSection target = objectFactory.create(); + target.getPlanOfCareActivityObservation(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPlanOfCareActivityProcedure() { + + PlanOfCareSection target = objectFactory.create(); + target.getPlanOfCareActivityProcedure(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPlanOfCareActivitySubstanceAdministration() { + + PlanOfCareSection target = objectFactory.create(); + target.getPlanOfCareActivitySubstanceAdministration(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPlanOfCareActivitySupply() { + + PlanOfCareSection target = objectFactory.create(); + target.getPlanOfCareActivitySupply(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PlanOfCareSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public PlanOfCareSection create() { + return CCDFactory.eINSTANCE.createPlanOfCareSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PlanOfCareSectionOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PlanOfCareSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/PolicyActivityTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/PolicyActivityTest.java new file mode 100644 index 000000000..2b12c6a02 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/PolicyActivityTest.java @@ -0,0 +1,748 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.Participant2; +import org.openhealthtools.mdht.uml.cda.ParticipantRole; +import org.openhealthtools.mdht.uml.cda.Performer2; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.PolicyActivity; +import org.openhealthtools.mdht.uml.cda.ccd.operations.PolicyActivityOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.vocab.ParticipationPhysicalPerformer; +import org.openhealthtools.mdht.uml.hl7.vocab.ParticipationType; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * A static utility class that provides operations + * related to 'Policy Activity' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.PolicyActivity#validatePolicyActivityPayerEntityIsRequired(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Policy Activity Payer Entity Is Required}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.PolicyActivity#validatePolicyActivityCoveredPartyIsRequired(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Policy Activity Covered Party Is Required}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.PolicyActivity#validatePolicyActivityCoveredPartyTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Policy Activity Covered Party Time}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.PolicyActivity#validatePolicyActivitySubscriberIsAllowed(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Policy Activity Subscriber Is Allowed}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.PolicyActivity#validatePolicyActivitySubscriberTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Policy Activity Subscriber Time}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.PolicyActivity#validatePolicyActivityEntryRelationshipREFR(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Policy Activity Entry Relationship REFR}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.PolicyActivity#validatePolicyActivityEntryRelationshipTarget(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Policy Activity Entry Relationship Target}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.PolicyActivity#validatePolicyActivityTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Policy Activity Template Id}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.PolicyActivity#validatePolicyActivityClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Policy Activity Class Code}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.PolicyActivity#validatePolicyActivityMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Policy Activity Mood Code}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.PolicyActivity#validatePolicyActivityId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Policy Activity Id}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.PolicyActivity#validatePolicyActivityStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Policy Activity Status Code}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.PolicyActivity#validatePolicyActivityPayerEntity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Policy Activity Payer Entity}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.PolicyActivity#validatePolicyActivityCoveredParty(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Policy Activity Covered Party}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.PolicyActivity#validatePolicyActivitySubscriber(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Policy Activity Subscriber}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.PolicyActivity#getPayerEntity() + * Get Payer Entity}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.PolicyActivity#getCoveredParty() + * Get Covered Party}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.PolicyActivity#getSubscriber() + * Get Subscriber}
  • + *
+ *

+ * + * @generated + */ + +public class PolicyActivityTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidatePolicyActivityPayerEntityIsRequired() { + OperationsTestCase validatePolicyActivityPayerEntityIsRequiredTestCase = new OperationsTestCase( + "validatePolicyActivityPayerEntityIsRequired", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_PAYER_ENTITY_IS_REQUIRED__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + Performer2 p2 = CDAFactory.eINSTANCE.createPerformer2(); + p2.setTypeCode(ParticipationPhysicalPerformer.PRF); + target.getPerformers().add(p2); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityPayerEntityIsRequired( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityPayerEntityIsRequiredTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePolicyActivityCoveredPartyIsRequired() { + OperationsTestCase validatePolicyActivityCoveredPartyIsRequiredTestCase = new OperationsTestCase( + "validatePolicyActivityCoveredPartyIsRequired", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_COVERED_PARTY_IS_REQUIRED__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + Participant2 p2 = CDAFactory.eINSTANCE.createParticipant2(); + p2.setTypeCode(ParticipationType.COV); + target.getParticipants().add(p2); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityCoveredPartyIsRequired( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityCoveredPartyIsRequiredTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePolicyActivityCoveredPartyTime() { + OperationsTestCase validatePolicyActivityCoveredPartyTimeTestCase = new OperationsTestCase( + "validatePolicyActivityCoveredPartyTime", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_COVERED_PARTY_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + Participant2 p2 = CDAFactory.eINSTANCE.createParticipant2(); + p2.setTypeCode(ParticipationType.COV); + p2.setTime(DatatypesFactory.eINSTANCE.createIVL_TS()); + target.getParticipants().add(p2); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityCoveredPartyTime( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityCoveredPartyTimeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePolicyActivitySubscriberIsAllowed() { + OperationsTestCase validatePolicyActivitySubscriberIsAllowedTestCase = new OperationsTestCase( + "validatePolicyActivitySubscriberIsAllowed", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_SUBSCRIBER_IS_ALLOWED__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + Participant2 p2 = CDAFactory.eINSTANCE.createParticipant2(); + p2.setTypeCode(ParticipationType.HLD); + target.getParticipants().add(p2); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivitySubscriberIsAllowed( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivitySubscriberIsAllowedTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePolicyActivitySubscriberTime() { + OperationsTestCase validatePolicyActivitySubscriberTimeTestCase = new OperationsTestCase( + "validatePolicyActivitySubscriberTime", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_SUBSCRIBER_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + Participant2 p2 = CDAFactory.eINSTANCE.createParticipant2(); + p2.setTypeCode(ParticipationType.HLD); + p2.setTime(DatatypesFactory.eINSTANCE.createIVL_TS()); + target.getParticipants().add(p2); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivitySubscriberTime( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivitySubscriberTimeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePolicyActivityEntryRelationshipREFR() { + OperationsTestCase validatePolicyActivityEntryRelationshipREFRTestCase = new OperationsTestCase( + "validatePolicyActivityEntryRelationshipREFR", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_ENTRY_RELATIONSHIP_REFR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + target.getEntryRelationships().add(er); + } + + @Override + protected void updateToPass(PolicyActivity target) { + + target.init(); + target.getEntryRelationships().clear(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.REFR); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityEntryRelationshipREFR( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityEntryRelationshipREFRTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePolicyActivityEntryRelationshipTarget() { + OperationsTestCase validatePolicyActivityEntryRelationshipTargetTestCase = new OperationsTestCase( + "validatePolicyActivityEntryRelationshipTarget", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_ENTRY_RELATIONSHIP_TARGET__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setAct(CCDFactory.eINSTANCE.createProblemAct()); + target.getEntryRelationships().add(er); + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + target.getEntryRelationships().clear(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setAct(CCDFactory.eINSTANCE.createAuthorizationActivity()); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityEntryRelationshipTarget( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityEntryRelationshipTargetTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePolicyActivityTemplateId() { + OperationsTestCase validatePolicyActivityTemplateIdTestCase = new OperationsTestCase( + "validatePolicyActivityTemplateId", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityTemplateId( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePolicyActivityClassCode() { + OperationsTestCase validatePolicyActivityClassCodeTestCase = new OperationsTestCase( + "validatePolicyActivityClassCode", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityClassCode( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePolicyActivityMoodCode() { + OperationsTestCase validatePolicyActivityMoodCodeTestCase = new OperationsTestCase( + "validatePolicyActivityMoodCode", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityMoodCode( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePolicyActivityId() { + OperationsTestCase validatePolicyActivityIdTestCase = new OperationsTestCase( + "validatePolicyActivityId", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + target.getIds().add(DatatypesFactory.eINSTANCE.createII()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityId( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePolicyActivityStatusCode() { + OperationsTestCase validatePolicyActivityStatusCodeTestCase = new OperationsTestCase( + "validatePolicyActivityStatusCode", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityStatusCode( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePolicyActivityPayerEntity() { + OperationsTestCase validatePolicyActivityPayerEntityTestCase = new OperationsTestCase( + "validatePolicyActivityPayerEntity", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_PAYER_ENTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + Performer2 p2 = CDAFactory.eINSTANCE.createPerformer2(); + p2.setAssignedEntity(CDAFactory.eINSTANCE.createAssignedEntity()); + target.getPerformers().add(p2); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityPayerEntity( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityPayerEntityTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePolicyActivityCoveredParty() { + OperationsTestCase validatePolicyActivityCoveredPartyTestCase = new OperationsTestCase( + "validatePolicyActivityCoveredParty", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_COVERED_PARTY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + Participant2 p2 = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + p2.setParticipantRole(pr); + target.getParticipants().add(p2); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityCoveredParty( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityCoveredPartyTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePolicyActivitySubscriber() { + OperationsTestCase validatePolicyActivitySubscriberTestCase = new OperationsTestCase( + "validatePolicyActivitySubscriber", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_SUBSCRIBER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + Participant2 p2 = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + p2.setParticipantRole(pr); + target.getParticipants().add(p2); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivitySubscriber( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivitySubscriberTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetPayerEntity() { + + PolicyActivity target = objectFactory.create(); + target.getPayerEntity(); + + } + + /** + * + * @generated + */ + @Test + public void testGetCoveredParty() { + + PolicyActivity target = objectFactory.create(); + target.getCoveredParty(); + + } + + /** + * + * @generated + */ + @Test + public void testGetSubscriber() { + + PolicyActivity target = objectFactory.create(); + target.getSubscriber(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PolicyActivityOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public PolicyActivity create() { + return CCDFactory.eINSTANCE.createPolicyActivity(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PolicyActivityOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PolicyActivityOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/PolicySubscriberTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/PolicySubscriberTest.java new file mode 100644 index 000000000..c05b70ec6 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/PolicySubscriberTest.java @@ -0,0 +1,141 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.PolicySubscriber; +import org.openhealthtools.mdht.uml.cda.ccd.operations.PolicySubscriberOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; + +/** + * A static utility class that provides operations + * related to 'Policy Subscriber' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PolicySubscriber#validatePolicySubscriberId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Subscriber Id}
  • + *
+ *

+ * + * @generated + */ + +public class PolicySubscriberTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidatePolicySubscriberId() { + OperationsTestCase validatePolicySubscriberIdTestCase = new OperationsTestCase( + "validatePolicySubscriberId", + operationsForOCL.getOCLValue("VALIDATE_POLICY_SUBSCRIBER_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicySubscriber target) { + + } + + @Override + protected void updateToPass(PolicySubscriber target) { + target.init(); + target.getIds().add(DatatypesFactory.eINSTANCE.createII()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicySubscriberOperations.validatePolicySubscriberId( + (PolicySubscriber) objectToTest, diagnostician, map); + } + + }; + + validatePolicySubscriberIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PolicySubscriberOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public PolicySubscriber create() { + return CCDFactory.eINSTANCE.createPolicySubscriber(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PolicySubscriberOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PolicySubscriberOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ProblemActTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ProblemActTest.java new file mode 100644 index 000000000..6ec3d18fc --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ProblemActTest.java @@ -0,0 +1,568 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.EpisodeObservation; +import org.openhealthtools.mdht.uml.cda.ccd.PatientAwareness; +import org.openhealthtools.mdht.uml.cda.ccd.ProblemAct; +import org.openhealthtools.mdht.uml.cda.ccd.operations.ProblemActOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * A static utility class that provides operations + * related to 'Problem Act' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProblemAct#validateProblemActEntryRelationshipRequired(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Act Entry Relationship Required}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProblemAct#validateProblemActSubjectOfTarget(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Act Subject Of Target}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProblemAct#validateProblemActContainsProblemObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Act Contains Problem Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProblemAct#validateProblemActContainsAlertObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Act Contains Alert Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProblemAct#validateProblemActContainsPatientAwareness(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Act Contains Patient Awareness}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProblemAct#validateProblemActTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Act Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProblemAct#validateProblemActClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Act Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProblemAct#validateProblemActMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Act Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProblemAct#validateProblemActId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Act Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProblemAct#validateProblemActCodeNullFlavor(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Act Code Null Flavor}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProblemAct#validateProblemActEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Act Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProblemAct#validateProblemActEpisodeObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Act Episode Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProblemAct#getEpisodeObservation() Get Episode Observation}
  • + *
+ *

+ * + * @generated + */ + +public class ProblemActTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateProblemActEntryRelationshipRequired() { + OperationsTestCase validateProblemActEntryRelationshipRequiredTestCase = new OperationsTestCase( + "validateProblemActEntryRelationshipRequired", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_ACT_ENTRY_RELATIONSHIP_REQUIRED__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemAct target) { + + } + + @Override + protected void updateToPass(ProblemAct target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemActOperations.validateProblemActEntryRelationshipRequired( + (ProblemAct) objectToTest, diagnostician, map); + } + + }; + + validateProblemActEntryRelationshipRequiredTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProblemActSubjectOfTarget() { + OperationsTestCase validateProblemActSubjectOfTargetTestCase = new OperationsTestCase( + "validateProblemActSubjectOfTarget", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_ACT_SUBJECT_OF_TARGET__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemAct target) { + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + er.setObservation(CCDFactory.eINSTANCE.createEpisodeObservation()); + target.getEntryRelationships().add(er); + } + + @Override + protected void updateToPass(ProblemAct target) { + target.init(); + target.getEntryRelationships().clear(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + er.setObservation(CCDFactory.eINSTANCE.createProblemObservation()); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemActOperations.validateProblemActSubjectOfTarget( + (ProblemAct) objectToTest, diagnostician, map); + } + + }; + + validateProblemActSubjectOfTargetTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProblemActContainsProblemObservation() { + OperationsTestCase validateProblemActContainsProblemObservationTestCase = new OperationsTestCase( + "validateProblemActContainsProblemObservation", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_ACT_CONTAINS_PROBLEM_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemAct target) { + + } + + @Override + protected void updateToPass(ProblemAct target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + er.setObservation(CCDFactory.eINSTANCE.createProblemObservation()); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemActOperations.validateProblemActContainsProblemObservation( + (ProblemAct) objectToTest, diagnostician, map); + } + + }; + + validateProblemActContainsProblemObservationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProblemActContainsAlertObservation() { + OperationsTestCase validateProblemActContainsAlertObservationTestCase = new OperationsTestCase( + "validateProblemActContainsAlertObservation", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_ACT_CONTAINS_ALERT_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemAct target) { + + } + + @Override + protected void updateToPass(ProblemAct target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + er.setObservation(CCDFactory.eINSTANCE.createAlertObservation()); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemActOperations.validateProblemActContainsAlertObservation( + (ProblemAct) objectToTest, diagnostician, map); + } + + }; + + validateProblemActContainsAlertObservationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProblemActContainsPatientAwareness() { + OperationsTestCase validateProblemActContainsPatientAwarenessTestCase = new OperationsTestCase( + "validateProblemActContainsPatientAwareness", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_ACT_CONTAINS_PATIENT_AWARENESS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemAct target) { + + } + + @Override + protected void updateToPass(ProblemAct target) { + target.init(); + PatientAwareness p2 = CCDFactory.eINSTANCE.createPatientAwareness(); + target.getParticipants().add(p2); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemActOperations.validateProblemActContainsPatientAwareness( + (ProblemAct) objectToTest, diagnostician, map); + } + + }; + + validateProblemActContainsPatientAwarenessTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProblemActTemplateId() { + OperationsTestCase validateProblemActTemplateIdTestCase = new OperationsTestCase( + "validateProblemActTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_ACT_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemAct target) { + + } + + @Override + protected void updateToPass(ProblemAct target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemActOperations.validateProblemActTemplateId((ProblemAct) objectToTest, diagnostician, map); + } + + }; + + validateProblemActTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProblemActClassCode() { + OperationsTestCase validateProblemActClassCodeTestCase = new OperationsTestCase( + "validateProblemActClassCode", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_ACT_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemAct target) { + + } + + @Override + protected void updateToPass(ProblemAct target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemActOperations.validateProblemActClassCode((ProblemAct) objectToTest, diagnostician, map); + } + + }; + + validateProblemActClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProblemActMoodCode() { + OperationsTestCase validateProblemActMoodCodeTestCase = new OperationsTestCase( + "validateProblemActMoodCode", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_ACT_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemAct target) { + + } + + @Override + protected void updateToPass(ProblemAct target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemActOperations.validateProblemActMoodCode((ProblemAct) objectToTest, diagnostician, map); + } + + }; + + validateProblemActMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProblemActId() { + OperationsTestCase validateProblemActIdTestCase = new OperationsTestCase( + "validateProblemActId", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_ACT_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(ProblemAct target) { + + } + + @Override + protected void updateToPass(ProblemAct target) { + target.init(); + + II id = DatatypesFactory.eINSTANCE.createII(); + target.getIds().add(id); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemActOperations.validateProblemActId((ProblemAct) objectToTest, diagnostician, map); + } + + }; + + validateProblemActIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProblemActCodeNullFlavor() { + OperationsTestCase validateProblemActCodeNullFlavorTestCase = new OperationsTestCase( + "validateProblemActCodeNullFlavor", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_ACT_CODE_NULL_FLAVOR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemAct target) { + + } + + @Override + protected void updateToPass(ProblemAct target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemActOperations.validateProblemActCodeNullFlavor( + (ProblemAct) objectToTest, diagnostician, map); + } + + }; + + validateProblemActCodeNullFlavorTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProblemActEffectiveTime() { + OperationsTestCase validateProblemActEffectiveTimeTestCase = new OperationsTestCase( + "validateProblemActEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_ACT_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemAct target) { + + } + + @Override + protected void updateToPass(ProblemAct target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemActOperations.validateProblemActEffectiveTime( + (ProblemAct) objectToTest, diagnostician, map); + } + + }; + + validateProblemActEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProblemActEpisodeObservation() { + OperationsTestCase validateProblemActEpisodeObservationTestCase = new OperationsTestCase( + "validateProblemActEpisodeObservation", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_ACT_EPISODE_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemAct target) { + + } + + @Override + protected void updateToPass(ProblemAct target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + EpisodeObservation eo = CCDFactory.eINSTANCE.createEpisodeObservation(); + er.setObservation(eo); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemActOperations.validateProblemActEpisodeObservation( + (ProblemAct) objectToTest, diagnostician, map); + } + + }; + + validateProblemActEpisodeObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetEpisodeObservation() { + + ProblemAct target = objectFactory.create(); + target.getEpisodeObservation(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ProblemActOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ProblemAct create() { + return CCDFactory.eINSTANCE.createProblemAct(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ProblemActOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ProblemActOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ProblemHealthStatusObservationTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ProblemHealthStatusObservationTest.java new file mode 100644 index 000000000..341504b45 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ProblemHealthStatusObservationTest.java @@ -0,0 +1,220 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.ProblemHealthStatusObservation; +import org.openhealthtools.mdht.uml.cda.ccd.operations.ProblemHealthStatusObservationOperations; +import org.openhealthtools.mdht.uml.cda.ccd.operations.StatusObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; + +/** + * A static utility class that provides operations + * related to 'Problem Health Status Observation' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProblemHealthStatusObservation#validateProblemHealthStatusObservationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Health Status Observation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProblemHealthStatusObservation#validateStatusObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Status Observation Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class ProblemHealthStatusObservationTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateProblemHealthStatusObservationCode() { + OperationsTestCase validateProblemHealthStatusObservationCodeTestCase = new OperationsTestCase( + "validateProblemHealthStatusObservationCode", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_HEALTH_STATUS_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemHealthStatusObservation target) { + + } + + @Override + protected void updateToPass(ProblemHealthStatusObservation target) { + target.init(); + + CD cd = DatatypesFactory.eINSTANCE.createCD(); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemHealthStatusObservationOperations.validateProblemHealthStatusObservationCode( + (ProblemHealthStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateProblemHealthStatusObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateStatusObservationTemplateId() { + OperationsTestCase validateStatusObservationTemplateIdTestCase = new OperationsTestCase( + "validateStatusObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_STATUS_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemHealthStatusObservation target) { + + } + + @Override + protected void updateToPass(ProblemHealthStatusObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemHealthStatusObservationOperations.validateStatusObservationTemplateId( + (ProblemHealthStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateStatusObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateStatusObservationCode() { + OperationsTestCase validateStatusObservationCodeTestCase = new OperationsTestCase( + "validateStatusObservationCode", + operationsForOCL.getOCLValue("VALIDATE_STATUS_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemHealthStatusObservation target) { + + } + + @Override + protected void updateToPass(ProblemHealthStatusObservation target) { + target.init(); + + CD cd = DatatypesFactory.eINSTANCE.createCD(); + cd.setCode("11323-3"); + cd.setCodeSystem("2.16.840.1.113883.6.1"); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return StatusObservationOperations.validateStatusObservationCode( + (ProblemHealthStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateStatusObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ProblemHealthStatusObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ProblemHealthStatusObservation create() { + return CCDFactory.eINSTANCE.createProblemHealthStatusObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ProblemHealthStatusObservationOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ProblemHealthStatusObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ProblemObservationTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ProblemObservationTest.java new file mode 100644 index 000000000..d9c850e71 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ProblemObservationTest.java @@ -0,0 +1,490 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.Informant12; +import org.openhealthtools.mdht.uml.cda.ccd.AgeObservation; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.ProblemHealthStatusObservation; +import org.openhealthtools.mdht.uml.cda.ccd.ProblemObservation; +import org.openhealthtools.mdht.uml.cda.ccd.ProblemStatusObservation; +import org.openhealthtools.mdht.uml.cda.ccd.operations.ProblemObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * A static utility class that provides operations + * related to 'Problem Observation' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProblemObservation#validateProblemObservationInformationSource(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Observation Information Source}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProblemObservation#validateProblemObservationContainsPatientAwareness(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Observation Contains Patient Awareness}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProblemObservation#validateProblemObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Observation Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProblemObservation#validateProblemObservationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Observation Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProblemObservation#validateProblemObservationStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Observation Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProblemObservation#validateProblemObservationEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Observation Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProblemObservation#validateProblemObservationProblemStatus(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Observation Problem Status}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProblemObservation#validateProblemObservationProblemHealthStatus(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Observation Problem Health Status}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProblemObservation#validateProblemObservationAgeObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Observation Age Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProblemObservation#getProblemStatus() Get Problem Status}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProblemObservation#getProblemHealthStatus() Get Problem Health Status}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProblemObservation#getAgeObservation() Get Age Observation}
  • + *
+ *

+ * + * @generated + */ + +public class ProblemObservationTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateProblemObservationInformationSource() { + OperationsTestCase validateProblemObservationInformationSourceTestCase = new OperationsTestCase( + "validateProblemObservationInformationSource", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_OBSERVATION_INFORMATION_SOURCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemObservation target) { + + } + + @Override + protected void updateToPass(ProblemObservation target) { + target.init(); + + Informant12 inf = CDAFactory.eINSTANCE.createInformant12(); + target.getInformants().add(inf); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemObservationOperations.validateProblemObservationInformationSource( + (ProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateProblemObservationInformationSourceTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProblemObservationContainsPatientAwareness() { + OperationsTestCase validateProblemObservationContainsPatientAwarenessTestCase = new OperationsTestCase( + "validateProblemObservationContainsPatientAwareness", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_OBSERVATION_CONTAINS_PATIENT_AWARENESS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemObservation target) { + + } + + @Override + protected void updateToPass(ProblemObservation target) { + target.init(); + target.getParticipants().add(CCDFactory.eINSTANCE.createPatientAwareness()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemObservationOperations.validateProblemObservationContainsPatientAwareness( + (ProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateProblemObservationContainsPatientAwarenessTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProblemObservationTemplateId() { + OperationsTestCase validateProblemObservationTemplateIdTestCase = new OperationsTestCase( + "validateProblemObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemObservation target) { + + } + + @Override + protected void updateToPass(ProblemObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemObservationOperations.validateProblemObservationTemplateId( + (ProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateProblemObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProblemObservationMoodCode() { + OperationsTestCase validateProblemObservationMoodCodeTestCase = new OperationsTestCase( + "validateProblemObservationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_OBSERVATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemObservation target) { + + } + + @Override + protected void updateToPass(ProblemObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemObservationOperations.validateProblemObservationMoodCode( + (ProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateProblemObservationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProblemObservationStatusCode() { + OperationsTestCase validateProblemObservationStatusCodeTestCase = new OperationsTestCase( + "validateProblemObservationStatusCode", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_OBSERVATION_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemObservation target) { + + } + + @Override + protected void updateToPass(ProblemObservation target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemObservationOperations.validateProblemObservationStatusCode( + (ProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateProblemObservationStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProblemObservationEffectiveTime() { + OperationsTestCase validateProblemObservationEffectiveTimeTestCase = new OperationsTestCase( + "validateProblemObservationEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_OBSERVATION_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemObservation target) { + + } + + @Override + protected void updateToPass(ProblemObservation target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemObservationOperations.validateProblemObservationEffectiveTime( + (ProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateProblemObservationEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProblemObservationProblemStatus() { + OperationsTestCase validateProblemObservationProblemStatusTestCase = new OperationsTestCase( + "validateProblemObservationProblemStatus", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_OBSERVATION_PROBLEM_STATUS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemObservation target) { + + } + + @Override + protected void updateToPass(ProblemObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + ProblemStatusObservation obs = CCDFactory.eINSTANCE.createProblemStatusObservation(); + er.setTypeCode(x_ActRelationshipEntryRelationship.REFR); + er.setObservation(obs); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemObservationOperations.validateProblemObservationProblemStatus( + (ProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateProblemObservationProblemStatusTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProblemObservationProblemHealthStatus() { + OperationsTestCase validateProblemObservationProblemHealthStatusTestCase = new OperationsTestCase( + "validateProblemObservationProblemHealthStatus", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_OBSERVATION_PROBLEM_HEALTH_STATUS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemObservation target) { + + } + + @Override + protected void updateToPass(ProblemObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + ProblemHealthStatusObservation obs = CCDFactory.eINSTANCE.createProblemHealthStatusObservation(); + er.setTypeCode(x_ActRelationshipEntryRelationship.REFR); + er.setObservation(obs); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemObservationOperations.validateProblemObservationProblemHealthStatus( + (ProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateProblemObservationProblemHealthStatusTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProblemObservationAgeObservation() { + OperationsTestCase validateProblemObservationAgeObservationTestCase = new OperationsTestCase( + "validateProblemObservationAgeObservation", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_OBSERVATION_AGE_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemObservation target) { + + } + + @Override + protected void updateToPass(ProblemObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + AgeObservation obs = CCDFactory.eINSTANCE.createAgeObservation(); + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + er.setObservation(obs); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemObservationOperations.validateProblemObservationAgeObservation( + (ProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateProblemObservationAgeObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemStatus() { + + ProblemObservation target = objectFactory.create(); + target.getProblemStatus(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProblemHealthStatus() { + + ProblemObservation target = objectFactory.create(); + target.getProblemHealthStatus(); + + } + + /** + * + * @generated + */ + @Test + public void testGetAgeObservation() { + + ProblemObservation target = objectFactory.create(); + target.getAgeObservation(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ProblemObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ProblemObservation create() { + return CCDFactory.eINSTANCE.createProblemObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ProblemObservationOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ProblemObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ProblemSectionTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ProblemSectionTest.java new file mode 100644 index 000000000..34c7bed77 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ProblemSectionTest.java @@ -0,0 +1,318 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.ProblemSection; +import org.openhealthtools.mdht.uml.cda.ccd.operations.ProblemSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * A static utility class that provides operations + * related to 'Problem Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.ProblemSection#validateProblemSectionTitleValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Problem Section Title Value}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.ProblemSection#validateProblemSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Problem Section Template Id}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.ProblemSection#validateProblemSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Problem Section Code}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.ProblemSection#validateProblemSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Problem Section Title}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.ProblemSection#validateProblemSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Problem Section Text}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.ProblemSection#validateProblemSectionProblemAct(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Problem Section Problem Act}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.ProblemSection#getProblemActs() + * Get Problem Acts}
  • + *
+ *

+ * + * @generated + */ + +public class ProblemSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateProblemSectionTemplateId() { + OperationsTestCase validateProblemSectionTemplateIdTestCase = new OperationsTestCase( + "validateProblemSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemSection target) { + + } + + @Override + protected void updateToPass(ProblemSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemSectionOperations.validateProblemSectionTemplateId( + (ProblemSection) objectToTest, diagnostician, map); + } + + }; + + validateProblemSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProblemSectionCode() { + OperationsTestCase validateProblemSectionCodeTestCase = new OperationsTestCase( + "validateProblemSectionCode", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemSection target) { + + } + + @Override + protected void updateToPass(ProblemSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemSectionOperations.validateProblemSectionCode( + (ProblemSection) objectToTest, diagnostician, map); + } + + }; + + validateProblemSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProblemSectionTitle() { + OperationsTestCase validateProblemSectionTitleTestCase = new OperationsTestCase( + "validateProblemSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemSection target) { + + } + + @Override + protected void updateToPass(ProblemSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemSectionOperations.validateProblemSectionTitle( + (ProblemSection) objectToTest, diagnostician, map); + } + + }; + + validateProblemSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProblemSectionText() { + OperationsTestCase validateProblemSectionTextTestCase = new OperationsTestCase( + "validateProblemSectionText", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemSection target) { + + } + + @Override + protected void updateToPass(ProblemSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemSectionOperations.validateProblemSectionText( + (ProblemSection) objectToTest, diagnostician, map); + } + + }; + + validateProblemSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProblemSectionProblemAct() { + OperationsTestCase validateProblemSectionProblemActTestCase = new OperationsTestCase( + "validateProblemSectionProblemAct", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_SECTION_PROBLEM_ACT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemSection target) { + + } + + @Override + protected void updateToPass(ProblemSection target) { + target.init(); + target.addAct(CCDFactory.eINSTANCE.createProblemAct()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemSectionOperations.validateProblemSectionProblemAct( + (ProblemSection) objectToTest, diagnostician, map); + } + + }; + + validateProblemSectionProblemActTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemActs() { + + ProblemSection target = objectFactory.create(); + target.getProblemActs(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ProblemSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ProblemSection create() { + return CCDFactory.eINSTANCE.createProblemSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ProblemSectionOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ProblemSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ProblemStatusObservationTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ProblemStatusObservationTest.java new file mode 100644 index 000000000..4daf028ba --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ProblemStatusObservationTest.java @@ -0,0 +1,140 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.ProblemStatusObservation; +import org.openhealthtools.mdht.uml.cda.ccd.operations.ProblemStatusObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Problem Status Observation' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProblemStatusObservation#validateStatusObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Status Observation Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class ProblemStatusObservationTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateStatusObservationTemplateId() { + OperationsTestCase validateStatusObservationTemplateIdTestCase = new OperationsTestCase( + "validateStatusObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_STATUS_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemStatusObservation target) { + + } + + @Override + protected void updateToPass(ProblemStatusObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemStatusObservationOperations.validateStatusObservationTemplateId( + (ProblemStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateStatusObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ProblemStatusObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ProblemStatusObservation create() { + return CCDFactory.eINSTANCE.createProblemStatusObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ProblemStatusObservationOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ProblemStatusObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ProcedureActivityActTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ProcedureActivityActTest.java new file mode 100644 index 000000000..124d713d5 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ProcedureActivityActTest.java @@ -0,0 +1,612 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityAct; +import org.openhealthtools.mdht.uml.cda.ccd.operations.ProcedureActivityActOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * A static utility class that provides operations + * related to 'Procedure Activity Act' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityAct#validateProcedureActivityActTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityAct#validateProcedureActivityActMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityAct#validateProcedureActivityActCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityAct#validateProcedureActivityActEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityAct#validateProcedureActivityActId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityAct#validateProcedureActivityActEncounterLocation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Encounter Location}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityAct#validateProcedureActivityActPerformer2(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Performer2}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityAct#validateProcedureActivityActProblemAct(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Problem Act}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityAct#validateProcedureActivityActProblemObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Problem Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityAct#validateProcedureActivityActAgeObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Age Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityAct#validateProcedureActivityActMedicationActivity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Medication Activity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityAct#validateProcedureActivityActPatientInstruction(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Patient Instruction}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityAct#getProblemAct() Get Problem Act}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityAct#getProblemObservation() Get Problem Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityAct#getAgeObservation() Get Age Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityAct#getMedicationActivity() Get Medication Activity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityAct#getPatientInstructions() Get Patient Instructions}
  • + *
+ *

+ * + * @generated + */ + +public class ProcedureActivityActTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateProcedureActivityActTemplateId() { + OperationsTestCase validateProcedureActivityActTemplateIdTestCase = new OperationsTestCase( + "validateProcedureActivityActTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityAct target) { + + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActTemplateId( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureActivityActMoodCode() { + OperationsTestCase validateProcedureActivityActMoodCodeTestCase = new OperationsTestCase( + "validateProcedureActivityActMoodCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityAct target) { + + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActMoodCode( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityActCode() { + OperationsTestCase validateProcedureActivityActCodeTestCase = new OperationsTestCase( + "validateProcedureActivityActCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityAct target) { + target.init(); + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + target.setCode(DatatypesFactory.eINSTANCE.createCD()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActCode( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureActivityActEffectiveTime() { + OperationsTestCase validateProcedureActivityActEffectiveTimeTestCase = new OperationsTestCase( + "validateProcedureActivityActEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityAct target) { + + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActEffectiveTime( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityActId() { + OperationsTestCase validateProcedureActivityActIdTestCase = new OperationsTestCase( + "validateProcedureActivityActId", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityAct target) { + target.init(); + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + target.getIds().add(DatatypesFactory.eINSTANCE.createII()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActId( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityActEncounterLocation() { + OperationsTestCase validateProcedureActivityActEncounterLocationTestCase = new OperationsTestCase( + "validateProcedureActivityActEncounterLocation", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_ENCOUNTER_LOCATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityAct target) { + target.init(); + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + target.getParticipants().add(CCDFactory.eINSTANCE.createEncounterLocation().init()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActEncounterLocation( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActEncounterLocationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityActPerformer2() { + OperationsTestCase validateProcedureActivityActPerformer2TestCase = new OperationsTestCase( + "validateProcedureActivityActPerformer2", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_PERFORMER2__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityAct target) { + target.init(); + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + target.getPerformers().add(CDAFactory.eINSTANCE.createPerformer2()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActPerformer2( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActPerformer2TestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityActProblemAct() { + OperationsTestCase validateProcedureActivityActProblemActTestCase = new OperationsTestCase( + "validateProcedureActivityActProblemAct", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_PROBLEM_ACT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityAct target) { + target.init(); + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.RSON); + er.setAct(CCDFactory.eINSTANCE.createProblemAct().init()); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActProblemAct( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActProblemActTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityActProblemObservation() { + OperationsTestCase validateProcedureActivityActProblemObservationTestCase = new OperationsTestCase( + "validateProcedureActivityActProblemObservation", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_PROBLEM_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityAct target) { + target.init(); + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.RSON); + er.setObservation(CCDFactory.eINSTANCE.createProblemObservation().init()); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActProblemObservation( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActProblemObservationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityActAgeObservation() { + OperationsTestCase validateProcedureActivityActAgeObservationTestCase = new OperationsTestCase( + "validateProcedureActivityActAgeObservation", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_AGE_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityAct target) { + + target.init(); + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + er.setObservation(CCDFactory.eINSTANCE.createAgeObservation().init()); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActAgeObservation( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActAgeObservationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityActMedicationActivity() { + OperationsTestCase validateProcedureActivityActMedicationActivityTestCase = new OperationsTestCase( + "validateProcedureActivityActMedicationActivity", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_MEDICATION_ACTIVITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityAct target) { + target.init(); + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + er.setSubstanceAdministration(CCDFactory.eINSTANCE.createMedicationActivity().init()); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActMedicationActivity( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActMedicationActivityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityActPatientInstruction() { + OperationsTestCase validateProcedureActivityActPatientInstructionTestCase = new OperationsTestCase( + "validateProcedureActivityActPatientInstruction", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_PATIENT_INSTRUCTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityAct target) { + target.init(); + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + target.addAct(CCDFactory.eINSTANCE.createPatientInstruction().init()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActPatientInstruction( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActPatientInstructionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemAct() { + + ProcedureActivityAct target = objectFactory.create(); + target.getProblemAct(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProblemObservation() { + + ProcedureActivityAct target = objectFactory.create(); + target.getProblemObservation(); + + } + + /** + * + * @generated + */ + @Test + public void testGetAgeObservation() { + + ProcedureActivityAct target = objectFactory.create(); + target.getAgeObservation(); + + } + + /** + * + * @generated + */ + @Test + public void testGetMedicationActivity() { + + ProcedureActivityAct target = objectFactory.create(); + target.getMedicationActivity(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPatientInstructions() { + + ProcedureActivityAct target = objectFactory.create(); + target.getPatientInstructions(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ProcedureActivityActOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ProcedureActivityAct create() { + return CCDFactory.eINSTANCE.createProcedureActivityAct(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ProcedureActivityActOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ProcedureActivityActOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ProcedureActivityObservationTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ProcedureActivityObservationTest.java new file mode 100644 index 000000000..a7a6d2d49 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ProcedureActivityObservationTest.java @@ -0,0 +1,661 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityObservation; +import org.openhealthtools.mdht.uml.cda.ccd.operations.ProcedureActivityObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * A static utility class that provides operations + * related to 'Procedure Activity Observation' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityObservation#validateProcedureActivityObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityObservation#validateProcedureActivityObservationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityObservation#validateProcedureActivityObservationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityObservation#validateProcedureActivityObservationEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityObservation#validateProcedureActivityObservationId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityObservation#validateProcedureActivityObservationStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityObservation#validateProcedureActivityObservationEncounterLocation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Encounter Location}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityObservation#validateProcedureActivityObservationPerformer2(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Performer2}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityObservation#validateProcedureActivityObservationProblemObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Problem Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityObservation#validateProcedureActivityObservationAgeObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Age Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityObservation#validateProcedureActivityObservationMedicationActivity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Medication Activity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityObservation#validateProcedureActivityObservationPatientInstruction(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Patient Instruction}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityObservation#validateProcedureActivityObservationProblemAct(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Problem Act}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityObservation#getProblemObservation() Get Problem Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityObservation#getAgeObservation() Get Age Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityObservation#getMedicationActivities() Get Medication Activities}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityObservation#getPatientInstructions() Get Patient Instructions}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityObservation#getProblemAct() Get Problem Act}
  • + *
+ *

+ * + * @generated + */ + +public class ProcedureActivityObservationTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateProcedureActivityObservationTemplateId() { + OperationsTestCase validateProcedureActivityObservationTemplateIdTestCase = new OperationsTestCase( + "validateProcedureActivityObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationTemplateId( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureActivityObservationMoodCode() { + OperationsTestCase validateProcedureActivityObservationMoodCodeTestCase = new OperationsTestCase( + "validateProcedureActivityObservationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationMoodCode( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureActivityObservationCode() { + OperationsTestCase validateProcedureActivityObservationCodeTestCase = new OperationsTestCase( + "validateProcedureActivityObservationCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + target.init(); + + CD cd = DatatypesFactory.eINSTANCE.createCD(); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationCode( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureActivityObservationEffectiveTime() { + OperationsTestCase validateProcedureActivityObservationEffectiveTimeTestCase = new OperationsTestCase( + "validateProcedureActivityObservationEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationEffectiveTime( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureActivityObservationId() { + OperationsTestCase validateProcedureActivityObservationIdTestCase = new OperationsTestCase( + "validateProcedureActivityObservationId", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + target.init(); + + II ii = DatatypesFactory.eINSTANCE.createII(); + target.getIds().add(ii); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationId( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureActivityObservationStatusCode() { + OperationsTestCase validateProcedureActivityObservationStatusCodeTestCase = new OperationsTestCase( + "validateProcedureActivityObservationStatusCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationStatusCode( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityObservationEncounterLocation() { + OperationsTestCase validateProcedureActivityObservationEncounterLocationTestCase = new OperationsTestCase( + "validateProcedureActivityObservationEncounterLocation", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_ENCOUNTER_LOCATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + target.init(); + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + + target.getParticipants().add(CCDFactory.eINSTANCE.createEncounterLocation().init()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationEncounterLocation( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationEncounterLocationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityObservationPerformer2() { + OperationsTestCase validateProcedureActivityObservationPerformer2TestCase = new OperationsTestCase( + "validateProcedureActivityObservationPerformer2", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_PERFORMER2__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + target.init(); + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + + target.getPerformers().add(CDAFactory.eINSTANCE.createPerformer2()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationPerformer2( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationPerformer2TestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityObservationProblemObservation() { + OperationsTestCase validateProcedureActivityObservationProblemObservationTestCase = new OperationsTestCase( + "validateProcedureActivityObservationProblemObservation", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_PROBLEM_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + target.init(); + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.RSON); + er.setObservation(CCDFactory.eINSTANCE.createProblemObservation().init()); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationProblemObservation( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationProblemObservationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityObservationAgeObservation() { + OperationsTestCase validateProcedureActivityObservationAgeObservationTestCase = new OperationsTestCase( + "validateProcedureActivityObservationAgeObservation", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_AGE_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + target.init(); + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + er.setObservation(CCDFactory.eINSTANCE.createAgeObservation().init()); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationAgeObservation( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationAgeObservationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityObservationMedicationActivity() { + OperationsTestCase validateProcedureActivityObservationMedicationActivityTestCase = new OperationsTestCase( + "validateProcedureActivityObservationMedicationActivity", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_MEDICATION_ACTIVITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + target.init(); + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + er.setSubstanceAdministration(CCDFactory.eINSTANCE.createMedicationActivity().init()); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationMedicationActivity( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationMedicationActivityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityObservationPatientInstruction() { + OperationsTestCase validateProcedureActivityObservationPatientInstructionTestCase = new OperationsTestCase( + "validateProcedureActivityObservationPatientInstruction", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_PATIENT_INSTRUCTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + target.init(); + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + + target.addAct(CCDFactory.eINSTANCE.createPatientInstruction().init()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationPatientInstruction( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationPatientInstructionTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityObservationProblemAct() { + OperationsTestCase validateProcedureActivityObservationProblemActTestCase = new OperationsTestCase( + "validateProcedureActivityObservationProblemAct", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_PROBLEM_ACT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + target.init(); + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.RSON); + er.setAct(CCDFactory.eINSTANCE.createProblemAct().init()); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationProblemAct( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationProblemActTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemObservation() { + + ProcedureActivityObservation target = objectFactory.create(); + target.getProblemObservation(); + + } + + /** + * + * @generated + */ + @Test + public void testGetAgeObservation() { + + ProcedureActivityObservation target = objectFactory.create(); + target.getAgeObservation(); + + } + + /** + * + * @generated + */ + @Test + public void testGetMedicationActivities() { + + ProcedureActivityObservation target = objectFactory.create(); + target.getMedicationActivities(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPatientInstructions() { + + ProcedureActivityObservation target = objectFactory.create(); + target.getPatientInstructions(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProblemAct() { + + ProcedureActivityObservation target = objectFactory.create(); + target.getProblemAct(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ProcedureActivityObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ProcedureActivityObservation create() { + return CCDFactory.eINSTANCE.createProcedureActivityObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ProcedureActivityObservationOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ProcedureActivityObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ProcedureActivityProcedureTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ProcedureActivityProcedureTest.java new file mode 100644 index 000000000..fe106c637 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ProcedureActivityProcedureTest.java @@ -0,0 +1,644 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityProcedure; +import org.openhealthtools.mdht.uml.cda.ccd.operations.ProcedureActivityProcedureOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * A static utility class that provides operations + * related to 'Procedure Activity Procedure' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityProcedure#validateProcedureActivityProcedureTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityProcedure#validateProcedureActivityProcedureMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityProcedure#validateProcedureActivityProcedureCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityProcedure#validateProcedureActivityProcedureEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityProcedure#validateProcedureActivityProcedureId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityProcedure#validateProcedureActivityProcedureSpecimen(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Specimen}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityProcedure#validateProcedureActivityProcedureEncounterLocation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Encounter Location}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityProcedure#validateProcedureActivityProcedurePerformer2(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Performer2}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityProcedure#validateProcedureActivityProcedureProblemObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Problem Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityProcedure#validateProcedureActivityProcedureProblemAct(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Problem Act}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityProcedure#validateProcedureActivityProcedureAgeObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Age Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityProcedure#validateProcedureActivityProcedureMedicationActivity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Medication Activity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityProcedure#validateProcedureActivityProcedurePatientInstruction(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Patient Instruction}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityProcedure#getProblemObservation() Get Problem Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityProcedure#getProblemAct() Get Problem Act}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityProcedure#getAgeObservation() Get Age Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityProcedure#getMedicationActivities() Get Medication Activities}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityProcedure#getPatientInstructions() Get Patient Instructions}
  • + *
+ *

+ * + * @generated + */ + +public class ProcedureActivityProcedureTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateProcedureActivityProcedureTemplateId() { + OperationsTestCase validateProcedureActivityProcedureTemplateIdTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureTemplateId( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureActivityProcedureMoodCode() { + OperationsTestCase validateProcedureActivityProcedureMoodCodeTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureMoodCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureMoodCode( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityProcedureCode() { + OperationsTestCase validateProcedureActivityProcedureCodeTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + target.init(); + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + + target.setCode(DatatypesFactory.eINSTANCE.createCD()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureCode( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureActivityProcedureEffectiveTime() { + OperationsTestCase validateProcedureActivityProcedureEffectiveTimeTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureEffectiveTime( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityProcedureId() { + OperationsTestCase validateProcedureActivityProcedureIdTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureId", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + target.init(); + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + target.getIds().add(DatatypesFactory.eINSTANCE.createII()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureId( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityProcedureSpecimen() { + OperationsTestCase validateProcedureActivityProcedureSpecimenTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureSpecimen", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_SPECIMEN__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + target.init(); + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + target.getSpecimens().add(CDAFactory.eINSTANCE.createSpecimen()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureSpecimen( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureSpecimenTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityProcedureEncounterLocation() { + OperationsTestCase validateProcedureActivityProcedureEncounterLocationTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureEncounterLocation", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_ENCOUNTER_LOCATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + target.init(); + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + + target.getParticipants().add(CCDFactory.eINSTANCE.createEncounterLocation().init()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureEncounterLocation( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureEncounterLocationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityProcedurePerformer2() { + OperationsTestCase validateProcedureActivityProcedurePerformer2TestCase = new OperationsTestCase( + "validateProcedureActivityProcedurePerformer2", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_PERFORMER2__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + target.init(); + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + + target.getPerformers().add(CDAFactory.eINSTANCE.createPerformer2()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedurePerformer2( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedurePerformer2TestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityProcedureProblemObservation() { + OperationsTestCase validateProcedureActivityProcedureProblemObservationTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureProblemObservation", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_PROBLEM_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + target.init(); + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.RSON); + er.setObservation(CCDFactory.eINSTANCE.createProblemObservation().init()); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureProblemObservation( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureProblemObservationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityProcedureProblemAct() { + OperationsTestCase validateProcedureActivityProcedureProblemActTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureProblemAct", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_PROBLEM_ACT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + target.init(); + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.RSON); + er.setAct(CCDFactory.eINSTANCE.createProblemAct().init()); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureProblemAct( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureProblemActTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityProcedureAgeObservation() { + OperationsTestCase validateProcedureActivityProcedureAgeObservationTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureAgeObservation", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_AGE_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + target.init(); + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + er.setObservation(CCDFactory.eINSTANCE.createAgeObservation().init()); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureAgeObservation( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureAgeObservationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityProcedureMedicationActivity() { + OperationsTestCase validateProcedureActivityProcedureMedicationActivityTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureMedicationActivity", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_MEDICATION_ACTIVITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + target.init(); + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + er.setSubstanceAdministration(CCDFactory.eINSTANCE.createMedicationActivity().init()); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureMedicationActivity( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureMedicationActivityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityProcedurePatientInstruction() { + OperationsTestCase validateProcedureActivityProcedurePatientInstructionTestCase = new OperationsTestCase( + "validateProcedureActivityProcedurePatientInstruction", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_PATIENT_INSTRUCTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + target.init(); + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + target.addAct(CCDFactory.eINSTANCE.createPatientInstruction().init()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedurePatientInstruction( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedurePatientInstructionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemObservation() { + + ProcedureActivityProcedure target = objectFactory.create(); + target.getProblemObservation(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProblemAct() { + + ProcedureActivityProcedure target = objectFactory.create(); + target.getProblemAct(); + + } + + /** + * + * @generated + */ + @Test + public void testGetAgeObservation() { + + ProcedureActivityProcedure target = objectFactory.create(); + target.getAgeObservation(); + + } + + /** + * + * @generated + */ + @Test + public void testGetMedicationActivities() { + + ProcedureActivityProcedure target = objectFactory.create(); + target.getMedicationActivities(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPatientInstructions() { + + ProcedureActivityProcedure target = objectFactory.create(); + target.getPatientInstructions(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ProcedureActivityProcedureOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ProcedureActivityProcedure create() { + return CCDFactory.eINSTANCE.createProcedureActivityProcedure(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ProcedureActivityProcedureOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ProcedureActivityProcedureOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ProcedureActivityTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ProcedureActivityTest.java new file mode 100644 index 000000000..288966391 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ProcedureActivityTest.java @@ -0,0 +1,45 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Procedure Activity' model objects. + * + * + * @generated + */ + +public class ProcedureActivityTest extends CDAValidationTest { + + /** + * No Operations Test + * @generated + */ + @Test + public void testNoOperations() { + } + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ProcedureActivityOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ProceduresSectionTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ProceduresSectionTest.java new file mode 100644 index 000000000..a5233d8a7 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ProceduresSectionTest.java @@ -0,0 +1,329 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityAct; +import org.openhealthtools.mdht.uml.cda.ccd.ProcedureActivityObservation; +import org.openhealthtools.mdht.uml.cda.ccd.ProceduresSection; +import org.openhealthtools.mdht.uml.cda.ccd.operations.ProceduresSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * A static utility class that provides operations + * related to 'Procedures Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProceduresSection#validateProceduresSectionHasProcedureActivity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedures Section Has Procedure Activity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProceduresSection#validateProceduresSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedures Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProceduresSection#validateProceduresSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedures Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProceduresSection#validateProceduresSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedures Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProceduresSection#validateProceduresSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedures Section Text}
  • + *
+ *

+ * + * @generated + */ + +public class ProceduresSectionTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateProceduresSectionHasProcedureActivity() { + OperationsTestCase validateProceduresSectionHasProcedureActivityTestCase = new OperationsTestCase( + "validateProceduresSectionHasProcedureActivity", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURES_SECTION_HAS_PROCEDURE_ACTIVITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProceduresSection target) { + + } + + @Override + protected void updateToPass(ProceduresSection target) { + + } + + /* + * (non-Javadoc) + * + * @see org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest.OperationsTestCase#addPassTests() + */ + @Override + public void addPassTests() { + + addPassTest(new PassTest() { + + @Override + public void updateToPass(ProceduresSection target) { + target.init(); + + ProcedureActivityAct paa = CCDFactory.eINSTANCE.createProcedureActivityAct().init(); + + target.addAct(paa); + + } + + }); + + addPassTest(new PassTest() { + + @Override + public void updateToPass(ProceduresSection target) { + target.init(); + + ProcedureActivityObservation pao = CCDFactory.eINSTANCE.createProcedureActivityObservation().init(); + + target.addObservation(pao); + + } + + }); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProceduresSectionOperations.validateProceduresSectionHasProcedureActivity( + (ProceduresSection) objectToTest, diagnostician, map); + } + + }; + + validateProceduresSectionHasProcedureActivityTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProceduresSectionTemplateId() { + OperationsTestCase validateProceduresSectionTemplateIdTestCase = new OperationsTestCase( + "validateProceduresSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURES_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProceduresSection target) { + + } + + @Override + protected void updateToPass(ProceduresSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProceduresSectionOperations.validateProceduresSectionTemplateId( + (ProceduresSection) objectToTest, diagnostician, map); + } + + }; + + validateProceduresSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProceduresSectionCode() { + OperationsTestCase validateProceduresSectionCodeTestCase = new OperationsTestCase( + "validateProceduresSectionCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURES_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProceduresSection target) { + + } + + @Override + protected void updateToPass(ProceduresSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProceduresSectionOperations.validateProceduresSectionCode( + (ProceduresSection) objectToTest, diagnostician, map); + } + + }; + + validateProceduresSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProceduresSectionTitle() { + OperationsTestCase validateProceduresSectionTitleTestCase = new OperationsTestCase( + "validateProceduresSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURES_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProceduresSection target) { + + } + + @Override + protected void updateToPass(ProceduresSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProceduresSectionOperations.validateProceduresSectionTitle( + (ProceduresSection) objectToTest, diagnostician, map); + } + + }; + + validateProceduresSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProceduresSectionText() { + OperationsTestCase validateProceduresSectionTextTestCase = new OperationsTestCase( + "validateProceduresSectionText", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURES_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProceduresSection target) { + + } + + @Override + protected void updateToPass(ProceduresSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProceduresSectionOperations.validateProceduresSectionText( + (ProceduresSection) objectToTest, diagnostician, map); + } + + }; + + validateProceduresSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ProceduresSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ProceduresSection create() { + return CCDFactory.eINSTANCE.createProceduresSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ProceduresSectionOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ProceduresSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ProductInstanceTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ProductInstanceTest.java new file mode 100644 index 000000000..b744b9657 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ProductInstanceTest.java @@ -0,0 +1,213 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.ProductInstance; +import org.openhealthtools.mdht.uml.cda.ccd.operations.ProductInstanceOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; + +/** + * A static utility class that provides operations + * related to 'Product Instance' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProductInstance#validateProductInstanceHasScopingEntity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Product Instance Has Scoping Entity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProductInstance#validateProductInstanceTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Product Instance Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ProductInstance#validateProductInstanceClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Product Instance Class Code}
  • + *
+ *

+ * + * @generated + */ + +public class ProductInstanceTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateProductInstanceHasScopingEntity() { + OperationsTestCase validateProductInstanceHasScopingEntityTestCase = new OperationsTestCase( + "validateProductInstanceHasScopingEntity", + operationsForOCL.getOCLValue("VALIDATE_PRODUCT_INSTANCE_HAS_SCOPING_ENTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProductInstance target) { + target.getIds().add(DatatypesFactory.eINSTANCE.createII()); + } + + @Override + protected void updateToPass(ProductInstance target) { + target.init(); + target.getIds().add(DatatypesFactory.eINSTANCE.createII()); + target.setScopingEntity(CDAFactory.eINSTANCE.createEntity()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProductInstanceOperations.validateProductInstanceHasScopingEntity( + (ProductInstance) objectToTest, diagnostician, map); + } + + }; + + validateProductInstanceHasScopingEntityTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProductInstanceTemplateId() { + OperationsTestCase validateProductInstanceTemplateIdTestCase = new OperationsTestCase( + "validateProductInstanceTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PRODUCT_INSTANCE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProductInstance target) { + + } + + @Override + protected void updateToPass(ProductInstance target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProductInstanceOperations.validateProductInstanceTemplateId( + (ProductInstance) objectToTest, diagnostician, map); + } + + }; + + validateProductInstanceTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProductInstanceClassCode() { + OperationsTestCase validateProductInstanceClassCodeTestCase = new OperationsTestCase( + "validateProductInstanceClassCode", + operationsForOCL.getOCLValue("VALIDATE_PRODUCT_INSTANCE_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProductInstance target) { + + } + + @Override + protected void updateToPass(ProductInstance target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProductInstanceOperations.validateProductInstanceClassCode( + (ProductInstance) objectToTest, diagnostician, map); + } + + }; + + validateProductInstanceClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ProductInstanceOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ProductInstance create() { + return CCDFactory.eINSTANCE.createProductInstance(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ProductInstanceOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ProductInstanceOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ProductTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ProductTest.java new file mode 100644 index 000000000..6641f08c0 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ProductTest.java @@ -0,0 +1,429 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Material; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.Product; +import org.openhealthtools.mdht.uml.cda.ccd.operations.ProductOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; + +/** + * A static utility class that provides operations + * related to 'Product' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.Product#validateProductHasMaterial(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Product Has Material}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.Product#validateProductHasMaterialCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Product Has Material Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.Product#validateProductHasMaterialCodeVocab(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Product Has Material Code Vocab}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.Product#validateProductHasMaterialCodeOriginalText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Product Has Material Code Original Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.Product#validateProductHasMaterialName(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Product Has Material Name}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.Product#validateProductMayHaveMaterialManufacturer(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Product May Have Material Manufacturer}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.Product#validateProductShouldHaveMaterialManufacturer(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Product Should Have Material Manufacturer}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.Product#validateProductTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Product Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.Product#validateProductId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Product Id}
  • + *
+ *

+ * + * @generated + */ + +public class ProductTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateProductHasMaterial() { + OperationsTestCase validateProductHasMaterialTestCase = new OperationsTestCase( + "validateProductHasMaterial", + operationsForOCL.getOCLValue("VALIDATE_PRODUCT_HAS_MATERIAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Product target) { + + } + + @Override + protected void updateToPass(Product target) { + target.init(); + target.setManufacturedMaterial(CDAFactory.eINSTANCE.createMaterial()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProductOperations.validateProductHasMaterial((Product) objectToTest, diagnostician, map); + } + + }; + + validateProductHasMaterialTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProductHasMaterialCode() { + OperationsTestCase validateProductHasMaterialCodeTestCase = new OperationsTestCase( + "validateProductHasMaterialCode", + operationsForOCL.getOCLValue("VALIDATE_PRODUCT_HAS_MATERIAL_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Product target) { + + } + + @Override + protected void updateToPass(Product target) { + target.init(); + Material mat = CDAFactory.eINSTANCE.createMaterial(); + mat.setCode(DatatypesFactory.eINSTANCE.createCE()); + target.setManufacturedMaterial(mat); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProductOperations.validateProductHasMaterialCode((Product) objectToTest, diagnostician, map); + } + + }; + + validateProductHasMaterialCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProductHasMaterialCodeVocab() { + OperationsTestCase validateProductHasMaterialCodeVocabTestCase = new OperationsTestCase( + "validateProductHasMaterialCodeVocab", + operationsForOCL.getOCLValue("VALIDATE_PRODUCT_HAS_MATERIAL_CODE_VOCAB__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Product target) { + + } + + @Override + protected void updateToPass(Product target) { + target.init(); + Material mat = CDAFactory.eINSTANCE.createMaterial(); + CE code = DatatypesFactory.eINSTANCE.createCE(); + code.setCodeSystem("2.16.840.1.113883.6.88"); + mat.setCode(code); + + target.setManufacturedMaterial(mat); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProductOperations.validateProductHasMaterialCodeVocab((Product) objectToTest, diagnostician, map); + } + + }; + + validateProductHasMaterialCodeVocabTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProductHasMaterialCodeOriginalText() { + OperationsTestCase validateProductHasMaterialCodeOriginalTextTestCase = new OperationsTestCase( + "validateProductHasMaterialCodeOriginalText", + operationsForOCL.getOCLValue("VALIDATE_PRODUCT_HAS_MATERIAL_CODE_ORIGINAL_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Product target) { + + } + + @Override + protected void updateToPass(Product target) { + target.init(); + Material mat = CDAFactory.eINSTANCE.createMaterial(); + CE code = DatatypesFactory.eINSTANCE.createCE(); + code.setOriginalText(DatatypesFactory.eINSTANCE.createED()); + mat.setCode(code); + target.setManufacturedMaterial(mat); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProductOperations.validateProductHasMaterialCodeOriginalText( + (Product) objectToTest, diagnostician, map); + } + + }; + + validateProductHasMaterialCodeOriginalTextTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProductHasMaterialName() { + OperationsTestCase validateProductHasMaterialNameTestCase = new OperationsTestCase( + "validateProductHasMaterialName", + operationsForOCL.getOCLValue("VALIDATE_PRODUCT_HAS_MATERIAL_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Product target) { + + } + + @Override + protected void updateToPass(Product target) { + target.init(); + Material mat = CDAFactory.eINSTANCE.createMaterial(); + mat.setName(DatatypesFactory.eINSTANCE.createEN()); + target.setManufacturedMaterial(mat); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProductOperations.validateProductHasMaterialName((Product) objectToTest, diagnostician, map); + } + + }; + + validateProductHasMaterialNameTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProductMayHaveMaterialManufacturer() { + OperationsTestCase validateProductMayHaveMaterialManufacturerTestCase = new OperationsTestCase( + "validateProductMayHaveMaterialManufacturer", + operationsForOCL.getOCLValue("VALIDATE_PRODUCT_MAY_HAVE_MATERIAL_MANUFACTURER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Product target) { + + } + + @Override + protected void updateToPass(Product target) { + target.init(); + target.setManufacturerOrganization(CDAFactory.eINSTANCE.createOrganization()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProductOperations.validateProductMayHaveMaterialManufacturer( + (Product) objectToTest, diagnostician, map); + } + + }; + + validateProductMayHaveMaterialManufacturerTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProductShouldHaveMaterialManufacturer() { + OperationsTestCase validateProductShouldHaveMaterialManufacturerTestCase = new OperationsTestCase( + "validateProductShouldHaveMaterialManufacturer", + operationsForOCL.getOCLValue("VALIDATE_PRODUCT_SHOULD_HAVE_MATERIAL_MANUFACTURER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Product target) { + target.getIds().add(DatatypesFactory.eINSTANCE.createII()); + } + + @Override + protected void updateToPass(Product target) { + target.init(); + target.getIds().add(DatatypesFactory.eINSTANCE.createII()); + target.setManufacturerOrganization(CDAFactory.eINSTANCE.createOrganization()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProductOperations.validateProductShouldHaveMaterialManufacturer( + (Product) objectToTest, diagnostician, map); + } + + }; + + validateProductShouldHaveMaterialManufacturerTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProductTemplateId() { + OperationsTestCase validateProductTemplateIdTestCase = new OperationsTestCase( + "validateProductTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PRODUCT_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(Product target) { + + } + + @Override + protected void updateToPass(Product target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProductOperations.validateProductTemplateId((Product) objectToTest, diagnostician, map); + } + + }; + + validateProductTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProductId() { + OperationsTestCase validateProductIdTestCase = new OperationsTestCase( + "validateProductId", operationsForOCL.getOCLValue("VALIDATE_PRODUCT_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Product target) { + + } + + @Override + protected void updateToPass(Product target) { + target.init(); + target.getIds().add(DatatypesFactory.eINSTANCE.createII()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProductOperations.validateProductId((Product) objectToTest, diagnostician, map); + } + + }; + + validateProductIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ProductOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public Product create() { + return CCDFactory.eINSTANCE.createProduct(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ProductOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ProductOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/PurposeActivityTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/PurposeActivityTest.java new file mode 100644 index 000000000..12f35b52a --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/PurposeActivityTest.java @@ -0,0 +1,369 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.PurposeActivity; +import org.openhealthtools.mdht.uml.cda.ccd.operations.PurposeActivityOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * A static utility class that provides operations + * related to 'Purpose Activity' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PurposeActivity#validatePurposeActivityHasReason(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Purpose Activity Has Reason}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PurposeActivity#validatePurposeActivityReasonType(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Purpose Activity Reason Type}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PurposeActivity#validatePurposeActivityTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Purpose Activity Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PurposeActivity#validatePurposeActivityClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Purpose Activity Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PurposeActivity#validatePurposeActivityMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Purpose Activity Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PurposeActivity#validatePurposeActivityCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Purpose Activity Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.PurposeActivity#validatePurposeActivityStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Purpose Activity Status Code}
  • + *
+ *

+ * + * @generated + */ + +public class PurposeActivityTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidatePurposeActivityHasReason() { + OperationsTestCase validatePurposeActivityHasReasonTestCase = new OperationsTestCase( + "validatePurposeActivityHasReason", + operationsForOCL.getOCLValue("VALIDATE_PURPOSE_ACTIVITY_HAS_REASON__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PurposeActivity target) { + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + target.getEntryRelationships().add(er); + } + + @Override + protected void updateToPass(PurposeActivity target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.RSON); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PurposeActivityOperations.validatePurposeActivityHasReason( + (PurposeActivity) objectToTest, diagnostician, map); + } + + }; + + validatePurposeActivityHasReasonTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePurposeActivityReasonType() { + OperationsTestCase validatePurposeActivityReasonTypeTestCase = new OperationsTestCase( + "validatePurposeActivityReasonType", + operationsForOCL.getOCLValue("VALIDATE_PURPOSE_ACTIVITY_REASON_TYPE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PurposeActivity target) { + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.RSON); + er.setOrganizer(CCDFactory.eINSTANCE.createFamilyHistoryOrganizer()); + target.getEntryRelationships().add(er); + } + + @Override + protected void updateToPass(PurposeActivity target) { + target.init(); + target.getEntryRelationships().clear(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.RSON); + er.setObservation(CCDFactory.eINSTANCE.createAgeObservation()); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PurposeActivityOperations.validatePurposeActivityReasonType( + (PurposeActivity) objectToTest, diagnostician, map); + } + + }; + + validatePurposeActivityReasonTypeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePurposeActivityTemplateId() { + OperationsTestCase validatePurposeActivityTemplateIdTestCase = new OperationsTestCase( + "validatePurposeActivityTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PURPOSE_ACTIVITY_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PurposeActivity target) { + + } + + @Override + protected void updateToPass(PurposeActivity target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PurposeActivityOperations.validatePurposeActivityTemplateId( + (PurposeActivity) objectToTest, diagnostician, map); + } + + }; + + validatePurposeActivityTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePurposeActivityClassCode() { + OperationsTestCase validatePurposeActivityClassCodeTestCase = new OperationsTestCase( + "validatePurposeActivityClassCode", + operationsForOCL.getOCLValue("VALIDATE_PURPOSE_ACTIVITY_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PurposeActivity target) { + + } + + @Override + protected void updateToPass(PurposeActivity target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PurposeActivityOperations.validatePurposeActivityClassCode( + (PurposeActivity) objectToTest, diagnostician, map); + } + + }; + + validatePurposeActivityClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePurposeActivityMoodCode() { + OperationsTestCase validatePurposeActivityMoodCodeTestCase = new OperationsTestCase( + "validatePurposeActivityMoodCode", + operationsForOCL.getOCLValue("VALIDATE_PURPOSE_ACTIVITY_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PurposeActivity target) { + + } + + @Override + protected void updateToPass(PurposeActivity target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PurposeActivityOperations.validatePurposeActivityMoodCode( + (PurposeActivity) objectToTest, diagnostician, map); + } + + }; + + validatePurposeActivityMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePurposeActivityCode() { + OperationsTestCase validatePurposeActivityCodeTestCase = new OperationsTestCase( + "validatePurposeActivityCode", + operationsForOCL.getOCLValue("VALIDATE_PURPOSE_ACTIVITY_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PurposeActivity target) { + + } + + @Override + protected void updateToPass(PurposeActivity target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PurposeActivityOperations.validatePurposeActivityCode( + (PurposeActivity) objectToTest, diagnostician, map); + } + + }; + + validatePurposeActivityCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePurposeActivityStatusCode() { + OperationsTestCase validatePurposeActivityStatusCodeTestCase = new OperationsTestCase( + "validatePurposeActivityStatusCode", + operationsForOCL.getOCLValue("VALIDATE_PURPOSE_ACTIVITY_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PurposeActivity target) { + + } + + @Override + protected void updateToPass(PurposeActivity target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PurposeActivityOperations.validatePurposeActivityStatusCode( + (PurposeActivity) objectToTest, diagnostician, map); + } + + }; + + validatePurposeActivityStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PurposeActivityOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public PurposeActivity create() { + return CCDFactory.eINSTANCE.createPurposeActivity(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PurposeActivityOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PurposeActivityOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/PurposeSectionTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/PurposeSectionTest.java new file mode 100644 index 000000000..34663502d --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/PurposeSectionTest.java @@ -0,0 +1,318 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.PurposeSection; +import org.openhealthtools.mdht.uml.cda.ccd.operations.PurposeSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * A static utility class that provides operations + * related to 'Purpose Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.PurposeSection#validatePurposeSectionTitleValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Purpose Section Title Value}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.PurposeSection#validatePurposeSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Purpose Section Template Id}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.PurposeSection#validatePurposeSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Purpose Section Code}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.PurposeSection#validatePurposeSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Purpose Section Title}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.PurposeSection#validatePurposeSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Purpose Section Text}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.PurposeSection#validatePurposeSectionPurposeActivity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Purpose Section Purpose Activity}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.PurposeSection#getPurposeActivities() + * Get Purpose Activities}
  • + *
+ *

+ * + * @generated + */ + +public class PurposeSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidatePurposeSectionTemplateId() { + OperationsTestCase validatePurposeSectionTemplateIdTestCase = new OperationsTestCase( + "validatePurposeSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PURPOSE_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PurposeSection target) { + + } + + @Override + protected void updateToPass(PurposeSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PurposeSectionOperations.validatePurposeSectionTemplateId( + (PurposeSection) objectToTest, diagnostician, map); + } + + }; + + validatePurposeSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePurposeSectionCode() { + OperationsTestCase validatePurposeSectionCodeTestCase = new OperationsTestCase( + "validatePurposeSectionCode", + operationsForOCL.getOCLValue("VALIDATE_PURPOSE_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PurposeSection target) { + + } + + @Override + protected void updateToPass(PurposeSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PurposeSectionOperations.validatePurposeSectionCode( + (PurposeSection) objectToTest, diagnostician, map); + } + + }; + + validatePurposeSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePurposeSectionTitle() { + OperationsTestCase validatePurposeSectionTitleTestCase = new OperationsTestCase( + "validatePurposeSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_PURPOSE_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PurposeSection target) { + + } + + @Override + protected void updateToPass(PurposeSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PurposeSectionOperations.validatePurposeSectionTitle( + (PurposeSection) objectToTest, diagnostician, map); + } + + }; + + validatePurposeSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePurposeSectionText() { + OperationsTestCase validatePurposeSectionTextTestCase = new OperationsTestCase( + "validatePurposeSectionText", + operationsForOCL.getOCLValue("VALIDATE_PURPOSE_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PurposeSection target) { + + } + + @Override + protected void updateToPass(PurposeSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PurposeSectionOperations.validatePurposeSectionText( + (PurposeSection) objectToTest, diagnostician, map); + } + + }; + + validatePurposeSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePurposeSectionPurposeActivity() { + OperationsTestCase validatePurposeSectionPurposeActivityTestCase = new OperationsTestCase( + "validatePurposeSectionPurposeActivity", + operationsForOCL.getOCLValue("VALIDATE_PURPOSE_SECTION_PURPOSE_ACTIVITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PurposeSection target) { + + } + + @Override + protected void updateToPass(PurposeSection target) { + target.init(); + target.addAct(CCDFactory.eINSTANCE.createPurposeActivity()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PurposeSectionOperations.validatePurposeSectionPurposeActivity( + (PurposeSection) objectToTest, diagnostician, map); + } + + }; + + validatePurposeSectionPurposeActivityTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetPurposeActivities() { + + PurposeSection target = objectFactory.create(); + target.getPurposeActivities(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PurposeSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public PurposeSection create() { + return CCDFactory.eINSTANCE.createPurposeSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PurposeSectionOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PurposeSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ReactionObservationTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ReactionObservationTest.java new file mode 100644 index 000000000..a03fe80ce --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ReactionObservationTest.java @@ -0,0 +1,445 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.ReactionObservation; +import org.openhealthtools.mdht.uml.cda.ccd.operations.ReactionObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * A static utility class that provides operations + * related to 'Reaction Observation' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ReactionObservation#validateReactionObservationHasReactionIntervention(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Reaction Observation Has Reaction Intervention}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ReactionObservation#validateReactionObservationReactionInterventionTypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Reaction Observation Reaction Intervention Type Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ReactionObservation#validateReactionObservationReactionInterventionType(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Reaction Observation Reaction Intervention Type}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ReactionObservation#validateReactionObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Reaction Observation Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ReactionObservation#validateReactionObservationClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Reaction Observation Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ReactionObservation#validateReactionObservationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Reaction Observation Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ReactionObservation#validateReactionObservationStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Reaction Observation Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ReactionObservation#validateReactionObservationSeverityObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Reaction Observation Severity Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ReactionObservation#getSeverityObservation() Get Severity Observation}
  • + *
+ *

+ * + * @generated + */ + +public class ReactionObservationTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateReactionObservationHasReactionIntervention() { + OperationsTestCase validateReactionObservationHasReactionInterventionTestCase = new OperationsTestCase( + "validateReactionObservationHasReactionIntervention", + operationsForOCL.getOCLValue("VALIDATE_REACTION_OBSERVATION_HAS_REACTION_INTERVENTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReactionObservation target) { + target.init(); + + } + + @Override + protected void updateToPass(ReactionObservation target) { + target.addObservation(CDAFactory.eINSTANCE.createObservation()); + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.RSON); + } + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReactionObservationOperations.validateReactionObservationHasReactionIntervention( + (ReactionObservation) objectToTest, diagnostician, map); + } + + }; + + validateReactionObservationHasReactionInterventionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateReactionObservationReactionInterventionTypeCode() { + OperationsTestCase validateReactionObservationReactionInterventionTypeCodeTestCase = new OperationsTestCase( + "validateReactionObservationReactionInterventionTypeCode", + operationsForOCL.getOCLValue("VALIDATE_REACTION_OBSERVATION_REACTION_INTERVENTION_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + /* + * (non-Javadoc) + * + * @see org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest.OperationsTestCase#addFailTests() + */ + @Override + public void addFailTests() { + + addFailTest(new FailTest() { + + @Override + public void updateToFail(ReactionObservation target) { + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.RSON); + er.setAct(CDAFactory.eINSTANCE.createAct()); + target.getEntryRelationships().add(er); + + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(ReactionObservation target) { + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.RSON); + er.setProcedure(CDAFactory.eINSTANCE.createProcedure()); + target.getEntryRelationships().add(er); + + } + }); + + } + + @Override + protected void updateToPass(ReactionObservation target) { + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.RSON); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReactionObservationOperations.validateReactionObservationReactionInterventionTypeCode( + (ReactionObservation) objectToTest, diagnostician, map); + } + + }; + + validateReactionObservationReactionInterventionTypeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateReactionObservationReactionInterventionType() { + OperationsTestCase validateReactionObservationReactionInterventionTypeTestCase = new OperationsTestCase( + "validateReactionObservationReactionInterventionType", + operationsForOCL.getOCLValue("VALIDATE_REACTION_OBSERVATION_REACTION_INTERVENTION_TYPE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReactionObservation target) { + + } + + @Override + protected void updateToPass(ReactionObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setSubstanceAdministration(CCDFactory.eINSTANCE.createMedicationActivity()); + er.setTypeCode(x_ActRelationshipEntryRelationship.RSON); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReactionObservationOperations.validateReactionObservationReactionInterventionType( + (ReactionObservation) objectToTest, diagnostician, map); + } + + }; + + validateReactionObservationReactionInterventionTypeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateReactionObservationTemplateId() { + OperationsTestCase validateReactionObservationTemplateIdTestCase = new OperationsTestCase( + "validateReactionObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_REACTION_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReactionObservation target) { + + } + + @Override + protected void updateToPass(ReactionObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReactionObservationOperations.validateReactionObservationTemplateId( + (ReactionObservation) objectToTest, diagnostician, map); + } + + }; + + validateReactionObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateReactionObservationClassCode() { + OperationsTestCase validateReactionObservationClassCodeTestCase = new OperationsTestCase( + "validateReactionObservationClassCode", + operationsForOCL.getOCLValue("VALIDATE_REACTION_OBSERVATION_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReactionObservation target) { + + } + + @Override + protected void updateToPass(ReactionObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReactionObservationOperations.validateReactionObservationClassCode( + (ReactionObservation) objectToTest, diagnostician, map); + } + + }; + + validateReactionObservationClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateReactionObservationMoodCode() { + OperationsTestCase validateReactionObservationMoodCodeTestCase = new OperationsTestCase( + "validateReactionObservationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_REACTION_OBSERVATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReactionObservation target) { + + } + + @Override + protected void updateToPass(ReactionObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReactionObservationOperations.validateReactionObservationMoodCode( + (ReactionObservation) objectToTest, diagnostician, map); + } + + }; + + validateReactionObservationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateReactionObservationStatusCode() { + OperationsTestCase validateReactionObservationStatusCodeTestCase = new OperationsTestCase( + "validateReactionObservationStatusCode", + operationsForOCL.getOCLValue("VALIDATE_REACTION_OBSERVATION_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReactionObservation target) { + + } + + @Override + protected void updateToPass(ReactionObservation target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReactionObservationOperations.validateReactionObservationStatusCode( + (ReactionObservation) objectToTest, diagnostician, map); + } + + }; + + validateReactionObservationStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateReactionObservationSeverityObservation() { + OperationsTestCase validateReactionObservationSeverityObservationTestCase = new OperationsTestCase( + "validateReactionObservationSeverityObservation", + operationsForOCL.getOCLValue("VALIDATE_REACTION_OBSERVATION_SEVERITY_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReactionObservation target) { + + } + + @Override + protected void updateToPass(ReactionObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setObservation(CCDFactory.eINSTANCE.createSeverityObservation()); + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReactionObservationOperations.validateReactionObservationSeverityObservation( + (ReactionObservation) objectToTest, diagnostician, map); + } + + }; + + validateReactionObservationSeverityObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetSeverityObservation() { + + ReactionObservation target = objectFactory.create(); + target.getSeverityObservation(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ReactionObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ReactionObservation create() { + return CCDFactory.eINSTANCE.createReactionObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ReactionObservationOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ReactionObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ResultObservationTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ResultObservationTest.java new file mode 100644 index 000000000..4116641c1 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ResultObservationTest.java @@ -0,0 +1,612 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Informant12; +import org.openhealthtools.mdht.uml.cda.ObservationRange; +import org.openhealthtools.mdht.uml.cda.ReferenceRange; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.ResultObservation; +import org.openhealthtools.mdht.uml.cda.ccd.operations.ResultObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; + +/** + * A static utility class that provides operations + * related to 'Result Observation' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ResultObservation#validateResultObservationCodeValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Observation Code Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ResultObservation#validateResultObservationReferenceRangeRequired(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Observation Reference Range Required}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ResultObservation#validateResultObservationNoObservationRangeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Observation No Observation Range Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ResultObservation#validateResultObservationInformationSource(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Observation Information Source}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ResultObservation#validateResultObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Observation Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ResultObservation#validateResultObservationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Observation Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ResultObservation#validateResultObservationId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Observation Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ResultObservation#validateResultObservationEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Observation Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ResultObservation#validateResultObservationStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Observation Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ResultObservation#validateResultObservationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Observation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ResultObservation#validateResultObservationMethodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Observation Method Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ResultObservation#validateResultObservationInterpretationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Observation Interpretation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ResultObservation#validateResultObservationValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Observation Value}
  • + *
+ *

+ * + * @generated + */ + +public class ResultObservationTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateResultObservationCodeValue() { + OperationsTestCase validateResultObservationCodeValueTestCase = new OperationsTestCase( + "validateResultObservationCodeValue", + operationsForOCL.getOCLValue("VALIDATE_RESULT_OBSERVATION_CODE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultObservation target) { + + } + + @Override + protected void updateToPass(ResultObservation target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD(); + value.setCodeSystem("2.16.840.1.113883.6.96"); + target.setCode(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultObservationOperations.validateResultObservationCodeValue( + (ResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateResultObservationCodeValueTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateResultObservationReferenceRangeRequired() { + OperationsTestCase validateResultObservationReferenceRangeRequiredTestCase = new OperationsTestCase( + "validateResultObservationReferenceRangeRequired", + operationsForOCL.getOCLValue("VALIDATE_RESULT_OBSERVATION_REFERENCE_RANGE_REQUIRED__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultObservation target) { + + } + + @Override + protected void updateToPass(ResultObservation target) { + target.init(); + ReferenceRange rr = CDAFactory.eINSTANCE.createReferenceRange(); + target.getReferenceRanges().add(rr); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultObservationOperations.validateResultObservationReferenceRangeRequired( + (ResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateResultObservationReferenceRangeRequiredTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateResultObservationNoObservationRangeCode() { + OperationsTestCase validateResultObservationNoObservationRangeCodeTestCase = new OperationsTestCase( + "validateResultObservationNoObservationRangeCode", + operationsForOCL.getOCLValue("VALIDATE_RESULT_OBSERVATION_NO_OBSERVATION_RANGE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultObservation target) { + + ReferenceRange rr = CDAFactory.eINSTANCE.createReferenceRange(); + ObservationRange obsrange = CDAFactory.eINSTANCE.createObservationRange(); + CD value = DatatypesFactory.eINSTANCE.createCD(); + value.setCode("1"); + obsrange.setCode(value); + rr.setObservationRange(obsrange); + target.getReferenceRanges().add(rr); + } + + @Override + protected void updateToPass(ResultObservation target) { + target.init(); + target.getReferenceRanges().clear(); + ReferenceRange rr = CDAFactory.eINSTANCE.createReferenceRange(); + ObservationRange obsrange = CDAFactory.eINSTANCE.createObservationRange(); + CD value = DatatypesFactory.eINSTANCE.createCD(); + value.setCode(null); + obsrange.setCode(value); + rr.setObservationRange(obsrange); + target.getReferenceRanges().add(rr); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultObservationOperations.validateResultObservationNoObservationRangeCode( + (ResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateResultObservationNoObservationRangeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateResultObservationInformationSource() { + OperationsTestCase validateResultObservationInformationSourceTestCase = new OperationsTestCase( + "validateResultObservationInformationSource", + operationsForOCL.getOCLValue("VALIDATE_RESULT_OBSERVATION_INFORMATION_SOURCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultObservation target) { + + } + + @Override + protected void updateToPass(ResultObservation target) { + target.init(); + + Informant12 inf = CDAFactory.eINSTANCE.createInformant12(); + target.getInformants().add(inf); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultObservationOperations.validateResultObservationInformationSource( + (ResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateResultObservationInformationSourceTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateResultObservationTemplateId() { + OperationsTestCase validateResultObservationTemplateIdTestCase = new OperationsTestCase( + "validateResultObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_RESULT_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultObservation target) { + + } + + @Override + protected void updateToPass(ResultObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultObservationOperations.validateResultObservationTemplateId( + (ResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateResultObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateResultObservationMoodCode() { + OperationsTestCase validateResultObservationMoodCodeTestCase = new OperationsTestCase( + "validateResultObservationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_RESULT_OBSERVATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultObservation target) { + + } + + @Override + protected void updateToPass(ResultObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultObservationOperations.validateResultObservationMoodCode( + (ResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateResultObservationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateResultObservationId() { + OperationsTestCase validateResultObservationIdTestCase = new OperationsTestCase( + "validateResultObservationId", + operationsForOCL.getOCLValue("VALIDATE_RESULT_OBSERVATION_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultObservation target) { + + } + + @Override + protected void updateToPass(ResultObservation target) { + target.init(); + + II ii = DatatypesFactory.eINSTANCE.createII(); + target.getIds().add(ii); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultObservationOperations.validateResultObservationId( + (ResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateResultObservationIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateResultObservationEffectiveTime() { + OperationsTestCase validateResultObservationEffectiveTimeTestCase = new OperationsTestCase( + "validateResultObservationEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_RESULT_OBSERVATION_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultObservation target) { + + } + + @Override + protected void updateToPass(ResultObservation target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultObservationOperations.validateResultObservationEffectiveTime( + (ResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateResultObservationEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateResultObservationStatusCode() { + OperationsTestCase validateResultObservationStatusCodeTestCase = new OperationsTestCase( + "validateResultObservationStatusCode", + operationsForOCL.getOCLValue("VALIDATE_RESULT_OBSERVATION_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultObservation target) { + + } + + @Override + protected void updateToPass(ResultObservation target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultObservationOperations.validateResultObservationStatusCode( + (ResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateResultObservationStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateResultObservationCode() { + OperationsTestCase validateResultObservationCodeTestCase = new OperationsTestCase( + "validateResultObservationCode", + operationsForOCL.getOCLValue("VALIDATE_RESULT_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultObservation target) { + + } + + @Override + protected void updateToPass(ResultObservation target) { + target.init(); + + CD cd = DatatypesFactory.eINSTANCE.createCD(); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultObservationOperations.validateResultObservationCode( + (ResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateResultObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateResultObservationMethodCode() { + OperationsTestCase validateResultObservationMethodCodeTestCase = new OperationsTestCase( + "validateResultObservationMethodCode", + operationsForOCL.getOCLValue("VALIDATE_RESULT_OBSERVATION_METHOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultObservation target) { + + } + + @Override + protected void updateToPass(ResultObservation target) { + target.init(); + CE mc = DatatypesFactory.eINSTANCE.createCE(); + target.getMethodCodes().add(mc); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultObservationOperations.validateResultObservationMethodCode( + (ResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateResultObservationMethodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateResultObservationInterpretationCode() { + OperationsTestCase validateResultObservationInterpretationCodeTestCase = new OperationsTestCase( + "validateResultObservationInterpretationCode", + operationsForOCL.getOCLValue("VALIDATE_RESULT_OBSERVATION_INTERPRETATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultObservation target) { + + } + + @Override + protected void updateToPass(ResultObservation target) { + target.init(); + + CE e = DatatypesFactory.eINSTANCE.createCE(); + target.getInterpretationCodes().add(e); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultObservationOperations.validateResultObservationInterpretationCode( + (ResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateResultObservationInterpretationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateResultObservationValue() { + OperationsTestCase validateResultObservationValueTestCase = new OperationsTestCase( + "validateResultObservationValue", + operationsForOCL.getOCLValue("VALIDATE_RESULT_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultObservation target) { + + } + + @Override + protected void updateToPass(ResultObservation target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD(); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultObservationOperations.validateResultObservationValue( + (ResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateResultObservationValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ResultObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ResultObservation create() { + return CCDFactory.eINSTANCE.createResultObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ResultObservationOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ResultObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ResultOrganizerTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ResultOrganizerTest.java new file mode 100644 index 000000000..c47fa1386 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ResultOrganizerTest.java @@ -0,0 +1,491 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Component4; +import org.openhealthtools.mdht.uml.cda.Informant12; +import org.openhealthtools.mdht.uml.cda.Observation; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.ResultOrganizer; +import org.openhealthtools.mdht.uml.cda.ccd.operations.ResultOrganizerOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; + +/** + * A static utility class that provides operations + * related to 'Result Organizer' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ResultOrganizer#validateResultOrganizerCodeValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Organizer Code Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ResultOrganizer#validateResultOrganizerComponentElement(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Organizer Component Element}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ResultOrganizer#validateResultOrganizerInformationSource(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Organizer Information Source}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ResultOrganizer#validateResultOrganizerTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Organizer Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ResultOrganizer#validateResultOrganizerMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Organizer Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ResultOrganizer#validateResultOrganizerId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Organizer Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ResultOrganizer#validateResultOrganizerCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Organizer Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ResultOrganizer#validateResultOrganizerStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Organizer Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ResultOrganizer#validateResultOrganizerResultObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Organizer Result Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ResultOrganizer#validateResultOrganizerSpecimen(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Organizer Specimen}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.ResultOrganizer#getResultObservations() Get Result Observations}
  • + *
+ *

+ * + * @generated + */ + +public class ResultOrganizerTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateResultOrganizerCodeValue() { + OperationsTestCase validateResultOrganizerCodeValueTestCase = new OperationsTestCase( + "validateResultOrganizerCodeValue", + operationsForOCL.getOCLValue("VALIDATE_RESULT_ORGANIZER_CODE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultOrganizer target) { + + } + + @Override + protected void updateToPass(ResultOrganizer target) { + target.init(); + CD value = DatatypesFactory.eINSTANCE.createCD(); + value.setCodeSystem("2.16.840.1.113883.6.96"); + target.setCode(value); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultOrganizerOperations.validateResultOrganizerCodeValue( + (ResultOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateResultOrganizerCodeValueTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateResultOrganizerComponentElement() { + OperationsTestCase validateResultOrganizerComponentElementTestCase = new OperationsTestCase( + "validateResultOrganizerComponentElement", + operationsForOCL.getOCLValue("VALIDATE_RESULT_ORGANIZER_COMPONENT_ELEMENT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultOrganizer target) { + + } + + @Override + protected void updateToPass(ResultOrganizer target) { + target.init(); + Component4 comp = CDAFactory.eINSTANCE.createComponent4(); + target.getComponents().add(comp); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultOrganizerOperations.validateResultOrganizerComponentElement( + (ResultOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateResultOrganizerComponentElementTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateResultOrganizerInformationSource() { + OperationsTestCase validateResultOrganizerInformationSourceTestCase = new OperationsTestCase( + "validateResultOrganizerInformationSource", + operationsForOCL.getOCLValue("VALIDATE_RESULT_ORGANIZER_INFORMATION_SOURCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultOrganizer target) { + + } + + @Override + protected void updateToPass(ResultOrganizer target) { + target.init(); + + Informant12 inf = CDAFactory.eINSTANCE.createInformant12(); + target.getInformants().add(inf); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultOrganizerOperations.validateResultOrganizerInformationSource( + (ResultOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateResultOrganizerInformationSourceTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateResultOrganizerTemplateId() { + OperationsTestCase validateResultOrganizerTemplateIdTestCase = new OperationsTestCase( + "validateResultOrganizerTemplateId", + operationsForOCL.getOCLValue("VALIDATE_RESULT_ORGANIZER_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultOrganizer target) { + + } + + @Override + protected void updateToPass(ResultOrganizer target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultOrganizerOperations.validateResultOrganizerTemplateId( + (ResultOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateResultOrganizerTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateResultOrganizerMoodCode() { + OperationsTestCase validateResultOrganizerMoodCodeTestCase = new OperationsTestCase( + "validateResultOrganizerMoodCode", + operationsForOCL.getOCLValue("VALIDATE_RESULT_ORGANIZER_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultOrganizer target) { + + } + + @Override + protected void updateToPass(ResultOrganizer target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultOrganizerOperations.validateResultOrganizerMoodCode( + (ResultOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateResultOrganizerMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateResultOrganizerId() { + OperationsTestCase validateResultOrganizerIdTestCase = new OperationsTestCase( + "validateResultOrganizerId", + operationsForOCL.getOCLValue("VALIDATE_RESULT_ORGANIZER_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(ResultOrganizer target) { + + } + + @Override + protected void updateToPass(ResultOrganizer target) { + target.init(); + + II id = DatatypesFactory.eINSTANCE.createII(); + target.getIds().add(id); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultOrganizerOperations.validateResultOrganizerId( + (ResultOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateResultOrganizerIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateResultOrganizerCode() { + OperationsTestCase validateResultOrganizerCodeTestCase = new OperationsTestCase( + "validateResultOrganizerCode", + operationsForOCL.getOCLValue("VALIDATE_RESULT_ORGANIZER_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultOrganizer target) { + + } + + @Override + protected void updateToPass(ResultOrganizer target) { + target.init(); + CD value = DatatypesFactory.eINSTANCE.createCD(); + target.setCode(value); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultOrganizerOperations.validateResultOrganizerCode( + (ResultOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateResultOrganizerCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateResultOrganizerStatusCode() { + OperationsTestCase validateResultOrganizerStatusCodeTestCase = new OperationsTestCase( + "validateResultOrganizerStatusCode", + operationsForOCL.getOCLValue("VALIDATE_RESULT_ORGANIZER_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultOrganizer target) { + + } + + @Override + protected void updateToPass(ResultOrganizer target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultOrganizerOperations.validateResultOrganizerStatusCode( + (ResultOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateResultOrganizerStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateResultOrganizerResultObservation() { + OperationsTestCase validateResultOrganizerResultObservationTestCase = new OperationsTestCase( + "validateResultOrganizerResultObservation", + operationsForOCL.getOCLValue("VALIDATE_RESULT_ORGANIZER_RESULT_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultOrganizer target) { + + } + + @Override + protected void updateToPass(ResultOrganizer target) { + target.init(); + Component4 comp = CDAFactory.eINSTANCE.createComponent4(); + Observation obs = CCDFactory.eINSTANCE.createResultObservation(); + comp.setObservation(obs); + target.getComponents().add(comp); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultOrganizerOperations.validateResultOrganizerResultObservation( + (ResultOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateResultOrganizerResultObservationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateResultOrganizerSpecimen() { + OperationsTestCase validateResultOrganizerSpecimenTestCase = new OperationsTestCase( + "validateResultOrganizerSpecimen", + operationsForOCL.getOCLValue("VALIDATE_RESULT_ORGANIZER_SPECIMEN__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultOrganizer target) { + target.init(); + + } + + @Override + protected void updateToPass(ResultOrganizer target) { + target.getSpecimens().add(CDAFactory.eINSTANCE.createSpecimen()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultOrganizerOperations.validateResultOrganizerSpecimen( + (ResultOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateResultOrganizerSpecimenTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetResultObservations() { + + ResultOrganizer target = objectFactory.create(); + target.getResultObservations(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ResultOrganizerOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ResultOrganizer create() { + return CCDFactory.eINSTANCE.createResultOrganizer(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ResultOrganizerOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ResultOrganizerOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ResultsSectionTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ResultsSectionTest.java new file mode 100644 index 000000000..a75dc9582 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/ResultsSectionTest.java @@ -0,0 +1,318 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.ResultsSection; +import org.openhealthtools.mdht.uml.cda.ccd.operations.ResultsSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * A static utility class that provides operations + * related to 'Results Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.ResultsSection#validateResultsSectionTitleValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Results Section Title Value}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.ResultsSection#validateResultsSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Results Section Template Id}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.ResultsSection#validateResultsSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Results Section Code}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.ResultsSection#validateResultsSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Results Section Title}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.ResultsSection#validateResultsSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Results Section Text}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.ResultsSection#validateResultsSectionResultOrganizer(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Results Section Result Organizer}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.ResultsSection#getResultOrganizers() + * Get Result Organizers}
  • + *
+ *

+ * + * @generated + */ + +public class ResultsSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateResultsSectionTemplateId() { + OperationsTestCase validateResultsSectionTemplateIdTestCase = new OperationsTestCase( + "validateResultsSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_RESULTS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultsSection target) { + + } + + @Override + protected void updateToPass(ResultsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultsSectionOperations.validateResultsSectionTemplateId( + (ResultsSection) objectToTest, diagnostician, map); + } + + }; + + validateResultsSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateResultsSectionCode() { + OperationsTestCase validateResultsSectionCodeTestCase = new OperationsTestCase( + "validateResultsSectionCode", + operationsForOCL.getOCLValue("VALIDATE_RESULTS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultsSection target) { + + } + + @Override + protected void updateToPass(ResultsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultsSectionOperations.validateResultsSectionCode( + (ResultsSection) objectToTest, diagnostician, map); + } + + }; + + validateResultsSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateResultsSectionTitle() { + OperationsTestCase validateResultsSectionTitleTestCase = new OperationsTestCase( + "validateResultsSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_RESULTS_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultsSection target) { + + } + + @Override + protected void updateToPass(ResultsSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultsSectionOperations.validateResultsSectionTitle( + (ResultsSection) objectToTest, diagnostician, map); + } + + }; + + validateResultsSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateResultsSectionText() { + OperationsTestCase validateResultsSectionTextTestCase = new OperationsTestCase( + "validateResultsSectionText", + operationsForOCL.getOCLValue("VALIDATE_RESULTS_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultsSection target) { + + } + + @Override + protected void updateToPass(ResultsSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultsSectionOperations.validateResultsSectionText( + (ResultsSection) objectToTest, diagnostician, map); + } + + }; + + validateResultsSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateResultsSectionResultOrganizer() { + OperationsTestCase validateResultsSectionResultOrganizerTestCase = new OperationsTestCase( + "validateResultsSectionResultOrganizer", + operationsForOCL.getOCLValue("VALIDATE_RESULTS_SECTION_RESULT_ORGANIZER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultsSection target) { + + } + + @Override + protected void updateToPass(ResultsSection target) { + target.init(); + target.addOrganizer(CCDFactory.eINSTANCE.createResultOrganizer()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultsSectionOperations.validateResultsSectionResultOrganizer( + (ResultsSection) objectToTest, diagnostician, map); + } + + }; + + validateResultsSectionResultOrganizerTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetResultOrganizers() { + + ResultsSection target = objectFactory.create(); + target.getResultOrganizers(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ResultsSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ResultsSection create() { + return CCDFactory.eINSTANCE.createResultsSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ResultsSectionOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ResultsSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/SeverityObservationTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/SeverityObservationTest.java new file mode 100644 index 000000000..fc3b302f3 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/SeverityObservationTest.java @@ -0,0 +1,329 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.SeverityObservation; +import org.openhealthtools.mdht.uml.cda.ccd.operations.SeverityObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; + +/** + * A static utility class that provides operations + * related to 'Severity Observation' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.SeverityObservation#validateSeverityObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Severity Observation Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.SeverityObservation#validateSeverityObservationClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Severity Observation Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.SeverityObservation#validateSeverityObservationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Severity Observation Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.SeverityObservation#validateSeverityObservationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Severity Observation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.SeverityObservation#validateSeverityObservationStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Severity Observation Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.SeverityObservation#validateSeverityObservationValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Severity Observation Value}
  • + *
+ *

+ * + * @generated + */ + +public class SeverityObservationTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateSeverityObservationTemplateId() { + OperationsTestCase validateSeverityObservationTemplateIdTestCase = new OperationsTestCase( + "validateSeverityObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_SEVERITY_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SeverityObservation target) { + + } + + @Override + protected void updateToPass(SeverityObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SeverityObservationOperations.validateSeverityObservationTemplateId( + (SeverityObservation) objectToTest, diagnostician, map); + } + + }; + + validateSeverityObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSeverityObservationClassCode() { + OperationsTestCase validateSeverityObservationClassCodeTestCase = new OperationsTestCase( + "validateSeverityObservationClassCode", + operationsForOCL.getOCLValue("VALIDATE_SEVERITY_OBSERVATION_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SeverityObservation target) { + + } + + @Override + protected void updateToPass(SeverityObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SeverityObservationOperations.validateSeverityObservationClassCode( + (SeverityObservation) objectToTest, diagnostician, map); + } + + }; + + validateSeverityObservationClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSeverityObservationMoodCode() { + OperationsTestCase validateSeverityObservationMoodCodeTestCase = new OperationsTestCase( + "validateSeverityObservationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_SEVERITY_OBSERVATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SeverityObservation target) { + + } + + @Override + protected void updateToPass(SeverityObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SeverityObservationOperations.validateSeverityObservationMoodCode( + (SeverityObservation) objectToTest, diagnostician, map); + } + + }; + + validateSeverityObservationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSeverityObservationCode() { + OperationsTestCase validateSeverityObservationCodeTestCase = new OperationsTestCase( + "validateSeverityObservationCode", + operationsForOCL.getOCLValue("VALIDATE_SEVERITY_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SeverityObservation target) { + + } + + @Override + protected void updateToPass(SeverityObservation target) { + target.init(); + + CD cd = DatatypesFactory.eINSTANCE.createCD(); + cd.setCode("SEV"); + cd.setCodeSystem("2.16.840.1.113883.5.4"); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SeverityObservationOperations.validateSeverityObservationCode( + (SeverityObservation) objectToTest, diagnostician, map); + } + + }; + + validateSeverityObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSeverityObservationStatusCode() { + OperationsTestCase validateSeverityObservationStatusCodeTestCase = new OperationsTestCase( + "validateSeverityObservationStatusCode", + operationsForOCL.getOCLValue("VALIDATE_SEVERITY_OBSERVATION_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SeverityObservation target) { + + } + + @Override + protected void updateToPass(SeverityObservation target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SeverityObservationOperations.validateSeverityObservationStatusCode( + (SeverityObservation) objectToTest, diagnostician, map); + } + + }; + + validateSeverityObservationStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSeverityObservationValue() { + OperationsTestCase validateSeverityObservationValueTestCase = new OperationsTestCase( + "validateSeverityObservationValue", + operationsForOCL.getOCLValue("VALIDATE_SEVERITY_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SeverityObservation target) { + + } + + @Override + protected void updateToPass(SeverityObservation target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD(); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SeverityObservationOperations.validateSeverityObservationValue( + (SeverityObservation) objectToTest, diagnostician, map); + } + + }; + + validateSeverityObservationValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends SeverityObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public SeverityObservation create() { + return CCDFactory.eINSTANCE.createSeverityObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends SeverityObservationOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // SeverityObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/SocialHistoryObservationTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/SocialHistoryObservationTest.java new file mode 100644 index 000000000..f6f372cb1 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/SocialHistoryObservationTest.java @@ -0,0 +1,423 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.SocialHistoryObservation; +import org.openhealthtools.mdht.uml.cda.ccd.operations.SocialHistoryObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; + +/** + * A static utility class that provides operations + * related to 'Social History Observation' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.SocialHistoryObservation#validateSocialHistoryObservationCodeValueSet(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Social History Observation Code Value Set}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.SocialHistoryObservation#validateSocialHistoryObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Social History Observation Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.SocialHistoryObservation#validateSocialHistoryObservationClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Social History Observation Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.SocialHistoryObservation#validateSocialHistoryObservationId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Social History Observation Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.SocialHistoryObservation#validateSocialHistoryObservationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Social History Observation Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.SocialHistoryObservation#validateSocialHistoryObservationStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Social History Observation Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.SocialHistoryObservation#validateSocialHistoryObservationSocialHistoryStatusObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Social History Observation Social History Status Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.SocialHistoryObservation#validateSocialHistoryObservationEpisodeObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Social History Observation Episode Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.SocialHistoryObservation#getSocialHistoryStatusObservation() Get Social History Status Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.SocialHistoryObservation#getEpisodeObservation() Get Episode Observation}
  • + *
+ *

+ * + * @generated + */ + +public class SocialHistoryObservationTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateSocialHistoryObservationCodeValueSet() { + OperationsTestCase validateSocialHistoryObservationCodeValueSetTestCase = new OperationsTestCase( + "validateSocialHistoryObservationCodeValueSet", + operationsForOCL.getOCLValue("VALIDATE_SOCIAL_HISTORY_OBSERVATION_CODE_VALUE_SET__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistoryObservation target) { + + } + + @Override + protected void updateToPass(SocialHistoryObservation target) { + target.init(); + CD cd = DatatypesFactory.eINSTANCE.createCD(); + cd.setCodeSystem("2.16.840.1.113883.6.1"); + target.setCode(cd); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistoryObservationOperations.validateSocialHistoryObservationCodeValueSet( + (SocialHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateSocialHistoryObservationCodeValueSetTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSocialHistoryObservationTemplateId() { + OperationsTestCase validateSocialHistoryObservationTemplateIdTestCase = new OperationsTestCase( + "validateSocialHistoryObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_SOCIAL_HISTORY_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistoryObservation target) { + + } + + @Override + protected void updateToPass(SocialHistoryObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistoryObservationOperations.validateSocialHistoryObservationTemplateId( + (SocialHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateSocialHistoryObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSocialHistoryObservationClassCode() { + OperationsTestCase validateSocialHistoryObservationClassCodeTestCase = new OperationsTestCase( + "validateSocialHistoryObservationClassCode", + operationsForOCL.getOCLValue("VALIDATE_SOCIAL_HISTORY_OBSERVATION_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistoryObservation target) { + + } + + @Override + protected void updateToPass(SocialHistoryObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistoryObservationOperations.validateSocialHistoryObservationClassCode( + (SocialHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateSocialHistoryObservationClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSocialHistoryObservationId() { + OperationsTestCase validateSocialHistoryObservationIdTestCase = new OperationsTestCase( + "validateSocialHistoryObservationId", + operationsForOCL.getOCLValue("VALIDATE_SOCIAL_HISTORY_OBSERVATION_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistoryObservation target) { + + } + + @Override + protected void updateToPass(SocialHistoryObservation target) { + target.init(); + + II ii = DatatypesFactory.eINSTANCE.createII(); + target.getIds().add(ii); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistoryObservationOperations.validateSocialHistoryObservationId( + (SocialHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateSocialHistoryObservationIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSocialHistoryObservationMoodCode() { + OperationsTestCase validateSocialHistoryObservationMoodCodeTestCase = new OperationsTestCase( + "validateSocialHistoryObservationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_SOCIAL_HISTORY_OBSERVATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistoryObservation target) { + + } + + @Override + protected void updateToPass(SocialHistoryObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistoryObservationOperations.validateSocialHistoryObservationMoodCode( + (SocialHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateSocialHistoryObservationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSocialHistoryObservationStatusCode() { + OperationsTestCase validateSocialHistoryObservationStatusCodeTestCase = new OperationsTestCase( + "validateSocialHistoryObservationStatusCode", + operationsForOCL.getOCLValue("VALIDATE_SOCIAL_HISTORY_OBSERVATION_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistoryObservation target) { + + } + + @Override + protected void updateToPass(SocialHistoryObservation target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistoryObservationOperations.validateSocialHistoryObservationStatusCode( + (SocialHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateSocialHistoryObservationStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSocialHistoryObservationSocialHistoryStatusObservation() { + OperationsTestCase validateSocialHistoryObservationSocialHistoryStatusObservationTestCase = new OperationsTestCase( + "validateSocialHistoryObservationSocialHistoryStatusObservation", + operationsForOCL.getOCLValue("VALIDATE_SOCIAL_HISTORY_OBSERVATION_SOCIAL_HISTORY_STATUS_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistoryObservation target) { + + } + + @Override + protected void updateToPass(SocialHistoryObservation target) { + target.init(); + target.addObservation(CCDFactory.eINSTANCE.createSocialHistoryStatusObservation()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistoryObservationOperations.validateSocialHistoryObservationSocialHistoryStatusObservation( + (SocialHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateSocialHistoryObservationSocialHistoryStatusObservationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSocialHistoryObservationEpisodeObservation() { + OperationsTestCase validateSocialHistoryObservationEpisodeObservationTestCase = new OperationsTestCase( + "validateSocialHistoryObservationEpisodeObservation", + operationsForOCL.getOCLValue("VALIDATE_SOCIAL_HISTORY_OBSERVATION_EPISODE_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistoryObservation target) { + + } + + @Override + protected void updateToPass(SocialHistoryObservation target) { + target.init(); + target.addObservation(CCDFactory.eINSTANCE.createEpisodeObservation()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistoryObservationOperations.validateSocialHistoryObservationEpisodeObservation( + (SocialHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateSocialHistoryObservationEpisodeObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetSocialHistoryStatusObservation() { + + SocialHistoryObservation target = objectFactory.create(); + target.getSocialHistoryStatusObservation(); + + } + + /** + * + * @generated + */ + @Test + public void testGetEpisodeObservation() { + + SocialHistoryObservation target = objectFactory.create(); + target.getEpisodeObservation(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends SocialHistoryObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public SocialHistoryObservation create() { + return CCDFactory.eINSTANCE.createSocialHistoryObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends SocialHistoryObservationOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // SocialHistoryObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/SocialHistorySectionTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/SocialHistorySectionTest.java new file mode 100644 index 000000000..504c1fead --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/SocialHistorySectionTest.java @@ -0,0 +1,553 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.ClinicalDocument; +import org.openhealthtools.mdht.uml.cda.Patient; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.SocialHistorySection; +import org.openhealthtools.mdht.uml.cda.ccd.operations.SocialHistorySectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * A static utility class that provides operations + * related to 'Social History Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.SocialHistorySection#validateSocialHistorySectionMaritalStatus(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Social History Section Marital Status}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.SocialHistorySection#validateSocialHistorySectionReligiousAffiliation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Social History Section Religious Affiliation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.SocialHistorySection#validateSocialHistorySectionPatientRace(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Social History Section Patient Race}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.SocialHistorySection#validateSocialHistorySectionPatientRaceCodeSystem(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Social History Section Patient Race Code System}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.SocialHistorySection#validateSocialHistorySectionPatientEthnicity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Social History Section Patient Ethnicity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.SocialHistorySection#validateSocialHistorySectionPatientEthnicityCodeSystem(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Social History Section Patient Ethnicity Code System}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.SocialHistorySection#validateSocialHistorySectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Social History Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.SocialHistorySection#validateSocialHistorySectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Social History Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.SocialHistorySection#validateSocialHistorySectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Social History Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.SocialHistorySection#validateSocialHistorySectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Social History Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.SocialHistorySection#validateSocialHistorySectionSocialHistoryObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Social History Section Social History Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.SocialHistorySection#getSocialHistoryObservations() Get Social History Observations}
  • + *
+ *

+ * + * @generated + */ + +public class SocialHistorySectionTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateSocialHistorySectionMaritalStatus() { + OperationsTestCase validateSocialHistorySectionMaritalStatusTestCase = new OperationsTestCase( + "validateSocialHistorySectionMaritalStatus", + operationsForOCL.getOCLValue("VALIDATE_SOCIAL_HISTORY_SECTION_MARITAL_STATUS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistorySection target) { + ClinicalDocument clinicalDocument = CDAFactory.eINSTANCE.createClinicalDocument(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + clinicalDocument.addPatient(patient); + clinicalDocument.addSection(target.init()); + } + + @Override + protected void updateToPass(SocialHistorySection target) { + + ClinicalDocument clinicalDocument = CDAFactory.eINSTANCE.createClinicalDocument(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + + patient.setMaritalStatusCode(DatatypesFactory.eINSTANCE.createCE("code", "codesystem")); + + clinicalDocument.addPatient(patient); + + target.init(); + + clinicalDocument.addSection(target); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistorySectionOperations.validateSocialHistorySectionMaritalStatus( + (SocialHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateSocialHistorySectionMaritalStatusTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSocialHistorySectionReligiousAffiliation() { + OperationsTestCase validateSocialHistorySectionReligiousAffiliationTestCase = new OperationsTestCase( + "validateSocialHistorySectionReligiousAffiliation", + operationsForOCL.getOCLValue("VALIDATE_SOCIAL_HISTORY_SECTION_RELIGIOUS_AFFILIATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistorySection target) { + ClinicalDocument clinicalDocument = CDAFactory.eINSTANCE.createClinicalDocument(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + clinicalDocument.addPatient(patient); + clinicalDocument.addSection(target.init()); + } + + @Override + protected void updateToPass(SocialHistorySection target) { + for (Patient patient : target.getClinicalDocument().getPatients()) { + patient.setReligiousAffiliationCode(DatatypesFactory.eINSTANCE.createCE("code", "codeSystem")); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistorySectionOperations.validateSocialHistorySectionReligiousAffiliation( + (SocialHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateSocialHistorySectionReligiousAffiliationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSocialHistorySectionPatientRace() { + OperationsTestCase validateSocialHistorySectionPatientRaceTestCase = new OperationsTestCase( + "validateSocialHistorySectionPatientRace", + operationsForOCL.getOCLValue("VALIDATE_SOCIAL_HISTORY_SECTION_PATIENT_RACE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistorySection target) { + ClinicalDocument clinicalDocument = CDAFactory.eINSTANCE.createClinicalDocument(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + clinicalDocument.addPatient(patient); + clinicalDocument.addSection(target.init()); + } + + @Override + protected void updateToPass(SocialHistorySection target) { + for (Patient patient : target.getClinicalDocument().getPatients()) { + patient.setRaceCode(DatatypesFactory.eINSTANCE.createCE("code", "codeSystem")); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistorySectionOperations.validateSocialHistorySectionPatientRace( + (SocialHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateSocialHistorySectionPatientRaceTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSocialHistorySectionPatientRaceCodeSystem() { + OperationsTestCase validateSocialHistorySectionPatientRaceCodeSystemTestCase = new OperationsTestCase( + "validateSocialHistorySectionPatientRaceCodeSystem", + operationsForOCL.getOCLValue("VALIDATE_SOCIAL_HISTORY_SECTION_PATIENT_RACE_CODE_SYSTEM__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistorySection target) { + ClinicalDocument clinicalDocument = CDAFactory.eINSTANCE.createClinicalDocument(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + clinicalDocument.addPatient(patient); + clinicalDocument.addSection(target.init()); + } + + @Override + protected void updateToPass(SocialHistorySection target) { + for (Patient patient : target.getClinicalDocument().getPatients()) { + patient.setRaceCode(DatatypesFactory.eINSTANCE.createCE("code", "2.16.840.1.113883.5.104")); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistorySectionOperations.validateSocialHistorySectionPatientRaceCodeSystem( + (SocialHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateSocialHistorySectionPatientRaceCodeSystemTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSocialHistorySectionPatientEthnicity() { + OperationsTestCase validateSocialHistorySectionPatientEthnicityTestCase = new OperationsTestCase( + "validateSocialHistorySectionPatientEthnicity", + operationsForOCL.getOCLValue("VALIDATE_SOCIAL_HISTORY_SECTION_PATIENT_ETHNICITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistorySection target) { + ClinicalDocument clinicalDocument = CDAFactory.eINSTANCE.createClinicalDocument(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + clinicalDocument.addPatient(patient); + clinicalDocument.addSection(target.init()); + } + + @Override + protected void updateToPass(SocialHistorySection target) { + for (Patient patient : target.getClinicalDocument().getPatients()) { + patient.setEthnicGroupCode(DatatypesFactory.eINSTANCE.createCE("code", "codesystem")); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistorySectionOperations.validateSocialHistorySectionPatientEthnicity( + (SocialHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateSocialHistorySectionPatientEthnicityTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSocialHistorySectionPatientEthnicityCodeSystem() { + OperationsTestCase validateSocialHistorySectionPatientEthnicityCodeSystemTestCase = new OperationsTestCase( + "validateSocialHistorySectionPatientEthnicityCodeSystem", + operationsForOCL.getOCLValue("VALIDATE_SOCIAL_HISTORY_SECTION_PATIENT_ETHNICITY_CODE_SYSTEM__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistorySection target) { + ClinicalDocument clinicalDocument = CDAFactory.eINSTANCE.createClinicalDocument(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + clinicalDocument.addPatient(patient); + clinicalDocument.addSection(target.init()); + } + + @Override + protected void updateToPass(SocialHistorySection target) { + for (Patient patient : target.getClinicalDocument().getPatients()) { + patient.setEthnicGroupCode(DatatypesFactory.eINSTANCE.createCE("code", "2.16.840.1.113883.5.50")); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistorySectionOperations.validateSocialHistorySectionPatientEthnicityCodeSystem( + (SocialHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateSocialHistorySectionPatientEthnicityCodeSystemTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSocialHistorySectionTemplateId() { + OperationsTestCase validateSocialHistorySectionTemplateIdTestCase = new OperationsTestCase( + "validateSocialHistorySectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_SOCIAL_HISTORY_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistorySection target) { + + } + + @Override + protected void updateToPass(SocialHistorySection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistorySectionOperations.validateSocialHistorySectionTemplateId( + (SocialHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateSocialHistorySectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSocialHistorySectionCode() { + OperationsTestCase validateSocialHistorySectionCodeTestCase = new OperationsTestCase( + "validateSocialHistorySectionCode", + operationsForOCL.getOCLValue("VALIDATE_SOCIAL_HISTORY_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistorySection target) { + + } + + @Override + protected void updateToPass(SocialHistorySection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistorySectionOperations.validateSocialHistorySectionCode( + (SocialHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateSocialHistorySectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSocialHistorySectionTitle() { + OperationsTestCase validateSocialHistorySectionTitleTestCase = new OperationsTestCase( + "validateSocialHistorySectionTitle", + operationsForOCL.getOCLValue("VALIDATE_SOCIAL_HISTORY_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistorySection target) { + + } + + @Override + protected void updateToPass(SocialHistorySection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistorySectionOperations.validateSocialHistorySectionTitle( + (SocialHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateSocialHistorySectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSocialHistorySectionText() { + OperationsTestCase validateSocialHistorySectionTextTestCase = new OperationsTestCase( + "validateSocialHistorySectionText", + operationsForOCL.getOCLValue("VALIDATE_SOCIAL_HISTORY_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistorySection target) { + + } + + @Override + protected void updateToPass(SocialHistorySection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistorySectionOperations.validateSocialHistorySectionText( + (SocialHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateSocialHistorySectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSocialHistorySectionSocialHistoryObservation() { + OperationsTestCase validateSocialHistorySectionSocialHistoryObservationTestCase = new OperationsTestCase( + "validateSocialHistorySectionSocialHistoryObservation", + operationsForOCL.getOCLValue("VALIDATE_SOCIAL_HISTORY_SECTION_SOCIAL_HISTORY_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistorySection target) { + + } + + @Override + protected void updateToPass(SocialHistorySection target) { + target.init(); + target.addObservation(CCDFactory.eINSTANCE.createSocialHistoryObservation()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistorySectionOperations.validateSocialHistorySectionSocialHistoryObservation( + (SocialHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateSocialHistorySectionSocialHistoryObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetSocialHistoryObservations() { + + SocialHistorySection target = objectFactory.create(); + target.getSocialHistoryObservations(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends SocialHistorySectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public SocialHistorySection create() { + return CCDFactory.eINSTANCE.createSocialHistorySection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends SocialHistorySectionOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // SocialHistorySectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/SocialHistoryStatusObservationTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/SocialHistoryStatusObservationTest.java new file mode 100644 index 000000000..679fef6dc --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/SocialHistoryStatusObservationTest.java @@ -0,0 +1,223 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.SocialHistoryStatusObservation; +import org.openhealthtools.mdht.uml.cda.ccd.operations.SocialHistoryStatusObservationOperations; +import org.openhealthtools.mdht.uml.cda.ccd.operations.StatusObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; + +/** + * + * A static utility class that provides operations related to 'Social History Status Observation' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.SocialHistoryStatusObservation#validateSocialHistoryStatusObservationValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Social History Status Observation Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.SocialHistoryStatusObservation#validateStatusObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Status Observation Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class SocialHistoryStatusObservationTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateSocialHistoryStatusObservationValue() { + OperationsTestCase validateSocialHistoryStatusObservationValueTestCase = new OperationsTestCase( + "validateSocialHistoryStatusObservationValue", + operationsForOCL.getOCLValue("VALIDATE_SOCIAL_HISTORY_STATUS_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistoryStatusObservation target) { + + } + + @Override + protected void updateToPass(SocialHistoryStatusObservation target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD(); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistoryStatusObservationOperations.validateSocialHistoryStatusObservationValue( + (SocialHistoryStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateSocialHistoryStatusObservationValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateStatusObservationTemplateId() { + OperationsTestCase validateStatusObservationTemplateIdTestCase = new OperationsTestCase( + "validateStatusObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_STATUS_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistoryStatusObservation target) { + + } + + @Override + protected void updateToPass(SocialHistoryStatusObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistoryStatusObservationOperations.validateStatusObservationTemplateId( + (SocialHistoryStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateStatusObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateStatusObservationValue() { + OperationsTestCase validateStatusObservationValueTestCase = new OperationsTestCase( + "validateStatusObservationValue", + operationsForOCL.getOCLValue("VALIDATE_STATUS_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistoryStatusObservation target) { + + } + + @Override + protected void updateToPass(SocialHistoryStatusObservation target) { + target.init(); + + CE value = DatatypesFactory.eINSTANCE.createCE(); + value.setCode("12345"); + + value.setCodeSystem("2.16.840.1.113883.1.11.20.17"); + + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return StatusObservationOperations.validateStatusObservationValue( + (SocialHistoryStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateStatusObservationValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends SocialHistoryStatusObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public SocialHistoryStatusObservation create() { + return CCDFactory.eINSTANCE.createSocialHistoryStatusObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends SocialHistoryStatusObservationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // SocialHistoryStatusObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/StatusObservationTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/StatusObservationTest.java new file mode 100644 index 000000000..0a8f99158 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/StatusObservationTest.java @@ -0,0 +1,487 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.Participant2; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.StatusObservation; +import org.openhealthtools.mdht.uml.cda.ccd.operations.StatusObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * A static utility class that provides operations + * related to 'Status Observation' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.StatusObservation#validateStatusObservationTargetOfEntryRelationship(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Status Observation Target Of Entry Relationship}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.StatusObservation#validateStatusObservationNoAdditionalParticipants(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Status Observation No Additional Participants}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.StatusObservation#validateStatusObservationNoAdditionalRelationships(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Status Observation No Additional Relationships}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.StatusObservation#validateStatusObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Status Observation Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.StatusObservation#validateStatusObservationClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Status Observation Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.StatusObservation#validateStatusObservationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Status Observation Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.StatusObservation#validateStatusObservationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Status Observation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.StatusObservation#validateStatusObservationStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Status Observation Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.StatusObservation#validateStatusObservationValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Status Observation Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.StatusObservation#validateTargetOfEntryRelationship() Validate Target Of Entry Relationship}
  • + *
+ *

+ * + * @generated + */ + +public class StatusObservationTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateStatusObservationTargetOfEntryRelationship() { + OperationsTestCase validateStatusObservationTargetOfEntryRelationshipTestCase = new OperationsTestCase( + "validateStatusObservationTargetOfEntryRelationship", + operationsForOCL.getOCLValue("VALIDATE_STATUS_OBSERVATION_TARGET_OF_ENTRY_RELATIONSHIP__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + + @Override + protected void updateToFail(StatusObservation target) { + + er.setObservation(target); + + target.init(); + + } + + @Override + protected void updateToPass(StatusObservation target) { + + er.setTypeCode(x_ActRelationshipEntryRelationship.REFR); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return StatusObservationOperations.validateStatusObservationTargetOfEntryRelationship( + (StatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateStatusObservationTargetOfEntryRelationshipTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateStatusObservationNoAdditionalParticipants() { + OperationsTestCase validateStatusObservationNoAdditionalParticipantsTestCase = new OperationsTestCase( + "validateStatusObservationNoAdditionalParticipants", + operationsForOCL.getOCLValue("VALIDATE_STATUS_OBSERVATION_NO_ADDITIONAL_PARTICIPANTS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(StatusObservation target) { + Participant2 p2 = CDAFactory.eINSTANCE.createParticipant2(); + target.getParticipants().add(p2); + } + + @Override + protected void updateToPass(StatusObservation target) { + target.init(); + target.getParticipants().clear(); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return StatusObservationOperations.validateStatusObservationNoAdditionalParticipants( + (StatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateStatusObservationNoAdditionalParticipantsTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateStatusObservationNoAdditionalRelationships() { + OperationsTestCase validateStatusObservationNoAdditionalRelationshipsTestCase = new OperationsTestCase( + "validateStatusObservationNoAdditionalRelationships", + operationsForOCL.getOCLValue("VALIDATE_STATUS_OBSERVATION_NO_ADDITIONAL_RELATIONSHIPS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(StatusObservation target) { + target.init(); + target.addObservation(CDAFactory.eINSTANCE.createObservation()); + } + + @Override + protected void updateToPass(StatusObservation target) { + target.getEntryRelationships().clear(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return StatusObservationOperations.validateStatusObservationNoAdditionalRelationships( + (StatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateStatusObservationNoAdditionalRelationshipsTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateStatusObservationTemplateId() { + OperationsTestCase validateStatusObservationTemplateIdTestCase = new OperationsTestCase( + "validateStatusObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_STATUS_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(StatusObservation target) { + + } + + @Override + protected void updateToPass(StatusObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return StatusObservationOperations.validateStatusObservationTemplateId( + (StatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateStatusObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateStatusObservationClassCode() { + OperationsTestCase validateStatusObservationClassCodeTestCase = new OperationsTestCase( + "validateStatusObservationClassCode", + operationsForOCL.getOCLValue("VALIDATE_STATUS_OBSERVATION_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(StatusObservation target) { + + } + + @Override + protected void updateToPass(StatusObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return StatusObservationOperations.validateStatusObservationClassCode( + (StatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateStatusObservationClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateStatusObservationMoodCode() { + OperationsTestCase validateStatusObservationMoodCodeTestCase = new OperationsTestCase( + "validateStatusObservationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_STATUS_OBSERVATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(StatusObservation target) { + + } + + @Override + protected void updateToPass(StatusObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return StatusObservationOperations.validateStatusObservationMoodCode( + (StatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateStatusObservationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateStatusObservationCode() { + OperationsTestCase validateStatusObservationCodeTestCase = new OperationsTestCase( + "validateStatusObservationCode", + operationsForOCL.getOCLValue("VALIDATE_STATUS_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(StatusObservation target) { + + } + + @Override + protected void updateToPass(StatusObservation target) { + target.init(); + + CD cd = DatatypesFactory.eINSTANCE.createCD(); + cd.setCode("33999-4"); + cd.setCodeSystem("2.16.840.1.113883.6.1"); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return StatusObservationOperations.validateStatusObservationCode( + (StatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateStatusObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateStatusObservationStatusCode() { + OperationsTestCase validateStatusObservationStatusCodeTestCase = new OperationsTestCase( + "validateStatusObservationStatusCode", + operationsForOCL.getOCLValue("VALIDATE_STATUS_OBSERVATION_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(StatusObservation target) { + + } + + @Override + protected void updateToPass(StatusObservation target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return StatusObservationOperations.validateStatusObservationStatusCode( + (StatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateStatusObservationStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateStatusObservationValue() { + OperationsTestCase validateStatusObservationValueTestCase = new OperationsTestCase( + "validateStatusObservationValue", + operationsForOCL.getOCLValue("VALIDATE_STATUS_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(StatusObservation target) { + + } + + @Override + protected void updateToPass(StatusObservation target) { + target.init(); + + CE value = DatatypesFactory.eINSTANCE.createCE(); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return StatusObservationOperations.validateStatusObservationValue( + (StatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateStatusObservationValueTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateTargetOfEntryRelationship() { + OperationsTestCase validateTargetOfEntryRelationshipTestCase = new OperationsTestCase( + "validateTargetOfEntryRelationship", + operationsForOCL.getOCLValue("VALIDATE_TARGET_OF_ENTRY_RELATIONSHIP__EOCL_EXP"), objectFactory) { + + { + // This is non test + this.skipFailsTest(); + this.skipPassTest(); + } + + @Override + protected void updateToFail(StatusObservation target) { + + } + + @Override + protected void updateToPass(StatusObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return StatusObservationOperations.validateTargetOfEntryRelationship((StatusObservation) objectToTest); + } + + }; + + validateTargetOfEntryRelationshipTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends StatusObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public StatusObservation create() { + return CCDFactory.eINSTANCE.createStatusObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends StatusObservationOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // StatusObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/SupplyActivityTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/SupplyActivityTest.java new file mode 100644 index 000000000..ab518a562 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/SupplyActivityTest.java @@ -0,0 +1,746 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.Author; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.Informant12; +import org.openhealthtools.mdht.uml.cda.Participant2; +import org.openhealthtools.mdht.uml.cda.Product; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.FulfillmentInstruction; +import org.openhealthtools.mdht.uml.cda.ccd.MedicationStatusObservation; +import org.openhealthtools.mdht.uml.cda.ccd.ProductInstance; +import org.openhealthtools.mdht.uml.cda.ccd.SupplyActivity; +import org.openhealthtools.mdht.uml.cda.ccd.operations.SupplyActivityOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.vocab.ParticipationType; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; +import org.openhealthtools.mdht.uml.hl7.vocab.x_DocumentSubstanceMood; + +/** + * A static utility class that provides operations + * related to 'Supply Activity' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.SupplyActivity#validateSupplyActivityMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Supply Activity Mood Code}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.SupplyActivity#validateSupplyActivityHasAuthor(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Supply Activity Has Author}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.SupplyActivity#validateSupplyActivityHasPerformer(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Supply Activity Has Performer}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.SupplyActivity#validateSupplyActivityHasParticipantLocation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Supply Activity Has Participant Location}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.SupplyActivity#validateSupplyActivityInformationSource(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Supply Activity Information Source}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.SupplyActivity#validateSupplyActivityHasProduct(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Supply Activity Has Product}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.SupplyActivity#validateSupplyActivityTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Supply Activity Template Id}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.SupplyActivity#validateSupplyActivityId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Supply Activity Id}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.SupplyActivity#validateSupplyActivityStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Supply Activity Status Code}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.SupplyActivity#validateSupplyActivityEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Supply Activity Effective Time}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.SupplyActivity#validateSupplyActivityQuantity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Supply Activity Quantity}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.SupplyActivity#validateSupplyActivityRepeatNumber(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Supply Activity Repeat Number}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.SupplyActivity#validateSupplyActivityMedicationStatusObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Supply Activity Medication Status Observation}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.SupplyActivity#validateSupplyActivityFulfillmentInstruction(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Supply Activity Fulfillment Instruction}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.SupplyActivity#validateSupplyActivityProductInstance(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Supply Activity Product Instance}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.SupplyActivity#getMedicationStatusObservation() + * Get Medication Status Observation}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.SupplyActivity#getFulfillmentInstructions() + * Get Fulfillment Instructions}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.ccd.SupplyActivity#getProductInstances() + * Get Product Instances}
  • + *
+ *

+ * + * @generated + */ + +public class SupplyActivityTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateSupplyActivityMoodCode() { + OperationsTestCase validateSupplyActivityMoodCodeTestCase = new OperationsTestCase( + "validateSupplyActivityMoodCode", + operationsForOCL.getOCLValue("VALIDATE_SUPPLY_ACTIVITY_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SupplyActivity target) { + target.setMoodCode(x_DocumentSubstanceMood.PRP); + } + + @Override + protected void updateToPass(SupplyActivity target) { + target.init(); + target.setMoodCode(x_DocumentSubstanceMood.EVN); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SupplyActivityOperations.validateSupplyActivityMoodCode( + (SupplyActivity) objectToTest, diagnostician, map); + } + + }; + + validateSupplyActivityMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSupplyActivityHasAuthor() { + OperationsTestCase validateSupplyActivityHasAuthorTestCase = new OperationsTestCase( + "validateSupplyActivityHasAuthor", + operationsForOCL.getOCLValue("VALIDATE_SUPPLY_ACTIVITY_HAS_AUTHOR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SupplyActivity target) { + + } + + @Override + protected void updateToPass(SupplyActivity target) { + target.init(); + Author e = CDAFactory.eINSTANCE.createAuthor(); + target.getAuthors().add(e); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SupplyActivityOperations.validateSupplyActivityHasAuthor( + (SupplyActivity) objectToTest, diagnostician, map); + } + + }; + + validateSupplyActivityHasAuthorTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSupplyActivityHasPerformer() { + OperationsTestCase validateSupplyActivityHasPerformerTestCase = new OperationsTestCase( + "validateSupplyActivityHasPerformer", + operationsForOCL.getOCLValue("VALIDATE_SUPPLY_ACTIVITY_HAS_PERFORMER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SupplyActivity target) { + + } + + @Override + protected void updateToPass(SupplyActivity target) { + target.init(); + target.getPerformers().add(CDAFactory.eINSTANCE.createPerformer2()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SupplyActivityOperations.validateSupplyActivityHasPerformer( + (SupplyActivity) objectToTest, diagnostician, map); + } + + }; + + validateSupplyActivityHasPerformerTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSupplyActivityHasParticipantLocation() { + OperationsTestCase validateSupplyActivityHasParticipantLocationTestCase = new OperationsTestCase( + "validateSupplyActivityHasParticipantLocation", + operationsForOCL.getOCLValue("VALIDATE_SUPPLY_ACTIVITY_HAS_PARTICIPANT_LOCATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SupplyActivity target) { + + } + + @Override + protected void updateToPass(SupplyActivity target) { + target.init(); + Participant2 p2 = CDAFactory.eINSTANCE.createParticipant2(); + p2.setTypeCode(ParticipationType.LOC); + target.getParticipants().add(p2); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SupplyActivityOperations.validateSupplyActivityHasParticipantLocation( + (SupplyActivity) objectToTest, diagnostician, map); + } + + }; + + validateSupplyActivityHasParticipantLocationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSupplyActivityInformationSource() { + OperationsTestCase validateSupplyActivityInformationSourceTestCase = new OperationsTestCase( + "validateSupplyActivityInformationSource", + operationsForOCL.getOCLValue("VALIDATE_SUPPLY_ACTIVITY_INFORMATION_SOURCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SupplyActivity target) { + + } + + @Override + protected void updateToPass(SupplyActivity target) { + target.init(); + + Informant12 inf = CDAFactory.eINSTANCE.createInformant12(); + target.getInformants().add(inf); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SupplyActivityOperations.validateSupplyActivityInformationSource( + (SupplyActivity) objectToTest, diagnostician, map); + } + + }; + + validateSupplyActivityInformationSourceTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSupplyActivityHasProduct() { + OperationsTestCase validateSupplyActivityHasProductTestCase = new OperationsTestCase( + "validateSupplyActivityHasProduct", + operationsForOCL.getOCLValue("VALIDATE_SUPPLY_ACTIVITY_HAS_PRODUCT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SupplyActivity target) { + + } + + @Override + protected void updateToPass(SupplyActivity target) { + target.init(); + + Product p = CDAFactory.eINSTANCE.createProduct(); + target.setProduct(p); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SupplyActivityOperations.validateSupplyActivityHasProduct( + (SupplyActivity) objectToTest, diagnostician, map); + } + + }; + + validateSupplyActivityHasProductTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSupplyActivityTemplateId() { + OperationsTestCase validateSupplyActivityTemplateIdTestCase = new OperationsTestCase( + "validateSupplyActivityTemplateId", + operationsForOCL.getOCLValue("VALIDATE_SUPPLY_ACTIVITY_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SupplyActivity target) { + + } + + @Override + protected void updateToPass(SupplyActivity target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SupplyActivityOperations.validateSupplyActivityTemplateId( + (SupplyActivity) objectToTest, diagnostician, map); + } + + }; + + validateSupplyActivityTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSupplyActivityId() { + OperationsTestCase validateSupplyActivityIdTestCase = new OperationsTestCase( + "validateSupplyActivityId", + operationsForOCL.getOCLValue("VALIDATE_SUPPLY_ACTIVITY_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(SupplyActivity target) { + + } + + @Override + protected void updateToPass(SupplyActivity target) { + target.init(); + target.getIds().add(DatatypesFactory.eINSTANCE.createII()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SupplyActivityOperations.validateSupplyActivityId( + (SupplyActivity) objectToTest, diagnostician, map); + } + + }; + + validateSupplyActivityIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSupplyActivityStatusCode() { + OperationsTestCase validateSupplyActivityStatusCodeTestCase = new OperationsTestCase( + "validateSupplyActivityStatusCode", + operationsForOCL.getOCLValue("VALIDATE_SUPPLY_ACTIVITY_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SupplyActivity target) { + + } + + @Override + protected void updateToPass(SupplyActivity target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SupplyActivityOperations.validateSupplyActivityStatusCode( + (SupplyActivity) objectToTest, diagnostician, map); + } + + }; + + validateSupplyActivityStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSupplyActivityEffectiveTime() { + OperationsTestCase validateSupplyActivityEffectiveTimeTestCase = new OperationsTestCase( + "validateSupplyActivityEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_SUPPLY_ACTIVITY_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SupplyActivity target) { + + } + + @Override + protected void updateToPass(SupplyActivity target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.getEffectiveTimes().add(ts); + // target.setEffectiveTime(ts ); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SupplyActivityOperations.validateSupplyActivityEffectiveTime( + (SupplyActivity) objectToTest, diagnostician, map); + } + + }; + + validateSupplyActivityEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSupplyActivityQuantity() { + OperationsTestCase validateSupplyActivityQuantityTestCase = new OperationsTestCase( + "validateSupplyActivityQuantity", + operationsForOCL.getOCLValue("VALIDATE_SUPPLY_ACTIVITY_QUANTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SupplyActivity target) { + + } + + @Override + protected void updateToPass(SupplyActivity target) { + target.init(); + target.setQuantity(DatatypesFactory.eINSTANCE.createPQ()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SupplyActivityOperations.validateSupplyActivityQuantity( + (SupplyActivity) objectToTest, diagnostician, map); + } + + }; + + validateSupplyActivityQuantityTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSupplyActivityRepeatNumber() { + OperationsTestCase validateSupplyActivityRepeatNumberTestCase = new OperationsTestCase( + "validateSupplyActivityRepeatNumber", + operationsForOCL.getOCLValue("VALIDATE_SUPPLY_ACTIVITY_REPEAT_NUMBER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SupplyActivity target) { + + } + + @Override + protected void updateToPass(SupplyActivity target) { + target.init(); + target.setRepeatNumber(DatatypesFactory.eINSTANCE.createIVL_INT()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SupplyActivityOperations.validateSupplyActivityRepeatNumber( + (SupplyActivity) objectToTest, diagnostician, map); + } + + }; + + validateSupplyActivityRepeatNumberTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSupplyActivityMedicationStatusObservation() { + OperationsTestCase validateSupplyActivityMedicationStatusObservationTestCase = new OperationsTestCase( + "validateSupplyActivityMedicationStatusObservation", + operationsForOCL.getOCLValue("VALIDATE_SUPPLY_ACTIVITY_MEDICATION_STATUS_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SupplyActivity target) { + + } + + @Override + protected void updateToPass(SupplyActivity target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + MedicationStatusObservation obs = CCDFactory.eINSTANCE.createMedicationStatusObservation(); + er.setObservation(obs); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SupplyActivityOperations.validateSupplyActivityMedicationStatusObservation( + (SupplyActivity) objectToTest, diagnostician, map); + } + + }; + + validateSupplyActivityMedicationStatusObservationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSupplyActivityFulfillmentInstruction() { + OperationsTestCase validateSupplyActivityFulfillmentInstructionTestCase = new OperationsTestCase( + "validateSupplyActivityFulfillmentInstruction", + operationsForOCL.getOCLValue("VALIDATE_SUPPLY_ACTIVITY_FULFILLMENT_INSTRUCTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SupplyActivity target) { + + } + + @Override + protected void updateToPass(SupplyActivity target) { + target.init(); + FulfillmentInstruction fi = CCDFactory.eINSTANCE.createFulfillmentInstruction(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + er.setAct(fi); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SupplyActivityOperations.validateSupplyActivityFulfillmentInstruction( + (SupplyActivity) objectToTest, diagnostician, map); + } + + }; + + validateSupplyActivityFulfillmentInstructionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSupplyActivityProductInstance() { + OperationsTestCase validateSupplyActivityProductInstanceTestCase = new OperationsTestCase( + "validateSupplyActivityProductInstance", + operationsForOCL.getOCLValue("VALIDATE_SUPPLY_ACTIVITY_PRODUCT_INSTANCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SupplyActivity target) { + + } + + @Override + protected void updateToPass(SupplyActivity target) { + target.init(); + Participant2 p2 = CDAFactory.eINSTANCE.createParticipant2(); + ProductInstance pi = CCDFactory.eINSTANCE.createProductInstance(); + p2.setParticipantRole(pi); + target.getParticipants().add(p2); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SupplyActivityOperations.validateSupplyActivityProductInstance( + (SupplyActivity) objectToTest, diagnostician, map); + } + + }; + + validateSupplyActivityProductInstanceTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetMedicationStatusObservation() { + + SupplyActivity target = objectFactory.create(); + target.getMedicationStatusObservation(); + + } + + /** + * + * @generated + */ + @Test + public void testGetFulfillmentInstructions() { + + SupplyActivity target = objectFactory.create(); + target.getFulfillmentInstructions(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProductInstances() { + + SupplyActivity target = objectFactory.create(); + target.getProductInstances(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends SupplyActivityOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public SupplyActivity create() { + return CCDFactory.eINSTANCE.createSupplyActivity(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends SupplyActivityOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // SupplyActivityOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/SupportGuardianTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/SupportGuardianTest.java new file mode 100644 index 000000000..a0a0a0787 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/SupportGuardianTest.java @@ -0,0 +1,45 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Support Guardian' model objects. + * + * + * @generated + */ + +public class SupportGuardianTest extends CDAValidationTest { + + /** + * No Operations Test + * @generated + */ + @Test + public void testNoOperations() { + } + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // SupportGuardianOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/SupportParticipantTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/SupportParticipantTest.java new file mode 100644 index 000000000..b899fb9a1 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/SupportParticipantTest.java @@ -0,0 +1,45 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Support Participant' model objects. + * + * + * @generated + */ + +public class SupportParticipantTest extends CDAValidationTest { + + /** + * No Operations Test + * @generated + */ + @Test + public void testNoOperations() { + } + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // SupportParticipantOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/SupportTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/SupportTest.java new file mode 100644 index 000000000..915004300 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/SupportTest.java @@ -0,0 +1,44 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Support' model objects. + * + * + * @generated + */ + +public class SupportTest extends CDAValidationTest { + + /** + * No Operations Test + * @generated + */ + @Test + public void testNoOperations() { + } + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // SupportOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/VitalSignsOrganizerTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/VitalSignsOrganizerTest.java new file mode 100644 index 000000000..75027ca04 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/VitalSignsOrganizerTest.java @@ -0,0 +1,180 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Informant12; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.VitalSignsOrganizer; +import org.openhealthtools.mdht.uml.cda.ccd.operations.VitalSignsOrganizerOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Vital Signs Organizer' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.VitalSignsOrganizer#validateVitalSignsOrganizerInformationSource(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Signs Organizer Information Source}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.VitalSignsOrganizer#validateResultOrganizerTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Organizer Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class VitalSignsOrganizerTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateVitalSignsOrganizerInformationSource() { + OperationsTestCase validateVitalSignsOrganizerInformationSourceTestCase = new OperationsTestCase( + "validateVitalSignsOrganizerInformationSource", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGNS_ORGANIZER_INFORMATION_SOURCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignsOrganizer target) { + + } + + @Override + protected void updateToPass(VitalSignsOrganizer target) { + target.init(); + + Informant12 inf = CDAFactory.eINSTANCE.createInformant12(); + target.getInformants().add(inf); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignsOrganizerOperations.validateVitalSignsOrganizerInformationSource( + (VitalSignsOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignsOrganizerInformationSourceTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateResultOrganizerTemplateId() { + OperationsTestCase validateResultOrganizerTemplateIdTestCase = new OperationsTestCase( + "validateResultOrganizerTemplateId", + operationsForOCL.getOCLValue("VALIDATE_RESULT_ORGANIZER_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignsOrganizer target) { + + } + + @Override + protected void updateToPass(VitalSignsOrganizer target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignsOrganizerOperations.validateResultOrganizerTemplateId( + (VitalSignsOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateResultOrganizerTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends VitalSignsOrganizerOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public VitalSignsOrganizer create() { + return CCDFactory.eINSTANCE.createVitalSignsOrganizer(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends VitalSignsOrganizerOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // VitalSignsOrganizerOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/VitalSignsSectionTest.java b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/VitalSignsSectionTest.java new file mode 100644 index 000000000..a765ce3e6 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/src/org/openhealthtools/mdht/uml/cda/ccd/tests/VitalSignsSectionTest.java @@ -0,0 +1,309 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ccd.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Entry; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.VitalSignsOrganizer; +import org.openhealthtools.mdht.uml.cda.ccd.VitalSignsSection; +import org.openhealthtools.mdht.uml.cda.ccd.operations.VitalSignsSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * A static utility class that provides operations + * related to 'Vital Signs Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.VitalSignsSection#validateVitalSignsSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Signs Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.VitalSignsSection#validateVitalSignsSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Signs Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.VitalSignsSection#validateVitalSignsSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Signs Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.VitalSignsSection#validateVitalSignsSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Signs Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.VitalSignsSection#validateVitalSignsSectionVitalSignsOrganizer(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Signs Section Vital Signs Organizer}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ccd.VitalSignsSection#getVitalSignsOrganizers() Get Vital Signs Organizers}
  • + *
+ *

+ * + * @generated + */ + +public class VitalSignsSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateVitalSignsSectionTemplateId() { + OperationsTestCase validateVitalSignsSectionTemplateIdTestCase = new OperationsTestCase( + "validateVitalSignsSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGNS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignsSection target) { + + } + + @Override + protected void updateToPass(VitalSignsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignsSectionOperations.validateVitalSignsSectionTemplateId( + (VitalSignsSection) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignsSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateVitalSignsSectionCode() { + OperationsTestCase validateVitalSignsSectionCodeTestCase = new OperationsTestCase( + "validateVitalSignsSectionCode", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGNS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignsSection target) { + + } + + @Override + protected void updateToPass(VitalSignsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignsSectionOperations.validateVitalSignsSectionCode( + (VitalSignsSection) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignsSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateVitalSignsSectionTitle() { + OperationsTestCase validateVitalSignsSectionTitleTestCase = new OperationsTestCase( + "validateVitalSignsSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGNS_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignsSection target) { + + } + + @Override + protected void updateToPass(VitalSignsSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignsSectionOperations.validateVitalSignsSectionTitle( + (VitalSignsSection) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignsSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateVitalSignsSectionText() { + OperationsTestCase validateVitalSignsSectionTextTestCase = new OperationsTestCase( + "validateVitalSignsSectionText", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGNS_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignsSection target) { + + } + + @Override + protected void updateToPass(VitalSignsSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignsSectionOperations.validateVitalSignsSectionText( + (VitalSignsSection) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignsSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateVitalSignsSectionVitalSignsOrganizer() { + OperationsTestCase validateVitalSignsSectionVitalSignsOrganizerTestCase = new OperationsTestCase( + "validateVitalSignsSectionVitalSignsOrganizer", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGNS_SECTION_VITAL_SIGNS_ORGANIZER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignsSection target) { + + } + + @Override + protected void updateToPass(VitalSignsSection target) { + target.init(); + Entry entry = CDAFactory.eINSTANCE.createEntry(); + VitalSignsOrganizer org = CCDFactory.eINSTANCE.createVitalSignsOrganizer().init(); + entry.setOrganizer(org); + target.getEntries().add(entry); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignsSectionOperations.validateVitalSignsSectionVitalSignsOrganizer( + (VitalSignsSection) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignsSectionVitalSignsOrganizerTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetVitalSignsOrganizers() { + + VitalSignsSection target = objectFactory.create(); + target.getVitalSignsOrganizers(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends VitalSignsSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public VitalSignsSection create() { + return CCDFactory.eINSTANCE.createVitalSignsSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends VitalSignsSectionOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // VitalSignsSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ccd.tests/test.xml b/org.openhealthtools.mdht.uml.cda.ccd.tests/test.xml new file mode 100644 index 000000000..dfb9f3175 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ccd.tests/test.xml @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/org.openhealthtools.mdht.uml.cda.cdt.tests/.classpath b/org.openhealthtools.mdht.uml.cda.cdt.tests/.classpath new file mode 100644 index 000000000..121e527a9 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.cdt.tests/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.openhealthtools.mdht.uml.cda.cdt.tests/.project b/org.openhealthtools.mdht.uml.cda.cdt.tests/.project new file mode 100644 index 000000000..683267034 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.cdt.tests/.project @@ -0,0 +1,28 @@ + + + org.openhealthtools.mdht.uml.cda.cdt.tests + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.pde.PluginNature + + diff --git a/org.openhealthtools.mdht.uml.cda.cdt.tests/.settings/org.eclipse.jdt.core.prefs b/org.openhealthtools.mdht.uml.cda.cdt.tests/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..fd79a3e6c --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.cdt.tests/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,355 @@ +#Mon May 16 10:24:25 EDT 2011 +eclipse.preferences.version=1 +org.eclipse.jdt.core.codeComplete.argumentPrefixes= +org.eclipse.jdt.core.codeComplete.argumentSuffixes= +org.eclipse.jdt.core.codeComplete.fieldPrefixes= +org.eclipse.jdt.core.codeComplete.fieldSuffixes= +org.eclipse.jdt.core.codeComplete.localPrefixes= +org.eclipse.jdt.core.codeComplete.localSuffixes= +org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.5 +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.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning +org.eclipse.jdt.core.compiler.problem.deadCode=warning +org.eclipse.jdt.core.compiler.problem.deprecation=warning +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore +org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=error +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore +org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning +org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +org.eclipse.jdt.core.compiler.problem.nullReference=warning +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore +org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=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 +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedImport=warning +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +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.5 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=36 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=36 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=36 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=36 +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_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=49 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=32 +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_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=0 +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 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=1 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=150 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@fmtOff +org.eclipse.jdt.core.formatter.enabling_tag=@fmtOn +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +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=true +org.eclipse.jdt.core.formatter.indentation.size=4 +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_parameter=do not 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=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +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_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_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 +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +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_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 +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +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_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not 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_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 +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +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_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 +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +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_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_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 +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=false +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=120 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +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=false +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/org.openhealthtools.mdht.uml.cda.cdt.tests/.settings/org.eclipse.jdt.ui.prefs b/org.openhealthtools.mdht.uml.cda.cdt.tests/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 000000000..6245d2099 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.cdt.tests/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,120 @@ +#Tue Mar 29 22:38:51 EDT 2011 +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=false +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=false +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=false +cleanup.format_source_code=true +cleanup.format_source_code_changes_only=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=false +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=true +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=true +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=true +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_blocks=true +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_parentheses_in_expressions=false +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup_profile=_MDHT +cleanup_settings_version=2 +eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true +formatter_profile=_MDHT +formatter_settings_version=11 +org.eclipse.jdt.ui.exception.name=e +org.eclipse.jdt.ui.gettersetter.use.is=true +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com; +org.eclipse.jdt.ui.javadoc=true +org.eclipse.jdt.ui.keywordthis=false +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.overrideannotation=true +org.eclipse.jdt.ui.staticondemandthreshold=99 +org.eclipse.jdt.ui.text.custom_code_templates= +sp_cleanup.add_default_serial_version_id=true +sp_cleanup.add_generated_serial_version_id=false +sp_cleanup.add_missing_annotations=true +sp_cleanup.add_missing_deprecated_annotations=true +sp_cleanup.add_missing_methods=false +sp_cleanup.add_missing_nls_tags=false +sp_cleanup.add_missing_override_annotations=true +sp_cleanup.add_missing_override_annotations_interface_methods=false +sp_cleanup.add_serial_version_id=false +sp_cleanup.always_use_blocks=true +sp_cleanup.always_use_parentheses_in_expressions=false +sp_cleanup.always_use_this_for_non_static_field_access=false +sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.convert_to_enhanced_for_loop=false +sp_cleanup.correct_indentation=false +sp_cleanup.format_source_code=true +sp_cleanup.format_source_code_changes_only=false +sp_cleanup.make_local_variable_final=false +sp_cleanup.make_parameters_final=false +sp_cleanup.make_private_fields_final=true +sp_cleanup.make_type_abstract_if_missing_method=false +sp_cleanup.make_variable_declarations_final=false +sp_cleanup.never_use_blocks=false +sp_cleanup.never_use_parentheses_in_expressions=true +sp_cleanup.on_save_use_additional_actions=true +sp_cleanup.organize_imports=true +sp_cleanup.qualify_static_field_accesses_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_with_declaring_class=false +sp_cleanup.qualify_static_method_accesses_with_declaring_class=false +sp_cleanup.remove_private_constructors=true +sp_cleanup.remove_trailing_whitespaces=true +sp_cleanup.remove_trailing_whitespaces_all=true +sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +sp_cleanup.remove_unnecessary_casts=true +sp_cleanup.remove_unnecessary_nls_tags=false +sp_cleanup.remove_unused_imports=false +sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_private_fields=true +sp_cleanup.remove_unused_private_members=false +sp_cleanup.remove_unused_private_methods=true +sp_cleanup.remove_unused_private_types=true +sp_cleanup.sort_members=false +sp_cleanup.sort_members_all=false +sp_cleanup.use_blocks=false +sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_parentheses_in_expressions=false +sp_cleanup.use_this_for_non_static_field_access=false +sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true +sp_cleanup.use_this_for_non_static_method_access=false +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/org.openhealthtools.mdht.uml.cda.cdt.tests/META-INF/MANIFEST.MF b/org.openhealthtools.mdht.uml.cda.cdt.tests/META-INF/MANIFEST.MF new file mode 100644 index 000000000..69c47bfce --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.cdt.tests/META-INF/MANIFEST.MF @@ -0,0 +1,23 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: org.openhealthtools.mdht.uml.cda.cdt.tests;singleton:=true +Bundle-Version: 1.1.0.qualifier +Bundle-ClassPath: . +Bundle-Vendor: %providerName +Bundle-Localization: plugin +Bundle-RequiredExecutionEnvironment: J2SE-1.5 +Export-Package: org.openhealthtools.mdht.uml.cda.cdt.tests +Require-Bundle: org.eclipse.core.runtime, + org.openhealthtools.mdht.uml.cda.cdt;visibility:=reexport, + org.openhealthtools.mdht.uml.cda.ccd;visibility:=reexport, + org.openhealthtools.mdht.uml.cda;visibility:=reexport, + org.openhealthtools.mdht.uml.hl7.datatypes;visibility:=reexport, + org.eclipse.emf.ecore;visibility:=reexport, + org.openhealthtools.mdht.uml.hl7.rim;visibility:=reexport, + org.openhealthtools.mdht.uml.hl7.vocab;visibility:=reexport, + org.eclipse.emf.ecore.xmi;visibility:=reexport, + org.junit;visibility:=reexport, + org.openhealthtools.mdht.uml.cda.test;visibility:=reexport, + org.openhealthtools.mdht.uml.cda.ihe;visibility:=reexport +Bundle-ActivationPolicy: lazy diff --git a/org.openhealthtools.mdht.uml.cda.cdt.tests/build.properties b/org.openhealthtools.mdht.uml.cda.cdt.tests/build.properties new file mode 100644 index 000000000..e8b61f336 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.cdt.tests/build.properties @@ -0,0 +1,17 @@ +############################################################################### +# Copyright (c) 2011, 2012 Sean Muir and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Sean Muir (JKM Software) - initial API and implementation +############################################################################### + +bin.includes = .,\ + META-INF/,\ + plugin.properties +jars.compile.order = . +source.. = src/ +output.. = bin/ diff --git a/org.openhealthtools.mdht.uml.cda.cdt.tests/plugin.properties b/org.openhealthtools.mdht.uml.cda.cdt.tests/plugin.properties new file mode 100644 index 000000000..ef2aac197 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.cdt.tests/plugin.properties @@ -0,0 +1,14 @@ +############################################################################### +# Copyright (c) 2011, 2012 Sean Muir and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Sean Muir (JKM Software) - initial API and implementation +############################################################################### + +pluginName = CDT Tests +providerName = www.example.org + diff --git a/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/AssessmentAndPlanSectionProcNoteTest.java b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/AssessmentAndPlanSectionProcNoteTest.java new file mode 100644 index 000000000..c44ae6dfd --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/AssessmentAndPlanSectionProcNoteTest.java @@ -0,0 +1,179 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.cdt.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.cdt.AssessmentAndPlanSectionProcNote; +import org.openhealthtools.mdht.uml.cda.cdt.CDTFactory; +import org.openhealthtools.mdht.uml.cda.cdt.operations.AssessmentAndPlanSectionProcNoteOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Assessment And Plan Section Proc Note' model + * objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.AssessmentAndPlanSectionProcNote#validateAssessmentAndPlanSectionProcNoteTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment And Plan Section Proc Note Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.AssessmentAndPlanSectionProcNote#validateAssessmentAndPlanSectionProcNoteCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment And Plan Section Proc Note Code}
  • + *
+ *

+ * + * @generated + */ + +public class AssessmentAndPlanSectionProcNoteTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateAssessmentAndPlanSectionProcNoteTemplateId() { + OperationsTestCase validateAssessmentAndPlanSectionProcNoteTemplateIdTestCase = new OperationsTestCase( + "validateAssessmentAndPlanSectionProcNoteTemplateId", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_AND_PLAN_SECTION_PROC_NOTE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentAndPlanSectionProcNote target) { + + } + + @Override + protected void updateToPass(AssessmentAndPlanSectionProcNote target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentAndPlanSectionProcNoteOperations.validateAssessmentAndPlanSectionProcNoteTemplateId( + (AssessmentAndPlanSectionProcNote) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentAndPlanSectionProcNoteTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAssessmentAndPlanSectionProcNoteCode() { + OperationsTestCase validateAssessmentAndPlanSectionProcNoteCodeTestCase = new OperationsTestCase( + "validateAssessmentAndPlanSectionProcNoteCode", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_AND_PLAN_SECTION_PROC_NOTE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentAndPlanSectionProcNote target) { + + } + + @Override + protected void updateToPass(AssessmentAndPlanSectionProcNote target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentAndPlanSectionProcNoteOperations.validateAssessmentAndPlanSectionProcNoteCode( + (AssessmentAndPlanSectionProcNote) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentAndPlanSectionProcNoteCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends AssessmentAndPlanSectionProcNoteOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public AssessmentAndPlanSectionProcNote create() { + return CDTFactory.eINSTANCE.createAssessmentAndPlanSectionProcNote(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends AssessmentAndPlanSectionProcNoteOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // AssessmentAndPlanSectionProcNoteOperations diff --git a/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/AssessmentAndPlanSectionTest.java b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/AssessmentAndPlanSectionTest.java new file mode 100644 index 000000000..e3043d41d --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/AssessmentAndPlanSectionTest.java @@ -0,0 +1,179 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.cdt.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.cdt.AssessmentAndPlanSection; +import org.openhealthtools.mdht.uml.cda.cdt.CDTFactory; +import org.openhealthtools.mdht.uml.cda.cdt.operations.AssessmentAndPlanSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Assessment And Plan Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.AssessmentAndPlanSection#validateAssessmentAndPlanSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment And Plan Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.AssessmentAndPlanSection#validateAssessmentAndPlanSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment And Plan Section Code}
  • + *
+ *

+ * + * @generated + */ + +public class AssessmentAndPlanSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateAssessmentAndPlanSectionTemplateId() { + OperationsTestCase validateAssessmentAndPlanSectionTemplateIdTestCase = new OperationsTestCase( + "validateAssessmentAndPlanSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_AND_PLAN_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentAndPlanSection target) { + + } + + @Override + protected void updateToPass(AssessmentAndPlanSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentAndPlanSectionOperations.validateAssessmentAndPlanSectionTemplateId( + (AssessmentAndPlanSection) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentAndPlanSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAssessmentAndPlanSectionCode() { + OperationsTestCase validateAssessmentAndPlanSectionCodeTestCase = new OperationsTestCase( + "validateAssessmentAndPlanSectionCode", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_AND_PLAN_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentAndPlanSection target) { + + } + + @Override + protected void updateToPass(AssessmentAndPlanSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentAndPlanSectionOperations.validateAssessmentAndPlanSectionCode( + (AssessmentAndPlanSection) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentAndPlanSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends AssessmentAndPlanSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public AssessmentAndPlanSection create() { + return CDTFactory.eINSTANCE.createAssessmentAndPlanSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends AssessmentAndPlanSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // AssessmentAndPlanSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/AssessmentSectionProcNoteTest.java b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/AssessmentSectionProcNoteTest.java new file mode 100644 index 000000000..ffcb50fd6 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/AssessmentSectionProcNoteTest.java @@ -0,0 +1,179 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.cdt.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.cdt.AssessmentSectionProcNote; +import org.openhealthtools.mdht.uml.cda.cdt.CDTFactory; +import org.openhealthtools.mdht.uml.cda.cdt.operations.AssessmentSectionProcNoteOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Assessment Section Proc Note' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.AssessmentSectionProcNote#validateAssessmentSectionProcNoteTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment Section Proc Note Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.AssessmentSectionProcNote#validateAssessmentSectionProcNoteCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment Section Proc Note Code}
  • + *
+ *

+ * + * @generated + */ + +public class AssessmentSectionProcNoteTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateAssessmentSectionProcNoteTemplateId() { + OperationsTestCase validateAssessmentSectionProcNoteTemplateIdTestCase = new OperationsTestCase( + "validateAssessmentSectionProcNoteTemplateId", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_SECTION_PROC_NOTE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentSectionProcNote target) { + + } + + @Override + protected void updateToPass(AssessmentSectionProcNote target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentSectionProcNoteOperations.validateAssessmentSectionProcNoteTemplateId( + (AssessmentSectionProcNote) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentSectionProcNoteTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAssessmentSectionProcNoteCode() { + OperationsTestCase validateAssessmentSectionProcNoteCodeTestCase = new OperationsTestCase( + "validateAssessmentSectionProcNoteCode", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_SECTION_PROC_NOTE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentSectionProcNote target) { + + } + + @Override + protected void updateToPass(AssessmentSectionProcNote target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentSectionProcNoteOperations.validateAssessmentSectionProcNoteCode( + (AssessmentSectionProcNote) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentSectionProcNoteCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends AssessmentSectionProcNoteOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public AssessmentSectionProcNote create() { + return CDTFactory.eINSTANCE.createAssessmentSectionProcNote(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends AssessmentSectionProcNoteOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // AssessmentSectionProcNoteOperations diff --git a/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/AssessmentSectionTest.java b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/AssessmentSectionTest.java new file mode 100644 index 000000000..a7d363713 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/AssessmentSectionTest.java @@ -0,0 +1,179 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.cdt.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.cdt.AssessmentSection; +import org.openhealthtools.mdht.uml.cda.cdt.CDTFactory; +import org.openhealthtools.mdht.uml.cda.cdt.operations.AssessmentSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Assessment Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.AssessmentSection#validateAssessmentSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.AssessmentSection#validateAssessmentSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment Section Code}
  • + *
+ *

+ * + * @generated + */ + +public class AssessmentSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateAssessmentSectionTemplateId() { + OperationsTestCase validateAssessmentSectionTemplateIdTestCase = new OperationsTestCase( + "validateAssessmentSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentSection target) { + + } + + @Override + protected void updateToPass(AssessmentSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentSectionOperations.validateAssessmentSectionTemplateId( + (AssessmentSection) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAssessmentSectionCode() { + OperationsTestCase validateAssessmentSectionCodeTestCase = new OperationsTestCase( + "validateAssessmentSectionCode", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentSection target) { + + } + + @Override + protected void updateToPass(AssessmentSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentSectionOperations.validateAssessmentSectionCode( + (AssessmentSection) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends AssessmentSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public AssessmentSection create() { + return CDTFactory.eINSTANCE.createAssessmentSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends AssessmentSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // AssessmentSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/CDTAllTests.java b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/CDTAllTests.java new file mode 100644 index 000000000..8bad286fb --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/CDTAllTests.java @@ -0,0 +1,50 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.cdt.tests; + +import junit.framework.Test; +import junit.framework.TestSuite; +import junit.textui.TestRunner; + +/** + * A test suite for the 'CDT' model. + * + * @generated + */ +public class CDTAllTests extends TestSuite { + + /** + * + * @generated + */ + public static void main(String[] args) { + TestRunner.run(suite()); + } + + /** + * + * @generated + */ + public static Test suite() { + TestSuite suite = new CDTAllTests("CDT Tests"); + suite.addTest(CDTTests.suite()); + return suite; + } + + /** + * + * @generated + */ + public CDTAllTests(String name) { + super(name); + } + +} // CDTAllTests diff --git a/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/CDTExample.java b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/CDTExample.java new file mode 100644 index 000000000..5436f7789 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/CDTExample.java @@ -0,0 +1,116 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.cdt.tests; + +import java.io.File; +import java.io.IOException; + +import org.eclipse.emf.common.util.Diagnostic; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; +import org.eclipse.emf.ecore.util.Diagnostician; +import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl; +import org.openhealthtools.mdht.uml.cda.cdt.CDTFactory; +import org.openhealthtools.mdht.uml.cda.cdt.CDTPackage; +import org.openhealthtools.mdht.uml.cda.cdt.GeneralHeaderConstraints; + +/** + * A sample utility for the 'cdt' + * package. + * @generated + */ +public class CDTExample { + /** + * Load all the argument file paths or URIs as + * instances of the model. + * @param args the file paths or URIs. + * @generated + */ + public static void main(String[] args) { + // Create a resource set to hold the resources. + // + ResourceSet resourceSet = new ResourceSetImpl(); + + // Register the appropriate resource factory to handle all file extensions. + // + resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put( + Resource.Factory.Registry.DEFAULT_EXTENSION, new XMIResourceFactoryImpl()); + + // Register the package to ensure it is available during loading. + // + resourceSet.getPackageRegistry().put(CDTPackage.eNS_URI, CDTPackage.eINSTANCE); + + // If there are no arguments, emit an appropriate usage message. + // + if (args.length == 0) { + System.out.println("Enter a list of file paths or URIs that have content like this:"); + try { + Resource resource = resourceSet.createResource(URI.createURI("http:///My.cdt")); + GeneralHeaderConstraints root = CDTFactory.eINSTANCE.createGeneralHeaderConstraints(); + resource.getContents().add(root); + resource.save(System.out, null); + } catch (IOException exception) { + exception.printStackTrace(); + } + } else { + // Iterate over all the arguments. + // + for (int i = 0; i < args.length; ++i) { + // Construct the URI for the instance file. + // The argument is treated as a file path only if it denotes an existing file. + // Otherwise, it's directly treated as a URL. + // + File file = new File(args[i]); + URI uri = file.isFile() + ? URI.createFileURI(file.getAbsolutePath()) + : URI.createURI(args[i]); + + try { + // Demand load resource for this file. + // + Resource resource = resourceSet.getResource(uri, true); + System.out.println("Loaded " + uri); + + // Validate the contents of the loaded resource. + // + for (EObject eObject : resource.getContents()) { + Diagnostic diagnostic = Diagnostician.INSTANCE.validate(eObject); + if (diagnostic.getSeverity() != Diagnostic.OK) { + printDiagnostic(diagnostic, ""); + } + } + } catch (RuntimeException exception) { + System.out.println("Problem loading " + uri); + exception.printStackTrace(); + } + } + } + } + + /** + * Prints diagnostics with indentation. + * @param diagnostic the diagnostic to print. + * @param indent the indentation for printing. + * @generated + */ + protected static void printDiagnostic(Diagnostic diagnostic, String indent) { + System.out.print(indent); + System.out.println(diagnostic.getMessage()); + for (Diagnostic child : diagnostic.getChildren()) { + printDiagnostic(child, indent + " "); + } + } + +} // CDTExample diff --git a/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/CDTRegistryDelegateTest.java b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/CDTRegistryDelegateTest.java new file mode 100644 index 000000000..c91b42218 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/CDTRegistryDelegateTest.java @@ -0,0 +1,116 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.cdt.tests; + +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.cdt.CDTFactory; +import org.openhealthtools.mdht.uml.cda.cdt.CDTRegistryDelegate; +import org.openhealthtools.mdht.uml.cda.cdt.operations.CDTRegistryDelegateOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Registry Delegate' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.RegistryDelegate#getEClass(java.lang.String, java.lang.Object) Get EClass}
  • + *
+ *

+ * + * @generated + */ + +public class CDTRegistryDelegateTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testGetEClass() { + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends CDTRegistryDelegateOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public CDTRegistryDelegate create() { + return CDTFactory.eINSTANCE.createCDTRegistryDelegate(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends CDTRegistryDelegateOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // CDTRegistryDelegateOperations diff --git a/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/CDTTests.java b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/CDTTests.java new file mode 100644 index 000000000..c3a87d7ff --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/CDTTests.java @@ -0,0 +1,48 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.cdt.tests; + +import junit.framework.JUnit4TestAdapter; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +/** + * A test suite for the 'cdt' package. + * + * + + * @generated + */ +@RunWith(Suite.class) +@Suite.SuiteClasses({ + GeneralHeaderConstraintsTest.class, HistoryAndPhysicalTest.class, HistoryOfPresentIllnessTest.class, + PastMedicalHistorySectionTest.class, ReviewOfSystemsSectionIHETest.class, PhysicalExaminationSectionTest.class, + VitalSignsSectionTest.class, GeneralStatusSectionTest.class, DiagnosticFindingsTest.class, + ConsultationNoteTest.class, PastMedicalHistorySectionConsultTest.class, ReviewOfSystemsSectionTest.class, + ReasonForReferralSectionTest.class, ReasonForVisitSectionConsultTest.class, LevelOneConformanceTest.class, + LevelTwoConformanceTest.class, LevelThreeConformanceTest.class, AssessmentSectionTest.class, + PlanSectionTest.class, AssessmentAndPlanSectionTest.class, ReasonForVisitSectionTest.class, + ChiefComplaintSectionTest.class, ReasonForVisitAndChiefComplaintSectionTest.class, ProgressNoteTest.class, + AssessmentAndPlanSectionProcNoteTest.class, AssessmentSectionProcNoteTest.class, + ChiefComplaintSectionProcNoteTest.class, ObjectiveSectionTest.class, SubjectiveSectionTest.class, + CDTRegistryDelegateTest.class }) +public class CDTTests { + + /** + * + * @generated + */ + public static junit.framework.Test suite() { + return new JUnit4TestAdapter(CDTTests.class); + } + +} // CDTTests diff --git a/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/ChiefComplaintSectionProcNoteTest.java b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/ChiefComplaintSectionProcNoteTest.java new file mode 100644 index 000000000..92ca30ded --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/ChiefComplaintSectionProcNoteTest.java @@ -0,0 +1,179 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.cdt.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.cdt.CDTFactory; +import org.openhealthtools.mdht.uml.cda.cdt.ChiefComplaintSectionProcNote; +import org.openhealthtools.mdht.uml.cda.cdt.operations.ChiefComplaintSectionProcNoteOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Chief Complaint Section Proc Note' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ChiefComplaintSectionProcNote#validateChiefComplaintSectionProcNoteTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Chief Complaint Section Proc Note Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ChiefComplaintSectionProcNote#validateChiefComplaintSectionProcNoteCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Chief Complaint Section Proc Note Code}
  • + *
+ *

+ * + * @generated + */ + +public class ChiefComplaintSectionProcNoteTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateChiefComplaintSectionProcNoteTemplateId() { + OperationsTestCase validateChiefComplaintSectionProcNoteTemplateIdTestCase = new OperationsTestCase( + "validateChiefComplaintSectionProcNoteTemplateId", + operationsForOCL.getOCLValue("VALIDATE_CHIEF_COMPLAINT_SECTION_PROC_NOTE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ChiefComplaintSectionProcNote target) { + + } + + @Override + protected void updateToPass(ChiefComplaintSectionProcNote target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ChiefComplaintSectionProcNoteOperations.validateChiefComplaintSectionProcNoteTemplateId( + (ChiefComplaintSectionProcNote) objectToTest, diagnostician, map); + } + + }; + + validateChiefComplaintSectionProcNoteTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateChiefComplaintSectionProcNoteCode() { + OperationsTestCase validateChiefComplaintSectionProcNoteCodeTestCase = new OperationsTestCase( + "validateChiefComplaintSectionProcNoteCode", + operationsForOCL.getOCLValue("VALIDATE_CHIEF_COMPLAINT_SECTION_PROC_NOTE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ChiefComplaintSectionProcNote target) { + + } + + @Override + protected void updateToPass(ChiefComplaintSectionProcNote target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ChiefComplaintSectionProcNoteOperations.validateChiefComplaintSectionProcNoteCode( + (ChiefComplaintSectionProcNote) objectToTest, diagnostician, map); + } + + }; + + validateChiefComplaintSectionProcNoteCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ChiefComplaintSectionProcNoteOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public ChiefComplaintSectionProcNote create() { + return CDTFactory.eINSTANCE.createChiefComplaintSectionProcNote(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends ChiefComplaintSectionProcNoteOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ChiefComplaintSectionProcNoteOperations diff --git a/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/ChiefComplaintSectionTest.java b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/ChiefComplaintSectionTest.java new file mode 100644 index 000000000..c164cd87c --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/ChiefComplaintSectionTest.java @@ -0,0 +1,179 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.cdt.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.cdt.CDTFactory; +import org.openhealthtools.mdht.uml.cda.cdt.ChiefComplaintSection; +import org.openhealthtools.mdht.uml.cda.cdt.operations.ChiefComplaintSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Chief Complaint Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ChiefComplaintSection#validateChiefComplaintSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Chief Complaint Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ChiefComplaintSection#validateChiefComplaintSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Chief Complaint Section Code}
  • + *
+ *

+ * + * @generated + */ + +public class ChiefComplaintSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateChiefComplaintSectionTemplateId() { + OperationsTestCase validateChiefComplaintSectionTemplateIdTestCase = new OperationsTestCase( + "validateChiefComplaintSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_CHIEF_COMPLAINT_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ChiefComplaintSection target) { + + } + + @Override + protected void updateToPass(ChiefComplaintSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ChiefComplaintSectionOperations.validateChiefComplaintSectionTemplateId( + (ChiefComplaintSection) objectToTest, diagnostician, map); + } + + }; + + validateChiefComplaintSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateChiefComplaintSectionCode() { + OperationsTestCase validateChiefComplaintSectionCodeTestCase = new OperationsTestCase( + "validateChiefComplaintSectionCode", + operationsForOCL.getOCLValue("VALIDATE_CHIEF_COMPLAINT_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ChiefComplaintSection target) { + + } + + @Override + protected void updateToPass(ChiefComplaintSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ChiefComplaintSectionOperations.validateChiefComplaintSectionCode( + (ChiefComplaintSection) objectToTest, diagnostician, map); + } + + }; + + validateChiefComplaintSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ChiefComplaintSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public ChiefComplaintSection create() { + return CDTFactory.eINSTANCE.createChiefComplaintSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends ChiefComplaintSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ChiefComplaintSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/ConsultationNoteTest.java b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/ConsultationNoteTest.java new file mode 100644 index 000000000..418409309 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/ConsultationNoteTest.java @@ -0,0 +1,996 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.cdt.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ccd.AlertsSection; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.FamilyHistorySection; +import org.openhealthtools.mdht.uml.cda.ccd.ImmunizationsSection; +import org.openhealthtools.mdht.uml.cda.ccd.MedicationsSection; +import org.openhealthtools.mdht.uml.cda.ccd.ProblemSection; +import org.openhealthtools.mdht.uml.cda.ccd.ProceduresSection; +import org.openhealthtools.mdht.uml.cda.ccd.SocialHistorySection; +import org.openhealthtools.mdht.uml.cda.cdt.CDTFactory; +import org.openhealthtools.mdht.uml.cda.cdt.ConsultationNote; +import org.openhealthtools.mdht.uml.cda.cdt.DiagnosticFindings; +import org.openhealthtools.mdht.uml.cda.cdt.GeneralStatusSection; +import org.openhealthtools.mdht.uml.cda.cdt.HistoryOfPresentIllness; +import org.openhealthtools.mdht.uml.cda.cdt.PastMedicalHistorySectionConsult; +import org.openhealthtools.mdht.uml.cda.cdt.PhysicalExaminationSection; +import org.openhealthtools.mdht.uml.cda.cdt.ReasonForVisitSectionConsult; +import org.openhealthtools.mdht.uml.cda.cdt.ReviewOfSystemsSection; +import org.openhealthtools.mdht.uml.cda.cdt.operations.ConsultationNoteOperations; +import org.openhealthtools.mdht.uml.cda.cdt.operations.GeneralHeaderConstraintsOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; + +/** + * A static utility class that provides operations + * related to 'Consultation Note' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ConsultationNote#validateConsultationNoteReferralOrVisit(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note Referral Or Visit}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ConsultationNote#validateConsultationNoteHistoryOfPresentIllness(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note History Of Present Illness}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ConsultationNote#validateConsultationNotePhysicalExamination(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note Physical Examination}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ConsultationNote#validateConsultationNoteProblemSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note Problem Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ConsultationNote#validateConsultationNoteProceduresSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note Procedures Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ConsultationNote#validateConsultationNotePastMedicalHistorySection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note Past Medical History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ConsultationNote#validateConsultationNoteImmunizationsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note Immunizations Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ConsultationNote#validateConsultationNoteMedicationsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note Medications Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ConsultationNote#validateConsultationNoteAlertsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note Alerts Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ConsultationNote#validateConsultationNoteSocialHistorySection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note Social History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ConsultationNote#validateConsultationNoteFamilyHistorySection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note Family History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ConsultationNote#validateConsultationNoteReviewOfSystemsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note Review Of Systems Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ConsultationNote#validateConsultationNoteVitalSignsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note Vital Signs Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ConsultationNote#validateConsultationNoteGeneralStatusSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note General Status Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ConsultationNote#validateConsultationNoteDiagnosticFindings(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note Diagnostic Findings}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ConsultationNote#getHistoryOfPresentIllness() Get History Of Present Illness}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ConsultationNote#getPhysicalExamination() Get Physical Examination}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ConsultationNote#getProblemSection() Get Problem Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ConsultationNote#getProceduresSection() Get Procedures Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ConsultationNote#getPastMedicalHistorySection() Get Past Medical History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ConsultationNote#getImmunizationsSection() Get Immunizations Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ConsultationNote#getMedicationsSection() Get Medications Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ConsultationNote#getAlertsSection() Get Alerts Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ConsultationNote#getSocialHistorySection() Get Social History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ConsultationNote#getFamilyHistorySection() Get Family History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ConsultationNote#getReviewOfSystemsSection() Get Review Of Systems Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ConsultationNote#getVitalSignsSection() Get Vital Signs Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ConsultationNote#getGeneralStatusSection() Get General Status Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ConsultationNote#getDiagnosticFindings() Get Diagnostic Findings}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ConsultationNote#validateGeneralHeaderConstraintsTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ConsultationNote#validateGeneralHeaderConstraintsCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Code}
  • + *
+ *

+ * + * @generated NOT + */ + +public class ConsultationNoteTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationNoteReferralOrVisit() { + OperationsTestCase validateConsultationNoteReferralOrVisitTestCase = new OperationsTestCase( + "validateConsultationNoteReferralOrVisit", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_REFERRAL_OR_VISIT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + + } + + @Override + protected void updateToPass(ConsultationNote target) { + target.init(); + ReasonForVisitSectionConsult rfvsc = CDTFactory.eINSTANCE.createReasonForVisitSectionConsult().init(); + target.addSection(rfvsc); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteReferralOrVisit( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteReferralOrVisitTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateConsultationNoteHistoryOfPresentIllness() { + OperationsTestCase validateConsultationNoteHistoryOfPresentIllnessTestCase = new OperationsTestCase( + "validateConsultationNoteHistoryOfPresentIllness", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_HISTORY_OF_PRESENT_ILLNESS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + + } + + @Override + protected void updateToPass(ConsultationNote target) { + target.init(); + + HistoryOfPresentIllness hopi = CDTFactory.eINSTANCE.createHistoryOfPresentIllness().init(); + target.addSection(hopi); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteHistoryOfPresentIllness( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteHistoryOfPresentIllnessTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationNotePhysicalExamination() { + OperationsTestCase validateConsultationNotePhysicalExaminationTestCase = new OperationsTestCase( + "validateConsultationNotePhysicalExamination", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_PHYSICAL_EXAMINATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + + } + + @Override + protected void updateToPass(ConsultationNote target) { + target.init(); + + PhysicalExaminationSection pes = CDTFactory.eINSTANCE.createPhysicalExaminationSection().init(); + + target.addSection(pes); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNotePhysicalExamination( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNotePhysicalExaminationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateConsultationNoteProblemSection() { + OperationsTestCase validateConsultationNoteProblemSectionTestCase = new OperationsTestCase( + "validateConsultationNoteProblemSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_PROBLEM_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + + } + + @Override + protected void updateToPass(ConsultationNote target) { + target.init(); + + /* ProblemSection */ + ProblemSection section = + + CCDFactory.eINSTANCE.createProblemSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteProblemSection( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteProblemSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateConsultationNoteProceduresSection() { + OperationsTestCase validateConsultationNoteProceduresSectionTestCase = new OperationsTestCase( + "validateConsultationNoteProceduresSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_PROCEDURES_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + + } + + @Override + protected void updateToPass(ConsultationNote target) { + target.init(); + + /* ProceduresSection */ + ProceduresSection section = + + CCDFactory.eINSTANCE.createProceduresSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteProceduresSection( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteProceduresSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationNotePastMedicalHistorySection() { + OperationsTestCase validateConsultationNotePastMedicalHistorySectionTestCase = new OperationsTestCase( + "validateConsultationNotePastMedicalHistorySection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_PAST_MEDICAL_HISTORY_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + + } + + @Override + protected void updateToPass(ConsultationNote target) { + target.init(); + + /* PastMedicalHistorySection */ + PastMedicalHistorySectionConsult section = + + CDTFactory.eINSTANCE.createPastMedicalHistorySectionConsult().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNotePastMedicalHistorySection( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNotePastMedicalHistorySectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateConsultationNoteImmunizationsSection() { + OperationsTestCase validateConsultationNoteImmunizationsSectionTestCase = new OperationsTestCase( + "validateConsultationNoteImmunizationsSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_IMMUNIZATIONS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + + } + + @Override + protected void updateToPass(ConsultationNote target) { + target.init(); + + /* ImmunizationsSection */ + ImmunizationsSection section = + + CCDFactory.eINSTANCE.createImmunizationsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteImmunizationsSection( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteImmunizationsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateConsultationNoteMedicationsSection() { + OperationsTestCase validateConsultationNoteMedicationsSectionTestCase = new OperationsTestCase( + "validateConsultationNoteMedicationsSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_MEDICATIONS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + + } + + @Override + protected void updateToPass(ConsultationNote target) { + target.init(); + + /* MedicationsSection */ + MedicationsSection section = + + CCDFactory.eINSTANCE.createMedicationsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteMedicationsSection( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteMedicationsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateConsultationNoteAlertsSection() { + OperationsTestCase validateConsultationNoteAlertsSectionTestCase = new OperationsTestCase( + "validateConsultationNoteAlertsSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_ALERTS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + + } + + @Override + protected void updateToPass(ConsultationNote target) { + target.init(); + + /* AlertsSection */ + AlertsSection section = + + CCDFactory.eINSTANCE.createAlertsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteAlertsSection( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteAlertsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateConsultationNoteSocialHistorySection() { + OperationsTestCase validateConsultationNoteSocialHistorySectionTestCase = new OperationsTestCase( + "validateConsultationNoteSocialHistorySection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_SOCIAL_HISTORY_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + + } + + @Override + protected void updateToPass(ConsultationNote target) { + target.init(); + + /* SocialHistorySection */ + SocialHistorySection section = + + CCDFactory.eINSTANCE.createSocialHistorySection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteSocialHistorySection( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteSocialHistorySectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateConsultationNoteFamilyHistorySection() { + OperationsTestCase validateConsultationNoteFamilyHistorySectionTestCase = new OperationsTestCase( + "validateConsultationNoteFamilyHistorySection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_FAMILY_HISTORY_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + + } + + @Override + protected void updateToPass(ConsultationNote target) { + target.init(); + + /* FamilyHistorySection */ + FamilyHistorySection section = + + CCDFactory.eINSTANCE.createFamilyHistorySection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteFamilyHistorySection( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteFamilyHistorySectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateConsultationNoteReviewOfSystemsSection() { + OperationsTestCase validateConsultationNoteReviewOfSystemsSectionTestCase = new OperationsTestCase( + "validateConsultationNoteReviewOfSystemsSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_REVIEW_OF_SYSTEMS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + + } + + @Override + protected void updateToPass(ConsultationNote target) { + target.init(); + + /* ReviewOfSystemsSection */ + ReviewOfSystemsSection section = + + CDTFactory.eINSTANCE.createReviewOfSystemsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteReviewOfSystemsSection( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteReviewOfSystemsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateConsultationNoteVitalSignsSection() { + OperationsTestCase validateConsultationNoteVitalSignsSectionTestCase = new OperationsTestCase( + "validateConsultationNoteVitalSignsSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_VITAL_SIGNS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + + } + + @Override + protected void updateToPass(ConsultationNote target) { + target.init(); + + /* VitalSignsSection */ + org.openhealthtools.mdht.uml.cda.ccd.VitalSignsSection section = + + CCDFactory.eINSTANCE.createVitalSignsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteVitalSignsSection( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteVitalSignsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateConsultationNoteGeneralStatusSection() { + OperationsTestCase validateConsultationNoteGeneralStatusSectionTestCase = new OperationsTestCase( + "validateConsultationNoteGeneralStatusSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_GENERAL_STATUS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + + } + + @Override + protected void updateToPass(ConsultationNote target) { + target.init(); + + /* GeneralStatusSection */ + GeneralStatusSection section = + + CDTFactory.eINSTANCE.createGeneralStatusSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteGeneralStatusSection( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteGeneralStatusSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationNoteDiagnosticFindings() { + OperationsTestCase validateConsultationNoteDiagnosticFindingsTestCase = new OperationsTestCase( + "validateConsultationNoteDiagnosticFindings", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_DIAGNOSTIC_FINDINGS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + + } + + @Override + protected void updateToPass(ConsultationNote target) { + target.init(); + DiagnosticFindings df = CDTFactory.eINSTANCE.createDiagnosticFindings().init(); + target.addSection(df); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteDiagnosticFindings( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteDiagnosticFindingsTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetHistoryOfPresentIllness() { + + ConsultationNote target = objectFactory.create(); + target.getHistoryOfPresentIllness(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPhysicalExamination() { + + ConsultationNote target = objectFactory.create(); + target.getPhysicalExamination(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProblemSection() { + + ConsultationNote target = objectFactory.create(); + target.getProblemSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProceduresSection() { + + ConsultationNote target = objectFactory.create(); + target.getProceduresSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPastMedicalHistorySection() { + + ConsultationNote target = objectFactory.create(); + target.getPastMedicalHistorySection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetImmunizationsSection() { + + ConsultationNote target = objectFactory.create(); + target.getImmunizationsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetMedicationsSection() { + + ConsultationNote target = objectFactory.create(); + target.getMedicationsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetAlertsSection() { + + ConsultationNote target = objectFactory.create(); + target.getAlertsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetSocialHistorySection() { + + ConsultationNote target = objectFactory.create(); + target.getSocialHistorySection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetFamilyHistorySection() { + + ConsultationNote target = objectFactory.create(); + target.getFamilyHistorySection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetReviewOfSystemsSection() { + + ConsultationNote target = objectFactory.create(); + target.getReviewOfSystemsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetVitalSignsSection() { + + ConsultationNote target = objectFactory.create(); + target.getVitalSignsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetGeneralStatusSection() { + + ConsultationNote target = objectFactory.create(); + target.getGeneralStatusSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetDiagnosticFindings() { + + ConsultationNote target = objectFactory.create(); + target.getDiagnosticFindings(); + + } + + /** + * + * @generated + */ + @Test + public void testValidateGeneralHeaderConstraintsTemplateId() { + OperationsTestCase validateGeneralHeaderConstraintsTemplateIdTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsTemplateId", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + + } + + @Override + protected void updateToPass(ConsultationNote target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateGeneralHeaderConstraintsTemplateId( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateGeneralHeaderConstraintsCode() { + OperationsTestCase validateGeneralHeaderConstraintsCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + + } + + @Override + protected void updateToPass(ConsultationNote target) { + target.init(); + CE ce = DatatypesFactory.eINSTANCE.createCE(); + ce.setCodeSystem("2.16.840.1.113883.6.1"); + ce.setCode("111"); + target.setCode(ce); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsCode( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ConsultationNoteOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public ConsultationNote create() { + return CDTFactory.eINSTANCE.createConsultationNote(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends ConsultationNoteOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ConsultationNoteOperations diff --git a/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/DiagnosticFindingsTest.java b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/DiagnosticFindingsTest.java new file mode 100644 index 000000000..4b2d649a4 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/DiagnosticFindingsTest.java @@ -0,0 +1,148 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.cdt.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.cdt.CDTFactory; +import org.openhealthtools.mdht.uml.cda.cdt.DiagnosticFindings; +import org.openhealthtools.mdht.uml.cda.cdt.operations.DiagnosticFindingsOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * A static utility class that provides operations + * related to 'Diagnostic Findings' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.DiagnosticFindings#validateDiagnosticFindingsTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Diagnostic Findings Title}
  • + *
+ *

+ * + * @generated + */ + +public class DiagnosticFindingsTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateDiagnosticFindingsTitle() { + OperationsTestCase validateDiagnosticFindingsTitleTestCase = new OperationsTestCase( + "validateDiagnosticFindingsTitle", + operationsForOCL.getOCLValue("VALIDATE_DIAGNOSTIC_FINDINGS_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DiagnosticFindings target) { + + } + + @Override + protected void updateToPass(DiagnosticFindings target) { + target.init(); + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DiagnosticFindingsOperations.validateDiagnosticFindingsTitle( + (DiagnosticFindings) objectToTest, diagnostician, map); + } + + }; + + validateDiagnosticFindingsTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends DiagnosticFindingsOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public DiagnosticFindings create() { + return CDTFactory.eINSTANCE.createDiagnosticFindings(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends DiagnosticFindingsOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // DiagnosticFindingsOperations diff --git a/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/GeneralHeaderConstraintsTest.java b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/GeneralHeaderConstraintsTest.java new file mode 100644 index 000000000..39e48c3f7 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/GeneralHeaderConstraintsTest.java @@ -0,0 +1,1620 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.cdt.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.AssignedEntity; +import org.openhealthtools.mdht.uml.cda.Authenticator; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.InfrastructureRootTypeId; +import org.openhealthtools.mdht.uml.cda.Patient; +import org.openhealthtools.mdht.uml.cda.PatientRole; +import org.openhealthtools.mdht.uml.cda.Person; +import org.openhealthtools.mdht.uml.cda.cdt.GeneralHeaderConstraints; +import org.openhealthtools.mdht.uml.cda.cdt.operations.GeneralHeaderConstraintsOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * A static utility class that provides operations + * related to 'General Header Constraints' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.GeneralHeaderConstraints#validateGeneralHeaderConstraintsPersonHasName(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Person Has Name}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRolesShallHaveAddrAndTelecom(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Roles Shall Have Addr And Telecom}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRolesShouldHaveAddrAndTelecom(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Roles Should Have Addr And Telecom}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.GeneralHeaderConstraints#validateGeneralHeaderConstraintsOrganizationsHaveContactInfo(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Organizations Have Contact Info}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.GeneralHeaderConstraints#validateGeneralHeaderConstraintsTimePreciseToDay(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Time Precise To Day}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.GeneralHeaderConstraints#validateGeneralHeaderConstraintsTimePreciseToYear(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Time Precise To Year}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.GeneralHeaderConstraints#validateGeneralHeaderConstraintsTelephoneMatchesRegex(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Telephone Matches Regex}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.GeneralHeaderConstraints#validateGeneralHeaderConstraintsHasTelephoneDialingDigits(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Has Telephone Dialing Digits}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.GeneralHeaderConstraints#validateGeneralHeaderConstraintsUnknownTelephoneUsesNullFlavor(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Unknown Telephone Uses Null Flavor}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.GeneralHeaderConstraints#validateGeneralHeaderConstraintsTypeIdExtension(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Type Id Extension}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.GeneralHeaderConstraints#validateGeneralHeaderConstraintsIdRootFormat(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Id Root Format}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.GeneralHeaderConstraints#validateGeneralHeaderConstraintsOidLength(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Oid Length}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.GeneralHeaderConstraints#validateGeneralHeaderConstraintsLanguageCodeForm(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Language Code Form}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.GeneralHeaderConstraints#validateGeneralHeaderConstraintsSetIdAndVersionNumber(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Set Id And Version Number}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.GeneralHeaderConstraints#validateGeneralHeaderConstraintsSetIdAndIdAreUnique(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Set Id And Id Are Unique}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.GeneralHeaderConstraints#validateGeneralHeaderConstraintsCopyTimeNotPresent(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Copy Time Not Present}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.GeneralHeaderConstraints#validateGeneralHeaderConstraintsHasRecordTargetPatientRole(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Has Record Target Patient Role}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.GeneralHeaderConstraints#validateGeneralHeaderConstraintsHasPatientBirthTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Has Patient Birth Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.GeneralHeaderConstraints#validateGeneralHeaderConstraintsHasAdministrativeGenderCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Has Administrative Gender Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.GeneralHeaderConstraints#validateGeneralHeaderConstraintsHasProviderOrganization(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Has Provider Organization}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.GeneralHeaderConstraints#validateGeneralHeaderConstraintsHasAuthorTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Has Author Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.GeneralHeaderConstraints#validateGeneralHeaderConstraintsHasAssignedAuthorId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Has Assigned Author Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.GeneralHeaderConstraints#validateGeneralHeaderConstraintsHasAssignedAuthorPersonOrDevice(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Has Assigned Author Person Or Device}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.GeneralHeaderConstraints#validateGeneralHeaderConstraintsHasDataEntererAssignedPerson(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Has Data Enterer Assigned Person}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.GeneralHeaderConstraints#validateGeneralHeaderConstraintsHasDataEntererTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Has Data Enterer Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.GeneralHeaderConstraints#validateGeneralHeaderConstraintsHasInformant(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Has Informant}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.GeneralHeaderConstraints#validateGeneralHeaderConstraintsHasInformantAssignedPersonOrRelatedPerson(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Has Informant Assigned Person Or Related Person}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.GeneralHeaderConstraints#validateGeneralHeaderConstraintsLegalAuthenticatorHasAssignedPerson(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Legal Authenticator Has Assigned Person}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthenticatorHasAssignedPerson(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Authenticator Has Assigned Person}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.GeneralHeaderConstraints#validateGeneralHeaderConstraintsTimePreciseToSecond(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Time Precise To Second}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.GeneralHeaderConstraints#validateGeneralHeaderConstraintsTimePreciseToYearAndDay(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Time Precise To Year And Day}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.GeneralHeaderConstraints#validateGeneralHeaderConstraintsTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.GeneralHeaderConstraints#validateGeneralHeaderConstraintsCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.GeneralHeaderConstraints#validateGeneralHeaderConstraintsEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.GeneralHeaderConstraints#validateGeneralHeaderConstraintsId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.GeneralHeaderConstraints#validateGeneralHeaderConstraintsLanguageCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Language Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRealmCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Realm Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.GeneralHeaderConstraints#validateGeneralHeaderConstraintsTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.GeneralHeaderConstraints#validateGeneralHeaderConstraintsTypeId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Type Id}
  • + *
+ *

+ * + * @generated + */ + +public class GeneralHeaderConstraintsTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateGeneralHeaderConstraintsPersonHasName() { + OperationsTestCase validateGeneralHeaderConstraintsPersonHasNameTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsPersonHasName", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_PERSON_HAS_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + target.init(); + + target.addPatient(CDAFactory.eINSTANCE.createPatient()); + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + + for (Patient patient : target.getPatients()) { + patient.getNames().add(DatatypesFactory.eINSTANCE.createPN()); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsPersonHasName( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsPersonHasNameTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateGeneralHeaderConstraintsRolesShallHaveAddrAndTelecom() { + OperationsTestCase validateGeneralHeaderConstraintsRolesShallHaveAddrAndTelecomTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRolesShallHaveAddrAndTelecom", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_ROLES_SHALL_HAVE_ADDR_AND_TELECOM__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + target.init(); + + target.addPatient(CDAFactory.eINSTANCE.createPatient()); + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + + for (PatientRole pr : target.getPatientRoles()) { + pr.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + pr.getTelecoms().add(DatatypesFactory.eINSTANCE.createTEL()); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRolesShallHaveAddrAndTelecom( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRolesShallHaveAddrAndTelecomTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateGeneralHeaderConstraintsRolesShouldHaveAddrAndTelecom() { + OperationsTestCase validateGeneralHeaderConstraintsRolesShouldHaveAddrAndTelecomTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRolesShouldHaveAddrAndTelecom", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_ROLES_SHOULD_HAVE_ADDR_AND_TELECOM__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRolesShouldHaveAddrAndTelecom( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRolesShouldHaveAddrAndTelecomTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateGeneralHeaderConstraintsOrganizationsHaveContactInfo() { + OperationsTestCase validateGeneralHeaderConstraintsOrganizationsHaveContactInfoTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsOrganizationsHaveContactInfo", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_ORGANIZATIONS_HAVE_CONTACT_INFO__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsOrganizationsHaveContactInfo( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsOrganizationsHaveContactInfoTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateGeneralHeaderConstraintsTimePreciseToDay() { + OperationsTestCase validateGeneralHeaderConstraintsTimePreciseToDayTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsTimePreciseToDay", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_TIME_PRECISE_TO_DAY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsTimePreciseToDay( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsTimePreciseToDayTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateGeneralHeaderConstraintsTimePreciseToYear() { + OperationsTestCase validateGeneralHeaderConstraintsTimePreciseToYearTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsTimePreciseToYear", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_TIME_PRECISE_TO_YEAR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsTimePreciseToYear( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsTimePreciseToYearTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateGeneralHeaderConstraintsTelephoneMatchesRegex() { + OperationsTestCase validateGeneralHeaderConstraintsTelephoneMatchesRegexTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsTelephoneMatchesRegex", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_TELEPHONE_MATCHES_REGEX__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsTelephoneMatchesRegex( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsTelephoneMatchesRegexTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateGeneralHeaderConstraintsHasTelephoneDialingDigits() { + OperationsTestCase validateGeneralHeaderConstraintsHasTelephoneDialingDigitsTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsHasTelephoneDialingDigits", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_HAS_TELEPHONE_DIALING_DIGITS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsHasTelephoneDialingDigits( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsHasTelephoneDialingDigitsTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateGeneralHeaderConstraintsUnknownTelephoneUsesNullFlavor() { + OperationsTestCase validateGeneralHeaderConstraintsUnknownTelephoneUsesNullFlavorTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsUnknownTelephoneUsesNullFlavor", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_UNKNOWN_TELEPHONE_USES_NULL_FLAVOR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsUnknownTelephoneUsesNullFlavor( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsUnknownTelephoneUsesNullFlavorTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsTypeIdExtension() { + OperationsTestCase validateGeneralHeaderConstraintsTypeIdExtensionTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsTypeIdExtension", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_TYPE_ID_EXTENSION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + InfrastructureRootTypeId value = CDAFactory.eINSTANCE.createInfrastructureRootTypeId(); + value.setExtension("POCD_HD000040"); + target.setTypeId(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsTypeIdExtension( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsTypeIdExtensionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateGeneralHeaderConstraintsIdRootFormat() { + OperationsTestCase validateGeneralHeaderConstraintsIdRootFormatTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsIdRootFormat", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_ID_ROOT_FORMAT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsIdRootFormat( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsIdRootFormatTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateGeneralHeaderConstraintsOidLength() { + OperationsTestCase validateGeneralHeaderConstraintsOidLengthTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsOidLength", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_OID_LENGTH__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsOidLength( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsOidLengthTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsLanguageCodeForm() { + OperationsTestCase validateGeneralHeaderConstraintsLanguageCodeFormTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsLanguageCodeForm", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_LANGUAGE_CODE_FORM__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + public void addFailTests() { + + addFailTest(new FailTest() { + + @Override + public void updateToFail(GeneralHeaderConstraints target) { + // Do nothing should trigger + + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(GeneralHeaderConstraints target) { + target.setLanguageCode(DatatypesFactory.eINSTANCE.createCS("aaaa")); + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(GeneralHeaderConstraints target) { + target.setLanguageCode(DatatypesFactory.eINSTANCE.createCS("AAAA")); + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(GeneralHeaderConstraints target) { + target.setLanguageCode(DatatypesFactory.eINSTANCE.createCS("aa-aa")); + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(GeneralHeaderConstraints target) { + target.setLanguageCode(DatatypesFactory.eINSTANCE.createCS("AA-AA")); + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(GeneralHeaderConstraints target) { + target.setLanguageCode(DatatypesFactory.eINSTANCE.createCS("aaa")); + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(GeneralHeaderConstraints target) { + target.setLanguageCode(DatatypesFactory.eINSTANCE.createCS("a")); + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(GeneralHeaderConstraints target) { + target.setLanguageCode(DatatypesFactory.eINSTANCE.createCS("AA-aa")); + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(GeneralHeaderConstraints target) { + target.setLanguageCode(DatatypesFactory.eINSTANCE.createCS("AA-")); + } + }); + + } + + @Override + public void addPassTests() { + this.addPassTest(new PassTest() { + + @Override + public void updateToPass(GeneralHeaderConstraints target) { + target.setLanguageCode(DatatypesFactory.eINSTANCE.createCS("en")); + + } + }); + + this.addPassTest(new PassTest() { + + @Override + public void updateToPass(GeneralHeaderConstraints target) { + target.setLanguageCode(DatatypesFactory.eINSTANCE.createCS("en-US")); + + } + }); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsLanguageCodeForm( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsLanguageCodeFormTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateGeneralHeaderConstraintsSetIdAndVersionNumber() { + OperationsTestCase validateGeneralHeaderConstraintsSetIdAndVersionNumberTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsSetIdAndVersionNumber", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_SET_ID_AND_VERSION_NUMBER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsSetIdAndVersionNumber( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsSetIdAndVersionNumberTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateGeneralHeaderConstraintsSetIdAndIdAreUnique() { + OperationsTestCase validateGeneralHeaderConstraintsSetIdAndIdAreUniqueTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsSetIdAndIdAreUnique", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_SET_ID_AND_ID_ARE_UNIQUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsSetIdAndIdAreUnique( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsSetIdAndIdAreUniqueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateGeneralHeaderConstraintsCopyTimeNotPresent() { + OperationsTestCase validateGeneralHeaderConstraintsCopyTimeNotPresentTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsCopyTimeNotPresent", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_COPY_TIME_NOT_PRESENT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsCopyTimeNotPresent( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsCopyTimeNotPresentTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateGeneralHeaderConstraintsHasRecordTargetPatientRole() { + OperationsTestCase validateGeneralHeaderConstraintsHasRecordTargetPatientRoleTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsHasRecordTargetPatientRole", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_HAS_RECORD_TARGET_PATIENT_ROLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsHasRecordTargetPatientRole( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsHasRecordTargetPatientRoleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateGeneralHeaderConstraintsHasPatientBirthTime() { + OperationsTestCase validateGeneralHeaderConstraintsHasPatientBirthTimeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsHasPatientBirthTime", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_HAS_PATIENT_BIRTH_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsHasPatientBirthTime( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsHasPatientBirthTimeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateGeneralHeaderConstraintsHasAdministrativeGenderCode() { + OperationsTestCase validateGeneralHeaderConstraintsHasAdministrativeGenderCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsHasAdministrativeGenderCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_HAS_ADMINISTRATIVE_GENDER_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsHasAdministrativeGenderCode( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsHasAdministrativeGenderCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateGeneralHeaderConstraintsHasProviderOrganization() { + OperationsTestCase validateGeneralHeaderConstraintsHasProviderOrganizationTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsHasProviderOrganization", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_HAS_PROVIDER_ORGANIZATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsHasProviderOrganization( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsHasProviderOrganizationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateGeneralHeaderConstraintsHasAuthorTime() { + OperationsTestCase validateGeneralHeaderConstraintsHasAuthorTimeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsHasAuthorTime", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_HAS_AUTHOR_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsHasAuthorTime( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsHasAuthorTimeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateGeneralHeaderConstraintsHasAssignedAuthorId() { + OperationsTestCase validateGeneralHeaderConstraintsHasAssignedAuthorIdTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsHasAssignedAuthorId", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_HAS_ASSIGNED_AUTHOR_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsHasAssignedAuthorId( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsHasAssignedAuthorIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateGeneralHeaderConstraintsHasAssignedAuthorPersonOrDevice() { + OperationsTestCase validateGeneralHeaderConstraintsHasAssignedAuthorPersonOrDeviceTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsHasAssignedAuthorPersonOrDevice", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_HAS_ASSIGNED_AUTHOR_PERSON_OR_DEVICE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsHasAssignedAuthorPersonOrDevice( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsHasAssignedAuthorPersonOrDeviceTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateGeneralHeaderConstraintsHasDataEntererAssignedPerson() { + OperationsTestCase validateGeneralHeaderConstraintsHasDataEntererAssignedPersonTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsHasDataEntererAssignedPerson", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_HAS_DATA_ENTERER_ASSIGNED_PERSON__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsHasDataEntererAssignedPerson( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsHasDataEntererAssignedPersonTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateGeneralHeaderConstraintsHasDataEntererTime() { + OperationsTestCase validateGeneralHeaderConstraintsHasDataEntererTimeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsHasDataEntererTime", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_HAS_DATA_ENTERER_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsHasDataEntererTime( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsHasDataEntererTimeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateGeneralHeaderConstraintsHasInformant() { + OperationsTestCase validateGeneralHeaderConstraintsHasInformantTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsHasInformant", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_HAS_INFORMANT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsHasInformant( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsHasInformantTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateGeneralHeaderConstraintsHasInformantAssignedPersonOrRelatedPerson() { + OperationsTestCase validateGeneralHeaderConstraintsHasInformantAssignedPersonOrRelatedPersonTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsHasInformantAssignedPersonOrRelatedPerson", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_HAS_INFORMANT_ASSIGNED_PERSON_OR_RELATED_PERSON__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsHasInformantAssignedPersonOrRelatedPerson( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsHasInformantAssignedPersonOrRelatedPersonTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateGeneralHeaderConstraintsLegalAuthenticatorHasAssignedPerson() { + OperationsTestCase validateGeneralHeaderConstraintsLegalAuthenticatorHasAssignedPersonTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsLegalAuthenticatorHasAssignedPerson", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_LEGAL_AUTHENTICATOR_HAS_ASSIGNED_PERSON__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsLegalAuthenticatorHasAssignedPerson( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsLegalAuthenticatorHasAssignedPersonTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthenticatorHasAssignedPerson() { + OperationsTestCase validateGeneralHeaderConstraintsAuthenticatorHasAssignedPersonTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthenticatorHasAssignedPerson", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHENTICATOR_HAS_ASSIGNED_PERSON__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + target.init(); + + Authenticator authenticator = CDAFactory.eINSTANCE.createAuthenticator(); + + AssignedEntity assignedEntity = CDAFactory.eINSTANCE.createAssignedEntity(); + + authenticator.setAssignedEntity(assignedEntity); + + target.getAuthenticators().add(authenticator); + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + + for (Authenticator authenticator : target.getAuthenticators()) { + Person person = CDAFactory.eINSTANCE.createPerson(); + authenticator.getAssignedEntity().setAssignedPerson(person); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthenticatorHasAssignedPerson( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthenticatorHasAssignedPersonTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateGeneralHeaderConstraintsTimePreciseToSecond() { + OperationsTestCase validateGeneralHeaderConstraintsTimePreciseToSecondTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsTimePreciseToSecond", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_TIME_PRECISE_TO_SECOND__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsTimePreciseToSecond( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsTimePreciseToSecondTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateGeneralHeaderConstraintsTimePreciseToYearAndDay() { + OperationsTestCase validateGeneralHeaderConstraintsTimePreciseToYearAndDayTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsTimePreciseToYearAndDay", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_TIME_PRECISE_TO_YEAR_AND_DAY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsTimePreciseToYearAndDay( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsTimePreciseToYearAndDayTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateGeneralHeaderConstraintsTemplateId() { + OperationsTestCase validateGeneralHeaderConstraintsTemplateIdTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsTemplateId", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsTemplateId( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateGeneralHeaderConstraintsCode() { + OperationsTestCase validateGeneralHeaderConstraintsCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + CE ce = DatatypesFactory.eINSTANCE.createCE(); + target.setCode(ce); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsCode( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateGeneralHeaderConstraintsEffectiveTime() { + OperationsTestCase validateGeneralHeaderConstraintsEffectiveTimeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsEffectiveTime( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateGeneralHeaderConstraintsId() { + OperationsTestCase validateGeneralHeaderConstraintsIdTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsId", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + II ii = DatatypesFactory.eINSTANCE.createII(); + target.setId(ii); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsId( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateGeneralHeaderConstraintsLanguageCode() { + OperationsTestCase validateGeneralHeaderConstraintsLanguageCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsLanguageCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_LANGUAGE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + CS cs = DatatypesFactory.eINSTANCE.createCS(); + target.setLanguageCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsLanguageCode( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsLanguageCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateGeneralHeaderConstraintsRealmCode() { + OperationsTestCase validateGeneralHeaderConstraintsRealmCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRealmCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_REALM_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRealmCode( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRealmCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateGeneralHeaderConstraintsTitle() { + OperationsTestCase validateGeneralHeaderConstraintsTitleTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsTitle", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsTitle( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsTitleTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateGeneralHeaderConstraintsTypeId() { + OperationsTestCase validateGeneralHeaderConstraintsTypeIdTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsTypeId", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_TYPE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + + InfrastructureRootTypeId value = CDAFactory.eINSTANCE.createInfrastructureRootTypeId(); + target.setTypeId(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsTypeId( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsTypeIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends GeneralHeaderConstraintsOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public GeneralHeaderConstraints create() { + return org.openhealthtools.mdht.uml.cda.ihe.IHEFactory.eINSTANCE.createMedicalDocument(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends GeneralHeaderConstraintsOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // GeneralHeaderConstraintsOperations diff --git a/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/GeneralStatusSectionTest.java b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/GeneralStatusSectionTest.java new file mode 100644 index 000000000..37497a626 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/GeneralStatusSectionTest.java @@ -0,0 +1,179 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.cdt.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.cdt.CDTFactory; +import org.openhealthtools.mdht.uml.cda.cdt.GeneralStatusSection; +import org.openhealthtools.mdht.uml.cda.cdt.operations.GeneralStatusSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'General Status Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.GeneralStatusSection#validateGeneralStatusSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Status Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.GeneralStatusSection#validateGeneralStatusSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Status Section Code}
  • + *
+ *

+ * + * @generated + */ + +public class GeneralStatusSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateGeneralStatusSectionTemplateId() { + OperationsTestCase validateGeneralStatusSectionTemplateIdTestCase = new OperationsTestCase( + "validateGeneralStatusSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_STATUS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralStatusSection target) { + + } + + @Override + protected void updateToPass(GeneralStatusSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralStatusSectionOperations.validateGeneralStatusSectionTemplateId( + (GeneralStatusSection) objectToTest, diagnostician, map); + } + + }; + + validateGeneralStatusSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateGeneralStatusSectionCode() { + OperationsTestCase validateGeneralStatusSectionCodeTestCase = new OperationsTestCase( + "validateGeneralStatusSectionCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_STATUS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralStatusSection target) { + + } + + @Override + protected void updateToPass(GeneralStatusSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralStatusSectionOperations.validateGeneralStatusSectionCode( + (GeneralStatusSection) objectToTest, diagnostician, map); + } + + }; + + validateGeneralStatusSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends GeneralStatusSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public GeneralStatusSection create() { + return CDTFactory.eINSTANCE.createGeneralStatusSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends GeneralStatusSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // GeneralStatusSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/HistoryAndPhysicalTest.java b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/HistoryAndPhysicalTest.java new file mode 100644 index 000000000..7394a8ac7 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/HistoryAndPhysicalTest.java @@ -0,0 +1,1211 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.cdt.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ccd.AlertsSection; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.FamilyHistorySection; +import org.openhealthtools.mdht.uml.cda.ccd.ImmunizationsSection; +import org.openhealthtools.mdht.uml.cda.ccd.MedicationsSection; +import org.openhealthtools.mdht.uml.cda.ccd.ProblemSection; +import org.openhealthtools.mdht.uml.cda.ccd.ProceduresSection; +import org.openhealthtools.mdht.uml.cda.ccd.SocialHistorySection; +import org.openhealthtools.mdht.uml.cda.cdt.CDTFactory; +import org.openhealthtools.mdht.uml.cda.cdt.DiagnosticFindings; +import org.openhealthtools.mdht.uml.cda.cdt.GeneralStatusSection; +import org.openhealthtools.mdht.uml.cda.cdt.HistoryAndPhysical; +import org.openhealthtools.mdht.uml.cda.cdt.HistoryOfPresentIllness; +import org.openhealthtools.mdht.uml.cda.cdt.PastMedicalHistorySection; +import org.openhealthtools.mdht.uml.cda.cdt.PhysicalExaminationSection; +import org.openhealthtools.mdht.uml.cda.cdt.ReviewOfSystemsSectionIHE; +import org.openhealthtools.mdht.uml.cda.cdt.VitalSignsSection; +import org.openhealthtools.mdht.uml.cda.cdt.operations.GeneralHeaderConstraintsOperations; +import org.openhealthtools.mdht.uml.cda.cdt.operations.HistoryAndPhysicalOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; + +/** + * A static utility class that provides operations + * related to 'History And Physical' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.HistoryAndPhysical#validateHistoryAndPhysicalAssessmentAndPlan(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Assessment And Plan}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.HistoryAndPhysical#validateHistoryAndPhysicalBothAssessmentAndPlan(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Both Assessment And Plan}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.HistoryAndPhysical#validateHistoryAndPhysicalReasonForVisitAndChiefComplaint(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Reason For Visit And Chief Complaint}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.HistoryAndPhysical#validateHistoryAndPhysicalBothReasonForVisitAndChiefComplaint(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Both Reason For Visit And Chief Complaint}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.HistoryAndPhysical#validateHistoryAndPhysicalCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.HistoryAndPhysical#validateHistoryAndPhysicalHistoryOfPresentIllness(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical History Of Present Illness}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.HistoryAndPhysical#validateHistoryAndPhysicalPastMedicalHistorySection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Past Medical History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.HistoryAndPhysical#validateHistoryAndPhysicalMedicationsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Medications Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.HistoryAndPhysical#validateHistoryAndPhysicalAlertsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Alerts Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.HistoryAndPhysical#validateHistoryAndPhysicalSocialHistorySection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Social History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.HistoryAndPhysical#validateHistoryAndPhysicalFamilyHistorySection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Family History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.HistoryAndPhysical#validateHistoryAndPhysicalReviewOfSystemsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Review Of Systems Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.HistoryAndPhysical#validateHistoryAndPhysicalPhysicalExaminationSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Physical Examination Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.HistoryAndPhysical#validateHistoryAndPhysicalVitalSignsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Vital Signs Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.HistoryAndPhysical#validateHistoryAndPhysicalGeneralStatusSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical General Status Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.HistoryAndPhysical#validateHistoryAndPhysicalDiagnosticFindings(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Diagnostic Findings}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.HistoryAndPhysical#validateHistoryAndPhysicalProblemSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Problem Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.HistoryAndPhysical#validateHistoryAndPhysicalProceduresSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Procedures Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.HistoryAndPhysical#validateHistoryAndPhysicalImmunizationsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Immunizations Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.HistoryAndPhysical#getHistoryOfPresentIllness() Get History Of Present Illness}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.HistoryAndPhysical#getPastMedicalHistorySection() Get Past Medical History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.HistoryAndPhysical#getMedicationsSection() Get Medications Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.HistoryAndPhysical#getAlertsSection() Get Alerts Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.HistoryAndPhysical#getSocialHistorySection() Get Social History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.HistoryAndPhysical#getFamilyHistorySection() Get Family History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.HistoryAndPhysical#getReviewOfSystemsSection() Get Review Of Systems Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.HistoryAndPhysical#getPhysicalExaminationSection() Get Physical Examination Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.HistoryAndPhysical#getVitalSignsSection() Get Vital Signs Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.HistoryAndPhysical#getGeneralStatusSection() Get General Status Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.HistoryAndPhysical#getDiagnosticFindings() Get Diagnostic Findings}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.HistoryAndPhysical#getProblemSection() Get Problem Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.HistoryAndPhysical#getProceduresSection() Get Procedures Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.HistoryAndPhysical#getImmunizationsSection() Get Immunizations Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.HistoryAndPhysical#validateGeneralHeaderConstraintsTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class HistoryAndPhysicalTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateHistoryAndPhysicalAssessmentAndPlan() { + OperationsTestCase validateHistoryAndPhysicalAssessmentAndPlanTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalAssessmentAndPlan", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_ASSESSMENT_AND_PLAN__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysical target) { + + } + + @Override + protected void updateToPass(HistoryAndPhysical target) { + target.init(); + target.addSection(CDTFactory.eINSTANCE.createAssessmentAndPlanSection().init()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalOperations.validateHistoryAndPhysicalAssessmentAndPlan( + (HistoryAndPhysical) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalAssessmentAndPlanTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHistoryAndPhysicalBothAssessmentAndPlan() { + OperationsTestCase validateHistoryAndPhysicalBothAssessmentAndPlanTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalBothAssessmentAndPlan", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_BOTH_ASSESSMENT_AND_PLAN__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysical target) { + target.init(); + target.addSection(CDTFactory.eINSTANCE.createAssessmentSection().init()); + + // target.addSection(CDTFactory.eINSTANCE.createAssessmentAndPlanSection().init()); + // target.addSection(CDTFactory.eINSTANCE.createAssessmentSection().init()); + + } + + @Override + protected void updateToPass(HistoryAndPhysical target) { + target.addSection(CDTFactory.eINSTANCE.createPlanSection().init()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalOperations.validateHistoryAndPhysicalBothAssessmentAndPlan( + (HistoryAndPhysical) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalBothAssessmentAndPlanTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateHistoryAndPhysicalReasonForVisitAndChiefComplaint() { + OperationsTestCase validateHistoryAndPhysicalReasonForVisitAndChiefComplaintTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalReasonForVisitAndChiefComplaint", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_REASON_FOR_VISIT_AND_CHIEF_COMPLAINT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + // cdt::ReasonForVisitAndChiefComplaintSection)) xor (self.getSections()->exists(section : cda::Section | not section.oclIsUndefined() and + // section.oclIsKindOf(cdt::ReasonForVisitSection)) and self.getSections()->exists(section : cda::Section | not section.oclIsUndefined() + // and section.oclIsKindOf(cdt::ChiefComplaintSection))) + + @Override + public void addFailTests() { + + this.addFailTest(new FailTest() { + + @Override + public void updateToFail(HistoryAndPhysical target) { + + } + }); + + this.addFailTest(new FailTest() { + + @Override + public void updateToFail(HistoryAndPhysical target) { + + target.addSection(CDTFactory.eINSTANCE.createReasonForVisitAndChiefComplaintSection().init()); + target.addSection(CDTFactory.eINSTANCE.createReasonForVisitSection().init()); + } + }); + + this.addFailTest(new FailTest() { + + @Override + public void updateToFail(HistoryAndPhysical target) { + + target.addSection(CDTFactory.eINSTANCE.createReasonForVisitAndChiefComplaintSection().init()); + target.addSection(CDTFactory.eINSTANCE.createChiefComplaintSection().init()); + } + }); + + this.addFailTest(new FailTest() { + + @Override + public void updateToFail(HistoryAndPhysical target) { + + target.addSection(CDTFactory.eINSTANCE.createReasonForVisitAndChiefComplaintSection().init()); + target.addSection(CDTFactory.eINSTANCE.createReasonForVisitSection().init()); + target.addSection(CDTFactory.eINSTANCE.createChiefComplaintSection().init()); + } + }); + + } + + @Override + public void addPassTests() { + + addPassTest(new PassTest() { + + @Override + public void updateToPass(HistoryAndPhysical target) { + target.addSection(CDTFactory.eINSTANCE.createReasonForVisitAndChiefComplaintSection().init()); + + } + }); + + addPassTest(new PassTest() { + + @Override + public void updateToPass(HistoryAndPhysical target) { + + target.addSection(CDTFactory.eINSTANCE.createReasonForVisitSection().init()); + target.addSection(CDTFactory.eINSTANCE.createChiefComplaintSection().init()); + } + }); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalOperations.validateHistoryAndPhysicalReasonForVisitAndChiefComplaint( + (HistoryAndPhysical) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalReasonForVisitAndChiefComplaintTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHistoryAndPhysicalBothReasonForVisitAndChiefComplaint() { + OperationsTestCase validateHistoryAndPhysicalBothReasonForVisitAndChiefComplaintTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalBothReasonForVisitAndChiefComplaint", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_BOTH_REASON_FOR_VISIT_AND_CHIEF_COMPLAINT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysical target) { + + target.init(); + target.addSection(CDTFactory.eINSTANCE.createChiefComplaintSection().init()); + + // + // ReasonForVisitSection rfvs = CDTFactory.eINSTANCE.createReasonForVisitSection().init(); + + } + + @Override + protected void updateToPass(HistoryAndPhysical target) { + + // ChiefComplaintSection ccs = CDTFactory.eINSTANCE.createChiefComplaintSection().init(); + // + target.addSection(CDTFactory.eINSTANCE.createReasonForVisitSection().init()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalOperations.validateHistoryAndPhysicalBothReasonForVisitAndChiefComplaint( + (HistoryAndPhysical) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalBothReasonForVisitAndChiefComplaintTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateHistoryAndPhysicalCode() { + OperationsTestCase validateHistoryAndPhysicalCodeTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalCode", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysical target) { + target.init(); + } + + @Override + protected void updateToPass(HistoryAndPhysical target) { + CE ce = DatatypesFactory.eINSTANCE.createCE("aaaa", "2.16.840.1.113883.6.1"); + target.setCode(ce); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalOperations.validateHistoryAndPhysicalCode( + (HistoryAndPhysical) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHistoryAndPhysicalHistoryOfPresentIllness() { + OperationsTestCase validateHistoryAndPhysicalHistoryOfPresentIllnessTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalHistoryOfPresentIllness", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_HISTORY_OF_PRESENT_ILLNESS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysical target) { + + } + + @Override + protected void updateToPass(HistoryAndPhysical target) { + target.init(); + + HistoryOfPresentIllness hopi = CDTFactory.eINSTANCE.createHistoryOfPresentIllness().init(); + target.addSection(hopi); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalOperations.validateHistoryAndPhysicalHistoryOfPresentIllness( + (HistoryAndPhysical) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalHistoryOfPresentIllnessTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHistoryAndPhysicalPastMedicalHistorySection() { + OperationsTestCase validateHistoryAndPhysicalPastMedicalHistorySectionTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalPastMedicalHistorySection", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_PAST_MEDICAL_HISTORY_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysical target) { + + } + + @Override + protected void updateToPass(HistoryAndPhysical target) { + target.init(); + + /* PastMedicalHistorySection */ + PastMedicalHistorySection section = + + CDTFactory.eINSTANCE.createPastMedicalHistorySection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalOperations.validateHistoryAndPhysicalPastMedicalHistorySection( + (HistoryAndPhysical) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalPastMedicalHistorySectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHistoryAndPhysicalMedicationsSection() { + OperationsTestCase validateHistoryAndPhysicalMedicationsSectionTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalMedicationsSection", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_MEDICATIONS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysical target) { + + } + + @Override + protected void updateToPass(HistoryAndPhysical target) { + target.init(); + + /* MedicationsSection */ + MedicationsSection section = + + CCDFactory.eINSTANCE.createMedicationsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalOperations.validateHistoryAndPhysicalMedicationsSection( + (HistoryAndPhysical) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalMedicationsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHistoryAndPhysicalAlertsSection() { + OperationsTestCase validateHistoryAndPhysicalAlertsSectionTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalAlertsSection", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_ALERTS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysical target) { + + } + + @Override + protected void updateToPass(HistoryAndPhysical target) { + target.init(); + + /* AlertsSection */ + AlertsSection section = + + CCDFactory.eINSTANCE.createAlertsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalOperations.validateHistoryAndPhysicalAlertsSection( + (HistoryAndPhysical) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalAlertsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHistoryAndPhysicalSocialHistorySection() { + OperationsTestCase validateHistoryAndPhysicalSocialHistorySectionTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalSocialHistorySection", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_SOCIAL_HISTORY_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysical target) { + + } + + @Override + protected void updateToPass(HistoryAndPhysical target) { + target.init(); + + /* SocialHistorySection */ + SocialHistorySection section = + + CCDFactory.eINSTANCE.createSocialHistorySection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalOperations.validateHistoryAndPhysicalSocialHistorySection( + (HistoryAndPhysical) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalSocialHistorySectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHistoryAndPhysicalFamilyHistorySection() { + OperationsTestCase validateHistoryAndPhysicalFamilyHistorySectionTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalFamilyHistorySection", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_FAMILY_HISTORY_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysical target) { + + } + + @Override + protected void updateToPass(HistoryAndPhysical target) { + target.init(); + + /* FamilyHistorySection */ + FamilyHistorySection section = + + CCDFactory.eINSTANCE.createFamilyHistorySection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalOperations.validateHistoryAndPhysicalFamilyHistorySection( + (HistoryAndPhysical) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalFamilyHistorySectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHistoryAndPhysicalReviewOfSystemsSection() { + OperationsTestCase validateHistoryAndPhysicalReviewOfSystemsSectionTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalReviewOfSystemsSection", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_REVIEW_OF_SYSTEMS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysical target) { + + } + + @Override + protected void updateToPass(HistoryAndPhysical target) { + target.init(); + + /* ReviewOfSystemsSection */ + ReviewOfSystemsSectionIHE section = + + CDTFactory.eINSTANCE.createReviewOfSystemsSectionIHE().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalOperations.validateHistoryAndPhysicalReviewOfSystemsSection( + (HistoryAndPhysical) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalReviewOfSystemsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHistoryAndPhysicalPhysicalExaminationSection() { + OperationsTestCase validateHistoryAndPhysicalPhysicalExaminationSectionTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalPhysicalExaminationSection", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_PHYSICAL_EXAMINATION_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysical target) { + + } + + @Override + protected void updateToPass(HistoryAndPhysical target) { + target.init(); + + /* PhysicalExaminationSection */ + PhysicalExaminationSection section = + + CDTFactory.eINSTANCE.createPhysicalExaminationSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalOperations.validateHistoryAndPhysicalPhysicalExaminationSection( + (HistoryAndPhysical) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalPhysicalExaminationSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHistoryAndPhysicalVitalSignsSection() { + OperationsTestCase validateHistoryAndPhysicalVitalSignsSectionTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalVitalSignsSection", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_VITAL_SIGNS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysical target) { + + } + + @Override + protected void updateToPass(HistoryAndPhysical target) { + target.init(); + + /* VitalSignsSection */ + VitalSignsSection section = + + CDTFactory.eINSTANCE.createVitalSignsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalOperations.validateHistoryAndPhysicalVitalSignsSection( + (HistoryAndPhysical) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalVitalSignsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHistoryAndPhysicalGeneralStatusSection() { + OperationsTestCase validateHistoryAndPhysicalGeneralStatusSectionTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalGeneralStatusSection", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_GENERAL_STATUS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysical target) { + + } + + @Override + protected void updateToPass(HistoryAndPhysical target) { + target.init(); + + /* GeneralStatusSection */ + GeneralStatusSection section = + + CDTFactory.eINSTANCE.createGeneralStatusSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalOperations.validateHistoryAndPhysicalGeneralStatusSection( + (HistoryAndPhysical) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalGeneralStatusSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHistoryAndPhysicalDiagnosticFindings() { + OperationsTestCase validateHistoryAndPhysicalDiagnosticFindingsTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalDiagnosticFindings", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_DIAGNOSTIC_FINDINGS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysical target) { + + } + + @Override + protected void updateToPass(HistoryAndPhysical target) { + target.init(); + DiagnosticFindings df = CDTFactory.eINSTANCE.createDiagnosticFindings().init(); + target.addSection(df); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalOperations.validateHistoryAndPhysicalDiagnosticFindings( + (HistoryAndPhysical) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalDiagnosticFindingsTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHistoryAndPhysicalProblemSection() { + OperationsTestCase validateHistoryAndPhysicalProblemSectionTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalProblemSection", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_PROBLEM_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysical target) { + + } + + @Override + protected void updateToPass(HistoryAndPhysical target) { + target.init(); + + /* ProblemSection */ + ProblemSection section = + + CCDFactory.eINSTANCE.createProblemSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalOperations.validateHistoryAndPhysicalProblemSection( + (HistoryAndPhysical) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalProblemSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHistoryAndPhysicalProceduresSection() { + OperationsTestCase validateHistoryAndPhysicalProceduresSectionTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalProceduresSection", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_PROCEDURES_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysical target) { + + } + + @Override + protected void updateToPass(HistoryAndPhysical target) { + target.init(); + + /* ProceduresSection */ + ProceduresSection section = + + CCDFactory.eINSTANCE.createProceduresSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalOperations.validateHistoryAndPhysicalProceduresSection( + (HistoryAndPhysical) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalProceduresSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHistoryAndPhysicalImmunizationsSection() { + OperationsTestCase validateHistoryAndPhysicalImmunizationsSectionTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalImmunizationsSection", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_IMMUNIZATIONS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysical target) { + + } + + @Override + protected void updateToPass(HistoryAndPhysical target) { + target.init(); + + /* ImmunizationsSection */ + ImmunizationsSection section = + + CCDFactory.eINSTANCE.createImmunizationsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalOperations.validateHistoryAndPhysicalImmunizationsSection( + (HistoryAndPhysical) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalImmunizationsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetHistoryOfPresentIllness() { + + HistoryAndPhysical target = objectFactory.create(); + target.getHistoryOfPresentIllness(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPastMedicalHistorySection() { + + HistoryAndPhysical target = objectFactory.create(); + target.getPastMedicalHistorySection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetMedicationsSection() { + + HistoryAndPhysical target = objectFactory.create(); + target.getMedicationsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetAlertsSection() { + + HistoryAndPhysical target = objectFactory.create(); + target.getAlertsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetSocialHistorySection() { + + HistoryAndPhysical target = objectFactory.create(); + target.getSocialHistorySection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetFamilyHistorySection() { + + HistoryAndPhysical target = objectFactory.create(); + target.getFamilyHistorySection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetReviewOfSystemsSection() { + + HistoryAndPhysical target = objectFactory.create(); + target.getReviewOfSystemsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPhysicalExaminationSection() { + + HistoryAndPhysical target = objectFactory.create(); + target.getPhysicalExaminationSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetVitalSignsSection() { + + HistoryAndPhysical target = objectFactory.create(); + target.getVitalSignsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetGeneralStatusSection() { + + HistoryAndPhysical target = objectFactory.create(); + target.getGeneralStatusSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetDiagnosticFindings() { + + HistoryAndPhysical target = objectFactory.create(); + target.getDiagnosticFindings(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProblemSection() { + + HistoryAndPhysical target = objectFactory.create(); + target.getProblemSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProceduresSection() { + + HistoryAndPhysical target = objectFactory.create(); + target.getProceduresSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetImmunizationsSection() { + + HistoryAndPhysical target = objectFactory.create(); + target.getImmunizationsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testValidateGeneralHeaderConstraintsTemplateId() { + OperationsTestCase validateGeneralHeaderConstraintsTemplateIdTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsTemplateId", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysical target) { + + } + + @Override + protected void updateToPass(HistoryAndPhysical target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalOperations.validateGeneralHeaderConstraintsTemplateId( + (HistoryAndPhysical) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateGeneralHeaderConstraintsCode() { + OperationsTestCase validateGeneralHeaderConstraintsCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysical target) { + + } + + @Override + protected void updateToPass(HistoryAndPhysical target) { + target.init(); + CE ce = DatatypesFactory.eINSTANCE.createCE(); + ce.setCodeSystem("2.16.840.1.113883.6.1"); + ce.setCode("111"); + target.setCode(ce); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsCode( + (HistoryAndPhysical) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends HistoryAndPhysicalOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public HistoryAndPhysical create() { + return CDTFactory.eINSTANCE.createHistoryAndPhysical(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends HistoryAndPhysicalOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // HistoryAndPhysicalOperations diff --git a/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/HistoryOfPresentIllnessTest.java b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/HistoryOfPresentIllnessTest.java new file mode 100644 index 000000000..703ae24b4 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/HistoryOfPresentIllnessTest.java @@ -0,0 +1,179 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.cdt.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.cdt.CDTFactory; +import org.openhealthtools.mdht.uml.cda.cdt.HistoryOfPresentIllness; +import org.openhealthtools.mdht.uml.cda.cdt.operations.HistoryOfPresentIllnessOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'History Of Present Illness' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.HistoryOfPresentIllness#validateHistoryOfPresentIllnessTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History Of Present Illness Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.HistoryOfPresentIllness#validateHistoryOfPresentIllnessCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History Of Present Illness Code}
  • + *
+ *

+ * + * @generated + */ + +public class HistoryOfPresentIllnessTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHistoryOfPresentIllnessTemplateId() { + OperationsTestCase validateHistoryOfPresentIllnessTemplateIdTestCase = new OperationsTestCase( + "validateHistoryOfPresentIllnessTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_OF_PRESENT_ILLNESS_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryOfPresentIllness target) { + + } + + @Override + protected void updateToPass(HistoryOfPresentIllness target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryOfPresentIllnessOperations.validateHistoryOfPresentIllnessTemplateId( + (HistoryOfPresentIllness) objectToTest, diagnostician, map); + } + + }; + + validateHistoryOfPresentIllnessTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHistoryOfPresentIllnessCode() { + OperationsTestCase validateHistoryOfPresentIllnessCodeTestCase = new OperationsTestCase( + "validateHistoryOfPresentIllnessCode", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_OF_PRESENT_ILLNESS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryOfPresentIllness target) { + + } + + @Override + protected void updateToPass(HistoryOfPresentIllness target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryOfPresentIllnessOperations.validateHistoryOfPresentIllnessCode( + (HistoryOfPresentIllness) objectToTest, diagnostician, map); + } + + }; + + validateHistoryOfPresentIllnessCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends HistoryOfPresentIllnessOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public HistoryOfPresentIllness create() { + return CDTFactory.eINSTANCE.createHistoryOfPresentIllness(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends HistoryOfPresentIllnessOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // HistoryOfPresentIllnessOperations diff --git a/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/HospitalDischargeStudiesSummarySectionTest.java b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/HospitalDischargeStudiesSummarySectionTest.java new file mode 100644 index 000000000..2923b0529 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/HospitalDischargeStudiesSummarySectionTest.java @@ -0,0 +1,215 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.cdt.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.cdt.CDTFactory; +import org.openhealthtools.mdht.uml.cda.cdt.HospitalDischargeStudiesSummarySection; +import org.openhealthtools.mdht.uml.cda.cdt.operations.HospitalDischargeStudiesSummarySectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Hospital Discharge Studies Summary Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.HospitalDischargeStudiesSummarySection#validateHospitalDischargeStudiesSummarySectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Discharge Studies Summary Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.HospitalDischargeStudiesSummarySection#validateHospitalDischargeStudiesSummarySectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Discharge Studies Summary Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.HospitalDischargeStudiesSummarySection#validateHospitalDischargeStudiesSummarySectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Discharge Studies Summary Section Title}
  • + *
+ *

+ * + * @generated + */ + +public class HospitalDischargeStudiesSummarySectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHospitalDischargeStudiesSummarySectionTemplateId() { + OperationsTestCase validateHospitalDischargeStudiesSummarySectionTemplateIdTestCase = new OperationsTestCase( + "validateHospitalDischargeStudiesSummarySectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_DISCHARGE_STUDIES_SUMMARY_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalDischargeStudiesSummarySection target) { + + } + + @Override + protected void updateToPass(HospitalDischargeStudiesSummarySection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalDischargeStudiesSummarySectionOperations.validateHospitalDischargeStudiesSummarySectionTemplateId( + (HospitalDischargeStudiesSummarySection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalDischargeStudiesSummarySectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalDischargeStudiesSummarySectionCode() { + OperationsTestCase validateHospitalDischargeStudiesSummarySectionCodeTestCase = new OperationsTestCase( + "validateHospitalDischargeStudiesSummarySectionCode", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_DISCHARGE_STUDIES_SUMMARY_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalDischargeStudiesSummarySection target) { + + } + + @Override + protected void updateToPass(HospitalDischargeStudiesSummarySection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalDischargeStudiesSummarySectionOperations.validateHospitalDischargeStudiesSummarySectionCode( + (HospitalDischargeStudiesSummarySection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalDischargeStudiesSummarySectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHospitalDischargeStudiesSummarySectionTitle() { + OperationsTestCase validateHospitalDischargeStudiesSummarySectionTitleTestCase = new OperationsTestCase( + "validateHospitalDischargeStudiesSummarySectionTitle", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_DISCHARGE_STUDIES_SUMMARY_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalDischargeStudiesSummarySection target) { + + } + + @Override + protected void updateToPass(HospitalDischargeStudiesSummarySection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("HOSPITAL DISCHARGE STUDIES SUMMARY"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalDischargeStudiesSummarySectionOperations.validateHospitalDischargeStudiesSummarySectionTitle( + (HospitalDischargeStudiesSummarySection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalDischargeStudiesSummarySectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends HospitalDischargeStudiesSummarySectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public HospitalDischargeStudiesSummarySection create() { + return CDTFactory.eINSTANCE.createHospitalDischargeStudiesSummarySection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends HospitalDischargeStudiesSummarySectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // HospitalDischargeStudiesSummarySectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/LevelOneConformanceTest.java b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/LevelOneConformanceTest.java new file mode 100644 index 000000000..fd4cc7b02 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/LevelOneConformanceTest.java @@ -0,0 +1,144 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.cdt.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.cdt.CDTFactory; +import org.openhealthtools.mdht.uml.cda.cdt.LevelOneConformance; +import org.openhealthtools.mdht.uml.cda.cdt.operations.LevelOneConformanceOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Level One Conformance' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.LevelOneConformance#validateLevelOneConformanceTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Level One Conformance Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class LevelOneConformanceTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateLevelOneConformanceTemplateId() { + OperationsTestCase validateLevelOneConformanceTemplateIdTestCase = new OperationsTestCase( + "validateLevelOneConformanceTemplateId", + operationsForOCL.getOCLValue("VALIDATE_LEVEL_ONE_CONFORMANCE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(LevelOneConformance target) { + + } + + @Override + protected void updateToPass(LevelOneConformance target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return LevelOneConformanceOperations.validateLevelOneConformanceTemplateId( + (LevelOneConformance) objectToTest, diagnostician, map); + } + + }; + + validateLevelOneConformanceTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends LevelOneConformanceOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public LevelOneConformance create() { + return CDTFactory.eINSTANCE.createLevelOneConformance(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends LevelOneConformanceOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // LevelOneConformanceOperations diff --git a/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/LevelThreeConformanceTest.java b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/LevelThreeConformanceTest.java new file mode 100644 index 000000000..555c04be5 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/LevelThreeConformanceTest.java @@ -0,0 +1,144 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.cdt.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.cdt.CDTFactory; +import org.openhealthtools.mdht.uml.cda.cdt.LevelThreeConformance; +import org.openhealthtools.mdht.uml.cda.cdt.operations.LevelThreeConformanceOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Level Three Conformance' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.LevelThreeConformance#validateLevelOneConformanceTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Level One Conformance Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class LevelThreeConformanceTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateLevelOneConformanceTemplateId() { + OperationsTestCase validateLevelOneConformanceTemplateIdTestCase = new OperationsTestCase( + "validateLevelOneConformanceTemplateId", + operationsForOCL.getOCLValue("VALIDATE_LEVEL_ONE_CONFORMANCE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(LevelThreeConformance target) { + + } + + @Override + protected void updateToPass(LevelThreeConformance target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return LevelThreeConformanceOperations.validateLevelOneConformanceTemplateId( + (LevelThreeConformance) objectToTest, diagnostician, map); + } + + }; + + validateLevelOneConformanceTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends LevelThreeConformanceOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public LevelThreeConformance create() { + return CDTFactory.eINSTANCE.createLevelThreeConformance(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends LevelThreeConformanceOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // LevelThreeConformanceOperations diff --git a/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/LevelTwoConformanceTest.java b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/LevelTwoConformanceTest.java new file mode 100644 index 000000000..1ca6f9173 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/LevelTwoConformanceTest.java @@ -0,0 +1,144 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.cdt.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.cdt.CDTFactory; +import org.openhealthtools.mdht.uml.cda.cdt.LevelTwoConformance; +import org.openhealthtools.mdht.uml.cda.cdt.operations.LevelTwoConformanceOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Level Two Conformance' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.LevelTwoConformance#validateLevelOneConformanceTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Level One Conformance Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class LevelTwoConformanceTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateLevelOneConformanceTemplateId() { + OperationsTestCase validateLevelOneConformanceTemplateIdTestCase = new OperationsTestCase( + "validateLevelOneConformanceTemplateId", + operationsForOCL.getOCLValue("VALIDATE_LEVEL_ONE_CONFORMANCE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(LevelTwoConformance target) { + + } + + @Override + protected void updateToPass(LevelTwoConformance target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return LevelTwoConformanceOperations.validateLevelOneConformanceTemplateId( + (LevelTwoConformance) objectToTest, diagnostician, map); + } + + }; + + validateLevelOneConformanceTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends LevelTwoConformanceOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public LevelTwoConformance create() { + return CDTFactory.eINSTANCE.createLevelTwoConformance(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends LevelTwoConformanceOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // LevelTwoConformanceOperations diff --git a/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/ObjectiveSectionTest.java b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/ObjectiveSectionTest.java new file mode 100644 index 000000000..da404c36e --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/ObjectiveSectionTest.java @@ -0,0 +1,298 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.cdt.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Entry; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.cdt.CDTFactory; +import org.openhealthtools.mdht.uml.cda.cdt.ObjectiveSection; +import org.openhealthtools.mdht.uml.cda.cdt.operations.ObjectiveSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * A static utility class that provides operations + * related to 'Objective Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ObjectiveSection#validateObjectiveSectionHasClinicalStatements(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Objective Section Has Clinical Statements}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ObjectiveSection#validateObjectiveSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Objective Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ObjectiveSection#validateObjectiveSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Objective Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ObjectiveSection#validateObjectiveSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Objective Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ObjectiveSection#validateObjectiveSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Objective Section Title}
  • + *
+ *

+ * + * @generated + */ + +public class ObjectiveSectionTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateObjectiveSectionHasClinicalStatements() { + OperationsTestCase validateObjectiveSectionHasClinicalStatementsTestCase = new OperationsTestCase( + "validateObjectiveSectionHasClinicalStatements", + operationsForOCL.getOCLValue("VALIDATE_OBJECTIVE_SECTION_HAS_CLINICAL_STATEMENTS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ObjectiveSection target) { + + } + + @Override + protected void updateToPass(ObjectiveSection target) { + target.init(); + + Entry entry = CDAFactory.eINSTANCE.createEntry(); + target.getEntries().add(entry); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ObjectiveSectionOperations.validateObjectiveSectionHasClinicalStatements( + (ObjectiveSection) objectToTest, diagnostician, map); + } + + }; + + validateObjectiveSectionHasClinicalStatementsTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateObjectiveSectionTemplateId() { + OperationsTestCase validateObjectiveSectionTemplateIdTestCase = new OperationsTestCase( + "validateObjectiveSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_OBJECTIVE_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ObjectiveSection target) { + + } + + @Override + protected void updateToPass(ObjectiveSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ObjectiveSectionOperations.validateObjectiveSectionTemplateId( + (ObjectiveSection) objectToTest, diagnostician, map); + } + + }; + + validateObjectiveSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateObjectiveSectionCode() { + OperationsTestCase validateObjectiveSectionCodeTestCase = new OperationsTestCase( + "validateObjectiveSectionCode", + operationsForOCL.getOCLValue("VALIDATE_OBJECTIVE_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ObjectiveSection target) { + + } + + @Override + protected void updateToPass(ObjectiveSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ObjectiveSectionOperations.validateObjectiveSectionCode( + (ObjectiveSection) objectToTest, diagnostician, map); + } + + }; + + validateObjectiveSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateObjectiveSectionText() { + OperationsTestCase validateObjectiveSectionTextTestCase = new OperationsTestCase( + "validateObjectiveSectionText", + operationsForOCL.getOCLValue("VALIDATE_OBJECTIVE_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ObjectiveSection target) { + + } + + @Override + protected void updateToPass(ObjectiveSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ObjectiveSectionOperations.validateObjectiveSectionText( + (ObjectiveSection) objectToTest, diagnostician, map); + } + + }; + + validateObjectiveSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateObjectiveSectionTitle() { + OperationsTestCase validateObjectiveSectionTitleTestCase = new OperationsTestCase( + "validateObjectiveSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_OBJECTIVE_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ObjectiveSection target) { + + } + + @Override + protected void updateToPass(ObjectiveSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ObjectiveSectionOperations.validateObjectiveSectionTitle( + (ObjectiveSection) objectToTest, diagnostician, map); + } + + }; + + validateObjectiveSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ObjectiveSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public ObjectiveSection create() { + return CDTFactory.eINSTANCE.createObjectiveSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends ObjectiveSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ObjectiveSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/PastMedicalHistorySectionConsultTest.java b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/PastMedicalHistorySectionConsultTest.java new file mode 100644 index 000000000..d9caccea2 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/PastMedicalHistorySectionConsultTest.java @@ -0,0 +1,219 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.cdt.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.cdt.CDTFactory; +import org.openhealthtools.mdht.uml.cda.cdt.PastMedicalHistorySectionConsult; +import org.openhealthtools.mdht.uml.cda.cdt.operations.PastMedicalHistorySectionConsultOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Past Medical History Section Consult' model + * objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.PastMedicalHistorySectionConsult#validatePastMedicalHistorySectionConsultTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Past Medical History Section Consult Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.PastMedicalHistorySectionConsult#validatePastMedicalHistorySectionConsultCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Past Medical History Section Consult Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.PastMedicalHistorySectionConsult#validatePastMedicalHistorySectionConsultText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Past Medical History Section Consult Text}
  • + *
+ *

+ * + * @generated + */ + +public class PastMedicalHistorySectionConsultTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidatePastMedicalHistorySectionConsultTemplateId() { + OperationsTestCase validatePastMedicalHistorySectionConsultTemplateIdTestCase = new OperationsTestCase( + "validatePastMedicalHistorySectionConsultTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PAST_MEDICAL_HISTORY_SECTION_CONSULT_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PastMedicalHistorySectionConsult target) { + + } + + @Override + protected void updateToPass(PastMedicalHistorySectionConsult target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PastMedicalHistorySectionConsultOperations.validatePastMedicalHistorySectionConsultTemplateId( + (PastMedicalHistorySectionConsult) objectToTest, diagnostician, map); + } + + }; + + validatePastMedicalHistorySectionConsultTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePastMedicalHistorySectionConsultCode() { + OperationsTestCase validatePastMedicalHistorySectionConsultCodeTestCase = new OperationsTestCase( + "validatePastMedicalHistorySectionConsultCode", + operationsForOCL.getOCLValue("VALIDATE_PAST_MEDICAL_HISTORY_SECTION_CONSULT_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PastMedicalHistorySectionConsult target) { + + } + + @Override + protected void updateToPass(PastMedicalHistorySectionConsult target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PastMedicalHistorySectionConsultOperations.validatePastMedicalHistorySectionConsultCode( + (PastMedicalHistorySectionConsult) objectToTest, diagnostician, map); + } + + }; + + validatePastMedicalHistorySectionConsultCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePastMedicalHistorySectionConsultText() { + OperationsTestCase validatePastMedicalHistorySectionConsultTextTestCase = new OperationsTestCase( + "validatePastMedicalHistorySectionConsultText", + operationsForOCL.getOCLValue("VALIDATE_PAST_MEDICAL_HISTORY_SECTION_CONSULT_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PastMedicalHistorySectionConsult target) { + + } + + @Override + protected void updateToPass(PastMedicalHistorySectionConsult target) { + target.init(); + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PastMedicalHistorySectionConsultOperations.validatePastMedicalHistorySectionConsultText( + (PastMedicalHistorySectionConsult) objectToTest, diagnostician, map); + } + + }; + + validatePastMedicalHistorySectionConsultTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PastMedicalHistorySectionConsultOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public PastMedicalHistorySectionConsult create() { + return CDTFactory.eINSTANCE.createPastMedicalHistorySectionConsult(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends PastMedicalHistorySectionConsultOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PastMedicalHistorySectionConsultOperations diff --git a/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/PastMedicalHistorySectionTest.java b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/PastMedicalHistorySectionTest.java new file mode 100644 index 000000000..417715466 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/PastMedicalHistorySectionTest.java @@ -0,0 +1,259 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.cdt.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Entry; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.cdt.CDTFactory; +import org.openhealthtools.mdht.uml.cda.cdt.PastMedicalHistorySection; +import org.openhealthtools.mdht.uml.cda.cdt.operations.PastMedicalHistorySectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Past Medical History Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.PastMedicalHistorySection#validatePastMedicalHistorySectionHasClinicalStatements(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Past Medical History Section Has Clinical Statements}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.PastMedicalHistorySection#validatePastMedicalHistorySectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Past Medical History Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.PastMedicalHistorySection#validatePastMedicalHistorySectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Past Medical History Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.PastMedicalHistorySection#validatePastMedicalHistorySectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Past Medical History Section Text}
  • + *
+ *

+ * + * @generated + */ + +public class PastMedicalHistorySectionTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidatePastMedicalHistorySectionHasClinicalStatements() { + OperationsTestCase validatePastMedicalHistorySectionHasClinicalStatementsTestCase = new OperationsTestCase( + "validatePastMedicalHistorySectionHasClinicalStatements", + operationsForOCL.getOCLValue("VALIDATE_PAST_MEDICAL_HISTORY_SECTION_HAS_CLINICAL_STATEMENTS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PastMedicalHistorySection target) { + + } + + @Override + protected void updateToPass(PastMedicalHistorySection target) { + target.init(); + + Entry entry = CDAFactory.eINSTANCE.createEntry(); + + target.getEntries().add(entry); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PastMedicalHistorySectionOperations.validatePastMedicalHistorySectionHasClinicalStatements( + (PastMedicalHistorySection) objectToTest, diagnostician, map); + } + + }; + + validatePastMedicalHistorySectionHasClinicalStatementsTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePastMedicalHistorySectionTemplateId() { + OperationsTestCase validatePastMedicalHistorySectionTemplateIdTestCase = new OperationsTestCase( + "validatePastMedicalHistorySectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PAST_MEDICAL_HISTORY_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PastMedicalHistorySection target) { + + } + + @Override + protected void updateToPass(PastMedicalHistorySection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PastMedicalHistorySectionOperations.validatePastMedicalHistorySectionTemplateId( + (PastMedicalHistorySection) objectToTest, diagnostician, map); + } + + }; + + validatePastMedicalHistorySectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePastMedicalHistorySectionCode() { + OperationsTestCase validatePastMedicalHistorySectionCodeTestCase = new OperationsTestCase( + "validatePastMedicalHistorySectionCode", + operationsForOCL.getOCLValue("VALIDATE_PAST_MEDICAL_HISTORY_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PastMedicalHistorySection target) { + + } + + @Override + protected void updateToPass(PastMedicalHistorySection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PastMedicalHistorySectionOperations.validatePastMedicalHistorySectionCode( + (PastMedicalHistorySection) objectToTest, diagnostician, map); + } + + }; + + validatePastMedicalHistorySectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePastMedicalHistorySectionText() { + OperationsTestCase validatePastMedicalHistorySectionTextTestCase = new OperationsTestCase( + "validatePastMedicalHistorySectionText", + operationsForOCL.getOCLValue("VALIDATE_PAST_MEDICAL_HISTORY_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PastMedicalHistorySection target) { + + } + + @Override + protected void updateToPass(PastMedicalHistorySection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PastMedicalHistorySectionOperations.validatePastMedicalHistorySectionText( + (PastMedicalHistorySection) objectToTest, diagnostician, map); + } + + }; + + validatePastMedicalHistorySectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PastMedicalHistorySectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public PastMedicalHistorySection create() { + return CDTFactory.eINSTANCE.createPastMedicalHistorySection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends PastMedicalHistorySectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PastMedicalHistorySectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/PhysicalExaminationSectionTest.java b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/PhysicalExaminationSectionTest.java new file mode 100644 index 000000000..9829dd522 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/PhysicalExaminationSectionTest.java @@ -0,0 +1,179 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.cdt.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.cdt.CDTFactory; +import org.openhealthtools.mdht.uml.cda.cdt.PhysicalExaminationSection; +import org.openhealthtools.mdht.uml.cda.cdt.operations.PhysicalExaminationSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Physical Examination Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.PhysicalExaminationSection#validatePhysicalExaminationSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physical Examination Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.PhysicalExaminationSection#validatePhysicalExaminationSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physical Examination Section Code}
  • + *
+ *

+ * + * @generated + */ + +public class PhysicalExaminationSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidatePhysicalExaminationSectionTemplateId() { + OperationsTestCase validatePhysicalExaminationSectionTemplateIdTestCase = new OperationsTestCase( + "validatePhysicalExaminationSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PHYSICAL_EXAMINATION_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicalExaminationSection target) { + + } + + @Override + protected void updateToPass(PhysicalExaminationSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicalExaminationSectionOperations.validatePhysicalExaminationSectionTemplateId( + (PhysicalExaminationSection) objectToTest, diagnostician, map); + } + + }; + + validatePhysicalExaminationSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePhysicalExaminationSectionCode() { + OperationsTestCase validatePhysicalExaminationSectionCodeTestCase = new OperationsTestCase( + "validatePhysicalExaminationSectionCode", + operationsForOCL.getOCLValue("VALIDATE_PHYSICAL_EXAMINATION_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicalExaminationSection target) { + + } + + @Override + protected void updateToPass(PhysicalExaminationSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicalExaminationSectionOperations.validatePhysicalExaminationSectionCode( + (PhysicalExaminationSection) objectToTest, diagnostician, map); + } + + }; + + validatePhysicalExaminationSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PhysicalExaminationSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public PhysicalExaminationSection create() { + return CDTFactory.eINSTANCE.createPhysicalExaminationSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends PhysicalExaminationSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PhysicalExaminationSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/PlanSectionTest.java b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/PlanSectionTest.java new file mode 100644 index 000000000..263f53b96 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/PlanSectionTest.java @@ -0,0 +1,181 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.cdt.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.cdt.CDTFactory; +import org.openhealthtools.mdht.uml.cda.cdt.PlanSection; +import org.openhealthtools.mdht.uml.cda.cdt.operations.PlanSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Plan Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • + * {@link org.openhealthtools.mdht.uml.cda.cdt.PlanSection#validatePlanSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Plan Section Template Id}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.cdt.PlanSection#validatePlanSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Plan Section Code}
  • + *
+ *

+ * + * @generated + */ + +public class PlanSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidatePlanSectionTemplateId() { + OperationsTestCase validatePlanSectionTemplateIdTestCase = new OperationsTestCase( + "validatePlanSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PLAN_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanSection target) { + + } + + @Override + protected void updateToPass(PlanSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanSectionOperations.validatePlanSectionTemplateId( + (PlanSection) objectToTest, diagnostician, map); + } + + }; + + validatePlanSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePlanSectionCode() { + OperationsTestCase validatePlanSectionCodeTestCase = new OperationsTestCase( + "validatePlanSectionCode", + operationsForOCL.getOCLValue("VALIDATE_PLAN_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(PlanSection target) { + + } + + @Override + protected void updateToPass(PlanSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanSectionOperations.validatePlanSectionCode((PlanSection) objectToTest, diagnostician, map); + } + + }; + + validatePlanSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PlanSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public PlanSection create() { + return CDTFactory.eINSTANCE.createPlanSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends PlanSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PlanSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/ProgressNoteTest.java b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/ProgressNoteTest.java new file mode 100644 index 000000000..a42cf8ee6 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/ProgressNoteTest.java @@ -0,0 +1,1273 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.cdt.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Component1; +import org.openhealthtools.mdht.uml.cda.DocumentationOf; +import org.openhealthtools.mdht.uml.cda.EncompassingEncounter; +import org.openhealthtools.mdht.uml.cda.HealthCareFacility; +import org.openhealthtools.mdht.uml.cda.Location; +import org.openhealthtools.mdht.uml.cda.ServiceEvent; +import org.openhealthtools.mdht.uml.cda.ccd.AlertsSection; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.MedicationsSection; +import org.openhealthtools.mdht.uml.cda.ccd.PlanOfCareSection; +import org.openhealthtools.mdht.uml.cda.ccd.ProblemSection; +import org.openhealthtools.mdht.uml.cda.ccd.ResultsSection; +import org.openhealthtools.mdht.uml.cda.cdt.AssessmentSectionProcNote; +import org.openhealthtools.mdht.uml.cda.cdt.CDTFactory; +import org.openhealthtools.mdht.uml.cda.cdt.ChiefComplaintSectionProcNote; +import org.openhealthtools.mdht.uml.cda.cdt.ObjectiveSection; +import org.openhealthtools.mdht.uml.cda.cdt.PhysicalExaminationSection; +import org.openhealthtools.mdht.uml.cda.cdt.ProgressNote; +import org.openhealthtools.mdht.uml.cda.cdt.ReviewOfSystemsSectionIHE; +import org.openhealthtools.mdht.uml.cda.cdt.SubjectiveSection; +import org.openhealthtools.mdht.uml.cda.cdt.VitalSignsSection; +import org.openhealthtools.mdht.uml.cda.cdt.operations.GeneralHeaderConstraintsOperations; +import org.openhealthtools.mdht.uml.cda.cdt.operations.ProgressNoteOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; + +/** + * A static utility class that provides operations + * related to 'Progress Note' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • + * {@link org.openhealthtools.mdht.uml.cda.cdt.ProgressNote#validateProgressNoteAssessmentAndPlan(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Progress Note Assessment And Plan}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.cdt.ProgressNote#validateProgressNoteBothAssessmentAndPlan(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Progress Note Both Assessment And Plan}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.cdt.ProgressNote#validateProgressNoteHasServiceEvent(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Progress Note Has Service Event}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.cdt.ProgressNote#validateProgressNoteHasServiceEventCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Progress Note Has Service Event Code}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.cdt.ProgressNote#validateProgressNoteHasServiceEventEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Progress Note Has Service Event Effective Time}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.cdt.ProgressNote#validateProgressNoteHasComponentOfElement(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Progress Note Has Component Of Element}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.cdt.ProgressNote#validateProgressNoteHasEncompassingEncounterId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Progress Note Has Encompassing Encounter Id}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.cdt.ProgressNote#validateProgressNoteHasEncompassingEncounterEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Progress Note Has Encompassing Encounter Effective Time}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.cdt.ProgressNote#validateProgressNoteHasEncompassingEncounterEffectiveTimeLow(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Progress Note Has Encompassing Encounter Effective Time Low + * }
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.cdt.ProgressNote#validateProgressNoteHasEncompassingEncounterFacilityId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Progress Note Has Encompassing Encounter Facility Id}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.cdt.ProgressNote#validateProgressNoteAlertsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Progress Note Alerts Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.cdt.ProgressNote#validateProgressNoteChiefComplaintSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Progress Note Chief Complaint Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.cdt.ProgressNote#validateProgressNoteMedicationsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Progress Note Medications Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.cdt.ProgressNote#validateProgressNoteObjectiveSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Progress Note Objective Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.cdt.ProgressNote#validateProgressNotePhysicalExaminationSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Progress Note Physical Examination Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.cdt.ProgressNote#validateProgressNoteProblemSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Progress Note Problem Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.cdt.ProgressNote#validateProgressNoteResultsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Progress Note Results Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.cdt.ProgressNote#validateProgressNoteVitalSignsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Progress Note Vital Signs Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.cdt.ProgressNote#validateProgressNoteReviewOfSystemsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Progress Note Review Of Systems Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.cdt.ProgressNote#validateProgressNoteSubjectiveSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Progress Note Subjective Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.cdt.ProgressNote#getAssessmentAndPlanSection() + * Get Assessment And Plan Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.cdt.ProgressNote#getAssessmentSection() + * Get Assessment Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.cdt.ProgressNote#getPlanSection() + * Get Plan Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.cdt.ProgressNote#getAlertsSection() + * Get Alerts Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.cdt.ProgressNote#getChiefComplaintSection() + * Get Chief Complaint Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.cdt.ProgressNote#getMedicationsSection() + * Get Medications Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.cdt.ProgressNote#getObjectiveSection() + * Get Objective Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.cdt.ProgressNote#getPhysicalExaminationSection() + * Get Physical Examination Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.cdt.ProgressNote#getProblemSection() + * Get Problem Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.cdt.ProgressNote#getResultsSection() + * Get Results Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.cdt.ProgressNote#getVitalSignsSection() + * Get Vital Signs Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.cdt.ProgressNote#getReviewOfSystemsSection() + * Get Review Of Systems Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.cdt.ProgressNote#getSubjectiveSection() + * Get Subjective Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.cdt.ProgressNote#validateGeneralHeaderConstraintsTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate General Header Constraints Template Id}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.cdt.ProgressNote#validateGeneralHeaderConstraintsCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate General Header Constraints Code}
  • + *
+ *

+ * + * @generated + */ + +public class ProgressNoteTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateProgressNoteAssessmentAndPlan() { + OperationsTestCase validateProgressNoteAssessmentAndPlanTestCase = new OperationsTestCase( + "validateProgressNoteAssessmentAndPlan", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_ASSESSMENT_AND_PLAN__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + + } + + @Override + protected void updateToPass(ProgressNote target) { + target.init(); + + AssessmentSectionProcNote aspn = CDTFactory.eINSTANCE.createAssessmentSectionProcNote().init(); + + target.addSection(aspn); + + PlanOfCareSection pocs = CCDFactory.eINSTANCE.createPlanOfCareSection().init(); + target.addSection(pocs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteAssessmentAndPlan( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteAssessmentAndPlanTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProgressNoteBothAssessmentAndPlan() { + OperationsTestCase validateProgressNoteBothAssessmentAndPlanTestCase = new OperationsTestCase( + "validateProgressNoteBothAssessmentAndPlan", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_BOTH_ASSESSMENT_AND_PLAN__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + target.init(); + + AssessmentSectionProcNote aspn = CDTFactory.eINSTANCE.createAssessmentSectionProcNote().init(); + + target.addSection(aspn); + + } + + @Override + protected void updateToPass(ProgressNote target) { + + PlanOfCareSection pocs = CCDFactory.eINSTANCE.createPlanOfCareSection().init(); + target.addSection(pocs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteBothAssessmentAndPlan( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteBothAssessmentAndPlanTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProgressNoteHasServiceEvent() { + OperationsTestCase validateProgressNoteHasServiceEventTestCase = new OperationsTestCase( + "validateProgressNoteHasServiceEvent", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_HAS_SERVICE_EVENT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + + } + + @Override + protected void updateToPass(ProgressNote target) { + target.init(); + + DocumentationOf docof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + docof.setServiceEvent(se); + + target.getDocumentationOfs().add(docof); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteHasServiceEvent( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteHasServiceEventTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProgressNoteHasServiceEventCode() { + OperationsTestCase validateProgressNoteHasServiceEventCodeTestCase = new OperationsTestCase( + "validateProgressNoteHasServiceEventCode", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_HAS_SERVICE_EVENT_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + + } + + @Override + protected void updateToPass(ProgressNote target) { + target.init(); + + DocumentationOf docof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + docof.setServiceEvent(se); + CE ce = DatatypesFactory.eINSTANCE.createCE("371532007", "2.16.840.1.113883.6.96"); + se.setCode(ce); + target.getDocumentationOfs().add(docof); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteHasServiceEventCode( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteHasServiceEventCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProgressNoteHasServiceEventEffectiveTime() { + OperationsTestCase validateProgressNoteHasServiceEventEffectiveTimeTestCase = new OperationsTestCase( + "validateProgressNoteHasServiceEventEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_HAS_SERVICE_EVENT_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + + } + + @Override + protected void updateToPass(ProgressNote target) { + target.init(); + + DocumentationOf docof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + docof.setServiceEvent(se); + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS("low", "high"); + + se.setEffectiveTime(ts); + target.getDocumentationOfs().add(docof); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteHasServiceEventEffectiveTime( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteHasServiceEventEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProgressNoteHasComponentOfElement() { + OperationsTestCase validateProgressNoteHasComponentOfElementTestCase = new OperationsTestCase( + "validateProgressNoteHasComponentOfElement", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_HAS_COMPONENT_OF_ELEMENT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + + } + + @Override + protected void updateToPass(ProgressNote target) { + target.init(); + Component1 value = CDAFactory.eINSTANCE.createComponent1(); + target.setComponentOf(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteHasComponentOfElement( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteHasComponentOfElementTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProgressNoteHasEncompassingEncounterId() { + OperationsTestCase validateProgressNoteHasEncompassingEncounterIdTestCase = new OperationsTestCase( + "validateProgressNoteHasEncompassingEncounterId", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_HAS_ENCOMPASSING_ENCOUNTER_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + + } + + @Override + protected void updateToPass(ProgressNote target) { + target.init(); + Component1 value = CDAFactory.eINSTANCE.createComponent1(); + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + II ii = DatatypesFactory.eINSTANCE.createII(); + ee.getIds().add(ii); + value.setEncompassingEncounter(ee); + target.setComponentOf(value); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteHasEncompassingEncounterId( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteHasEncompassingEncounterIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProgressNoteHasEncompassingEncounterEffectiveTime() { + OperationsTestCase validateProgressNoteHasEncompassingEncounterEffectiveTimeTestCase = new OperationsTestCase( + "validateProgressNoteHasEncompassingEncounterEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_HAS_ENCOMPASSING_ENCOUNTER_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + + } + + @Override + protected void updateToPass(ProgressNote target) { + target.init(); + + target.init(); + Component1 value = CDAFactory.eINSTANCE.createComponent1(); + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + IVL_TS time = DatatypesFactory.eINSTANCE.createIVL_TS(); + ee.setEffectiveTime(time); + value.setEncompassingEncounter(ee); + target.setComponentOf(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteHasEncompassingEncounterEffectiveTime( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteHasEncompassingEncounterEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProgressNoteHasEncompassingEncounterEffectiveTimeLow() { + OperationsTestCase validateProgressNoteHasEncompassingEncounterEffectiveTimeLowTestCase = new OperationsTestCase( + "validateProgressNoteHasEncompassingEncounterEffectiveTimeLow", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_HAS_ENCOMPASSING_ENCOUNTER_EFFECTIVE_TIME_LOW__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + + } + + @Override + protected void updateToPass(ProgressNote target) { + target.init(); + Component1 value = CDAFactory.eINSTANCE.createComponent1(); + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + IVL_TS time = DatatypesFactory.eINSTANCE.createIVL_TS("low", "high"); + ee.setEffectiveTime(time); + value.setEncompassingEncounter(ee); + target.setComponentOf(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteHasEncompassingEncounterEffectiveTimeLow( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteHasEncompassingEncounterEffectiveTimeLowTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProgressNoteHasEncompassingEncounterFacilityId() { + OperationsTestCase validateProgressNoteHasEncompassingEncounterFacilityIdTestCase = new OperationsTestCase( + "validateProgressNoteHasEncompassingEncounterFacilityId", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_HAS_ENCOMPASSING_ENCOUNTER_FACILITY_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + + } + + @Override + protected void updateToPass(ProgressNote target) { + target.init(); + + Component1 value = CDAFactory.eINSTANCE.createComponent1(); + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + Location loc = CDAFactory.eINSTANCE.createLocation(); + HealthCareFacility hcf = CDAFactory.eINSTANCE.createHealthCareFacility(); + II ii = DatatypesFactory.eINSTANCE.createII(); + hcf.getIds().add(ii); + loc.setHealthCareFacility(hcf); + + ee.setLocation(loc); + value.setEncompassingEncounter(ee); + target.setComponentOf(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteHasEncompassingEncounterFacilityId( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteHasEncompassingEncounterFacilityIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProgressNoteCode() { + OperationsTestCase validateProgressNoteCodeTestCase = new OperationsTestCase( + "validateProgressNoteCode", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + target.init(); + } + + @Override + protected void updateToPass(ProgressNote target) { + CE ce = DatatypesFactory.eINSTANCE.createCE(); + ce.setCodeSystem("2.16.840.1.113883.6.1"); + ce.setCode("aaaaaaa"); + target.setCode(ce); + + // + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteCode((ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProgressNoteAlertsSection() { + OperationsTestCase validateProgressNoteAlertsSectionTestCase = new OperationsTestCase( + "validateProgressNoteAlertsSection", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_ALERTS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + + } + + @Override + protected void updateToPass(ProgressNote target) { + target.init(); + AlertsSection resultsSection = CCDFactory.eINSTANCE.createAlertsSection().init(); + target.addSection(resultsSection); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteAlertsSection( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteAlertsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProgressNoteChiefComplaintSection() { + OperationsTestCase validateProgressNoteChiefComplaintSectionTestCase = new OperationsTestCase( + "validateProgressNoteChiefComplaintSection", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_CHIEF_COMPLAINT_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + + } + + @Override + protected void updateToPass(ProgressNote target) { + target.init(); + ChiefComplaintSectionProcNote resultsSection = CDTFactory.eINSTANCE.createChiefComplaintSectionProcNote().init(); + target.addSection(resultsSection); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteChiefComplaintSection( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteChiefComplaintSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProgressNoteMedicationsSection() { + OperationsTestCase validateProgressNoteMedicationsSectionTestCase = new OperationsTestCase( + "validateProgressNoteMedicationsSection", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_MEDICATIONS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + + } + + @Override + protected void updateToPass(ProgressNote target) { + target.init(); + MedicationsSection resultsSection = CCDFactory.eINSTANCE.createMedicationsSection().init(); + target.addSection(resultsSection); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteMedicationsSection( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteMedicationsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProgressNoteObjectiveSection() { + OperationsTestCase validateProgressNoteObjectiveSectionTestCase = new OperationsTestCase( + "validateProgressNoteObjectiveSection", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_OBJECTIVE_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + + } + + @Override + protected void updateToPass(ProgressNote target) { + target.init(); + ObjectiveSection resultsSection = CDTFactory.eINSTANCE.createObjectiveSection().init(); + target.addSection(resultsSection); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteObjectiveSection( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteObjectiveSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProgressNotePhysicalExaminationSection() { + OperationsTestCase validateProgressNotePhysicalExaminationSectionTestCase = new OperationsTestCase( + "validateProgressNotePhysicalExaminationSection", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_PHYSICAL_EXAMINATION_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + + } + + @Override + protected void updateToPass(ProgressNote target) { + target.init(); + PhysicalExaminationSection resultsSection = CDTFactory.eINSTANCE.createPhysicalExaminationSection().init(); + target.addSection(resultsSection); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNotePhysicalExaminationSection( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNotePhysicalExaminationSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProgressNoteProblemSection() { + OperationsTestCase validateProgressNoteProblemSectionTestCase = new OperationsTestCase( + "validateProgressNoteProblemSection", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_PROBLEM_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + + } + + @Override + protected void updateToPass(ProgressNote target) { + target.init(); + ProblemSection resultsSection = CCDFactory.eINSTANCE.createProblemSection().init(); + target.addSection(resultsSection); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteProblemSection( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteProblemSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProgressNoteResultsSection() { + OperationsTestCase validateProgressNoteResultsSectionTestCase = new OperationsTestCase( + "validateProgressNoteResultsSection", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_RESULTS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + + } + + @Override + protected void updateToPass(ProgressNote target) { + target.init(); + ResultsSection resultsSection = CCDFactory.eINSTANCE.createResultsSection().init(); + target.addSection(resultsSection); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteResultsSection( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteResultsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProgressNoteVitalSignsSection() { + OperationsTestCase validateProgressNoteVitalSignsSectionTestCase = new OperationsTestCase( + "validateProgressNoteVitalSignsSection", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_VITAL_SIGNS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + + } + + @Override + protected void updateToPass(ProgressNote target) { + target.init(); + VitalSignsSection vitalSignsSection = CDTFactory.eINSTANCE.createVitalSignsSection().init(); + target.addSection(vitalSignsSection); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteVitalSignsSection( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteVitalSignsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProgressNoteReviewOfSystemsSection() { + OperationsTestCase validateProgressNoteReviewOfSystemsSectionTestCase = new OperationsTestCase( + "validateProgressNoteReviewOfSystemsSection", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_REVIEW_OF_SYSTEMS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + + } + + @Override + protected void updateToPass(ProgressNote target) { + target.init(); + ReviewOfSystemsSectionIHE reviewOfSystemsSectionIHE = CDTFactory.eINSTANCE.createReviewOfSystemsSectionIHE().init(); + target.addSection(reviewOfSystemsSectionIHE); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteReviewOfSystemsSection( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteReviewOfSystemsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProgressNoteSubjectiveSection() { + OperationsTestCase validateProgressNoteSubjectiveSectionTestCase = new OperationsTestCase( + "validateProgressNoteSubjectiveSection", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_SUBJECTIVE_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + + } + + @Override + protected void updateToPass(ProgressNote target) { + target.init(); + SubjectiveSection subjectiveSection = CDTFactory.eINSTANCE.createSubjectiveSection().init(); + target.addSection(subjectiveSection); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteSubjectiveSection( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteSubjectiveSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetAssessmentAndPlanSection() { + + ProgressNote target = objectFactory.create(); + target.getAssessmentAndPlanSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetAssessmentSection() { + + ProgressNote target = objectFactory.create(); + target.getAssessmentSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPlanSection() { + + ProgressNote target = objectFactory.create(); + target.getPlanSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetAlertsSection() { + + ProgressNote target = objectFactory.create(); + target.getAlertsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetChiefComplaintSection() { + + ProgressNote target = objectFactory.create(); + target.getChiefComplaintSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetMedicationsSection() { + + ProgressNote target = objectFactory.create(); + target.getMedicationsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetObjectiveSection() { + + ProgressNote target = objectFactory.create(); + target.getObjectiveSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPhysicalExaminationSection() { + + ProgressNote target = objectFactory.create(); + target.getPhysicalExaminationSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProblemSection() { + + ProgressNote target = objectFactory.create(); + target.getProblemSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetResultsSection() { + + ProgressNote target = objectFactory.create(); + target.getResultsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetVitalSignsSection() { + + ProgressNote target = objectFactory.create(); + target.getVitalSignsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetReviewOfSystemsSection() { + + ProgressNote target = objectFactory.create(); + target.getReviewOfSystemsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetSubjectiveSection() { + + ProgressNote target = objectFactory.create(); + target.getSubjectiveSection(); + + } + + /** + * + * @generated + */ + @Test + public void testValidateGeneralHeaderConstraintsTemplateId() { + OperationsTestCase validateGeneralHeaderConstraintsTemplateIdTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsTemplateId", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + + } + + @Override + protected void updateToPass(ProgressNote target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateGeneralHeaderConstraintsTemplateId( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateGeneralHeaderConstraintsCode() { + OperationsTestCase validateGeneralHeaderConstraintsCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + + } + + @Override + protected void updateToPass(ProgressNote target) { + target.init(); + CE value = DatatypesFactory.eINSTANCE.createCE(); + value.setCode("11111"); + value.setCodeSystem("2.16.840.1.113883.6.1"); + + target.setCode(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsCode( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ProgressNoteOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public ProgressNote create() { + return CDTFactory.eINSTANCE.createProgressNote(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends ProgressNoteOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ProgressNoteOperations diff --git a/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/ReasonForReferralSectionTest.java b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/ReasonForReferralSectionTest.java new file mode 100644 index 000000000..9d2e64a04 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/ReasonForReferralSectionTest.java @@ -0,0 +1,179 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.cdt.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.cdt.CDTFactory; +import org.openhealthtools.mdht.uml.cda.cdt.ReasonForReferralSection; +import org.openhealthtools.mdht.uml.cda.cdt.operations.ReasonForReferralSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Reason For Referral Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ReasonForReferralSection#validateReasonForReferralSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Reason For Referral Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ReasonForReferralSection#validateReasonForReferralSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Reason For Referral Section Code}
  • + *
+ *

+ * + * @generated + */ + +public class ReasonForReferralSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateReasonForReferralSectionTemplateId() { + OperationsTestCase validateReasonForReferralSectionTemplateIdTestCase = new OperationsTestCase( + "validateReasonForReferralSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_REASON_FOR_REFERRAL_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReasonForReferralSection target) { + + } + + @Override + protected void updateToPass(ReasonForReferralSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReasonForReferralSectionOperations.validateReasonForReferralSectionTemplateId( + (ReasonForReferralSection) objectToTest, diagnostician, map); + } + + }; + + validateReasonForReferralSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateReasonForReferralSectionCode() { + OperationsTestCase validateReasonForReferralSectionCodeTestCase = new OperationsTestCase( + "validateReasonForReferralSectionCode", + operationsForOCL.getOCLValue("VALIDATE_REASON_FOR_REFERRAL_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReasonForReferralSection target) { + + } + + @Override + protected void updateToPass(ReasonForReferralSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReasonForReferralSectionOperations.validateReasonForReferralSectionCode( + (ReasonForReferralSection) objectToTest, diagnostician, map); + } + + }; + + validateReasonForReferralSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ReasonForReferralSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public ReasonForReferralSection create() { + return CDTFactory.eINSTANCE.createReasonForReferralSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends ReasonForReferralSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ReasonForReferralSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/ReasonForVisitAndChiefComplaintSectionTest.java b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/ReasonForVisitAndChiefComplaintSectionTest.java new file mode 100644 index 000000000..d0c59310c --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/ReasonForVisitAndChiefComplaintSectionTest.java @@ -0,0 +1,179 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.cdt.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.cdt.CDTFactory; +import org.openhealthtools.mdht.uml.cda.cdt.ReasonForVisitAndChiefComplaintSection; +import org.openhealthtools.mdht.uml.cda.cdt.operations.ReasonForVisitAndChiefComplaintSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Reason For Visit And Chief Complaint Section' + * model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ReasonForVisitAndChiefComplaintSection#validateReasonForVisitAndChiefComplaintSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Reason For Visit And Chief Complaint Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ReasonForVisitAndChiefComplaintSection#validateReasonForVisitAndChiefComplaintSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Reason For Visit And Chief Complaint Section Code}
  • + *
+ *

+ * + * @generated + */ + +public class ReasonForVisitAndChiefComplaintSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateReasonForVisitAndChiefComplaintSectionTemplateId() { + OperationsTestCase validateReasonForVisitAndChiefComplaintSectionTemplateIdTestCase = new OperationsTestCase( + "validateReasonForVisitAndChiefComplaintSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_REASON_FOR_VISIT_AND_CHIEF_COMPLAINT_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReasonForVisitAndChiefComplaintSection target) { + + } + + @Override + protected void updateToPass(ReasonForVisitAndChiefComplaintSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReasonForVisitAndChiefComplaintSectionOperations.validateReasonForVisitAndChiefComplaintSectionTemplateId( + (ReasonForVisitAndChiefComplaintSection) objectToTest, diagnostician, map); + } + + }; + + validateReasonForVisitAndChiefComplaintSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateReasonForVisitAndChiefComplaintSectionCode() { + OperationsTestCase validateReasonForVisitAndChiefComplaintSectionCodeTestCase = new OperationsTestCase( + "validateReasonForVisitAndChiefComplaintSectionCode", + operationsForOCL.getOCLValue("VALIDATE_REASON_FOR_VISIT_AND_CHIEF_COMPLAINT_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReasonForVisitAndChiefComplaintSection target) { + + } + + @Override + protected void updateToPass(ReasonForVisitAndChiefComplaintSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReasonForVisitAndChiefComplaintSectionOperations.validateReasonForVisitAndChiefComplaintSectionCode( + (ReasonForVisitAndChiefComplaintSection) objectToTest, diagnostician, map); + } + + }; + + validateReasonForVisitAndChiefComplaintSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ReasonForVisitAndChiefComplaintSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public ReasonForVisitAndChiefComplaintSection create() { + return CDTFactory.eINSTANCE.createReasonForVisitAndChiefComplaintSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends ReasonForVisitAndChiefComplaintSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ReasonForVisitAndChiefComplaintSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/ReasonForVisitSectionConsultTest.java b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/ReasonForVisitSectionConsultTest.java new file mode 100644 index 000000000..b5d508fd7 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/ReasonForVisitSectionConsultTest.java @@ -0,0 +1,179 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.cdt.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.cdt.CDTFactory; +import org.openhealthtools.mdht.uml.cda.cdt.ReasonForVisitSectionConsult; +import org.openhealthtools.mdht.uml.cda.cdt.operations.ReasonForVisitSectionConsultOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Reason For Visit Section Consult' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ReasonForVisitSectionConsult#validateReasonForVisitSectionConsultTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Reason For Visit Section Consult Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ReasonForVisitSectionConsult#validateReasonForVisitSectionConsultCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Reason For Visit Section Consult Code}
  • + *
+ *

+ * + * @generated + */ + +public class ReasonForVisitSectionConsultTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateReasonForVisitSectionConsultTemplateId() { + OperationsTestCase validateReasonForVisitSectionConsultTemplateIdTestCase = new OperationsTestCase( + "validateReasonForVisitSectionConsultTemplateId", + operationsForOCL.getOCLValue("VALIDATE_REASON_FOR_VISIT_SECTION_CONSULT_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReasonForVisitSectionConsult target) { + + } + + @Override + protected void updateToPass(ReasonForVisitSectionConsult target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReasonForVisitSectionConsultOperations.validateReasonForVisitSectionConsultTemplateId( + (ReasonForVisitSectionConsult) objectToTest, diagnostician, map); + } + + }; + + validateReasonForVisitSectionConsultTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateReasonForVisitSectionConsultCode() { + OperationsTestCase validateReasonForVisitSectionConsultCodeTestCase = new OperationsTestCase( + "validateReasonForVisitSectionConsultCode", + operationsForOCL.getOCLValue("VALIDATE_REASON_FOR_VISIT_SECTION_CONSULT_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReasonForVisitSectionConsult target) { + + } + + @Override + protected void updateToPass(ReasonForVisitSectionConsult target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReasonForVisitSectionConsultOperations.validateReasonForVisitSectionConsultCode( + (ReasonForVisitSectionConsult) objectToTest, diagnostician, map); + } + + }; + + validateReasonForVisitSectionConsultCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ReasonForVisitSectionConsultOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public ReasonForVisitSectionConsult create() { + return CDTFactory.eINSTANCE.createReasonForVisitSectionConsult(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends ReasonForVisitSectionConsultOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ReasonForVisitSectionConsultOperations diff --git a/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/ReasonForVisitSectionTest.java b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/ReasonForVisitSectionTest.java new file mode 100644 index 000000000..4fcd71c18 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/ReasonForVisitSectionTest.java @@ -0,0 +1,179 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.cdt.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.cdt.CDTFactory; +import org.openhealthtools.mdht.uml.cda.cdt.ReasonForVisitSection; +import org.openhealthtools.mdht.uml.cda.cdt.operations.ReasonForVisitSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Reason For Visit Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ReasonForVisitSection#validateReasonForVisitSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Reason For Visit Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ReasonForVisitSection#validateReasonForVisitSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Reason For Visit Section Code}
  • + *
+ *

+ * + * @generated + */ + +public class ReasonForVisitSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateReasonForVisitSectionTemplateId() { + OperationsTestCase validateReasonForVisitSectionTemplateIdTestCase = new OperationsTestCase( + "validateReasonForVisitSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_REASON_FOR_VISIT_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReasonForVisitSection target) { + + } + + @Override + protected void updateToPass(ReasonForVisitSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReasonForVisitSectionOperations.validateReasonForVisitSectionTemplateId( + (ReasonForVisitSection) objectToTest, diagnostician, map); + } + + }; + + validateReasonForVisitSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateReasonForVisitSectionCode() { + OperationsTestCase validateReasonForVisitSectionCodeTestCase = new OperationsTestCase( + "validateReasonForVisitSectionCode", + operationsForOCL.getOCLValue("VALIDATE_REASON_FOR_VISIT_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReasonForVisitSection target) { + + } + + @Override + protected void updateToPass(ReasonForVisitSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReasonForVisitSectionOperations.validateReasonForVisitSectionCode( + (ReasonForVisitSection) objectToTest, diagnostician, map); + } + + }; + + validateReasonForVisitSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ReasonForVisitSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public ReasonForVisitSection create() { + return CDTFactory.eINSTANCE.createReasonForVisitSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends ReasonForVisitSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ReasonForVisitSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/ReviewOfSystemsSectionIHETest.java b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/ReviewOfSystemsSectionIHETest.java new file mode 100644 index 000000000..501bf51eb --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/ReviewOfSystemsSectionIHETest.java @@ -0,0 +1,179 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.cdt.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.cdt.CDTFactory; +import org.openhealthtools.mdht.uml.cda.cdt.ReviewOfSystemsSectionIHE; +import org.openhealthtools.mdht.uml.cda.cdt.operations.ReviewOfSystemsSectionIHEOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Review Of Systems Section IHE' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ReviewOfSystemsSectionIHE#validateReviewOfSystemsSectionIHETemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Review Of Systems Section IHE Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ReviewOfSystemsSectionIHE#validateReviewOfSystemsSectionIHECode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Review Of Systems Section IHE Code}
  • + *
+ *

+ * + * @generated + */ + +public class ReviewOfSystemsSectionIHETest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateReviewOfSystemsSectionIHETemplateId() { + OperationsTestCase validateReviewOfSystemsSectionIHETemplateIdTestCase = new OperationsTestCase( + "validateReviewOfSystemsSectionIHETemplateId", + operationsForOCL.getOCLValue("VALIDATE_REVIEW_OF_SYSTEMS_SECTION_IHE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReviewOfSystemsSectionIHE target) { + + } + + @Override + protected void updateToPass(ReviewOfSystemsSectionIHE target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReviewOfSystemsSectionIHEOperations.validateReviewOfSystemsSectionIHETemplateId( + (ReviewOfSystemsSectionIHE) objectToTest, diagnostician, map); + } + + }; + + validateReviewOfSystemsSectionIHETemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateReviewOfSystemsSectionIHECode() { + OperationsTestCase validateReviewOfSystemsSectionIHECodeTestCase = new OperationsTestCase( + "validateReviewOfSystemsSectionIHECode", + operationsForOCL.getOCLValue("VALIDATE_REVIEW_OF_SYSTEMS_SECTION_IHE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReviewOfSystemsSectionIHE target) { + + } + + @Override + protected void updateToPass(ReviewOfSystemsSectionIHE target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReviewOfSystemsSectionIHEOperations.validateReviewOfSystemsSectionIHECode( + (ReviewOfSystemsSectionIHE) objectToTest, diagnostician, map); + } + + }; + + validateReviewOfSystemsSectionIHECodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ReviewOfSystemsSectionIHEOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public ReviewOfSystemsSectionIHE create() { + return CDTFactory.eINSTANCE.createReviewOfSystemsSectionIHE(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends ReviewOfSystemsSectionIHEOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ReviewOfSystemsSectionIHEOperations diff --git a/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/ReviewOfSystemsSectionTest.java b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/ReviewOfSystemsSectionTest.java new file mode 100644 index 000000000..15e036b35 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/ReviewOfSystemsSectionTest.java @@ -0,0 +1,179 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.cdt.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.cdt.CDTFactory; +import org.openhealthtools.mdht.uml.cda.cdt.ReviewOfSystemsSection; +import org.openhealthtools.mdht.uml.cda.cdt.operations.ReviewOfSystemsSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Review Of Systems Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ReviewOfSystemsSection#validateReviewOfSystemsSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Review Of Systems Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.ReviewOfSystemsSection#validateReviewOfSystemsSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Review Of Systems Section Code}
  • + *
+ *

+ * + * @generated + */ + +public class ReviewOfSystemsSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateReviewOfSystemsSectionTemplateId() { + OperationsTestCase validateReviewOfSystemsSectionTemplateIdTestCase = new OperationsTestCase( + "validateReviewOfSystemsSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_REVIEW_OF_SYSTEMS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReviewOfSystemsSection target) { + + } + + @Override + protected void updateToPass(ReviewOfSystemsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReviewOfSystemsSectionOperations.validateReviewOfSystemsSectionTemplateId( + (ReviewOfSystemsSection) objectToTest, diagnostician, map); + } + + }; + + validateReviewOfSystemsSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateReviewOfSystemsSectionCode() { + OperationsTestCase validateReviewOfSystemsSectionCodeTestCase = new OperationsTestCase( + "validateReviewOfSystemsSectionCode", + operationsForOCL.getOCLValue("VALIDATE_REVIEW_OF_SYSTEMS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReviewOfSystemsSection target) { + + } + + @Override + protected void updateToPass(ReviewOfSystemsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReviewOfSystemsSectionOperations.validateReviewOfSystemsSectionCode( + (ReviewOfSystemsSection) objectToTest, diagnostician, map); + } + + }; + + validateReviewOfSystemsSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ReviewOfSystemsSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public ReviewOfSystemsSection create() { + return CDTFactory.eINSTANCE.createReviewOfSystemsSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends ReviewOfSystemsSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ReviewOfSystemsSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/SubjectiveSectionTest.java b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/SubjectiveSectionTest.java new file mode 100644 index 000000000..d2549051e --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/SubjectiveSectionTest.java @@ -0,0 +1,297 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.cdt.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Entry; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.cdt.CDTFactory; +import org.openhealthtools.mdht.uml.cda.cdt.SubjectiveSection; +import org.openhealthtools.mdht.uml.cda.cdt.operations.SubjectiveSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * A static utility class that provides operations + * related to 'Subjective Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.SubjectiveSection#validateSubjectiveSectionHasClinicalStatements(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Subjective Section Has Clinical Statements}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.SubjectiveSection#validateSubjectiveSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Subjective Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.SubjectiveSection#validateSubjectiveSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Subjective Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.SubjectiveSection#validateSubjectiveSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Subjective Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.SubjectiveSection#validateSubjectiveSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Subjective Section Title}
  • + *
+ *

+ * + * @generated + */ + +public class SubjectiveSectionTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateSubjectiveSectionHasClinicalStatements() { + OperationsTestCase validateSubjectiveSectionHasClinicalStatementsTestCase = new OperationsTestCase( + "validateSubjectiveSectionHasClinicalStatements", + operationsForOCL.getOCLValue("VALIDATE_SUBJECTIVE_SECTION_HAS_CLINICAL_STATEMENTS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SubjectiveSection target) { + + } + + @Override + protected void updateToPass(SubjectiveSection target) { + target.init(); + Entry entry = CDAFactory.eINSTANCE.createEntry(); + target.getEntries().add(entry); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SubjectiveSectionOperations.validateSubjectiveSectionHasClinicalStatements( + (SubjectiveSection) objectToTest, diagnostician, map); + } + + }; + + validateSubjectiveSectionHasClinicalStatementsTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSubjectiveSectionTemplateId() { + OperationsTestCase validateSubjectiveSectionTemplateIdTestCase = new OperationsTestCase( + "validateSubjectiveSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_SUBJECTIVE_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SubjectiveSection target) { + + } + + @Override + protected void updateToPass(SubjectiveSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SubjectiveSectionOperations.validateSubjectiveSectionTemplateId( + (SubjectiveSection) objectToTest, diagnostician, map); + } + + }; + + validateSubjectiveSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSubjectiveSectionCode() { + OperationsTestCase validateSubjectiveSectionCodeTestCase = new OperationsTestCase( + "validateSubjectiveSectionCode", + operationsForOCL.getOCLValue("VALIDATE_SUBJECTIVE_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SubjectiveSection target) { + + } + + @Override + protected void updateToPass(SubjectiveSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SubjectiveSectionOperations.validateSubjectiveSectionCode( + (SubjectiveSection) objectToTest, diagnostician, map); + } + + }; + + validateSubjectiveSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSubjectiveSectionText() { + OperationsTestCase validateSubjectiveSectionTextTestCase = new OperationsTestCase( + "validateSubjectiveSectionText", + operationsForOCL.getOCLValue("VALIDATE_SUBJECTIVE_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SubjectiveSection target) { + + } + + @Override + protected void updateToPass(SubjectiveSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SubjectiveSectionOperations.validateSubjectiveSectionText( + (SubjectiveSection) objectToTest, diagnostician, map); + } + + }; + + validateSubjectiveSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSubjectiveSectionTitle() { + OperationsTestCase validateSubjectiveSectionTitleTestCase = new OperationsTestCase( + "validateSubjectiveSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_SUBJECTIVE_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SubjectiveSection target) { + + } + + @Override + protected void updateToPass(SubjectiveSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SubjectiveSectionOperations.validateSubjectiveSectionTitle( + (SubjectiveSection) objectToTest, diagnostician, map); + } + + }; + + validateSubjectiveSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends SubjectiveSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public SubjectiveSection create() { + return CDTFactory.eINSTANCE.createSubjectiveSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends SubjectiveSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // SubjectiveSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/UnstructuredDocumentTest.java b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/UnstructuredDocumentTest.java new file mode 100644 index 000000000..de110967d --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/UnstructuredDocumentTest.java @@ -0,0 +1,612 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.cdt.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Component2; +import org.openhealthtools.mdht.uml.cda.NonXMLBody; +import org.openhealthtools.mdht.uml.cda.cdt.CDTFactory; +import org.openhealthtools.mdht.uml.cda.cdt.UnstructuredDocument; +import org.openhealthtools.mdht.uml.cda.cdt.operations.UnstructuredDocumentOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; + +/** + * + * A static utility class that provides operations related to 'Unstructured Document' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.UnstructuredDocument#validateUnstructuredDocumentPatientRoleHasId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Unstructured Document Patient Role Has Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.UnstructuredDocument#validateUnstructuredDocumentAssignedAuthorHasAddr(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Unstructured Document Assigned Author Has Addr}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.UnstructuredDocument#validateUnstructuredDocumentAssignedAuthorHasTelecom(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Unstructured Document Assigned Author Has Telecom}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.UnstructuredDocument#validateUnstructuredDocumentHasRepresentedCustodianOrganization(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Unstructured Document Has Represented Custodian Organization}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.UnstructuredDocument#validateUnstructuredDocumentHasRepresentedCustodianOrganizationId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Unstructured Document Has Represented Custodian Organization Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.UnstructuredDocument#validateUnstructuredDocumentHasRepresentedCustodianOrganizationName(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Unstructured Document Has Represented Custodian Organization Name}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.UnstructuredDocument#validateUnstructuredDocumentHasRepresentedCustodianOrganizationTelecom(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Unstructured Document Has Represented Custodian Organization Telecom}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.UnstructuredDocument#validateUnstructuredDocumentHasRepresentedCustodianOrganizationAddr(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Unstructured Document Has Represented Custodian Organization Addr}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.UnstructuredDocument#validateUnstructuredDocumentHasNonXMLBodyText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Unstructured Document Has Non XML Body Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.UnstructuredDocument#validateUnstructuredDocumentHasTextReferenceOrRepresentation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Unstructured Document Has Text Reference Or Representation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.UnstructuredDocument#validateUnstructuredDocumentHasTextMediaTypeValueSet(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Unstructured Document Has Text Media Type Value Set}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.UnstructuredDocument#validateUnstructuredDocumentEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Unstructured Document Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.UnstructuredDocument#validateUnstructuredDocumentCustodian(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Unstructured Document Custodian}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.UnstructuredDocument#validateGeneralHeaderConstraintsTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class UnstructuredDocumentTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateUnstructuredDocumentPatientRoleHasId() { + OperationsTestCase validateUnstructuredDocumentPatientRoleHasIdTestCase = new OperationsTestCase( + "validateUnstructuredDocumentPatientRoleHasId", + operationsForOCL.getOCLValue("VALIDATE_UNSTRUCTURED_DOCUMENT_PATIENT_ROLE_HAS_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(UnstructuredDocument target) { + + } + + @Override + protected void updateToPass(UnstructuredDocument target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return UnstructuredDocumentOperations.validateUnstructuredDocumentPatientRoleHasId( + (UnstructuredDocument) objectToTest, diagnostician, map); + } + + }; + + validateUnstructuredDocumentPatientRoleHasIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateUnstructuredDocumentAssignedAuthorHasAddr() { + OperationsTestCase validateUnstructuredDocumentAssignedAuthorHasAddrTestCase = new OperationsTestCase( + "validateUnstructuredDocumentAssignedAuthorHasAddr", + operationsForOCL.getOCLValue("VALIDATE_UNSTRUCTURED_DOCUMENT_ASSIGNED_AUTHOR_HAS_ADDR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(UnstructuredDocument target) { + + } + + @Override + protected void updateToPass(UnstructuredDocument target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return UnstructuredDocumentOperations.validateUnstructuredDocumentAssignedAuthorHasAddr( + (UnstructuredDocument) objectToTest, diagnostician, map); + } + + }; + + validateUnstructuredDocumentAssignedAuthorHasAddrTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateUnstructuredDocumentAssignedAuthorHasTelecom() { + OperationsTestCase validateUnstructuredDocumentAssignedAuthorHasTelecomTestCase = new OperationsTestCase( + "validateUnstructuredDocumentAssignedAuthorHasTelecom", + operationsForOCL.getOCLValue("VALIDATE_UNSTRUCTURED_DOCUMENT_ASSIGNED_AUTHOR_HAS_TELECOM__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(UnstructuredDocument target) { + + } + + @Override + protected void updateToPass(UnstructuredDocument target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return UnstructuredDocumentOperations.validateUnstructuredDocumentAssignedAuthorHasTelecom( + (UnstructuredDocument) objectToTest, diagnostician, map); + } + + }; + + validateUnstructuredDocumentAssignedAuthorHasTelecomTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateUnstructuredDocumentHasRepresentedCustodianOrganization() { + OperationsTestCase validateUnstructuredDocumentHasRepresentedCustodianOrganizationTestCase = new OperationsTestCase( + "validateUnstructuredDocumentHasRepresentedCustodianOrganization", + operationsForOCL.getOCLValue("VALIDATE_UNSTRUCTURED_DOCUMENT_HAS_REPRESENTED_CUSTODIAN_ORGANIZATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(UnstructuredDocument target) { + + } + + @Override + protected void updateToPass(UnstructuredDocument target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return UnstructuredDocumentOperations.validateUnstructuredDocumentHasRepresentedCustodianOrganization( + (UnstructuredDocument) objectToTest, diagnostician, map); + } + + }; + + validateUnstructuredDocumentHasRepresentedCustodianOrganizationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateUnstructuredDocumentHasRepresentedCustodianOrganizationId() { + OperationsTestCase validateUnstructuredDocumentHasRepresentedCustodianOrganizationIdTestCase = new OperationsTestCase( + "validateUnstructuredDocumentHasRepresentedCustodianOrganizationId", + operationsForOCL.getOCLValue("VALIDATE_UNSTRUCTURED_DOCUMENT_HAS_REPRESENTED_CUSTODIAN_ORGANIZATION_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(UnstructuredDocument target) { + + } + + @Override + protected void updateToPass(UnstructuredDocument target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return UnstructuredDocumentOperations.validateUnstructuredDocumentHasRepresentedCustodianOrganizationId( + (UnstructuredDocument) objectToTest, diagnostician, map); + } + + }; + + validateUnstructuredDocumentHasRepresentedCustodianOrganizationIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateUnstructuredDocumentHasRepresentedCustodianOrganizationName() { + OperationsTestCase validateUnstructuredDocumentHasRepresentedCustodianOrganizationNameTestCase = new OperationsTestCase( + "validateUnstructuredDocumentHasRepresentedCustodianOrganizationName", + operationsForOCL.getOCLValue("VALIDATE_UNSTRUCTURED_DOCUMENT_HAS_REPRESENTED_CUSTODIAN_ORGANIZATION_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(UnstructuredDocument target) { + + } + + @Override + protected void updateToPass(UnstructuredDocument target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return UnstructuredDocumentOperations.validateUnstructuredDocumentHasRepresentedCustodianOrganizationName( + (UnstructuredDocument) objectToTest, diagnostician, map); + } + + }; + + validateUnstructuredDocumentHasRepresentedCustodianOrganizationNameTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateUnstructuredDocumentHasRepresentedCustodianOrganizationTelecom() { + OperationsTestCase validateUnstructuredDocumentHasRepresentedCustodianOrganizationTelecomTestCase = new OperationsTestCase( + "validateUnstructuredDocumentHasRepresentedCustodianOrganizationTelecom", + operationsForOCL.getOCLValue("VALIDATE_UNSTRUCTURED_DOCUMENT_HAS_REPRESENTED_CUSTODIAN_ORGANIZATION_TELECOM__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(UnstructuredDocument target) { + + } + + @Override + protected void updateToPass(UnstructuredDocument target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return UnstructuredDocumentOperations.validateUnstructuredDocumentHasRepresentedCustodianOrganizationTelecom( + (UnstructuredDocument) objectToTest, diagnostician, map); + } + + }; + + validateUnstructuredDocumentHasRepresentedCustodianOrganizationTelecomTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateUnstructuredDocumentHasRepresentedCustodianOrganizationAddr() { + OperationsTestCase validateUnstructuredDocumentHasRepresentedCustodianOrganizationAddrTestCase = new OperationsTestCase( + "validateUnstructuredDocumentHasRepresentedCustodianOrganizationAddr", + operationsForOCL.getOCLValue("VALIDATE_UNSTRUCTURED_DOCUMENT_HAS_REPRESENTED_CUSTODIAN_ORGANIZATION_ADDR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(UnstructuredDocument target) { + + } + + @Override + protected void updateToPass(UnstructuredDocument target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return UnstructuredDocumentOperations.validateUnstructuredDocumentHasRepresentedCustodianOrganizationAddr( + (UnstructuredDocument) objectToTest, diagnostician, map); + } + + }; + + validateUnstructuredDocumentHasRepresentedCustodianOrganizationAddrTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateUnstructuredDocumentHasNonXMLBodyText() { + OperationsTestCase validateUnstructuredDocumentHasNonXMLBodyTextTestCase = new OperationsTestCase( + "validateUnstructuredDocumentHasNonXMLBodyText", + operationsForOCL.getOCLValue("VALIDATE_UNSTRUCTURED_DOCUMENT_HAS_NON_XML_BODY_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(UnstructuredDocument target) { + + } + + @Override + protected void updateToPass(UnstructuredDocument target) { + target.init(); + + Component2 component = CDAFactory.eINSTANCE.createComponent2(); + target.setComponent(component); + + NonXMLBody body = CDAFactory.eINSTANCE.createNonXMLBody(); + component.setNonXMLBody(body); + + ED text = DatatypesFactory.eINSTANCE.createED(); + body.setText(text); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return UnstructuredDocumentOperations.validateUnstructuredDocumentHasNonXMLBodyText( + (UnstructuredDocument) objectToTest, diagnostician, map); + } + + }; + + validateUnstructuredDocumentHasNonXMLBodyTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateUnstructuredDocumentHasTextReferenceOrRepresentation() { + OperationsTestCase validateUnstructuredDocumentHasTextReferenceOrRepresentationTestCase = new OperationsTestCase( + "validateUnstructuredDocumentHasTextReferenceOrRepresentation", + operationsForOCL.getOCLValue("VALIDATE_UNSTRUCTURED_DOCUMENT_HAS_TEXT_REFERENCE_OR_REPRESENTATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(UnstructuredDocument target) { + + } + + @Override + protected void updateToPass(UnstructuredDocument target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return UnstructuredDocumentOperations.validateUnstructuredDocumentHasTextReferenceOrRepresentation( + (UnstructuredDocument) objectToTest, diagnostician, map); + } + + }; + + validateUnstructuredDocumentHasTextReferenceOrRepresentationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateUnstructuredDocumentHasTextMediaTypeValueSet() { + OperationsTestCase validateUnstructuredDocumentHasTextMediaTypeValueSetTestCase = new OperationsTestCase( + "validateUnstructuredDocumentHasTextMediaTypeValueSet", + operationsForOCL.getOCLValue("VALIDATE_UNSTRUCTURED_DOCUMENT_HAS_TEXT_MEDIA_TYPE_VALUE_SET__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(UnstructuredDocument target) { + + } + + @Override + protected void updateToPass(UnstructuredDocument target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return UnstructuredDocumentOperations.validateUnstructuredDocumentHasTextMediaTypeValueSet( + (UnstructuredDocument) objectToTest, diagnostician, map); + } + + }; + + validateUnstructuredDocumentHasTextMediaTypeValueSetTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateUnstructuredDocumentEffectiveTime() { + OperationsTestCase validateUnstructuredDocumentEffectiveTimeTestCase = new OperationsTestCase( + "validateUnstructuredDocumentEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_UNSTRUCTURED_DOCUMENT_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(UnstructuredDocument target) { + + } + + @Override + protected void updateToPass(UnstructuredDocument target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return UnstructuredDocumentOperations.validateUnstructuredDocumentEffectiveTime( + (UnstructuredDocument) objectToTest, diagnostician, map); + } + + }; + + validateUnstructuredDocumentEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateUnstructuredDocumentCustodian() { + OperationsTestCase validateUnstructuredDocumentCustodianTestCase = new OperationsTestCase( + "validateUnstructuredDocumentCustodian", + operationsForOCL.getOCLValue("VALIDATE_UNSTRUCTURED_DOCUMENT_CUSTODIAN__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(UnstructuredDocument target) { + + } + + @Override + protected void updateToPass(UnstructuredDocument target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return UnstructuredDocumentOperations.validateUnstructuredDocumentCustodian( + (UnstructuredDocument) objectToTest, diagnostician, map); + } + + }; + + validateUnstructuredDocumentCustodianTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateGeneralHeaderConstraintsTemplateId() { + OperationsTestCase validateGeneralHeaderConstraintsTemplateIdTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsTemplateId", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(UnstructuredDocument target) { + + } + + @Override + protected void updateToPass(UnstructuredDocument target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return UnstructuredDocumentOperations.validateGeneralHeaderConstraintsTemplateId( + (UnstructuredDocument) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends UnstructuredDocumentOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public UnstructuredDocument create() { + return CDTFactory.eINSTANCE.createUnstructuredDocument(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends UnstructuredDocumentOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // UnstructuredDocumentOperations diff --git a/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/VitalSignsSectionTest.java b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/VitalSignsSectionTest.java new file mode 100644 index 000000000..828246886 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.cdt.tests/src/org/openhealthtools/mdht/uml/cda/cdt/tests/VitalSignsSectionTest.java @@ -0,0 +1,314 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.cdt.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Entry; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.VitalSignsOrganizer; +import org.openhealthtools.mdht.uml.cda.cdt.CDTFactory; +import org.openhealthtools.mdht.uml.cda.cdt.VitalSignsSection; +import org.openhealthtools.mdht.uml.cda.cdt.operations.VitalSignsSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Vital Signs Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.VitalSignsSection#validateVitalSignsSectionClinicalStatements(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Signs Section Clinical Statements}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.VitalSignsSection#validateVitalSignsSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Signs Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.VitalSignsSection#validateVitalSignsSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Signs Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.VitalSignsSection#validateVitalSignsSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Signs Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.VitalSignsSection#validateVitalSignsSectionVitalSignsOrganizer(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Signs Section Vital Signs Organizer}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.cdt.VitalSignsSection#getVitalSignsOrganizer() Get Vital Signs Organizer}
  • + *
+ *

+ * + * @generated + */ + +public class VitalSignsSectionTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateVitalSignsSectionClinicalStatements() { + OperationsTestCase validateVitalSignsSectionClinicalStatementsTestCase = new OperationsTestCase( + "validateVitalSignsSectionClinicalStatements", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGNS_SECTION_CLINICAL_STATEMENTS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignsSection target) { + + } + + @Override + protected void updateToPass(VitalSignsSection target) { + target.init(); + + Entry entry = CDAFactory.eINSTANCE.createEntry(); + + target.getEntries().add(entry); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignsSectionOperations.validateVitalSignsSectionClinicalStatements( + (VitalSignsSection) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignsSectionClinicalStatementsTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateVitalSignsSectionTemplateId() { + OperationsTestCase validateVitalSignsSectionTemplateIdTestCase = new OperationsTestCase( + "validateVitalSignsSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGNS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignsSection target) { + + } + + @Override + protected void updateToPass(VitalSignsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignsSectionOperations.validateVitalSignsSectionTemplateId( + (VitalSignsSection) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignsSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateVitalSignsSectionCode() { + OperationsTestCase validateVitalSignsSectionCodeTestCase = new OperationsTestCase( + "validateVitalSignsSectionCode", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGNS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignsSection target) { + + } + + @Override + protected void updateToPass(VitalSignsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignsSectionOperations.validateVitalSignsSectionCode( + (VitalSignsSection) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignsSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateVitalSignsSectionText() { + OperationsTestCase validateVitalSignsSectionTextTestCase = new OperationsTestCase( + "validateVitalSignsSectionText", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGNS_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignsSection target) { + + } + + @Override + protected void updateToPass(VitalSignsSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignsSectionOperations.validateVitalSignsSectionText( + (VitalSignsSection) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignsSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateVitalSignsSectionVitalSignsOrganizer() { + OperationsTestCase validateVitalSignsSectionVitalSignsOrganizerTestCase = new OperationsTestCase( + "validateVitalSignsSectionVitalSignsOrganizer", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGNS_SECTION_VITAL_SIGNS_ORGANIZER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignsSection target) { + + } + + @Override + protected void updateToPass(VitalSignsSection target) { + target.init(); + + Entry entry = CDAFactory.eINSTANCE.createEntry(); + + VitalSignsOrganizer vso = CCDFactory.eINSTANCE.createVitalSignsOrganizer().init(); + entry.setOrganizer(vso); + target.getEntries().add(entry); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignsSectionOperations.validateVitalSignsSectionVitalSignsOrganizer( + (VitalSignsSection) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignsSectionVitalSignsOrganizerTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetVitalSignsOrganizer() { + + VitalSignsSection target = objectFactory.create(); + target.getVitalSignsOrganizer(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends VitalSignsSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public VitalSignsSection create() { + return CDTFactory.eINSTANCE.createVitalSignsSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends VitalSignsSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // VitalSignsSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/.classpath b/org.openhealthtools.mdht.uml.cda.consol.tests/.classpath new file mode 100644 index 000000000..121e527a9 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/.project b/org.openhealthtools.mdht.uml.cda.consol.tests/.project new file mode 100644 index 000000000..f3a8fe2e9 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/.project @@ -0,0 +1,28 @@ + + + org.openhealthtools.mdht.uml.cda.consol.tests + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.pde.PluginNature + + diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/.settings/org.eclipse.jdt.core.prefs b/org.openhealthtools.mdht.uml.cda.consol.tests/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..fd79a3e6c --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,355 @@ +#Mon May 16 10:24:25 EDT 2011 +eclipse.preferences.version=1 +org.eclipse.jdt.core.codeComplete.argumentPrefixes= +org.eclipse.jdt.core.codeComplete.argumentSuffixes= +org.eclipse.jdt.core.codeComplete.fieldPrefixes= +org.eclipse.jdt.core.codeComplete.fieldSuffixes= +org.eclipse.jdt.core.codeComplete.localPrefixes= +org.eclipse.jdt.core.codeComplete.localSuffixes= +org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.5 +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.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning +org.eclipse.jdt.core.compiler.problem.deadCode=warning +org.eclipse.jdt.core.compiler.problem.deprecation=warning +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore +org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=error +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore +org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning +org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +org.eclipse.jdt.core.compiler.problem.nullReference=warning +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore +org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=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 +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedImport=warning +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +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.5 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=36 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=36 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=36 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=36 +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_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=49 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=32 +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_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=0 +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 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=1 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=150 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@fmtOff +org.eclipse.jdt.core.formatter.enabling_tag=@fmtOn +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +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=true +org.eclipse.jdt.core.formatter.indentation.size=4 +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_parameter=do not 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=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +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_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_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 +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +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_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 +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +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_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not 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_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 +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +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_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 +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +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_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_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 +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=false +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=120 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +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=false +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/.settings/org.eclipse.jdt.ui.prefs b/org.openhealthtools.mdht.uml.cda.consol.tests/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 000000000..6245d2099 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,120 @@ +#Tue Mar 29 22:38:51 EDT 2011 +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=false +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=false +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=false +cleanup.format_source_code=true +cleanup.format_source_code_changes_only=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=false +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=true +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=true +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=true +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_blocks=true +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_parentheses_in_expressions=false +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup_profile=_MDHT +cleanup_settings_version=2 +eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true +formatter_profile=_MDHT +formatter_settings_version=11 +org.eclipse.jdt.ui.exception.name=e +org.eclipse.jdt.ui.gettersetter.use.is=true +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com; +org.eclipse.jdt.ui.javadoc=true +org.eclipse.jdt.ui.keywordthis=false +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.overrideannotation=true +org.eclipse.jdt.ui.staticondemandthreshold=99 +org.eclipse.jdt.ui.text.custom_code_templates= +sp_cleanup.add_default_serial_version_id=true +sp_cleanup.add_generated_serial_version_id=false +sp_cleanup.add_missing_annotations=true +sp_cleanup.add_missing_deprecated_annotations=true +sp_cleanup.add_missing_methods=false +sp_cleanup.add_missing_nls_tags=false +sp_cleanup.add_missing_override_annotations=true +sp_cleanup.add_missing_override_annotations_interface_methods=false +sp_cleanup.add_serial_version_id=false +sp_cleanup.always_use_blocks=true +sp_cleanup.always_use_parentheses_in_expressions=false +sp_cleanup.always_use_this_for_non_static_field_access=false +sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.convert_to_enhanced_for_loop=false +sp_cleanup.correct_indentation=false +sp_cleanup.format_source_code=true +sp_cleanup.format_source_code_changes_only=false +sp_cleanup.make_local_variable_final=false +sp_cleanup.make_parameters_final=false +sp_cleanup.make_private_fields_final=true +sp_cleanup.make_type_abstract_if_missing_method=false +sp_cleanup.make_variable_declarations_final=false +sp_cleanup.never_use_blocks=false +sp_cleanup.never_use_parentheses_in_expressions=true +sp_cleanup.on_save_use_additional_actions=true +sp_cleanup.organize_imports=true +sp_cleanup.qualify_static_field_accesses_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_with_declaring_class=false +sp_cleanup.qualify_static_method_accesses_with_declaring_class=false +sp_cleanup.remove_private_constructors=true +sp_cleanup.remove_trailing_whitespaces=true +sp_cleanup.remove_trailing_whitespaces_all=true +sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +sp_cleanup.remove_unnecessary_casts=true +sp_cleanup.remove_unnecessary_nls_tags=false +sp_cleanup.remove_unused_imports=false +sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_private_fields=true +sp_cleanup.remove_unused_private_members=false +sp_cleanup.remove_unused_private_methods=true +sp_cleanup.remove_unused_private_types=true +sp_cleanup.sort_members=false +sp_cleanup.sort_members_all=false +sp_cleanup.use_blocks=false +sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_parentheses_in_expressions=false +sp_cleanup.use_this_for_non_static_field_access=false +sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true +sp_cleanup.use_this_for_non_static_method_access=false +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/META-INF/MANIFEST.MF b/org.openhealthtools.mdht.uml.cda.consol.tests/META-INF/MANIFEST.MF new file mode 100644 index 000000000..122991ea3 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/META-INF/MANIFEST.MF @@ -0,0 +1,21 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: org.openhealthtools.mdht.uml.cda.consol.tests;singleton:=true +Bundle-Version: 1.1.0.qualifier +Bundle-ClassPath: . +Bundle-Vendor: %providerName +Bundle-Localization: plugin +Bundle-RequiredExecutionEnvironment: J2SE-1.5 +Export-Package: org.openhealthtools.mdht.uml.cda.consol.tests +Require-Bundle: org.eclipse.core.runtime, + org.openhealthtools.mdht.uml.cda.consol;visibility:=reexport, + org.openhealthtools.mdht.uml.cda;visibility:=reexport, + org.openhealthtools.mdht.uml.hl7.datatypes;visibility:=reexport, + org.eclipse.emf.ecore;visibility:=reexport, + org.openhealthtools.mdht.uml.hl7.rim;visibility:=reexport, + org.openhealthtools.mdht.uml.hl7.vocab;visibility:=reexport, + org.eclipse.emf.ecore.xmi;visibility:=reexport, + org.junit;visibility:=reexport, + org.openhealthtools.mdht.uml.cda.test +Bundle-ActivationPolicy: lazy diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/build.properties b/org.openhealthtools.mdht.uml.cda.consol.tests/build.properties new file mode 100644 index 000000000..f86eda894 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/build.properties @@ -0,0 +1,16 @@ +############################################################################### +# Copyright (c) 2011, 2012 Sean Muir and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Sean Muir (JKM Software) - initial API and implementation +############################################################################### +bin.includes = .,\ + META-INF/,\ + plugin.properties +jars.compile.order = . +source.. = src/ +output.. = bin/ diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/plugin.properties b/org.openhealthtools.mdht.uml.cda.consol.tests/plugin.properties new file mode 100644 index 000000000..e607395b2 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/plugin.properties @@ -0,0 +1,13 @@ +############################################################################### +# Copyright (c) 2011, 2012 Sean Muir and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Sean Muir (JKM Software) - initial API and implementation +############################################################################### +pluginName = Consol Tests +providerName = www.example.org + diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/AdmissionMedicationTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/AdmissionMedicationTest.java new file mode 100644 index 000000000..db9f6ab3a --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/AdmissionMedicationTest.java @@ -0,0 +1,332 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.consol.AdmissionMedication; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.operations.AdmissionMedicationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * + * A static utility class that provides operations related to 'Admission Medication' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AdmissionMedication#validateAdmissionMedicationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Admission Medication Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AdmissionMedication#validateAdmissionMedicationClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Admission Medication Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AdmissionMedication#validateAdmissionMedicationCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Admission Medication Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AdmissionMedication#validateAdmissionMedicationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Admission Medication Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AdmissionMedication#validateAdmissionMedicationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Admission Medication Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AdmissionMedication#validateAdmissionMedicationMedicationActivity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Admission Medication Medication Activity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AdmissionMedication#getMedicationActivity() Get Medication Activity}
  • + *
+ *

+ * + * @generated + */ + +public class AdmissionMedicationTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateAdmissionMedicationTemplateId() { + OperationsTestCase validateAdmissionMedicationTemplateIdTestCase = new OperationsTestCase( + "validateAdmissionMedicationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_ADMISSION_MEDICATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdmissionMedication target) { + + } + + @Override + protected void updateToPass(AdmissionMedication target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdmissionMedicationOperations.validateAdmissionMedicationTemplateId( + (AdmissionMedication) objectToTest, diagnostician, map); + } + + }; + + validateAdmissionMedicationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAdmissionMedicationClassCode() { + OperationsTestCase validateAdmissionMedicationClassCodeTestCase = new OperationsTestCase( + "validateAdmissionMedicationClassCode", + operationsForOCL.getOCLValue("VALIDATE_ADMISSION_MEDICATION_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdmissionMedication target) { + + } + + @Override + protected void updateToPass(AdmissionMedication target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdmissionMedicationOperations.validateAdmissionMedicationClassCode( + (AdmissionMedication) objectToTest, diagnostician, map); + } + + }; + + validateAdmissionMedicationClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAdmissionMedicationCodeP() { + OperationsTestCase validateAdmissionMedicationCodePTestCase = new OperationsTestCase( + "validateAdmissionMedicationCodeP", + operationsForOCL.getOCLValue("VALIDATE_ADMISSION_MEDICATION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdmissionMedication target) { + + } + + @Override + protected void updateToPass(AdmissionMedication target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdmissionMedicationOperations.validateAdmissionMedicationCodeP( + (AdmissionMedication) objectToTest, diagnostician, map); + } + + }; + + validateAdmissionMedicationCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAdmissionMedicationCode() { + OperationsTestCase validateAdmissionMedicationCodeTestCase = new OperationsTestCase( + "validateAdmissionMedicationCode", + operationsForOCL.getOCLValue("VALIDATE_ADMISSION_MEDICATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdmissionMedication target) { + + } + + @Override + protected void updateToPass(AdmissionMedication target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdmissionMedicationOperations.validateAdmissionMedicationCode( + (AdmissionMedication) objectToTest, diagnostician, map); + } + + }; + + validateAdmissionMedicationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAdmissionMedicationMoodCode() { + OperationsTestCase validateAdmissionMedicationMoodCodeTestCase = new OperationsTestCase( + "validateAdmissionMedicationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_ADMISSION_MEDICATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdmissionMedication target) { + + } + + @Override + protected void updateToPass(AdmissionMedication target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdmissionMedicationOperations.validateAdmissionMedicationMoodCode( + (AdmissionMedication) objectToTest, diagnostician, map); + } + + }; + + validateAdmissionMedicationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAdmissionMedicationMedicationActivity() { + OperationsTestCase validateAdmissionMedicationMedicationActivityTestCase = new OperationsTestCase( + "validateAdmissionMedicationMedicationActivity", + operationsForOCL.getOCLValue("VALIDATE_ADMISSION_MEDICATION_MEDICATION_ACTIVITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdmissionMedication target) { + target.init(); + } + + @Override + protected void updateToPass(AdmissionMedication target) { + target.addSubstanceAdministration(ConsolFactory.eINSTANCE.createMedicationActivity().init()); + for (org.openhealthtools.mdht.uml.cda.EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdmissionMedicationOperations.validateAdmissionMedicationMedicationActivity( + (AdmissionMedication) objectToTest, diagnostician, map); + } + + }; + + validateAdmissionMedicationMedicationActivityTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetMedicationActivity() { + + AdmissionMedication target = objectFactory.create(); + target.getMedicationActivity(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends AdmissionMedicationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public AdmissionMedication create() { + return ConsolFactory.eINSTANCE.createAdmissionMedication(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends AdmissionMedicationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // AdmissionMedicationOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/AdvanceDirectiveObservationTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/AdvanceDirectiveObservationTest.java new file mode 100644 index 000000000..82a7394cf --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/AdvanceDirectiveObservationTest.java @@ -0,0 +1,1369 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.ExternalDocument; +import org.openhealthtools.mdht.uml.cda.Participant2; +import org.openhealthtools.mdht.uml.cda.ParticipantRole; +import org.openhealthtools.mdht.uml.cda.PlayingEntity; +import org.openhealthtools.mdht.uml.cda.Reference; +import org.openhealthtools.mdht.uml.cda.consol.AdvanceDirectiveObservation; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.operations.AdvanceDirectiveObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.vocab.ParticipationType; +import org.openhealthtools.mdht.uml.hl7.vocab.RoleClassRoot; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipExternalReference; + +/** + * + * A static utility class that provides operations related to 'Advance Directive Observation' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AdvanceDirectiveObservation#validateAdvanceDirectiveObservationHasStartingTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directive Observation Has Starting Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AdvanceDirectiveObservation#validateAdvanceDirectiveObservationHasEndingTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directive Observation Has Ending Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AdvanceDirectiveObservation#validateAdvanceDirectiveObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directive Observation Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AdvanceDirectiveObservation#validateAdvanceDirectiveObservationClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directive Observation Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AdvanceDirectiveObservation#validateAdvanceDirectiveObservationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directive Observation Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AdvanceDirectiveObservation#validateAdvanceDirectiveObservationId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directive Observation Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AdvanceDirectiveObservation#validateAdvanceDirectiveObservationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directive Observation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AdvanceDirectiveObservation#validateAdvanceDirectiveObservationStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directive Observation Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AdvanceDirectiveObservation#validateAdvanceDirectiveObservationEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directive Observation Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AdvanceDirectiveObservation#validateAdvanceDirectiveObservationVerifier(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directive Observation Verifier}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AdvanceDirectiveObservation#validateAdvanceDirectiveObservationCustodian(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directive Observation Custodian}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AdvanceDirectiveObservation#validateAdvanceDirectiveObservationReference(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directive Observation Reference}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AdvanceDirectiveObservation#validateAdvanceDirectiveObservationVerifierTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directive Observation Verifier Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AdvanceDirectiveObservation#validateAdvanceDirectiveObservationVerifierTypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directive Observation Verifier Type Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AdvanceDirectiveObservation#validateAdvanceDirectiveObservationVerifierParticipantRole(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directive Observation Verifier Participant Role}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AdvanceDirectiveObservation#validateAdvanceDirectiveObservationCustodianCustodianRoleCustodianEntityName(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directive Observation Custodian Custodian Role Custodian Entity Name}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AdvanceDirectiveObservation#validateAdvanceDirectiveObservationCustodianCustodianRoleAddr(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directive Observation Custodian Custodian Role Addr}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AdvanceDirectiveObservation#validateAdvanceDirectiveObservationCustodianCustodianRoleClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directive Observation Custodian Custodian Role Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AdvanceDirectiveObservation#validateAdvanceDirectiveObservationCustodianCustodianRoleTelecom(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directive Observation Custodian Custodian Role Telecom}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AdvanceDirectiveObservation#validateAdvanceDirectiveObservationCustodianCustodianRolePlayingEntity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directive Observation Custodian Custodian Role Playing Entity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AdvanceDirectiveObservation#validateAdvanceDirectiveObservationCustodianTypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directive Observation Custodian Type Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AdvanceDirectiveObservation#validateAdvanceDirectiveObservationCustodianAdvanceDirectiveObservationCustodianRole(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directive Observation Custodian Advance Directive Observation Custodian Role}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AdvanceDirectiveObservation#validateAdvanceDirectiveObservationReferenceExternalDocumentTextMediaType(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directive Observation Reference External Document Text Media Type}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AdvanceDirectiveObservation#validateAdvanceDirectiveObservationReferenceExternalDocumentTextReference(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directive Observation Reference External Document Text Reference}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AdvanceDirectiveObservation#validateAdvanceDirectiveObservationReferenceExternalDocumentId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directive Observation Reference External Document Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AdvanceDirectiveObservation#validateAdvanceDirectiveObservationReferenceExternalDocumentText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directive Observation Reference External Document Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AdvanceDirectiveObservation#validateAdvanceDirectiveObservationReferenceTypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directive Observation Reference Type Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AdvanceDirectiveObservation#validateAdvanceDirectiveObservationReferenceExternalDocument(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directive Observation Reference External Document}
  • + *
+ *

+ * + * @generated + */ + +public class AdvanceDirectiveObservationTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateAdvanceDirectiveObservationHasStartingTime() { + OperationsTestCase validateAdvanceDirectiveObservationHasStartingTimeTestCase = new OperationsTestCase( + "validateAdvanceDirectiveObservationHasStartingTime", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_OBSERVATION_HAS_STARTING_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveObservation target) { + + } + + @Override + protected void updateToPass(AdvanceDirectiveObservation target) { + target.init(); + + target.setEffectiveTime(DatatypesFactory.eINSTANCE.createIVL_TS("low", "high")); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveObservationOperations.validateAdvanceDirectiveObservationHasStartingTime( + (AdvanceDirectiveObservation) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveObservationHasStartingTimeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAdvanceDirectiveObservationHasEndingTime() { + OperationsTestCase validateAdvanceDirectiveObservationHasEndingTimeTestCase = new OperationsTestCase( + "validateAdvanceDirectiveObservationHasEndingTime", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_OBSERVATION_HAS_ENDING_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveObservation target) { + + } + + @Override + protected void updateToPass(AdvanceDirectiveObservation target) { + target.init(); + target.setEffectiveTime(DatatypesFactory.eINSTANCE.createIVL_TS("low", "high")); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveObservationOperations.validateAdvanceDirectiveObservationHasEndingTime( + (AdvanceDirectiveObservation) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveObservationHasEndingTimeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAdvanceDirectiveObservationTemplateId() { + OperationsTestCase validateAdvanceDirectiveObservationTemplateIdTestCase = new OperationsTestCase( + "validateAdvanceDirectiveObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveObservation target) { + + } + + @Override + protected void updateToPass(AdvanceDirectiveObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveObservationOperations.validateAdvanceDirectiveObservationTemplateId( + (AdvanceDirectiveObservation) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAdvanceDirectiveObservationClassCode() { + OperationsTestCase validateAdvanceDirectiveObservationClassCodeTestCase = new OperationsTestCase( + "validateAdvanceDirectiveObservationClassCode", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_OBSERVATION_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveObservation target) { + + } + + @Override + protected void updateToPass(AdvanceDirectiveObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveObservationOperations.validateAdvanceDirectiveObservationClassCode( + (AdvanceDirectiveObservation) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveObservationClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAdvanceDirectiveObservationMoodCode() { + OperationsTestCase validateAdvanceDirectiveObservationMoodCodeTestCase = new OperationsTestCase( + "validateAdvanceDirectiveObservationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_OBSERVATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveObservation target) { + + } + + @Override + protected void updateToPass(AdvanceDirectiveObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveObservationOperations.validateAdvanceDirectiveObservationMoodCode( + (AdvanceDirectiveObservation) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveObservationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAdvanceDirectiveObservationId() { + OperationsTestCase validateAdvanceDirectiveObservationIdTestCase = new OperationsTestCase( + "validateAdvanceDirectiveObservationId", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_OBSERVATION_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveObservation target) { + + } + + @Override + protected void updateToPass(AdvanceDirectiveObservation target) { + target.init(); + + II ii = DatatypesFactory.eINSTANCE.createII(); + target.getIds().add(ii); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveObservationOperations.validateAdvanceDirectiveObservationId( + (AdvanceDirectiveObservation) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveObservationIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAdvanceDirectiveObservationCode() { + OperationsTestCase validateAdvanceDirectiveObservationCodeTestCase = new OperationsTestCase( + "validateAdvanceDirectiveObservationCode", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveObservation target) { + + } + + @Override + protected void updateToPass(AdvanceDirectiveObservation target) { + target.init(); + + CD cd = DatatypesFactory.eINSTANCE.createCD("304251008", "2.16.840.1.113883.6.96", "", ""); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveObservationOperations.validateAdvanceDirectiveObservationCode( + (AdvanceDirectiveObservation) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAdvanceDirectiveObservationStatusCode() { + OperationsTestCase validateAdvanceDirectiveObservationStatusCodeTestCase = new OperationsTestCase( + "validateAdvanceDirectiveObservationStatusCode", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_OBSERVATION_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveObservation target) { + + } + + @Override + protected void updateToPass(AdvanceDirectiveObservation target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveObservationOperations.validateAdvanceDirectiveObservationStatusCode( + (AdvanceDirectiveObservation) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveObservationStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAdvanceDirectiveObservationEffectiveTime() { + OperationsTestCase validateAdvanceDirectiveObservationEffectiveTimeTestCase = new OperationsTestCase( + "validateAdvanceDirectiveObservationEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_OBSERVATION_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveObservation target) { + + } + + @Override + protected void updateToPass(AdvanceDirectiveObservation target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveObservationOperations.validateAdvanceDirectiveObservationEffectiveTime( + (AdvanceDirectiveObservation) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveObservationEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAdvanceDirectiveObservationVerifier() { + OperationsTestCase validateAdvanceDirectiveObservationVerifierTestCase = new OperationsTestCase( + "validateAdvanceDirectiveObservationVerifier", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_OBSERVATION_VERIFIER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveObservation target) { + + } + + @Override + protected void updateToPass(AdvanceDirectiveObservation target) { + target.init(); + Participant2 p2 = CDAFactory.eINSTANCE.createParticipant2(); + + p2.setTypeCode(ParticipationType.VRF); + target.getParticipants().add(p2); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveObservationOperations.validateAdvanceDirectiveObservationVerifier( + (AdvanceDirectiveObservation) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveObservationVerifierTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAdvanceDirectiveObservationCustodian() { + OperationsTestCase validateAdvanceDirectiveObservationCustodianTestCase = new OperationsTestCase( + "validateAdvanceDirectiveObservationCustodian", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_OBSERVATION_CUSTODIAN__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveObservation target) { + + } + + @Override + protected void updateToPass(AdvanceDirectiveObservation target) { + target.init(); + Participant2 p2 = CDAFactory.eINSTANCE.createParticipant2(); + + p2.setTypeCode(ParticipationType.CST); + target.getParticipants().add(p2); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveObservationOperations.validateAdvanceDirectiveObservationCustodian( + (AdvanceDirectiveObservation) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveObservationCustodianTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAdvanceDirectiveObservationReference() { + OperationsTestCase validateAdvanceDirectiveObservationReferenceTestCase = new OperationsTestCase( + "validateAdvanceDirectiveObservationReference", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_OBSERVATION_REFERENCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveObservation target) { + + } + + @Override + protected void updateToPass(AdvanceDirectiveObservation target) { + target.init(); + Reference ref = CDAFactory.eINSTANCE.createReference(); + ExternalDocument ed = CDAFactory.eINSTANCE.createExternalDocument(); + ref.setExternalDocument(ed); + target.getReferences().add(ref); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveObservationOperations.validateAdvanceDirectiveObservationReference( + (AdvanceDirectiveObservation) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveObservationReferenceTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAdvanceDirectiveObservationVerifierTime() { + OperationsTestCase validateAdvanceDirectiveObservationVerifierTimeTestCase = new OperationsTestCase( + "validateAdvanceDirectiveObservationVerifierTime", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_OBSERVATION_VERIFIER_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveObservation target) { + target.init(); + Participant2 p2 = CDAFactory.eINSTANCE.createParticipant2(); + + p2.setTypeCode(ParticipationType.VRF); + target.getParticipants().add(p2); + } + + @Override + protected void updateToPass(AdvanceDirectiveObservation target) { + target.getParticipants().clear(); + Participant2 p2 = CDAFactory.eINSTANCE.createParticipant2(); + + p2.setTime(DatatypesFactory.eINSTANCE.createIVL_TS()); + + p2.setTypeCode(ParticipationType.VRF); + target.getParticipants().add(p2); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveObservationOperations.validateAdvanceDirectiveObservationVerifierTime( + (AdvanceDirectiveObservation) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveObservationVerifierTimeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAdvanceDirectiveObservationVerifierTypeCode() { + OperationsTestCase validateAdvanceDirectiveObservationVerifierTypeCodeTestCase = new OperationsTestCase( + "validateAdvanceDirectiveObservationVerifierTypeCode", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_OBSERVATION_VERIFIER_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + { + this.skipFailsTest(); + } + + @Override + protected void updateToFail(AdvanceDirectiveObservation target) { + // target.init(); + Participant2 p2 = CDAFactory.eINSTANCE.createParticipant2(); + + // p2.setTypeCode(ParticipationType.ADM); + target.getParticipants().add(p2); + } + + @Override + protected void updateToPass(AdvanceDirectiveObservation target) { + target.init(); + target.getParticipants().clear(); + Participant2 p2 = CDAFactory.eINSTANCE.createParticipant2(); + + p2.setTypeCode(ParticipationType.VRF); + target.getParticipants().add(p2); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveObservationOperations.validateAdvanceDirectiveObservationVerifierTypeCode( + (AdvanceDirectiveObservation) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveObservationVerifierTypeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAdvanceDirectiveObservationVerifierParticipantRole() { + OperationsTestCase validateAdvanceDirectiveObservationVerifierParticipantRoleTestCase = new OperationsTestCase( + "validateAdvanceDirectiveObservationVerifierParticipantRole", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_OBSERVATION_VERIFIER_PARTICIPANT_ROLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveObservation target) { + target.init(); + Participant2 p2 = CDAFactory.eINSTANCE.createParticipant2(); + + p2.setTypeCode(ParticipationType.VRF); + target.getParticipants().add(p2); + } + + @Override + protected void updateToPass(AdvanceDirectiveObservation target) { + target.getParticipants().clear(); + Participant2 p2 = CDAFactory.eINSTANCE.createParticipant2(); + + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + pr.getTelecoms().add(DatatypesFactory.eINSTANCE.createTEL()); + pr.setPlayingEntity(CDAFactory.eINSTANCE.createPlayingEntity()); + + p2.setParticipantRole(pr); + + p2.setTypeCode(ParticipationType.VRF); + target.getParticipants().add(p2); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveObservationOperations.validateAdvanceDirectiveObservationVerifierParticipantRole( + (AdvanceDirectiveObservation) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveObservationVerifierParticipantRoleTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAdvanceDirectiveObservationCustodianCustodianRoleCustodianEntityName() { + OperationsTestCase validateAdvanceDirectiveObservationCustodianCustodianRoleCustodianEntityNameTestCase = new OperationsTestCase( + "validateAdvanceDirectiveObservationCustodianCustodianRoleCustodianEntityName", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_OBSERVATION_CUSTODIAN_CUSTODIAN_ROLE_CUSTODIAN_ENTITY_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveObservation target) { + target.init(); + Participant2 p2 = CDAFactory.eINSTANCE.createParticipant2(); + + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + pr.setPlayingEntity(CDAFactory.eINSTANCE.createPlayingEntity()); + + pr.setClassCode(RoleClassRoot.ROL); + + pr.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + + p2.setParticipantRole(pr); + + p2.setTypeCode(ParticipationType.CST); + target.getParticipants().add(p2); + + } + + @Override + protected void updateToPass(AdvanceDirectiveObservation target) { + target.getParticipants().clear(); + Participant2 p2 = CDAFactory.eINSTANCE.createParticipant2(); + + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + pe.getNames().add(DatatypesFactory.eINSTANCE.createPN()); + pr.setPlayingEntity(pe); + + pr.setClassCode(RoleClassRoot.ROL); + + pr.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + + p2.setParticipantRole(pr); + + p2.setTypeCode(ParticipationType.CST); + target.getParticipants().add(p2); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveObservationOperations.validateAdvanceDirectiveObservationCustodianCustodianRoleCustodianEntityName( + (AdvanceDirectiveObservation) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveObservationCustodianCustodianRoleCustodianEntityNameTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAdvanceDirectiveObservationCustodianCustodianRoleAddr() { + OperationsTestCase validateAdvanceDirectiveObservationCustodianCustodianRoleAddrTestCase = new OperationsTestCase( + "validateAdvanceDirectiveObservationCustodianCustodianRoleAddr", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_OBSERVATION_CUSTODIAN_CUSTODIAN_ROLE_ADDR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveObservation target) { + target.init(); + Participant2 p2 = CDAFactory.eINSTANCE.createParticipant2(); + + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + pr.setPlayingEntity(CDAFactory.eINSTANCE.createPlayingEntity()); + + pr.setClassCode(RoleClassRoot.ROL); + + // pr.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + + p2.setParticipantRole(pr); + + p2.setTypeCode(ParticipationType.CST); + target.getParticipants().add(p2); + } + + @Override + protected void updateToPass(AdvanceDirectiveObservation target) { + target.getParticipants().clear(); + Participant2 p2 = CDAFactory.eINSTANCE.createParticipant2(); + + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + pr.setPlayingEntity(CDAFactory.eINSTANCE.createPlayingEntity()); + + pr.setClassCode(RoleClassRoot.ROL); + + pr.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + + p2.setParticipantRole(pr); + + p2.setTypeCode(ParticipationType.CST); + target.getParticipants().add(p2); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveObservationOperations.validateAdvanceDirectiveObservationCustodianCustodianRoleAddr( + (AdvanceDirectiveObservation) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveObservationCustodianCustodianRoleAddrTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAdvanceDirectiveObservationCustodianCustodianRoleClassCode() { + OperationsTestCase validateAdvanceDirectiveObservationCustodianCustodianRoleClassCodeTestCase = new OperationsTestCase( + "validateAdvanceDirectiveObservationCustodianCustodianRoleClassCode", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_OBSERVATION_CUSTODIAN_CUSTODIAN_ROLE_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveObservation target) { + target.init(); + Participant2 p2 = CDAFactory.eINSTANCE.createParticipant2(); + + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + pr.setPlayingEntity(CDAFactory.eINSTANCE.createPlayingEntity()); + + // pr.setClassCode(RoleClassRoot.ROL); + + // pr.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + + p2.setParticipantRole(pr); + + p2.setTypeCode(ParticipationType.CST); + target.getParticipants().add(p2); + } + + @Override + protected void updateToPass(AdvanceDirectiveObservation target) { + target.getParticipants().clear(); + + Participant2 p2 = CDAFactory.eINSTANCE.createParticipant2(); + + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + pr.setPlayingEntity(CDAFactory.eINSTANCE.createPlayingEntity()); + + pr.setClassCode(RoleClassRoot.AGNT); + + // pr.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + + p2.setParticipantRole(pr); + + p2.setTypeCode(ParticipationType.CST); + target.getParticipants().add(p2); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveObservationOperations.validateAdvanceDirectiveObservationCustodianCustodianRoleClassCode( + (AdvanceDirectiveObservation) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveObservationCustodianCustodianRoleClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAdvanceDirectiveObservationCustodianCustodianRoleTelecom() { + OperationsTestCase validateAdvanceDirectiveObservationCustodianCustodianRoleTelecomTestCase = new OperationsTestCase( + "validateAdvanceDirectiveObservationCustodianCustodianRoleTelecom", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_OBSERVATION_CUSTODIAN_CUSTODIAN_ROLE_TELECOM__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveObservation target) { + target.init(); + Participant2 p2 = CDAFactory.eINSTANCE.createParticipant2(); + + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + pr.setPlayingEntity(CDAFactory.eINSTANCE.createPlayingEntity()); + + pr.setClassCode(RoleClassRoot.ROL); + + pr.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + + p2.setParticipantRole(pr); + + p2.setTypeCode(ParticipationType.CST); + target.getParticipants().add(p2); + + } + + @Override + protected void updateToPass(AdvanceDirectiveObservation target) { + target.getParticipants().clear(); + Participant2 p2 = CDAFactory.eINSTANCE.createParticipant2(); + + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + pr.getTelecoms().add(DatatypesFactory.eINSTANCE.createTEL()); + pr.setPlayingEntity(CDAFactory.eINSTANCE.createPlayingEntity()); + + p2.setParticipantRole(pr); + + p2.setTypeCode(ParticipationType.CST); + target.getParticipants().add(p2); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveObservationOperations.validateAdvanceDirectiveObservationCustodianCustodianRoleTelecom( + (AdvanceDirectiveObservation) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveObservationCustodianCustodianRoleTelecomTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAdvanceDirectiveObservationCustodianCustodianRolePlayingEntity() { + OperationsTestCase validateAdvanceDirectiveObservationCustodianCustodianRolePlayingEntityTestCase = new OperationsTestCase( + "validateAdvanceDirectiveObservationCustodianCustodianRolePlayingEntity", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_OBSERVATION_CUSTODIAN_CUSTODIAN_ROLE_PLAYING_ENTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveObservation target) { + target.init(); + Participant2 p2 = CDAFactory.eINSTANCE.createParticipant2(); + p2.setParticipantRole(CDAFactory.eINSTANCE.createParticipantRole()); + + p2.setTypeCode(ParticipationType.CST); + target.getParticipants().add(p2); + + } + + @Override + protected void updateToPass(AdvanceDirectiveObservation target) { + target.getParticipants().clear(); + Participant2 p2 = CDAFactory.eINSTANCE.createParticipant2(); + + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + pr.setPlayingEntity(CDAFactory.eINSTANCE.createPlayingEntity()); + + p2.setParticipantRole(pr); + p2.setTypeCode(ParticipationType.CST); + target.getParticipants().add(p2); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveObservationOperations.validateAdvanceDirectiveObservationCustodianCustodianRolePlayingEntity( + (AdvanceDirectiveObservation) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveObservationCustodianCustodianRolePlayingEntityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAdvanceDirectiveObservationCustodianTypeCode() { + OperationsTestCase validateAdvanceDirectiveObservationCustodianTypeCodeTestCase = new OperationsTestCase( + "validateAdvanceDirectiveObservationCustodianTypeCode", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_OBSERVATION_CUSTODIAN_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + { + this.skipFailsTest(); + } + + @Override + protected void updateToFail(AdvanceDirectiveObservation target) { + target.init(); + Participant2 p2 = CDAFactory.eINSTANCE.createParticipant2(); + + // p2.setTypeCode(ParticipationType.CST); + target.getParticipants().add(p2); + + } + + @Override + protected void updateToPass(AdvanceDirectiveObservation target) { + target.getParticipants().clear(); + Participant2 p2 = CDAFactory.eINSTANCE.createParticipant2(); + + p2.setTypeCode(ParticipationType.CST); + target.getParticipants().add(p2); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveObservationOperations.validateAdvanceDirectiveObservationCustodianTypeCode( + (AdvanceDirectiveObservation) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveObservationCustodianTypeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAdvanceDirectiveObservationCustodianAdvanceDirectiveObservationCustodianRole() { + OperationsTestCase validateAdvanceDirectiveObservationCustodianAdvanceDirectiveObservationCustodianRoleTestCase = new OperationsTestCase( + "validateAdvanceDirectiveObservationCustodianAdvanceDirectiveObservationCustodianRole", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_OBSERVATION_CUSTODIAN_ADVANCE_DIRECTIVE_OBSERVATION_CUSTODIAN_ROLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveObservation target) { + target.init(); + Participant2 p2 = CDAFactory.eINSTANCE.createParticipant2(); + + p2.setTypeCode(ParticipationType.CST); + target.getParticipants().add(p2); + + } + + @Override + protected void updateToPass(AdvanceDirectiveObservation target) { + target.getParticipants().clear(); + Participant2 p2 = CDAFactory.eINSTANCE.createParticipant2(); + + p2.setParticipantRole(CDAFactory.eINSTANCE.createParticipantRole()); + p2.setTypeCode(ParticipationType.CST); + target.getParticipants().add(p2); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveObservationOperations.validateAdvanceDirectiveObservationCustodianAdvanceDirectiveObservationCustodianRole( + (AdvanceDirectiveObservation) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveObservationCustodianAdvanceDirectiveObservationCustodianRoleTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAdvanceDirectiveObservationReferenceExternalDocumentTextMediaType() { + OperationsTestCase validateAdvanceDirectiveObservationReferenceExternalDocumentTextMediaTypeTestCase = new OperationsTestCase( + "validateAdvanceDirectiveObservationReferenceExternalDocumentTextMediaType", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_OBSERVATION_REFERENCE_EXTERNAL_DOCUMENT_TEXT_MEDIA_TYPE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveObservation target) { + target.init(); + Reference ref = CDAFactory.eINSTANCE.createReference(); + ExternalDocument ed = CDAFactory.eINSTANCE.createExternalDocument(); + ED text = DatatypesFactory.eINSTANCE.createED(); + text.setMediaType(null); + ed.setText(text); + + ref.setExternalDocument(ed); + target.getReferences().add(ref); + } + + @Override + protected void updateToPass(AdvanceDirectiveObservation target) { + target.getReferences().clear(); + + Reference ref = CDAFactory.eINSTANCE.createReference(); + ExternalDocument ed = CDAFactory.eINSTANCE.createExternalDocument(); + ED text = DatatypesFactory.eINSTANCE.createED(); + text.setMediaType("JPEG"); + ed.setText(text); + ref.setExternalDocument(ed); + target.getReferences().add(ref); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveObservationOperations.validateAdvanceDirectiveObservationReferenceExternalDocumentTextMediaType( + (AdvanceDirectiveObservation) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveObservationReferenceExternalDocumentTextMediaTypeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAdvanceDirectiveObservationReferenceExternalDocumentTextReference() { + OperationsTestCase validateAdvanceDirectiveObservationReferenceExternalDocumentTextReferenceTestCase = new OperationsTestCase( + "validateAdvanceDirectiveObservationReferenceExternalDocumentTextReference", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_OBSERVATION_REFERENCE_EXTERNAL_DOCUMENT_TEXT_REFERENCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveObservation target) { + + target.init(); + Reference ref = CDAFactory.eINSTANCE.createReference(); + ExternalDocument ed = CDAFactory.eINSTANCE.createExternalDocument(); + ed.setText(DatatypesFactory.eINSTANCE.createED()); + ref.setExternalDocument(ed); + target.getReferences().add(ref); + + } + + @Override + protected void updateToPass(AdvanceDirectiveObservation target) { + target.getReferences().clear(); + + Reference ref = CDAFactory.eINSTANCE.createReference(); + ExternalDocument ed = CDAFactory.eINSTANCE.createExternalDocument(); + ED text = DatatypesFactory.eINSTANCE.createED(); + text.setReference(DatatypesFactory.eINSTANCE.createTEL()); + ed.setText(text); + ref.setExternalDocument(ed); + target.getReferences().add(ref); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveObservationOperations.validateAdvanceDirectiveObservationReferenceExternalDocumentTextReference( + (AdvanceDirectiveObservation) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveObservationReferenceExternalDocumentTextReferenceTestCase.doValidationTest(); + } + + /** + * + * @generated not not + */ + @Test + public void testValidateAdvanceDirectiveObservationReferenceExternalDocumentId() { + OperationsTestCase validateAdvanceDirectiveObservationReferenceExternalDocumentIdTestCase = new OperationsTestCase( + "validateAdvanceDirectiveObservationReferenceExternalDocumentId", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_OBSERVATION_REFERENCE_EXTERNAL_DOCUMENT_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveObservation target) { + target.init(); + Reference ref = CDAFactory.eINSTANCE.createReference(); + ExternalDocument ed = CDAFactory.eINSTANCE.createExternalDocument(); + ref.setExternalDocument(ed); + target.getReferences().add(ref); + } + + @Override + protected void updateToPass(AdvanceDirectiveObservation target) { + + target.getReferences().clear(); + Reference ref = CDAFactory.eINSTANCE.createReference(); + ExternalDocument ed = CDAFactory.eINSTANCE.createExternalDocument(); + ed.getIds().add(DatatypesFactory.eINSTANCE.createII()); + ref.setExternalDocument(ed); + target.getReferences().add(ref); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveObservationOperations.validateAdvanceDirectiveObservationReferenceExternalDocumentId( + (AdvanceDirectiveObservation) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveObservationReferenceExternalDocumentIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAdvanceDirectiveObservationReferenceExternalDocumentText() { + OperationsTestCase validateAdvanceDirectiveObservationReferenceExternalDocumentTextTestCase = new OperationsTestCase( + "validateAdvanceDirectiveObservationReferenceExternalDocumentText", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_OBSERVATION_REFERENCE_EXTERNAL_DOCUMENT_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveObservation target) { + target.init(); + Reference ref = CDAFactory.eINSTANCE.createReference(); + ExternalDocument ed = CDAFactory.eINSTANCE.createExternalDocument(); + ref.setExternalDocument(ed); + target.getReferences().add(ref); + } + + @Override + protected void updateToPass(AdvanceDirectiveObservation target) { + target.getReferences().clear(); + Reference ref = CDAFactory.eINSTANCE.createReference(); + ExternalDocument ed = CDAFactory.eINSTANCE.createExternalDocument(); + ed.setText(DatatypesFactory.eINSTANCE.createED()); + ref.setExternalDocument(ed); + target.getReferences().add(ref); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveObservationOperations.validateAdvanceDirectiveObservationReferenceExternalDocumentText( + (AdvanceDirectiveObservation) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveObservationReferenceExternalDocumentTextTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAdvanceDirectiveObservationReferenceTypeCode() { + OperationsTestCase validateAdvanceDirectiveObservationReferenceTypeCodeTestCase = new OperationsTestCase( + "validateAdvanceDirectiveObservationReferenceTypeCode", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_OBSERVATION_REFERENCE_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveObservation target) { + target.init(); + Reference ref = CDAFactory.eINSTANCE.createReference(); + ExternalDocument ed = CDAFactory.eINSTANCE.createExternalDocument(); + ref.setExternalDocument(ed); + target.getReferences().add(ref); + } + + @Override + protected void updateToPass(AdvanceDirectiveObservation target) { + target.getReferences().clear(); + Reference ref = CDAFactory.eINSTANCE.createReference(); + ExternalDocument ed = CDAFactory.eINSTANCE.createExternalDocument(); + ref.setExternalDocument(ed); + ref.setTypeCode(x_ActRelationshipExternalReference.REFR); + target.getReferences().add(ref); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveObservationOperations.validateAdvanceDirectiveObservationReferenceTypeCode( + (AdvanceDirectiveObservation) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveObservationReferenceTypeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAdvanceDirectiveObservationReferenceExternalDocument() { + OperationsTestCase validateAdvanceDirectiveObservationReferenceExternalDocumentTestCase = new OperationsTestCase( + "validateAdvanceDirectiveObservationReferenceExternalDocument", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_OBSERVATION_REFERENCE_EXTERNAL_DOCUMENT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveObservation target) { + target.init(); + Reference ref = CDAFactory.eINSTANCE.createReference(); + + target.getReferences().add(ref); + } + + @Override + protected void updateToPass(AdvanceDirectiveObservation target) { + target.getReferences().clear(); + Reference ref = CDAFactory.eINSTANCE.createReference(); + ExternalDocument ed = CDAFactory.eINSTANCE.createExternalDocument(); + ref.setExternalDocument(ed); + target.getReferences().add(ref); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveObservationOperations.validateAdvanceDirectiveObservationReferenceExternalDocument( + (AdvanceDirectiveObservation) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveObservationReferenceExternalDocumentTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends AdvanceDirectiveObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public AdvanceDirectiveObservation create() { + return ConsolFactory.eINSTANCE.createAdvanceDirectiveObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends AdvanceDirectiveObservationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // AdvanceDirectiveObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/AdvanceDirectivesSectionEntriesOptionalTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/AdvanceDirectivesSectionEntriesOptionalTest.java new file mode 100644 index 000000000..2509afdd5 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/AdvanceDirectivesSectionEntriesOptionalTest.java @@ -0,0 +1,339 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.AdvanceDirectivesSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.operations.AdvanceDirectivesSectionEntriesOptionalOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Advance Directives Section Entries Optional' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AdvanceDirectivesSectionEntriesOptional#validateAdvanceDirectivesSectionEntriesOptionalTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directives Section Entries Optional Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AdvanceDirectivesSectionEntriesOptional#validateAdvanceDirectivesSectionEntriesOptionalCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directives Section Entries Optional Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AdvanceDirectivesSectionEntriesOptional#validateAdvanceDirectivesSectionEntriesOptionalCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directives Section Entries Optional Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AdvanceDirectivesSectionEntriesOptional#validateAdvanceDirectivesSectionEntriesOptionalTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directives Section Entries Optional Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AdvanceDirectivesSectionEntriesOptional#validateAdvanceDirectivesSectionEntriesOptionalText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directives Section Entries Optional Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AdvanceDirectivesSectionEntriesOptional#validateAdvanceDirectivesSectionEntriesOptionalAdvanceDirectiveObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directives Section Entries Optional Advance Directive Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AdvanceDirectivesSectionEntriesOptional#getAdvanceDirectiveObservations() Get Advance Directive Observations}
  • + *
+ *

+ * + * @generated + */ + +public class AdvanceDirectivesSectionEntriesOptionalTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateAdvanceDirectivesSectionEntriesOptionalTemplateId() { + OperationsTestCase validateAdvanceDirectivesSectionEntriesOptionalTemplateIdTestCase = new OperationsTestCase( + "validateAdvanceDirectivesSectionEntriesOptionalTemplateId", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVES_SECTION_ENTRIES_OPTIONAL_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectivesSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(AdvanceDirectivesSectionEntriesOptional target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectivesSectionEntriesOptionalOperations.validateAdvanceDirectivesSectionEntriesOptionalTemplateId( + (AdvanceDirectivesSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectivesSectionEntriesOptionalTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAdvanceDirectivesSectionEntriesOptionalCode() { + OperationsTestCase validateAdvanceDirectivesSectionEntriesOptionalCodeTestCase = new OperationsTestCase( + "validateAdvanceDirectivesSectionEntriesOptionalCode", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVES_SECTION_ENTRIES_OPTIONAL_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectivesSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(AdvanceDirectivesSectionEntriesOptional target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectivesSectionEntriesOptionalOperations.validateAdvanceDirectivesSectionEntriesOptionalCode( + (AdvanceDirectivesSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectivesSectionEntriesOptionalCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAdvanceDirectivesSectionEntriesOptionalCodeP() { + OperationsTestCase validateAdvanceDirectivesSectionEntriesOptionalCodePTestCase = new OperationsTestCase( + "validateAdvanceDirectivesSectionEntriesOptionalCodeP", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVES_SECTION_ENTRIES_OPTIONAL_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectivesSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(AdvanceDirectivesSectionEntriesOptional target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectivesSectionEntriesOptionalOperations.validateAdvanceDirectivesSectionEntriesOptionalCodeP( + (AdvanceDirectivesSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectivesSectionEntriesOptionalCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAdvanceDirectivesSectionEntriesOptionalTitle() { + OperationsTestCase validateAdvanceDirectivesSectionEntriesOptionalTitleTestCase = new OperationsTestCase( + "validateAdvanceDirectivesSectionEntriesOptionalTitle", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVES_SECTION_ENTRIES_OPTIONAL_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectivesSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(AdvanceDirectivesSectionEntriesOptional target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectivesSectionEntriesOptionalOperations.validateAdvanceDirectivesSectionEntriesOptionalTitle( + (AdvanceDirectivesSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectivesSectionEntriesOptionalTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAdvanceDirectivesSectionEntriesOptionalText() { + OperationsTestCase validateAdvanceDirectivesSectionEntriesOptionalTextTestCase = new OperationsTestCase( + "validateAdvanceDirectivesSectionEntriesOptionalText", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVES_SECTION_ENTRIES_OPTIONAL_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectivesSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(AdvanceDirectivesSectionEntriesOptional target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectivesSectionEntriesOptionalOperations.validateAdvanceDirectivesSectionEntriesOptionalText( + (AdvanceDirectivesSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectivesSectionEntriesOptionalTextTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAdvanceDirectivesSectionEntriesOptionalAdvanceDirectiveObservation() { + OperationsTestCase validateAdvanceDirectivesSectionEntriesOptionalAdvanceDirectiveObservationTestCase = new OperationsTestCase( + "validateAdvanceDirectivesSectionEntriesOptionalAdvanceDirectiveObservation", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVES_SECTION_ENTRIES_OPTIONAL_ADVANCE_DIRECTIVE_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectivesSectionEntriesOptional target) { + target.init(); + } + + @Override + protected void updateToPass(AdvanceDirectivesSectionEntriesOptional target) { + + target.addObservation(ConsolFactory.eINSTANCE.createAdvanceDirectiveObservation().init()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectivesSectionEntriesOptionalOperations.validateAdvanceDirectivesSectionEntriesOptionalAdvanceDirectiveObservation( + (AdvanceDirectivesSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectivesSectionEntriesOptionalAdvanceDirectiveObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetAdvanceDirectiveObservations() { + + AdvanceDirectivesSectionEntriesOptional target = objectFactory.create(); + target.getAdvanceDirectiveObservations(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends AdvanceDirectivesSectionEntriesOptionalOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public AdvanceDirectivesSectionEntriesOptional create() { + return ConsolFactory.eINSTANCE.createAdvanceDirectivesSectionEntriesOptional(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends AdvanceDirectivesSectionEntriesOptionalOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // AdvanceDirectivesSectionEntriesOptionalOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/AdvanceDirectivesSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/AdvanceDirectivesSectionTest.java new file mode 100644 index 000000000..591a93b50 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/AdvanceDirectivesSectionTest.java @@ -0,0 +1,338 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.AdvanceDirectivesSection; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.operations.AdvanceDirectivesSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Advance Directives Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AdvanceDirectivesSection#validateAdvanceDirectivesSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directives Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AdvanceDirectivesSection#validateAdvanceDirectivesSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directives Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AdvanceDirectivesSection#validateAdvanceDirectivesSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directives Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AdvanceDirectivesSection#validateAdvanceDirectivesSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directives Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AdvanceDirectivesSection#validateAdvanceDirectivesSectionAdvanceDirectiveObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directives Section Advance Directive Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AdvanceDirectivesSection#getConsolAdvanceDirectiveObservations() Get Consol Advance Directive Observations}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AdvanceDirectivesSection#validateAdvanceDirectivesSectionEntriesOptionalTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directives Section Entries Optional Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class AdvanceDirectivesSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateAdvanceDirectivesSectionCodeP() { + OperationsTestCase validateAdvanceDirectivesSectionCodePTestCase = new OperationsTestCase( + "validateAdvanceDirectivesSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVES_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectivesSection target) { + + } + + @Override + protected void updateToPass(AdvanceDirectivesSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectivesSectionOperations.validateAdvanceDirectivesSectionCodeP( + (AdvanceDirectivesSection) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectivesSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAdvanceDirectivesSectionCode() { + OperationsTestCase validateAdvanceDirectivesSectionCodeTestCase = new OperationsTestCase( + "validateAdvanceDirectivesSectionCode", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVES_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectivesSection target) { + + } + + @Override + protected void updateToPass(AdvanceDirectivesSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectivesSectionOperations.validateAdvanceDirectivesSectionCode( + (AdvanceDirectivesSection) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectivesSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAdvanceDirectivesSectionTitle() { + OperationsTestCase validateAdvanceDirectivesSectionTitleTestCase = new OperationsTestCase( + "validateAdvanceDirectivesSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVES_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectivesSection target) { + + } + + @Override + protected void updateToPass(AdvanceDirectivesSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectivesSectionOperations.validateAdvanceDirectivesSectionTitle( + (AdvanceDirectivesSection) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectivesSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAdvanceDirectivesSectionText() { + OperationsTestCase validateAdvanceDirectivesSectionTextTestCase = new OperationsTestCase( + "validateAdvanceDirectivesSectionText", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVES_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectivesSection target) { + + } + + @Override + protected void updateToPass(AdvanceDirectivesSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectivesSectionOperations.validateAdvanceDirectivesSectionText( + (AdvanceDirectivesSection) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectivesSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAdvanceDirectivesSectionAdvanceDirectiveObservation() { + OperationsTestCase validateAdvanceDirectivesSectionAdvanceDirectiveObservationTestCase = new OperationsTestCase( + "validateAdvanceDirectivesSectionAdvanceDirectiveObservation", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVES_SECTION_ADVANCE_DIRECTIVE_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectivesSection target) { + target.init(); + } + + @Override + protected void updateToPass(AdvanceDirectivesSection target) { + target.addObservation(ConsolFactory.eINSTANCE.createAdvanceDirectiveObservation().init()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectivesSectionOperations.validateAdvanceDirectivesSectionAdvanceDirectiveObservation( + (AdvanceDirectivesSection) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectivesSectionAdvanceDirectiveObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetConsolAdvanceDirectiveObservations() { + + AdvanceDirectivesSection target = objectFactory.create(); + target.getConsolAdvanceDirectiveObservations(); + + } + + /** + * + * @generated + */ + @Test + public void testValidateAdvanceDirectivesSectionEntriesOptionalTemplateId() { + OperationsTestCase validateAdvanceDirectivesSectionEntriesOptionalTemplateIdTestCase = new OperationsTestCase( + "validateAdvanceDirectivesSectionEntriesOptionalTemplateId", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVES_SECTION_ENTRIES_OPTIONAL_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectivesSection target) { + + } + + @Override + protected void updateToPass(AdvanceDirectivesSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectivesSectionOperations.validateAdvanceDirectivesSectionEntriesOptionalTemplateId( + (AdvanceDirectivesSection) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectivesSectionEntriesOptionalTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends AdvanceDirectivesSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public AdvanceDirectivesSection create() { + return ConsolFactory.eINSTANCE.createAdvanceDirectivesSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends AdvanceDirectivesSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // AdvanceDirectivesSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/AgeObservationTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/AgeObservationTest.java new file mode 100644 index 000000000..eb32559ca --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/AgeObservationTest.java @@ -0,0 +1,437 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.consol.AgeObservation; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.operations.AgeObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.PQ; + +/** + * + * A static utility class that provides operations related to 'Age Observation' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AgeObservation#validateAgeObservationValueUnits(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Age Observation Value Units}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AgeObservation#validateAgeObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Age Observation Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AgeObservation#validateAgeObservationClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Age Observation Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AgeObservation#validateAgeObservationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Age Observation Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AgeObservation#validateAgeObservationCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Age Observation Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AgeObservation#validateAgeObservationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Age Observation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AgeObservation#validateAgeObservationStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Age Observation Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AgeObservation#validateAgeObservationStatusCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Age Observation Status Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AgeObservation#validateAgeObservationValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Age Observation Value}
  • + *
+ *

+ * + * @generated + */ + +public class AgeObservationTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateAgeObservationValueUnits() { + OperationsTestCase validateAgeObservationValueUnitsTestCase = new OperationsTestCase( + "validateAgeObservationValueUnits", + operationsForOCL.getOCLValue("VALIDATE_AGE_OBSERVATION_VALUE_UNITS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AgeObservation target) { + + } + + @Override + protected void updateToPass(AgeObservation target) { + target.init(); + PQ val = DatatypesFactory.eINSTANCE.createPQ(); + val.setUnit("meter"); + target.getValues().add(val); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AgeObservationOperations.validateAgeObservationValueUnits( + (AgeObservation) objectToTest, diagnostician, map); + } + + }; + + validateAgeObservationValueUnitsTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAgeObservationTemplateId() { + OperationsTestCase validateAgeObservationTemplateIdTestCase = new OperationsTestCase( + "validateAgeObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_AGE_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AgeObservation target) { + + } + + @Override + protected void updateToPass(AgeObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AgeObservationOperations.validateAgeObservationTemplateId( + (AgeObservation) objectToTest, diagnostician, map); + } + + }; + + validateAgeObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAgeObservationClassCode() { + OperationsTestCase validateAgeObservationClassCodeTestCase = new OperationsTestCase( + "validateAgeObservationClassCode", + operationsForOCL.getOCLValue("VALIDATE_AGE_OBSERVATION_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AgeObservation target) { + + } + + @Override + protected void updateToPass(AgeObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AgeObservationOperations.validateAgeObservationClassCode( + (AgeObservation) objectToTest, diagnostician, map); + } + + }; + + validateAgeObservationClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAgeObservationMoodCode() { + OperationsTestCase validateAgeObservationMoodCodeTestCase = new OperationsTestCase( + "validateAgeObservationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_AGE_OBSERVATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AgeObservation target) { + + } + + @Override + protected void updateToPass(AgeObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AgeObservationOperations.validateAgeObservationMoodCode( + (AgeObservation) objectToTest, diagnostician, map); + } + + }; + + validateAgeObservationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAgeObservationCodeP() { + OperationsTestCase validateAgeObservationCodePTestCase = new OperationsTestCase( + "validateAgeObservationCodeP", + operationsForOCL.getOCLValue("VALIDATE_AGE_OBSERVATION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AgeObservation target) { + + } + + @Override + protected void updateToPass(AgeObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AgeObservationOperations.validateAgeObservationCodeP( + (AgeObservation) objectToTest, diagnostician, map); + } + + }; + + validateAgeObservationCodePTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAgeObservationCode() { + OperationsTestCase validateAgeObservationCodeTestCase = new OperationsTestCase( + "validateAgeObservationCode", + operationsForOCL.getOCLValue("VALIDATE_AGE_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AgeObservation target) { + + } + + @Override + protected void updateToPass(AgeObservation target) { + target.init(); + + CD cd = DatatypesFactory.eINSTANCE.createCD(); + cd.setCodeSystem("2.16.840.1.113883.6.96"); + cd.setCode("445518008"); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AgeObservationOperations.validateAgeObservationCode( + (AgeObservation) objectToTest, diagnostician, map); + } + + }; + + validateAgeObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAgeObservationStatusCode() { + OperationsTestCase validateAgeObservationStatusCodeTestCase = new OperationsTestCase( + "validateAgeObservationStatusCode", + operationsForOCL.getOCLValue("VALIDATE_AGE_OBSERVATION_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AgeObservation target) { + + } + + @Override + protected void updateToPass(AgeObservation target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AgeObservationOperations.validateAgeObservationStatusCode( + (AgeObservation) objectToTest, diagnostician, map); + } + + }; + + validateAgeObservationStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAgeObservationStatusCodeP() { + OperationsTestCase validateAgeObservationStatusCodePTestCase = new OperationsTestCase( + "validateAgeObservationStatusCodeP", + operationsForOCL.getOCLValue("VALIDATE_AGE_OBSERVATION_STATUS_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AgeObservation target) { + + } + + @Override + protected void updateToPass(AgeObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AgeObservationOperations.validateAgeObservationStatusCodeP( + (AgeObservation) objectToTest, diagnostician, map); + } + + }; + + validateAgeObservationStatusCodePTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAgeObservationValue() { + OperationsTestCase validateAgeObservationValueTestCase = new OperationsTestCase( + "validateAgeObservationValue", + operationsForOCL.getOCLValue("VALIDATE_AGE_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AgeObservation target) { + + } + + @Override + protected void updateToPass(AgeObservation target) { + target.init(); + + PQ value = DatatypesFactory.eINSTANCE.createPQ(); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AgeObservationOperations.validateAgeObservationValue( + (AgeObservation) objectToTest, diagnostician, map); + } + + }; + + validateAgeObservationValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends AgeObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public AgeObservation create() { + return ConsolFactory.eINSTANCE.createAgeObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends AgeObservationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // AgeObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/AllergiesSectionEntriesOptionalTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/AllergiesSectionEntriesOptionalTest.java new file mode 100644 index 000000000..444f82c87 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/AllergiesSectionEntriesOptionalTest.java @@ -0,0 +1,331 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.consol.AllergiesSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.operations.AllergiesSectionEntriesOptionalOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; + +/** + * + * A static utility class that provides operations related to 'Allergies Section Entries Optional' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergiesSectionEntriesOptional#validateAllergiesSectionEntriesOptionalTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergies Section Entries Optional Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergiesSectionEntriesOptional#validateAllergiesSectionEntriesOptionalCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergies Section Entries Optional Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergiesSectionEntriesOptional#validateAllergiesSectionEntriesOptionalCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergies Section Entries Optional Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergiesSectionEntriesOptional#validateAllergiesSectionEntriesOptionalTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergies Section Entries Optional Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergiesSectionEntriesOptional#validateAllergiesSectionEntriesOptionalText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergies Section Entries Optional Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergiesSectionEntriesOptional#validateAllergiesSectionEntriesOptionalAllergyProblemAct(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergies Section Entries Optional Allergy Problem Act}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergiesSectionEntriesOptional#getAllergyProblemActs() Get Allergy Problem Acts}
  • + *
+ *

+ * + * @generated + */ + +public class AllergiesSectionEntriesOptionalTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateAllergiesSectionEntriesOptionalTemplateId() { + OperationsTestCase validateAllergiesSectionEntriesOptionalTemplateIdTestCase = new OperationsTestCase( + "validateAllergiesSectionEntriesOptionalTemplateId", + operationsForOCL.getOCLValue("VALIDATE_ALLERGIES_SECTION_ENTRIES_OPTIONAL_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergiesSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(AllergiesSectionEntriesOptional target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergiesSectionEntriesOptionalOperations.validateAllergiesSectionEntriesOptionalTemplateId( + (AllergiesSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateAllergiesSectionEntriesOptionalTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAllergiesSectionEntriesOptionalCode() { + OperationsTestCase validateAllergiesSectionEntriesOptionalCodeTestCase = new OperationsTestCase( + "validateAllergiesSectionEntriesOptionalCode", + operationsForOCL.getOCLValue("VALIDATE_ALLERGIES_SECTION_ENTRIES_OPTIONAL_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergiesSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(AllergiesSectionEntriesOptional target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergiesSectionEntriesOptionalOperations.validateAllergiesSectionEntriesOptionalCode( + (AllergiesSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateAllergiesSectionEntriesOptionalCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAllergiesSectionEntriesOptionalCodeP() { + OperationsTestCase validateAllergiesSectionEntriesOptionalCodePTestCase = new OperationsTestCase( + "validateAllergiesSectionEntriesOptionalCodeP", + operationsForOCL.getOCLValue("VALIDATE_ALLERGIES_SECTION_ENTRIES_OPTIONAL_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergiesSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(AllergiesSectionEntriesOptional target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergiesSectionEntriesOptionalOperations.validateAllergiesSectionEntriesOptionalCodeP( + (AllergiesSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateAllergiesSectionEntriesOptionalCodePTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergiesSectionEntriesOptionalTitle() { + OperationsTestCase validateAllergiesSectionEntriesOptionalTitleTestCase = new OperationsTestCase( + "validateAllergiesSectionEntriesOptionalTitle", + operationsForOCL.getOCLValue("VALIDATE_ALLERGIES_SECTION_ENTRIES_OPTIONAL_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergiesSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(AllergiesSectionEntriesOptional target) { + target.init(); + target.setTitle(DatatypesFactory.eINSTANCE.createST()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergiesSectionEntriesOptionalOperations.validateAllergiesSectionEntriesOptionalTitle( + (AllergiesSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateAllergiesSectionEntriesOptionalTitleTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergiesSectionEntriesOptionalText() { + OperationsTestCase validateAllergiesSectionEntriesOptionalTextTestCase = new OperationsTestCase( + "validateAllergiesSectionEntriesOptionalText", + operationsForOCL.getOCLValue("VALIDATE_ALLERGIES_SECTION_ENTRIES_OPTIONAL_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergiesSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(AllergiesSectionEntriesOptional target) { + target.init(); + target.setText(CDAFactory.eINSTANCE.createStrucDocText()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergiesSectionEntriesOptionalOperations.validateAllergiesSectionEntriesOptionalText( + (AllergiesSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateAllergiesSectionEntriesOptionalTextTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergiesSectionEntriesOptionalAllergyProblemAct() { + OperationsTestCase validateAllergiesSectionEntriesOptionalAllergyProblemActTestCase = new OperationsTestCase( + "validateAllergiesSectionEntriesOptionalAllergyProblemAct", + operationsForOCL.getOCLValue("VALIDATE_ALLERGIES_SECTION_ENTRIES_OPTIONAL_ALLERGY_PROBLEM_ACT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergiesSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(AllergiesSectionEntriesOptional target) { + target.init(); + target.addAct(ConsolFactory.eINSTANCE.createAllergyProblemAct()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergiesSectionEntriesOptionalOperations.validateAllergiesSectionEntriesOptionalAllergyProblemAct( + (AllergiesSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateAllergiesSectionEntriesOptionalAllergyProblemActTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetAllergyProblemActs() { + + AllergiesSectionEntriesOptional target = objectFactory.create(); + target.getAllergyProblemActs(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends AllergiesSectionEntriesOptionalOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public AllergiesSectionEntriesOptional create() { + return ConsolFactory.eINSTANCE.createAllergiesSectionEntriesOptional(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends AllergiesSectionEntriesOptionalOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // AllergiesSectionEntriesOptionalOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/AllergiesSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/AllergiesSectionTest.java new file mode 100644 index 000000000..a7b0ccfa5 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/AllergiesSectionTest.java @@ -0,0 +1,339 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.AllergiesSection; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.operations.AllergiesSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Allergies Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergiesSection#validateAllergiesSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergies Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergiesSection#validateAllergiesSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergies Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergiesSection#validateAllergiesSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergies Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergiesSection#validateAllergiesSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergies Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergiesSection#validateAllergiesSectionAllergyProblemAct(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergies Section Allergy Problem Act}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergiesSection#getConsolAllergyProblemActs() Get Consol Allergy Problem Acts}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergiesSection#validateAllergiesSectionEntriesOptionalTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergies Section Entries Optional Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class AllergiesSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateAllergiesSectionCodeP() { + OperationsTestCase validateAllergiesSectionCodePTestCase = new OperationsTestCase( + "validateAllergiesSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_ALLERGIES_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergiesSection target) { + + } + + @Override + protected void updateToPass(AllergiesSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergiesSectionOperations.validateAllergiesSectionCodeP( + (AllergiesSection) objectToTest, diagnostician, map); + } + + }; + + validateAllergiesSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAllergiesSectionCode() { + OperationsTestCase validateAllergiesSectionCodeTestCase = new OperationsTestCase( + "validateAllergiesSectionCode", + operationsForOCL.getOCLValue("VALIDATE_ALLERGIES_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergiesSection target) { + + } + + @Override + protected void updateToPass(AllergiesSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergiesSectionOperations.validateAllergiesSectionCode( + (AllergiesSection) objectToTest, diagnostician, map); + } + + }; + + validateAllergiesSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAllergiesSectionTitle() { + OperationsTestCase validateAllergiesSectionTitleTestCase = new OperationsTestCase( + "validateAllergiesSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_ALLERGIES_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergiesSection target) { + + } + + @Override + protected void updateToPass(AllergiesSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergiesSectionOperations.validateAllergiesSectionTitle( + (AllergiesSection) objectToTest, diagnostician, map); + } + + }; + + validateAllergiesSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAllergiesSectionText() { + OperationsTestCase validateAllergiesSectionTextTestCase = new OperationsTestCase( + "validateAllergiesSectionText", + operationsForOCL.getOCLValue("VALIDATE_ALLERGIES_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergiesSection target) { + + } + + @Override + protected void updateToPass(AllergiesSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergiesSectionOperations.validateAllergiesSectionText( + (AllergiesSection) objectToTest, diagnostician, map); + } + + }; + + validateAllergiesSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAllergiesSectionAllergyProblemAct() { + OperationsTestCase validateAllergiesSectionAllergyProblemActTestCase = new OperationsTestCase( + "validateAllergiesSectionAllergyProblemAct", + operationsForOCL.getOCLValue("VALIDATE_ALLERGIES_SECTION_ALLERGY_PROBLEM_ACT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergiesSection target) { + target.init(); + } + + @Override + protected void updateToPass(AllergiesSection target) { + + target.addAct(ConsolFactory.eINSTANCE.createAllergyProblemAct()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergiesSectionOperations.validateAllergiesSectionAllergyProblemAct( + (AllergiesSection) objectToTest, diagnostician, map); + } + + }; + + validateAllergiesSectionAllergyProblemActTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetConsolAllergyProblemActs() { + + AllergiesSection target = objectFactory.create(); + target.getConsolAllergyProblemActs(); + + } + + /** + * + * @generated + */ + @Test + public void testValidateAllergiesSectionEntriesOptionalTemplateId() { + OperationsTestCase validateAllergiesSectionEntriesOptionalTemplateIdTestCase = new OperationsTestCase( + "validateAllergiesSectionEntriesOptionalTemplateId", + operationsForOCL.getOCLValue("VALIDATE_ALLERGIES_SECTION_ENTRIES_OPTIONAL_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergiesSection target) { + + } + + @Override + protected void updateToPass(AllergiesSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergiesSectionOperations.validateAllergiesSectionEntriesOptionalTemplateId( + (AllergiesSection) objectToTest, diagnostician, map); + } + + }; + + validateAllergiesSectionEntriesOptionalTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends AllergiesSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public AllergiesSection create() { + return ConsolFactory.eINSTANCE.createAllergiesSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends AllergiesSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // AllergiesSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/AllergyObservationTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/AllergyObservationTest.java new file mode 100644 index 000000000..8295ea418 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/AllergyObservationTest.java @@ -0,0 +1,1737 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.Participant2; +import org.openhealthtools.mdht.uml.cda.ParticipantRole; +import org.openhealthtools.mdht.uml.cda.PlayingEntity; +import org.openhealthtools.mdht.uml.cda.consol.AllergyObservation; +import org.openhealthtools.mdht.uml.cda.consol.AllergyStatusObservation; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ConsolPackage; +import org.openhealthtools.mdht.uml.cda.consol.GeneralStatusSection; +import org.openhealthtools.mdht.uml.cda.consol.ReactionObservation; +import org.openhealthtools.mdht.uml.cda.consol.SeverityObservation; +import org.openhealthtools.mdht.uml.cda.consol.operations.AllergyObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.vocab.EntityClassRoot; +import org.openhealthtools.mdht.uml.hl7.vocab.NullFlavor; +import org.openhealthtools.mdht.uml.hl7.vocab.ParticipationType; +import org.openhealthtools.mdht.uml.hl7.vocab.RoleClassRoot; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * + * A static utility class that provides operations related to 'Allergy Observation' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyObservation#validateAllergyObservationValueOriginalText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Observation Value Original Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyObservation#validateAllergyObservationOriginalTextReference(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Observation Original Text Reference}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyObservation#validateAllergyObservationOriginalTextReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Observation Original Text Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyObservation#validateAllergyObservationReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Observation Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyObservation#validateAllergyObservationAllergyStatusInversionIndicator(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Observation Allergy Status Inversion Indicator}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyObservation#validateAllergyObservationReactionInversionIndicator(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Observation Reaction Inversion Indicator}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyObservation#validateAllergyObservationSeverityInversionIndicator(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Observation Severity Inversion Indicator}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyObservation#validateAllergyObservationAllergyPlayingEntityCodeSystems(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Observation Allergy Playing Entity Code Systems}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyObservation#validateAllergyObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Observation Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyObservation#validateAllergyObservationClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Observation Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyObservation#validateAllergyObservationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Observation Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyObservation#validateAllergyObservationId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Observation Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyObservation#validateAllergyObservationCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Observation Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyObservation#validateAllergyObservationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Observation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyObservation#validateAllergyObservationStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Observation Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyObservation#validateAllergyObservationEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Observation Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyObservation#validateAllergyObservationValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Observation Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyObservation#validateAllergyObservationProblemEntryReactionObservationContainer(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Observation Problem Entry Reaction Observation Container}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyObservation#validateAllergyObservationSeverity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Observation Severity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyObservation#validateAllergyObservationAllergyStatusObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Observation Allergy Status Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyObservation#validateAllergyObservationParticipant(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Observation Participant}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyObservation#validateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleAllergyObservationPlayingEntityCodeOriginalText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Observation Allergy Observation Participant Allergy Observation Participant Role Allergy Observation Playing Entity Code Original Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyObservation#validateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleAllergyObservationPlayingEntityOriginalTextReference(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Observation Allergy Observation Participant Allergy Observation Participant Role Allergy Observation Playing Entity Original Text Reference}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyObservation#validateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleAllergyObservationPlayingEntityReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Observation Allergy Observation Participant Allergy Observation Participant Role Allergy Observation Playing Entity Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyObservation#validateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleAllergyObservationPlayingEntityOriginalTextReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Observation Allergy Observation Participant Allergy Observation Participant Role Allergy Observation Playing Entity Original Text Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyObservation#validateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleAllergyObservationPlayingEntityCodeTranslation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Observation Allergy Observation Participant Allergy Observation Participant Role Allergy Observation Playing Entity Code Translation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyObservation#validateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleAllergyObservationPlayingEntityClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Observation Allergy Observation Participant Allergy Observation Participant Role Allergy Observation Playing Entity Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyObservation#validateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleAllergyObservationPlayingEntityCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Observation Allergy Observation Participant Allergy Observation Participant Role Allergy Observation Playing Entity Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyObservation#validateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Observation Allergy Observation Participant Allergy Observation Participant Role Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyObservation#validateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRolePlayingEntity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Observation Allergy Observation Participant Allergy Observation Participant Role Playing Entity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyObservation#validateAllergyObservationAllergyObservationParticipantTypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Observation Allergy Observation Participant Type Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyObservation#validateAllergyObservationAllergyObservationParticipantParticipantRole(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Observation Allergy Observation Participant Participant Role}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyObservation#getProblemEntryReactionObservationContainers() Get Problem Entry Reaction Observation Containers}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyObservation#getSeverity() Get Severity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyObservation#getAllergyStatusObservation() Get Allergy Status Observation}
  • + *
+ *

+ * + * @generated + */ + +public class AllergyObservationTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateAllergyObservationValueOriginalText() { + OperationsTestCase validateAllergyObservationValueOriginalTextTestCase = new OperationsTestCase( + "validateAllergyObservationValueOriginalText", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_OBSERVATION_VALUE_ORIGINAL_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyObservation target) { + + } + + @Override + protected void updateToPass(AllergyObservation target) { + target.init(); + CD value = DatatypesFactory.eINSTANCE.createCD(); + value.setOriginalText(DatatypesFactory.eINSTANCE.createED()); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyObservationOperations.validateAllergyObservationValueOriginalText( + (AllergyObservation) objectToTest, diagnostician, map); + } + + }; + + validateAllergyObservationValueOriginalTextTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAllergyObservationOriginalTextReference() { + OperationsTestCase validateAllergyObservationOriginalTextReferenceTestCase = new OperationsTestCase( + "validateAllergyObservationOriginalTextReference", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_OBSERVATION_ORIGINAL_TEXT_REFERENCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyObservation target) { + target.init(); + CD value = DatatypesFactory.eINSTANCE.createCD(); + value.setOriginalText(DatatypesFactory.eINSTANCE.createED()); + target.getValues().add(value); + } + + @Override + protected void updateToPass(AllergyObservation target) { + target.getValues().clear(); + CD value = DatatypesFactory.eINSTANCE.createCD(); + ED orig = DatatypesFactory.eINSTANCE.createED(); + orig.setReference(DatatypesFactory.eINSTANCE.createTEL("test")); + value.setOriginalText(orig); + + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyObservationOperations.validateAllergyObservationOriginalTextReference( + (AllergyObservation) objectToTest, diagnostician, map); + } + + }; + + validateAllergyObservationOriginalTextReferenceTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAllergyObservationOriginalTextReferenceValue() { + OperationsTestCase validateAllergyObservationOriginalTextReferenceValueTestCase = new OperationsTestCase( + "validateAllergyObservationOriginalTextReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_OBSERVATION_ORIGINAL_TEXT_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyObservation target) { + target.init(); + CD value = DatatypesFactory.eINSTANCE.createCD(); + value.setOriginalText(DatatypesFactory.eINSTANCE.createED()); + target.getValues().add(value); + } + + @Override + protected void updateToPass(AllergyObservation target) { + target.getValues().clear(); + CD value = DatatypesFactory.eINSTANCE.createCD(); + ED orig = DatatypesFactory.eINSTANCE.createED(); + orig.setReference(DatatypesFactory.eINSTANCE.createTEL("test")); + value.setOriginalText(orig); + + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyObservationOperations.validateAllergyObservationOriginalTextReferenceValue( + (AllergyObservation) objectToTest, diagnostician, map); + } + + }; + + validateAllergyObservationOriginalTextReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyObservationReferenceValue() { + OperationsTestCase validateAllergyObservationReferenceValueTestCase = new NarrativeReferenceTestCase( + "validateAllergyObservationReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_OBSERVATION_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyObservation target) { + target.init(); + target.setCode(createCDWithOriginalTextReference("Some sample text", "#1.2.3.4")); + + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), "", + "No particular health status observed."); + + } + + @Override + protected void updateToPass(AllergyObservation target) { + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), + "1.2.3.4", "No particular health status observed."); + + // add a reference to the section text + target.setText(createEDWithReference("Some sample text", "#1.2.3.4")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyObservationOperations.validateAllergyObservationReferenceValue( + (AllergyObservation) objectToTest, diagnostician, map); + } + + }; + + validateAllergyObservationReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyObservationAllergyStatusInversionIndicator() { + OperationsTestCase validateAllergyObservationAllergyStatusInversionIndicatorTestCase = new OperationsTestCase( + "validateAllergyObservationAllergyStatusInversionIndicator", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_OBSERVATION_ALLERGY_STATUS_INVERSION_INDICATOR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setObservation(ConsolFactory.eINSTANCE.createAllergyStatusObservation()); + target.getEntryRelationships().add(er); + } + + @Override + public void addPassTests() { + + addPassTest(new PassTest() { + + @Override + public void updateToPass(AllergyObservation target) { + // Test case with only entry Relationship + // Should pass + target.getEntryRelationships().clear(); + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + target.getEntryRelationships().add(er); + } + + }); + } + + @Override + protected void updateToPass(AllergyObservation target) { + target.init(); + target.getEntryRelationships().clear(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setObservation(ConsolFactory.eINSTANCE.createAllergyStatusObservation()); + er.setInversionInd(true); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyObservationOperations.validateAllergyObservationAllergyStatusInversionIndicator( + (AllergyObservation) objectToTest, diagnostician, map); + } + + }; + + validateAllergyObservationAllergyStatusInversionIndicatorTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyObservationReactionInversionIndicator() { + OperationsTestCase validateAllergyObservationReactionInversionIndicatorTestCase = new OperationsTestCase( + "validateAllergyObservationReactionInversionIndicator", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_OBSERVATION_REACTION_INVERSION_INDICATOR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setObservation(ConsolFactory.eINSTANCE.createReactionObservation()); + target.getEntryRelationships().add(er); + } + + @Override + public void addPassTests() { + + addPassTest(new PassTest() { + + @Override + public void updateToPass(AllergyObservation target) { + // Test case with only entry Relationship + // Should pass + target.getEntryRelationships().clear(); + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + target.getEntryRelationships().add(er); + } + + }); + } + + @Override + protected void updateToPass(AllergyObservation target) { + target.init(); + target.getEntryRelationships().clear(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setObservation(ConsolFactory.eINSTANCE.createReactionObservation()); + er.setInversionInd(true); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyObservationOperations.validateAllergyObservationReactionInversionIndicator( + (AllergyObservation) objectToTest, diagnostician, map); + } + + }; + + validateAllergyObservationReactionInversionIndicatorTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyObservationSeverityInversionIndicator() { + OperationsTestCase validateAllergyObservationSeverityInversionIndicatorTestCase = new OperationsTestCase( + "validateAllergyObservationSeverityInversionIndicator", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_OBSERVATION_SEVERITY_INVERSION_INDICATOR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setObservation(ConsolFactory.eINSTANCE.createSeverityObservation()); + target.getEntryRelationships().add(er); + } + + @Override + public void addPassTests() { + + addPassTest(new PassTest() { + + @Override + public void updateToPass(AllergyObservation target) { + // Test case with only entry Relationship + // Should pass + target.getEntryRelationships().clear(); + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + target.getEntryRelationships().add(er); + } + + }); + } + + @Override + protected void updateToPass(AllergyObservation target) { + target.init(); + target.getEntryRelationships().clear(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setObservation(ConsolFactory.eINSTANCE.createSeverityObservation()); + er.setInversionInd(true); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyObservationOperations.validateAllergyObservationSeverityInversionIndicator( + (AllergyObservation) objectToTest, diagnostician, map); + } + + }; + + validateAllergyObservationSeverityInversionIndicatorTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAllergyObservationAllergyPlayingEntityCodeSystems() { + OperationsTestCase validateAllergyObservationAllergyPlayingEntityCodeSystemsTestCase = new OperationsTestCase( + "validateAllergyObservationAllergyPlayingEntityCodeSystems", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_OBSERVATION_ALLERGY_PLAYING_ENTITY_CODE_SYSTEMS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + public void addFailTests() { + + addFailTest(new FailTest() { + @Override + public void updateToFail(AllergyObservation target) { + target.init(); + target.getValues().add(DatatypesFactory.eINSTANCE.createCD("419511003", "1.2.3.4", "", "")); + + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + + CE code = DatatypesFactory.eINSTANCE.createCE(); + pe.setCode(code); + pr.setPlayingEntity(pe); + par.setParticipantRole(pr); + target.getParticipants().add(par); + } + }); + + addFailTest(new FailTest() { + @Override + public void updateToFail(AllergyObservation target) { + target.init(); + target.getValues().add(DatatypesFactory.eINSTANCE.createCD("123456", "1.2.3.4", "", "")); + + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + + CE code = DatatypesFactory.eINSTANCE.createCE(); + pe.setCode(code); + pr.setPlayingEntity(pe); + par.setParticipantRole(pr); + target.getParticipants().add(par); + } + }); + + addFailTest(new FailTest() { + @Override + public void updateToFail(AllergyObservation target) { + target.init(); + target.getValues().add(DatatypesFactory.eINSTANCE.createCD("12345", "1.2.3.4", "", "")); + + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + + CE code = DatatypesFactory.eINSTANCE.createCE("test", "2.16.840.1.113883.6.88"); + pe.setCode(code); + pr.setPlayingEntity(pe); + par.setParticipantRole(pr); + target.getParticipants().add(par); + } + }); + + addFailTest(new FailTest() { + @Override + public void updateToFail(AllergyObservation target) { + target.init(); + target.getValues().add(DatatypesFactory.eINSTANCE.createCD("419511003", "1.2.3.4", "", "")); + + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + + CE code = DatatypesFactory.eINSTANCE.createCE("test", "2.16.840.1.113883.4.9"); + pe.setCode(code); + pr.setPlayingEntity(pe); + par.setParticipantRole(pr); + target.getParticipants().add(par); + } + }); + + } + + @Override + public void addPassTests() { + + addPassTest(new PassTest() { + @Override + public void updateToPass(AllergyObservation target) { + target.init(); + target.getValues().add(DatatypesFactory.eINSTANCE.createCD("419511003", "1.2.3.4", "", "")); + + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + + CE code = DatatypesFactory.eINSTANCE.createCE("test", "2.16.840.1.113883.6.88"); + pe.setCode(code); + pr.setPlayingEntity(pe); + par.setParticipantRole(pr); + target.getParticipants().add(par); + } + }); + + addPassTest(new PassTest() { + @Override + public void updateToPass(AllergyObservation target) { + target.init(); + target.getValues().add(DatatypesFactory.eINSTANCE.createCD("419511003", "1.2.3.4", "", "")); + + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + + CE code = DatatypesFactory.eINSTANCE.createCE("test", "2.16.840.1.113883.3.26.1.5"); + pe.setCode(code); + pr.setPlayingEntity(pe); + par.setParticipantRole(pr); + target.getParticipants().add(par); + } + }); + + addPassTest(new PassTest() { + @Override + public void updateToPass(AllergyObservation target) { + target.init(); + CD val = DatatypesFactory.eINSTANCE.createCD(); + val.setNullFlavor(NullFlavor.NA); + target.getValues().add(val); + + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + + CE code = DatatypesFactory.eINSTANCE.createCE("test", "2.16.840.1.113883.4.9"); + pe.setCode(code); + pr.setPlayingEntity(pe); + par.setParticipantRole(pr); + target.getParticipants().add(par); + } + }); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyObservationOperations.validateAllergyObservationAllergyPlayingEntityCodeSystems( + (AllergyObservation) objectToTest, diagnostician, map); + } + + }; + + validateAllergyObservationAllergyPlayingEntityCodeSystemsTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAllergyObservationTemplateId() { + OperationsTestCase validateAllergyObservationTemplateIdTestCase = new OperationsTestCase( + "validateAllergyObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyObservation target) { + + } + + @Override + protected void updateToPass(AllergyObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyObservationOperations.validateAllergyObservationTemplateId( + (AllergyObservation) objectToTest, diagnostician, map); + } + + }; + + validateAllergyObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAllergyObservationClassCode() { + OperationsTestCase validateAllergyObservationClassCodeTestCase = new OperationsTestCase( + "validateAllergyObservationClassCode", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_OBSERVATION_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyObservation target) { + + } + + @Override + protected void updateToPass(AllergyObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyObservationOperations.validateAllergyObservationClassCode( + (AllergyObservation) objectToTest, diagnostician, map); + } + + }; + + validateAllergyObservationClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAllergyObservationMoodCode() { + OperationsTestCase validateAllergyObservationMoodCodeTestCase = new OperationsTestCase( + "validateAllergyObservationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_OBSERVATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyObservation target) { + + } + + @Override + protected void updateToPass(AllergyObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyObservationOperations.validateAllergyObservationMoodCode( + (AllergyObservation) objectToTest, diagnostician, map); + } + + }; + + validateAllergyObservationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAllergyObservationId() { + OperationsTestCase validateAllergyObservationIdTestCase = new OperationsTestCase( + "validateAllergyObservationId", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_OBSERVATION_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyObservation target) { + + } + + @Override + protected void updateToPass(AllergyObservation target) { + target.init(); + + II ii = DatatypesFactory.eINSTANCE.createII(); + target.getIds().add(ii); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyObservationOperations.validateAllergyObservationId( + (AllergyObservation) objectToTest, diagnostician, map); + } + + }; + + validateAllergyObservationIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAllergyObservationCodeP() { + OperationsTestCase validateAllergyObservationCodePTestCase = new OperationsTestCase( + "validateAllergyObservationCodeP", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_OBSERVATION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyObservation target) { + + } + + @Override + protected void updateToPass(AllergyObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyObservationOperations.validateAllergyObservationCodeP( + (AllergyObservation) objectToTest, diagnostician, map); + } + + }; + + validateAllergyObservationCodePTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyObservationCode() { + OperationsTestCase validateAllergyObservationCodeTestCase = new OperationsTestCase( + "validateAllergyObservationCode", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyObservation target) { + + } + + @Override + protected void updateToPass(AllergyObservation target) { + target.init(); + + CD cd = DatatypesFactory.eINSTANCE.createCD(); + cd.setCode("ASSERTION"); + cd.setCodeSystem("2.16.840.1.113883.5.4"); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyObservationOperations.validateAllergyObservationCode( + (AllergyObservation) objectToTest, diagnostician, map); + } + + }; + + validateAllergyObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAllergyObservationStatusCode() { + OperationsTestCase validateAllergyObservationStatusCodeTestCase = new OperationsTestCase( + "validateAllergyObservationStatusCode", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_OBSERVATION_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyObservation target) { + + } + + @Override + protected void updateToPass(AllergyObservation target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyObservationOperations.validateAllergyObservationStatusCode( + (AllergyObservation) objectToTest, diagnostician, map); + } + + }; + + validateAllergyObservationStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAllergyObservationEffectiveTime() { + OperationsTestCase validateAllergyObservationEffectiveTimeTestCase = new OperationsTestCase( + "validateAllergyObservationEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_OBSERVATION_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyObservation target) { + + } + + @Override + protected void updateToPass(AllergyObservation target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyObservationOperations.validateAllergyObservationEffectiveTime( + (AllergyObservation) objectToTest, diagnostician, map); + } + + }; + + validateAllergyObservationEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyObservationValue() { + OperationsTestCase validateAllergyObservationValueTestCase = new OperationsTestCase( + "validateAllergyObservationValue", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyObservation target) { + + } + + @Override + protected void updateToPass(AllergyObservation target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD(); + value.setCodeSystem("2.16.840.1.113883.6.96"); + value.setCode("420134006"); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyObservationOperations.validateAllergyObservationValue( + (AllergyObservation) objectToTest, diagnostician, map); + } + + }; + + validateAllergyObservationValueTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyObservationProblemEntryReactionObservationContainer() { + OperationsTestCase validateAllergyObservationProblemEntryReactionObservationContainerTestCase = new OperationsTestCase( + "validateAllergyObservationProblemEntryReactionObservationContainer", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_OBSERVATION_PROBLEM_ENTRY_REACTION_OBSERVATION_CONTAINER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyObservation target) { + + } + + @Override + protected void updateToPass(AllergyObservation target) { + target.init(); + ReactionObservation observation = ConsolFactory.eINSTANCE.createReactionObservation().init(); + target.addObservation(observation); + for (org.openhealthtools.mdht.uml.cda.EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.MFST); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyObservationOperations.validateAllergyObservationProblemEntryReactionObservationContainer( + (AllergyObservation) objectToTest, diagnostician, map); + } + + }; + + validateAllergyObservationProblemEntryReactionObservationContainerTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyObservationSeverity() { + OperationsTestCase validateAllergyObservationSeverityTestCase = new OperationsTestCase( + "validateAllergyObservationSeverity", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_OBSERVATION_SEVERITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyObservation target) { + target.init(); + } + + @Override + protected void updateToPass(AllergyObservation target) { + target.init(); + SeverityObservation observation = ConsolFactory.eINSTANCE.createSeverityObservation().init(); + target.addObservation(observation); + for (org.openhealthtools.mdht.uml.cda.EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyObservationOperations.validateAllergyObservationSeverity( + (AllergyObservation) objectToTest, diagnostician, map); + } + + }; + + validateAllergyObservationSeverityTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyObservationAllergyStatusObservation() { + OperationsTestCase validateAllergyObservationAllergyStatusObservationTestCase = new OperationsTestCase( + "validateAllergyObservationAllergyStatusObservation", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_OBSERVATION_ALLERGY_STATUS_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyObservation target) { + + } + + @Override + protected void updateToPass(AllergyObservation target) { + target.init(); + + AllergyStatusObservation observation = ConsolFactory.eINSTANCE.createAllergyStatusObservation().init(); + target.addObservation(observation); + for (org.openhealthtools.mdht.uml.cda.EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyObservationOperations.validateAllergyObservationAllergyStatusObservation( + (AllergyObservation) objectToTest, diagnostician, map); + } + + }; + + validateAllergyObservationAllergyStatusObservationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAllergyObservationParticipant() { + OperationsTestCase validateAllergyObservationParticipantTestCase = new OperationsTestCase( + "validateAllergyObservationParticipant", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_OBSERVATION_PARTICIPANT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyObservation target) { + target.init(); + } + + @Override + protected void updateToPass(AllergyObservation target) { + target.getParticipants().add(CDAFactory.eINSTANCE.createParticipant2()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyObservationOperations.validateAllergyObservationParticipant( + (AllergyObservation) objectToTest, diagnostician, map); + } + + }; + + validateAllergyObservationParticipantTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleAllergyObservationPlayingEntityCodeOriginalText() { + OperationsTestCase validateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleAllergyObservationPlayingEntityCodeOriginalTextTestCase = new OperationsTestCase( + "validateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleAllergyObservationPlayingEntityCodeOriginalText", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_OBSERVATION_ALLERGY_OBSERVATION_PARTICIPANT_ALLERGY_OBSERVATION_PARTICIPANT_ROLE_ALLERGY_OBSERVATION_PLAYING_ENTITY_CODE_ORIGINAL_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyObservation target) { + target.init(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + + CE code = DatatypesFactory.eINSTANCE.createCE(); + pe.setCode(code); + pr.setPlayingEntity(pe); + par.setParticipantRole(pr); + target.getParticipants().add(par); + } + + @Override + protected void updateToPass(AllergyObservation target) { + target.getParticipants().clear(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + + CE code = DatatypesFactory.eINSTANCE.createCE(); + code.setOriginalText(DatatypesFactory.eINSTANCE.createED()); + pe.setCode(code); + pr.setPlayingEntity(pe); + par.setParticipantRole(pr); + target.getParticipants().add(par); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyObservationOperations.validateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleAllergyObservationPlayingEntityCodeOriginalText( + (AllergyObservation) objectToTest, diagnostician, map); + } + + }; + + validateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleAllergyObservationPlayingEntityCodeOriginalTextTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleAllergyObservationPlayingEntityOriginalTextReference() { + OperationsTestCase validateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleAllergyObservationPlayingEntityOriginalTextReferenceTestCase = new OperationsTestCase( + "validateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleAllergyObservationPlayingEntityOriginalTextReference", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_OBSERVATION_ALLERGY_OBSERVATION_PARTICIPANT_ALLERGY_OBSERVATION_PARTICIPANT_ROLE_ALLERGY_OBSERVATION_PLAYING_ENTITY_ORIGINAL_TEXT_REFERENCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyObservation target) { + target.init(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + + CE code = DatatypesFactory.eINSTANCE.createCE(); + ED ot = DatatypesFactory.eINSTANCE.createED(); + code.setOriginalText(ot); + pe.setCode(code); + pr.setPlayingEntity(pe); + par.setParticipantRole(pr); + target.getParticipants().add(par); + } + + @Override + protected void updateToPass(AllergyObservation target) { + target.getParticipants().clear(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + + CE code = DatatypesFactory.eINSTANCE.createCE(); + ED ot = DatatypesFactory.eINSTANCE.createED(); + ot.setReference(DatatypesFactory.eINSTANCE.createTEL()); + code.setOriginalText(ot); + pe.setCode(code); + pr.setPlayingEntity(pe); + par.setParticipantRole(pr); + target.getParticipants().add(par); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyObservationOperations.validateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleAllergyObservationPlayingEntityOriginalTextReference( + (AllergyObservation) objectToTest, diagnostician, map); + } + + }; + + validateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleAllergyObservationPlayingEntityOriginalTextReferenceTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleAllergyObservationPlayingEntityReferenceValue() { + OperationsTestCase validateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleAllergyObservationPlayingEntityReferenceValueTestCase = new OperationsTestCase( + "validateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleAllergyObservationPlayingEntityReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_OBSERVATION_ALLERGY_OBSERVATION_PARTICIPANT_ALLERGY_OBSERVATION_PARTICIPANT_ROLE_ALLERGY_OBSERVATION_PLAYING_ENTITY_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyObservation target) { + target.init(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + + CE code = DatatypesFactory.eINSTANCE.createCE(); + ED ot = DatatypesFactory.eINSTANCE.createED(); + ot.setReference(DatatypesFactory.eINSTANCE.createTEL()); + code.setOriginalText(ot); + pe.setCode(code); + pr.setPlayingEntity(pe); + par.setParticipantRole(pr); + target.getParticipants().add(par); + } + + @Override + protected void updateToPass(AllergyObservation target) { + target.getParticipants().clear(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + + CE code = DatatypesFactory.eINSTANCE.createCE(); + ED ot = DatatypesFactory.eINSTANCE.createED(); + ot.setReference(DatatypesFactory.eINSTANCE.createTEL("test")); + code.setOriginalText(ot); + pe.setCode(code); + pr.setPlayingEntity(pe); + par.setParticipantRole(pr); + target.getParticipants().add(par); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyObservationOperations.validateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleAllergyObservationPlayingEntityReferenceValue( + (AllergyObservation) objectToTest, diagnostician, map); + } + + }; + + validateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleAllergyObservationPlayingEntityReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleAllergyObservationPlayingEntityOriginalTextReferenceValue() { + OperationsTestCase validateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleAllergyObservationPlayingEntityOriginalTextReferenceValueTestCase = new NarrativeReferenceTestCase( + "validateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleAllergyObservationPlayingEntityOriginalTextReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_OBSERVATION_ALLERGY_OBSERVATION_PARTICIPANT_ALLERGY_OBSERVATION_PARTICIPANT_ROLE_ALLERGY_OBSERVATION_PLAYING_ENTITY_ORIGINAL_TEXT_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyObservation target) { + target.init(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + + CE code = DatatypesFactory.eINSTANCE.createCE(); + ED ot = DatatypesFactory.eINSTANCE.createED(); + code.setOriginalText(ot); + pe.setCode(createCEWithOriginalTextReference("Some sample text", "#1.2.3.4")); + pr.setPlayingEntity(pe); + par.setParticipantRole(pr); + target.getParticipants().add(par); + + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), "", + "No particular health status observed."); + } + + @Override + protected void updateToPass(AllergyObservation target) { + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), + "1.2.3.4", "No particular health status observed."); + + // add a reference to the section text + target.setText(createEDWithReference("Some sample text", "#1.2.3.4")); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyObservationOperations.validateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleAllergyObservationPlayingEntityOriginalTextReferenceValue( + (AllergyObservation) objectToTest, diagnostician, map); + } + + }; + + validateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleAllergyObservationPlayingEntityOriginalTextReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleAllergyObservationPlayingEntityCodeTranslation() { + OperationsTestCase validateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleAllergyObservationPlayingEntityCodeTranslationTestCase = new OperationsTestCase( + "validateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleAllergyObservationPlayingEntityCodeTranslation", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_OBSERVATION_ALLERGY_OBSERVATION_PARTICIPANT_ALLERGY_OBSERVATION_PARTICIPANT_ROLE_ALLERGY_OBSERVATION_PLAYING_ENTITY_CODE_TRANSLATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyObservation target) { + target.init(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + + CE code = DatatypesFactory.eINSTANCE.createCE(); + pe.setCode(code); + pr.setPlayingEntity(pe); + par.setParticipantRole(pr); + target.getParticipants().add(par); + } + + @Override + protected void updateToPass(AllergyObservation target) { + target.getParticipants().clear(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + + CE code = DatatypesFactory.eINSTANCE.createCE(); + code.getTranslations().add(DatatypesFactory.eINSTANCE.createCD()); + + pe.setCode(code); + pr.setPlayingEntity(pe); + par.setParticipantRole(pr); + target.getParticipants().add(par); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyObservationOperations.validateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleAllergyObservationPlayingEntityCodeTranslation( + (AllergyObservation) objectToTest, diagnostician, map); + } + + }; + + validateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleAllergyObservationPlayingEntityCodeTranslationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleAllergyObservationPlayingEntityClassCode() { + OperationsTestCase validateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleAllergyObservationPlayingEntityClassCodeTestCase = new OperationsTestCase( + "validateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleAllergyObservationPlayingEntityClassCode", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_OBSERVATION_ALLERGY_OBSERVATION_PARTICIPANT_ALLERGY_OBSERVATION_PARTICIPANT_ROLE_ALLERGY_OBSERVATION_PLAYING_ENTITY_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyObservation target) { + target.init(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + + CE code = DatatypesFactory.eINSTANCE.createCE(); + pe.setCode(code); + pr.setPlayingEntity(pe); + par.setParticipantRole(pr); + target.getParticipants().add(par); + } + + @Override + protected void updateToPass(AllergyObservation target) { + target.getParticipants().clear(); + + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + + pe.setClassCode(EntityClassRoot.MMAT); + pr.setPlayingEntity(pe); + par.setParticipantRole(pr); + target.getParticipants().add(par); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyObservationOperations.validateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleAllergyObservationPlayingEntityClassCode( + (AllergyObservation) objectToTest, diagnostician, map); + } + + }; + + validateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleAllergyObservationPlayingEntityClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleAllergyObservationPlayingEntityCode() { + OperationsTestCase validateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleAllergyObservationPlayingEntityCodeTestCase = new OperationsTestCase( + "validateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleAllergyObservationPlayingEntityCode", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_OBSERVATION_ALLERGY_OBSERVATION_PARTICIPANT_ALLERGY_OBSERVATION_PARTICIPANT_ROLE_ALLERGY_OBSERVATION_PLAYING_ENTITY_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyObservation target) { + target.init(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + + pr.setPlayingEntity(pe); + par.setParticipantRole(pr); + target.getParticipants().add(par); + } + + @Override + protected void updateToPass(AllergyObservation target) { + target.getParticipants().clear(); + + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + + pe.setCode(DatatypesFactory.eINSTANCE.createCE()); + pr.setPlayingEntity(pe); + par.setParticipantRole(pr); + target.getParticipants().add(par); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyObservationOperations.validateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleAllergyObservationPlayingEntityCode( + (AllergyObservation) objectToTest, diagnostician, map); + } + + }; + + validateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleAllergyObservationPlayingEntityCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleClassCode() { + OperationsTestCase validateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleClassCodeTestCase = new OperationsTestCase( + "validateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleClassCode", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_OBSERVATION_ALLERGY_OBSERVATION_PARTICIPANT_ALLERGY_OBSERVATION_PARTICIPANT_ROLE_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyObservation target) { + target.init(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + + par.setParticipantRole(pr); + target.getParticipants().add(par); + } + + @Override + protected void updateToPass(AllergyObservation target) { + target.getParticipants().clear(); + + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + pr.setClassCode(RoleClassRoot.MANU); + + par.setParticipantRole(pr); + target.getParticipants().add(par); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyObservationOperations.validateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleClassCode( + (AllergyObservation) objectToTest, diagnostician, map); + } + + }; + + validateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRoleClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRolePlayingEntity() { + OperationsTestCase validateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRolePlayingEntityTestCase = new OperationsTestCase( + "validateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRolePlayingEntity", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_OBSERVATION_ALLERGY_OBSERVATION_PARTICIPANT_ALLERGY_OBSERVATION_PARTICIPANT_ROLE_PLAYING_ENTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyObservation target) { + target.init(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + + par.setParticipantRole(pr); + target.getParticipants().add(par); + } + + @Override + protected void updateToPass(AllergyObservation target) { + target.getParticipants().clear(); + + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + + pr.setPlayingEntity(pe); + par.setParticipantRole(pr); + target.getParticipants().add(par); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyObservationOperations.validateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRolePlayingEntity( + (AllergyObservation) objectToTest, diagnostician, map); + } + + }; + + validateAllergyObservationAllergyObservationParticipantAllergyObservationParticipantRolePlayingEntityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAllergyObservationAllergyObservationParticipantTypeCode() { + OperationsTestCase validateAllergyObservationAllergyObservationParticipantTypeCodeTestCase = new OperationsTestCase( + "validateAllergyObservationAllergyObservationParticipantTypeCode", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_OBSERVATION_ALLERGY_OBSERVATION_PARTICIPANT_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyObservation target) { + target.init(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + + target.getParticipants().add(par); + } + + @Override + protected void updateToPass(AllergyObservation target) { + target.getParticipants().clear(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setTypeCode(ParticipationType.CSM); + target.getParticipants().add(par); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyObservationOperations.validateAllergyObservationAllergyObservationParticipantTypeCode( + (AllergyObservation) objectToTest, diagnostician, map); + } + + }; + + validateAllergyObservationAllergyObservationParticipantTypeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAllergyObservationAllergyObservationParticipantParticipantRole() { + OperationsTestCase validateAllergyObservationAllergyObservationParticipantParticipantRoleTestCase = new OperationsTestCase( + "validateAllergyObservationAllergyObservationParticipantParticipantRole", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_OBSERVATION_ALLERGY_OBSERVATION_PARTICIPANT_PARTICIPANT_ROLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyObservation target) { + target.init(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + + target.getParticipants().add(par); + + } + + @Override + protected void updateToPass(AllergyObservation target) { + target.getParticipants().clear(); + + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + + par.setParticipantRole(pr); + target.getParticipants().add(par); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyObservationOperations.validateAllergyObservationAllergyObservationParticipantParticipantRole( + (AllergyObservation) objectToTest, diagnostician, map); + } + + }; + + validateAllergyObservationAllergyObservationParticipantParticipantRoleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemEntryReactionObservationContainers() { + + AllergyObservation target = objectFactory.create(); + target.getProblemEntryReactionObservationContainers(); + + } + + /** + * + * @generated + */ + @Test + public void testGetSeverity() { + + AllergyObservation target = objectFactory.create(); + target.getSeverity(); + + } + + /** + * + * @generated + */ + @Test + public void testGetAllergyStatusObservation() { + + AllergyObservation target = objectFactory.create(); + target.getAllergyStatusObservation(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends AllergyObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public AllergyObservation create() { + return ConsolFactory.eINSTANCE.createAllergyObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends AllergyObservationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // AllergyObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/AllergyProblemActTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/AllergyProblemActTest.java new file mode 100644 index 000000000..a266e10cc --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/AllergyProblemActTest.java @@ -0,0 +1,497 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.consol.AllergyProblemAct; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.operations.AllergyProblemActOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVXB_TS; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * + * A static utility class that provides operations related to 'Allergy Problem Act' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyProblemAct#validateAllergyProblemActEffectiveTimeLow(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Problem Act Effective Time Low}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyProblemAct#validateAllergyProblemActEffectiveTimeHigh(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Problem Act Effective Time High}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyProblemAct#validateAllergyProblemActTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Problem Act Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyProblemAct#validateAllergyProblemActClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Problem Act Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyProblemAct#validateAllergyProblemActMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Problem Act Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyProblemAct#validateAllergyProblemActId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Problem Act Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyProblemAct#validateAllergyProblemActCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Problem Act Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyProblemAct#validateAllergyProblemActStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Problem Act Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyProblemAct#validateAllergyProblemActEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Problem Act Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyProblemAct#validateAllergyProblemActAllergyObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Problem Act Allergy Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyProblemAct#getAllergyObservations() Get Allergy Observations}
  • + *
+ *

+ * + * @generated + */ + +public class AllergyProblemActTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyProblemActEffectiveTimeHigh() { + OperationsTestCase validateAllergyProblemActEffectiveTimeHighTestCase = new OperationsTestCase( + "validateAllergyProblemActEffectiveTimeHigh", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_PROBLEM_ACT_EFFECTIVE_TIME_HIGH__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyProblemAct target) { + target.init(); + target.setStatusCode(DatatypesFactory.eINSTANCE.createCS("completed")); + } + + @Override + protected void updateToPass(AllergyProblemAct target) { + target.init(); + target.setStatusCode(DatatypesFactory.eINSTANCE.createCS("completed")); + IVL_TS pt = DatatypesFactory.eINSTANCE.createIVL_TS(); + IVXB_TS high = DatatypesFactory.eINSTANCE.createIVXB_TS(); + pt.setHigh(high); + target.setEffectiveTime(pt); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyProblemActOperations.validateAllergyProblemActEffectiveTimeHigh( + (AllergyProblemAct) objectToTest, diagnostician, map); + } + + }; + + validateAllergyProblemActEffectiveTimeHighTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyProblemActEffectiveTimeLow() { + OperationsTestCase validateAllergyProblemActEffectiveTimeLowTestCase = new OperationsTestCase( + "validateAllergyProblemActEffectiveTimeLow", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_PROBLEM_ACT_EFFECTIVE_TIME_LOW__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyProblemAct target) { + target.init(); + target.setStatusCode(DatatypesFactory.eINSTANCE.createCS("active")); + } + + @Override + protected void updateToPass(AllergyProblemAct target) { + target.init(); + target.setStatusCode(DatatypesFactory.eINSTANCE.createCS("active")); + IVL_TS et = DatatypesFactory.eINSTANCE.createIVL_TS(); + IVXB_TS low = DatatypesFactory.eINSTANCE.createIVXB_TS(); + et.setLow(low); + target.setEffectiveTime(et); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyProblemActOperations.validateAllergyProblemActEffectiveTimeLow( + (AllergyProblemAct) objectToTest, diagnostician, map); + } + + }; + + validateAllergyProblemActEffectiveTimeLowTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAllergyProblemActTemplateId() { + OperationsTestCase validateAllergyProblemActTemplateIdTestCase = new OperationsTestCase( + "validateAllergyProblemActTemplateId", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_PROBLEM_ACT_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyProblemAct target) { + + } + + @Override + protected void updateToPass(AllergyProblemAct target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyProblemActOperations.validateAllergyProblemActTemplateId( + (AllergyProblemAct) objectToTest, diagnostician, map); + } + + }; + + validateAllergyProblemActTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAllergyProblemActClassCode() { + OperationsTestCase validateAllergyProblemActClassCodeTestCase = new OperationsTestCase( + "validateAllergyProblemActClassCode", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_PROBLEM_ACT_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyProblemAct target) { + + } + + @Override + protected void updateToPass(AllergyProblemAct target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyProblemActOperations.validateAllergyProblemActClassCode( + (AllergyProblemAct) objectToTest, diagnostician, map); + } + + }; + + validateAllergyProblemActClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAllergyProblemActMoodCode() { + OperationsTestCase validateAllergyProblemActMoodCodeTestCase = new OperationsTestCase( + "validateAllergyProblemActMoodCode", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_PROBLEM_ACT_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyProblemAct target) { + + } + + @Override + protected void updateToPass(AllergyProblemAct target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyProblemActOperations.validateAllergyProblemActMoodCode( + (AllergyProblemAct) objectToTest, diagnostician, map); + } + + }; + + validateAllergyProblemActMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyProblemActId() { + OperationsTestCase validateAllergyProblemActIdTestCase = new OperationsTestCase( + "validateAllergyProblemActId", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_PROBLEM_ACT_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyProblemAct target) { + + } + + @Override + protected void updateToPass(AllergyProblemAct target) { + target.init(); + target.getIds().add(DatatypesFactory.eINSTANCE.createII()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyProblemActOperations.validateAllergyProblemActId( + (AllergyProblemAct) objectToTest, diagnostician, map); + } + + }; + + validateAllergyProblemActIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyProblemActCode() { + OperationsTestCase validateAllergyProblemActCodeTestCase = new OperationsTestCase( + "validateAllergyProblemActCode", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_PROBLEM_ACT_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyProblemAct target) { + + } + + @Override + protected void updateToPass(AllergyProblemAct target) { + target.init(); + CE ce = DatatypesFactory.eINSTANCE.createCE(); + ce.setCode("48765-2"); + ce.setCodeSystem("2.16.840.1.113883.6.1"); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyProblemActOperations.validateAllergyProblemActCode( + (AllergyProblemAct) objectToTest, diagnostician, map); + } + + }; + + validateAllergyProblemActCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyProblemActStatusCode() { + OperationsTestCase validateAllergyProblemActStatusCodeTestCase = new OperationsTestCase( + "validateAllergyProblemActStatusCode", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_PROBLEM_ACT_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyProblemAct target) { + + } + + @Override + protected void updateToPass(AllergyProblemAct target) { + target.init(); + target.setStatusCode(DatatypesFactory.eINSTANCE.createCS("completed")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyProblemActOperations.validateAllergyProblemActStatusCode( + (AllergyProblemAct) objectToTest, diagnostician, map); + } + + }; + + validateAllergyProblemActStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAllergyProblemActEffectiveTime() { + OperationsTestCase validateAllergyProblemActEffectiveTimeTestCase = new OperationsTestCase( + "validateAllergyProblemActEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_PROBLEM_ACT_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyProblemAct target) { + + } + + @Override + protected void updateToPass(AllergyProblemAct target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyProblemActOperations.validateAllergyProblemActEffectiveTime( + (AllergyProblemAct) objectToTest, diagnostician, map); + } + + }; + + validateAllergyProblemActEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyProblemActAllergyObservation() { + OperationsTestCase validateAllergyProblemActAllergyObservationTestCase = new OperationsTestCase( + "validateAllergyProblemActAllergyObservation", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_PROBLEM_ACT_ALLERGY_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyProblemAct target) { + + } + + @Override + protected void updateToPass(AllergyProblemAct target) { + target.init(); + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + er.setObservation(ConsolFactory.eINSTANCE.createAllergyObservation()); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyProblemActOperations.validateAllergyProblemActAllergyObservation( + (AllergyProblemAct) objectToTest, diagnostician, map); + } + + }; + + validateAllergyProblemActAllergyObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetAllergyObservations() { + + AllergyProblemAct target = objectFactory.create(); + target.getAllergyObservations(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends AllergyProblemActOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public AllergyProblemAct create() { + return ConsolFactory.eINSTANCE.createAllergyProblemAct(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends AllergyProblemActOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // AllergyProblemActOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/AllergyStatusObservationTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/AllergyStatusObservationTest.java new file mode 100644 index 000000000..1c64b11de --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/AllergyStatusObservationTest.java @@ -0,0 +1,326 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.consol.AllergyStatusObservation; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.operations.AllergyStatusObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; + +/** + * + * A static utility class that provides operations related to 'Allergy Status Observation' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyStatusObservation#validateAllergyStatusObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Status Observation Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyStatusObservation#validateAllergyStatusObservationClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Status Observation Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyStatusObservation#validateAllergyStatusObservationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Status Observation Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyStatusObservation#validateAllergyStatusObservationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Status Observation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyStatusObservation#validateAllergyStatusObservationStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Status Observation Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AllergyStatusObservation#validateAllergyStatusObservationValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Status Observation Value}
  • + *
+ *

+ * + * @generated + */ + +public class AllergyStatusObservationTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateAllergyStatusObservationTemplateId() { + OperationsTestCase validateAllergyStatusObservationTemplateIdTestCase = new OperationsTestCase( + "validateAllergyStatusObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_STATUS_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyStatusObservation target) { + + } + + @Override + protected void updateToPass(AllergyStatusObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyStatusObservationOperations.validateAllergyStatusObservationTemplateId( + (AllergyStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateAllergyStatusObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAllergyStatusObservationClassCode() { + OperationsTestCase validateAllergyStatusObservationClassCodeTestCase = new OperationsTestCase( + "validateAllergyStatusObservationClassCode", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_STATUS_OBSERVATION_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyStatusObservation target) { + + } + + @Override + protected void updateToPass(AllergyStatusObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyStatusObservationOperations.validateAllergyStatusObservationClassCode( + (AllergyStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateAllergyStatusObservationClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAllergyStatusObservationMoodCode() { + OperationsTestCase validateAllergyStatusObservationMoodCodeTestCase = new OperationsTestCase( + "validateAllergyStatusObservationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_STATUS_OBSERVATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyStatusObservation target) { + + } + + @Override + protected void updateToPass(AllergyStatusObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyStatusObservationOperations.validateAllergyStatusObservationMoodCode( + (AllergyStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateAllergyStatusObservationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyStatusObservationCode() { + OperationsTestCase validateAllergyStatusObservationCodeTestCase = new OperationsTestCase( + "validateAllergyStatusObservationCode", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_STATUS_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyStatusObservation target) { + + } + + @Override + protected void updateToPass(AllergyStatusObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyStatusObservationOperations.validateAllergyStatusObservationCode( + (AllergyStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateAllergyStatusObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAllergyStatusObservationStatusCode() { + OperationsTestCase validateAllergyStatusObservationStatusCodeTestCase = new OperationsTestCase( + "validateAllergyStatusObservationStatusCode", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_STATUS_OBSERVATION_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyStatusObservation target) { + + } + + @Override + protected void updateToPass(AllergyStatusObservation target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyStatusObservationOperations.validateAllergyStatusObservationStatusCode( + (AllergyStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateAllergyStatusObservationStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyStatusObservationValue() { + OperationsTestCase validateAllergyStatusObservationValueTestCase = new OperationsTestCase( + "validateAllergyStatusObservationValue", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_STATUS_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyStatusObservation target) { + + } + + @Override + protected void updateToPass(AllergyStatusObservation target) { + target.init(); + + CE value = DatatypesFactory.eINSTANCE.createCE(); + value.setCodeSystem("2.16.840.1.113883.6.96"); + value.setCode("55561003"); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyStatusObservationOperations.validateAllergyStatusObservationValue( + (AllergyStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateAllergyStatusObservationValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends AllergyStatusObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public AllergyStatusObservation create() { + return ConsolFactory.eINSTANCE.createAllergyStatusObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends AllergyStatusObservationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // AllergyStatusObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/AnesthesiaSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/AnesthesiaSectionTest.java new file mode 100644 index 000000000..d5dbc0ac3 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/AnesthesiaSectionTest.java @@ -0,0 +1,386 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.AnesthesiaSection; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.operations.AnesthesiaSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Anesthesia Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AnesthesiaSection#validateAnesthesiaSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Anesthesia Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AnesthesiaSection#validateAnesthesiaSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Anesthesia Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AnesthesiaSection#validateAnesthesiaSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Anesthesia Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AnesthesiaSection#validateAnesthesiaSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Anesthesia Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AnesthesiaSection#validateAnesthesiaSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Anesthesia Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AnesthesiaSection#validateAnesthesiaSectionProcedureActivityProcedure(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Anesthesia Section Procedure Activity Procedure}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AnesthesiaSection#validateAnesthesiaSectionMedicationActivity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Anesthesia Section Medication Activity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AnesthesiaSection#getProcedureActivityProcedures() Get Procedure Activity Procedures}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AnesthesiaSection#getMedicationActivities() Get Medication Activities}
  • + *
+ *

+ * + * @generated + */ + +public class AnesthesiaSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateAnesthesiaSectionTemplateId() { + OperationsTestCase validateAnesthesiaSectionTemplateIdTestCase = new OperationsTestCase( + "validateAnesthesiaSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_ANESTHESIA_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AnesthesiaSection target) { + + } + + @Override + protected void updateToPass(AnesthesiaSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AnesthesiaSectionOperations.validateAnesthesiaSectionTemplateId( + (AnesthesiaSection) objectToTest, diagnostician, map); + } + + }; + + validateAnesthesiaSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAnesthesiaSectionCode() { + OperationsTestCase validateAnesthesiaSectionCodeTestCase = new OperationsTestCase( + "validateAnesthesiaSectionCode", + operationsForOCL.getOCLValue("VALIDATE_ANESTHESIA_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AnesthesiaSection target) { + + } + + @Override + protected void updateToPass(AnesthesiaSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AnesthesiaSectionOperations.validateAnesthesiaSectionCode( + (AnesthesiaSection) objectToTest, diagnostician, map); + } + + }; + + validateAnesthesiaSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAnesthesiaSectionCodeP() { + OperationsTestCase validateAnesthesiaSectionCodePTestCase = new OperationsTestCase( + "validateAnesthesiaSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_ANESTHESIA_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AnesthesiaSection target) { + + } + + @Override + protected void updateToPass(AnesthesiaSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AnesthesiaSectionOperations.validateAnesthesiaSectionCodeP( + (AnesthesiaSection) objectToTest, diagnostician, map); + } + + }; + + validateAnesthesiaSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAnesthesiaSectionText() { + OperationsTestCase validateAnesthesiaSectionTextTestCase = new OperationsTestCase( + "validateAnesthesiaSectionText", + operationsForOCL.getOCLValue("VALIDATE_ANESTHESIA_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AnesthesiaSection target) { + + } + + @Override + protected void updateToPass(AnesthesiaSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AnesthesiaSectionOperations.validateAnesthesiaSectionText( + (AnesthesiaSection) objectToTest, diagnostician, map); + } + + }; + + validateAnesthesiaSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAnesthesiaSectionTitle() { + OperationsTestCase validateAnesthesiaSectionTitleTestCase = new OperationsTestCase( + "validateAnesthesiaSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_ANESTHESIA_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AnesthesiaSection target) { + + } + + @Override + protected void updateToPass(AnesthesiaSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AnesthesiaSectionOperations.validateAnesthesiaSectionTitle( + (AnesthesiaSection) objectToTest, diagnostician, map); + } + + }; + + validateAnesthesiaSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAnesthesiaSectionProcedureActivityProcedure() { + OperationsTestCase validateAnesthesiaSectionProcedureActivityProcedureTestCase = new OperationsTestCase( + "validateAnesthesiaSectionProcedureActivityProcedure", + operationsForOCL.getOCLValue("VALIDATE_ANESTHESIA_SECTION_PROCEDURE_ACTIVITY_PROCEDURE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AnesthesiaSection target) { + target.init(); + } + + @Override + protected void updateToPass(AnesthesiaSection target) { + target.addProcedure(ConsolFactory.eINSTANCE.createProcedureActivityProcedure().init()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AnesthesiaSectionOperations.validateAnesthesiaSectionProcedureActivityProcedure( + (AnesthesiaSection) objectToTest, diagnostician, map); + } + + }; + + validateAnesthesiaSectionProcedureActivityProcedureTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAnesthesiaSectionMedicationActivity() { + OperationsTestCase validateAnesthesiaSectionMedicationActivityTestCase = new OperationsTestCase( + "validateAnesthesiaSectionMedicationActivity", + operationsForOCL.getOCLValue("VALIDATE_ANESTHESIA_SECTION_MEDICATION_ACTIVITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AnesthesiaSection target) { + target.init(); + } + + @Override + protected void updateToPass(AnesthesiaSection target) { + target.addSubstanceAdministration(ConsolFactory.eINSTANCE.createMedicationActivity().init()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AnesthesiaSectionOperations.validateAnesthesiaSectionMedicationActivity( + (AnesthesiaSection) objectToTest, diagnostician, map); + } + + }; + + validateAnesthesiaSectionMedicationActivityTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProcedureActivityProcedures() { + + AnesthesiaSection target = objectFactory.create(); + target.getProcedureActivityProcedures(); + + } + + /** + * + * @generated + */ + @Test + public void testGetMedicationActivities() { + + AnesthesiaSection target = objectFactory.create(); + target.getMedicationActivities(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends AnesthesiaSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public AnesthesiaSection create() { + return ConsolFactory.eINSTANCE.createAnesthesiaSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends AnesthesiaSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // AnesthesiaSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/AssessmentAndPlanSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/AssessmentAndPlanSectionTest.java new file mode 100644 index 000000000..8aeb91e57 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/AssessmentAndPlanSectionTest.java @@ -0,0 +1,298 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.AssessmentAndPlanSection; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.operations.AssessmentAndPlanSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Assessment And Plan Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AssessmentAndPlanSection#validateAssessmentAndPlanSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment And Plan Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AssessmentAndPlanSection#validateAssessmentAndPlanSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment And Plan Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AssessmentAndPlanSection#validateAssessmentAndPlanSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment And Plan Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AssessmentAndPlanSection#validateAssessmentAndPlanSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment And Plan Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AssessmentAndPlanSection#validateAssessmentAndPlanSectionPlanOfCareActivityAct(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment And Plan Section Plan Of Care Activity Act}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AssessmentAndPlanSection#getPlanOfCareActivityActs() Get Plan Of Care Activity Acts}
  • + *
+ *

+ * + * @generated + */ + +public class AssessmentAndPlanSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateAssessmentAndPlanSectionTemplateId() { + OperationsTestCase validateAssessmentAndPlanSectionTemplateIdTestCase = new OperationsTestCase( + "validateAssessmentAndPlanSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_AND_PLAN_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentAndPlanSection target) { + + } + + @Override + protected void updateToPass(AssessmentAndPlanSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentAndPlanSectionOperations.validateAssessmentAndPlanSectionTemplateId( + (AssessmentAndPlanSection) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentAndPlanSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAssessmentAndPlanSectionCode() { + OperationsTestCase validateAssessmentAndPlanSectionCodeTestCase = new OperationsTestCase( + "validateAssessmentAndPlanSectionCode", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_AND_PLAN_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentAndPlanSection target) { + + } + + @Override + protected void updateToPass(AssessmentAndPlanSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentAndPlanSectionOperations.validateAssessmentAndPlanSectionCode( + (AssessmentAndPlanSection) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentAndPlanSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAssessmentAndPlanSectionCodeP() { + OperationsTestCase validateAssessmentAndPlanSectionCodePTestCase = new OperationsTestCase( + "validateAssessmentAndPlanSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_AND_PLAN_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentAndPlanSection target) { + + } + + @Override + protected void updateToPass(AssessmentAndPlanSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentAndPlanSectionOperations.validateAssessmentAndPlanSectionCodeP( + (AssessmentAndPlanSection) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentAndPlanSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAssessmentAndPlanSectionText() { + OperationsTestCase validateAssessmentAndPlanSectionTextTestCase = new OperationsTestCase( + "validateAssessmentAndPlanSectionText", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_AND_PLAN_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentAndPlanSection target) { + + } + + @Override + protected void updateToPass(AssessmentAndPlanSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentAndPlanSectionOperations.validateAssessmentAndPlanSectionText( + (AssessmentAndPlanSection) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentAndPlanSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAssessmentAndPlanSectionPlanOfCareActivityAct() { + OperationsTestCase validateAssessmentAndPlanSectionPlanOfCareActivityActTestCase = new OperationsTestCase( + "validateAssessmentAndPlanSectionPlanOfCareActivityAct", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_AND_PLAN_SECTION_PLAN_OF_CARE_ACTIVITY_ACT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentAndPlanSection target) { + + } + + @Override + protected void updateToPass(AssessmentAndPlanSection target) { + target.init(); + target.addAct(ConsolFactory.eINSTANCE.createPlanOfCareActivityAct()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentAndPlanSectionOperations.validateAssessmentAndPlanSectionPlanOfCareActivityAct( + (AssessmentAndPlanSection) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentAndPlanSectionPlanOfCareActivityActTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetPlanOfCareActivityActs() { + + AssessmentAndPlanSection target = objectFactory.create(); + target.getPlanOfCareActivityActs(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends AssessmentAndPlanSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public AssessmentAndPlanSection create() { + return ConsolFactory.eINSTANCE.createAssessmentAndPlanSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends AssessmentAndPlanSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // AssessmentAndPlanSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/AssessmentScaleObservationTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/AssessmentScaleObservationTest.java new file mode 100644 index 000000000..87fd11f87 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/AssessmentScaleObservationTest.java @@ -0,0 +1,947 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.ObservationRange; +import org.openhealthtools.mdht.uml.cda.ReferenceRange; +import org.openhealthtools.mdht.uml.cda.consol.AssessmentScaleObservation; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ConsolPackage; +import org.openhealthtools.mdht.uml.cda.consol.GeneralStatusSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.AssessmentScaleObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * + * A static utility class that provides operations related to 'Assessment Scale Observation' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AssessmentScaleObservation#validateAssessmentScaleObservationCodeCodeSystem(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment Scale Observation Code Code System}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AssessmentScaleObservation#validateAssessmentScaleObservationInterpretationCodeTranslation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment Scale Observation Interpretation Code Translation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AssessmentScaleObservation#validateAssessmentScaleObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment Scale Observation Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AssessmentScaleObservation#validateAssessmentScaleObservationClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment Scale Observation Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AssessmentScaleObservation#validateAssessmentScaleObservationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment Scale Observation Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AssessmentScaleObservation#validateAssessmentScaleObservationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment Scale Observation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AssessmentScaleObservation#validateAssessmentScaleObservationDerivationExpr(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment Scale Observation Derivation Expr}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AssessmentScaleObservation#validateAssessmentScaleObservationEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment Scale Observation Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AssessmentScaleObservation#validateAssessmentScaleObservationId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment Scale Observation Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AssessmentScaleObservation#validateAssessmentScaleObservationInterpretationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment Scale Observation Interpretation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AssessmentScaleObservation#validateAssessmentScaleObservationStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment Scale Observation Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AssessmentScaleObservation#validateAssessmentScaleObservationStatusCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment Scale Observation Status Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AssessmentScaleObservation#validateAssessmentScaleObservationValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment Scale Observation Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AssessmentScaleObservation#validateAssessmentScaleObservationAuthor(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment Scale Observation Author}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AssessmentScaleObservation#validateAssessmentScaleObservationReferenceRange(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment Scale Observation Reference Range}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AssessmentScaleObservation#validateAssessmentScaleObservationAssessmentScaleSupportingObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment Scale Observation Assessment Scale Supporting Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AssessmentScaleObservation#validateAssessmentScaleObservationReferenceRangeObservationRangeTextReference(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment Scale Observation Reference Range Observation Range Text Reference}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AssessmentScaleObservation#validateAssessmentScaleObservationReferenceRangeObservationRangeTextReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment Scale Observation Reference Range Observation Range Text Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AssessmentScaleObservation#validateAssessmentScaleObservationReferenceRangeObservationRangeReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment Scale Observation Reference Range Observation Range Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AssessmentScaleObservation#validateAssessmentScaleObservationReferenceRangeObservationRangeText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment Scale Observation Reference Range Observation Range Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AssessmentScaleObservation#validateAssessmentScaleObservationReferenceRangeObservationRange(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment Scale Observation Reference Range Observation Range}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AssessmentScaleObservation#getAssessmentScaleSupportingObservations() Get Assessment Scale Supporting Observations}
  • + *
+ *

+ * + * @generated + */ + +public class AssessmentScaleObservationTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateAssessmentScaleObservationCodeCodeSystem() { + OperationsTestCase validateAssessmentScaleObservationCodeCodeSystemTestCase = new OperationsTestCase( + "validateAssessmentScaleObservationCodeCodeSystem", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_SCALE_OBSERVATION_CODE_CODE_SYSTEM__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentScaleObservation target) { + + } + + @Override + protected void updateToPass(AssessmentScaleObservation target) { + target.init(); + target.setCode(DatatypesFactory.eINSTANCE.createCD("", "2.16.840.1.113883.6.1", "", "")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentScaleObservationOperations.validateAssessmentScaleObservationCodeCodeSystem( + (AssessmentScaleObservation) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentScaleObservationCodeCodeSystemTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAssessmentScaleObservationInterpretationCodeTranslation() { + OperationsTestCase validateAssessmentScaleObservationInterpretationCodeTranslationTestCase = new OperationsTestCase( + "validateAssessmentScaleObservationInterpretationCodeTranslation", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_SCALE_OBSERVATION_INTERPRETATION_CODE_TRANSLATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentScaleObservation target) { + target.init(); + target.getInterpretationCodes().add(DatatypesFactory.eINSTANCE.createCE()); + } + + @Override + protected void updateToPass(AssessmentScaleObservation target) { + target.getInterpretationCodes().clear(); + CE ic = DatatypesFactory.eINSTANCE.createCE(); + ic.getTranslations().add(DatatypesFactory.eINSTANCE.createCD()); + target.getInterpretationCodes().add(ic); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentScaleObservationOperations.validateAssessmentScaleObservationInterpretationCodeTranslation( + (AssessmentScaleObservation) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentScaleObservationInterpretationCodeTranslationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAssessmentScaleObservationTemplateId() { + OperationsTestCase validateAssessmentScaleObservationTemplateIdTestCase = new OperationsTestCase( + "validateAssessmentScaleObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_SCALE_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentScaleObservation target) { + + } + + @Override + protected void updateToPass(AssessmentScaleObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentScaleObservationOperations.validateAssessmentScaleObservationTemplateId( + (AssessmentScaleObservation) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentScaleObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAssessmentScaleObservationClassCode() { + OperationsTestCase validateAssessmentScaleObservationClassCodeTestCase = new OperationsTestCase( + "validateAssessmentScaleObservationClassCode", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_SCALE_OBSERVATION_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentScaleObservation target) { + + } + + @Override + protected void updateToPass(AssessmentScaleObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentScaleObservationOperations.validateAssessmentScaleObservationClassCode( + (AssessmentScaleObservation) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentScaleObservationClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAssessmentScaleObservationMoodCode() { + OperationsTestCase validateAssessmentScaleObservationMoodCodeTestCase = new OperationsTestCase( + "validateAssessmentScaleObservationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_SCALE_OBSERVATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentScaleObservation target) { + + } + + @Override + protected void updateToPass(AssessmentScaleObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentScaleObservationOperations.validateAssessmentScaleObservationMoodCode( + (AssessmentScaleObservation) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentScaleObservationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAssessmentScaleObservationCode() { + OperationsTestCase validateAssessmentScaleObservationCodeTestCase = new OperationsTestCase( + "validateAssessmentScaleObservationCode", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_SCALE_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentScaleObservation target) { + + } + + @Override + protected void updateToPass(AssessmentScaleObservation target) { + target.init(); + + CD cd = DatatypesFactory.eINSTANCE.createCD(); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentScaleObservationOperations.validateAssessmentScaleObservationCode( + (AssessmentScaleObservation) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentScaleObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAssessmentScaleObservationDerivationExpr() { + OperationsTestCase validateAssessmentScaleObservationDerivationExprTestCase = new OperationsTestCase( + "validateAssessmentScaleObservationDerivationExpr", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_SCALE_OBSERVATION_DERIVATION_EXPR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentScaleObservation target) { + + } + + @Override + protected void updateToPass(AssessmentScaleObservation target) { + target.init(); + target.setDerivationExpr(DatatypesFactory.eINSTANCE.createST()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentScaleObservationOperations.validateAssessmentScaleObservationDerivationExpr( + (AssessmentScaleObservation) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentScaleObservationDerivationExprTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAssessmentScaleObservationEffectiveTime() { + OperationsTestCase validateAssessmentScaleObservationEffectiveTimeTestCase = new OperationsTestCase( + "validateAssessmentScaleObservationEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_SCALE_OBSERVATION_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentScaleObservation target) { + + } + + @Override + protected void updateToPass(AssessmentScaleObservation target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentScaleObservationOperations.validateAssessmentScaleObservationEffectiveTime( + (AssessmentScaleObservation) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentScaleObservationEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAssessmentScaleObservationId() { + OperationsTestCase validateAssessmentScaleObservationIdTestCase = new OperationsTestCase( + "validateAssessmentScaleObservationId", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_SCALE_OBSERVATION_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentScaleObservation target) { + + } + + @Override + protected void updateToPass(AssessmentScaleObservation target) { + target.init(); + + II ii = DatatypesFactory.eINSTANCE.createII(); + target.getIds().add(ii); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentScaleObservationOperations.validateAssessmentScaleObservationId( + (AssessmentScaleObservation) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentScaleObservationIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAssessmentScaleObservationInterpretationCode() { + OperationsTestCase validateAssessmentScaleObservationInterpretationCodeTestCase = new OperationsTestCase( + "validateAssessmentScaleObservationInterpretationCode", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_SCALE_OBSERVATION_INTERPRETATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentScaleObservation target) { + + } + + @Override + protected void updateToPass(AssessmentScaleObservation target) { + target.init(); + target.getInterpretationCodes().add(DatatypesFactory.eINSTANCE.createCE()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentScaleObservationOperations.validateAssessmentScaleObservationInterpretationCode( + (AssessmentScaleObservation) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentScaleObservationInterpretationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAssessmentScaleObservationStatusCode() { + OperationsTestCase validateAssessmentScaleObservationStatusCodeTestCase = new OperationsTestCase( + "validateAssessmentScaleObservationStatusCode", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_SCALE_OBSERVATION_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentScaleObservation target) { + + } + + @Override + protected void updateToPass(AssessmentScaleObservation target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentScaleObservationOperations.validateAssessmentScaleObservationStatusCode( + (AssessmentScaleObservation) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentScaleObservationStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAssessmentScaleObservationStatusCodeP() { + OperationsTestCase validateAssessmentScaleObservationStatusCodePTestCase = new OperationsTestCase( + "validateAssessmentScaleObservationStatusCodeP", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_SCALE_OBSERVATION_STATUS_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentScaleObservation target) { + + } + + @Override + protected void updateToPass(AssessmentScaleObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentScaleObservationOperations.validateAssessmentScaleObservationStatusCodeP( + (AssessmentScaleObservation) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentScaleObservationStatusCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAssessmentScaleObservationValue() { + OperationsTestCase validateAssessmentScaleObservationValueTestCase = new OperationsTestCase( + "validateAssessmentScaleObservationValue", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_SCALE_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentScaleObservation target) { + + } + + @Override + protected void updateToPass(AssessmentScaleObservation target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD(); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentScaleObservationOperations.validateAssessmentScaleObservationValue( + (AssessmentScaleObservation) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentScaleObservationValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAssessmentScaleObservationAuthor() { + OperationsTestCase validateAssessmentScaleObservationAuthorTestCase = new OperationsTestCase( + "validateAssessmentScaleObservationAuthor", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_SCALE_OBSERVATION_AUTHOR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentScaleObservation target) { + + } + + @Override + protected void updateToPass(AssessmentScaleObservation target) { + target.init(); + target.getAuthors().add(CDAFactory.eINSTANCE.createAuthor()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentScaleObservationOperations.validateAssessmentScaleObservationAuthor( + (AssessmentScaleObservation) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentScaleObservationAuthorTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAssessmentScaleObservationReferenceRange() { + OperationsTestCase validateAssessmentScaleObservationReferenceRangeTestCase = new OperationsTestCase( + "validateAssessmentScaleObservationReferenceRange", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_SCALE_OBSERVATION_REFERENCE_RANGE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentScaleObservation target) { + + } + + @Override + protected void updateToPass(AssessmentScaleObservation target) { + target.init(); + target.getReferenceRanges().add(CDAFactory.eINSTANCE.createReferenceRange()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentScaleObservationOperations.validateAssessmentScaleObservationReferenceRange( + (AssessmentScaleObservation) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentScaleObservationReferenceRangeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAssessmentScaleObservationAssessmentScaleSupportingObservation() { + OperationsTestCase validateAssessmentScaleObservationAssessmentScaleSupportingObservationTestCase = new OperationsTestCase( + "validateAssessmentScaleObservationAssessmentScaleSupportingObservation", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_SCALE_OBSERVATION_ASSESSMENT_SCALE_SUPPORTING_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentScaleObservation target) { + + } + + @Override + protected void updateToPass(AssessmentScaleObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + er.setObservation(ConsolFactory.eINSTANCE.createAssessmentScaleSupportingObservation()); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentScaleObservationOperations.validateAssessmentScaleObservationAssessmentScaleSupportingObservation( + (AssessmentScaleObservation) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentScaleObservationAssessmentScaleSupportingObservationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAssessmentScaleObservationReferenceRangeObservationRangeTextReference() { + OperationsTestCase validateAssessmentScaleObservationReferenceRangeObservationRangeTextReferenceTestCase = new OperationsTestCase( + "validateAssessmentScaleObservationReferenceRangeObservationRangeTextReference", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_SCALE_OBSERVATION_REFERENCE_RANGE_OBSERVATION_RANGE_TEXT_REFERENCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentScaleObservation target) { + target.init(); + ReferenceRange rr = CDAFactory.eINSTANCE.createReferenceRange(); + ObservationRange or = CDAFactory.eINSTANCE.createObservationRange(); + or.setText(DatatypesFactory.eINSTANCE.createED()); + rr.setObservationRange(or); + target.getReferenceRanges().add(rr); + } + + @Override + protected void updateToPass(AssessmentScaleObservation target) { + target.getReferenceRanges().clear(); + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL()); + ReferenceRange rr = CDAFactory.eINSTANCE.createReferenceRange(); + ObservationRange or = CDAFactory.eINSTANCE.createObservationRange(); + or.setText(txt); + rr.setObservationRange(or); + target.getReferenceRanges().add(rr); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentScaleObservationOperations.validateAssessmentScaleObservationReferenceRangeObservationRangeTextReference( + (AssessmentScaleObservation) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentScaleObservationReferenceRangeObservationRangeTextReferenceTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAssessmentScaleObservationReferenceRangeObservationRangeTextReferenceValue() { + OperationsTestCase validateAssessmentScaleObservationReferenceRangeObservationRangeTextReferenceValueTestCase = new OperationsTestCase( + "validateAssessmentScaleObservationReferenceRangeObservationRangeTextReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_SCALE_OBSERVATION_REFERENCE_RANGE_OBSERVATION_RANGE_TEXT_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentScaleObservation target) { + target.init(); + ReferenceRange rr = CDAFactory.eINSTANCE.createReferenceRange(); + ObservationRange or = CDAFactory.eINSTANCE.createObservationRange(); + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL()); + or.setText(txt); + rr.setObservationRange(or); + target.getReferenceRanges().add(rr); + } + + @Override + protected void updateToPass(AssessmentScaleObservation target) { + target.getReferenceRanges().clear(); + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL("test")); + ReferenceRange rr = CDAFactory.eINSTANCE.createReferenceRange(); + ObservationRange or = CDAFactory.eINSTANCE.createObservationRange(); + or.setText(txt); + rr.setObservationRange(or); + target.getReferenceRanges().add(rr); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentScaleObservationOperations.validateAssessmentScaleObservationReferenceRangeObservationRangeTextReferenceValue( + (AssessmentScaleObservation) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentScaleObservationReferenceRangeObservationRangeTextReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAssessmentScaleObservationReferenceRangeObservationRangeReferenceValue() { + OperationsTestCase validateAssessmentScaleObservationReferenceRangeObservationRangeReferenceValueTestCase = new NarrativeReferenceTestCase( + "validateAssessmentScaleObservationReferenceRangeObservationRangeReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_SCALE_OBSERVATION_REFERENCE_RANGE_OBSERVATION_RANGE_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentScaleObservation target) { + target.init(); + + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), "", + "No particular health status observed."); + + // add a reference to the section text + ReferenceRange rr = CDAFactory.eINSTANCE.createReferenceRange(); + ObservationRange or = CDAFactory.eINSTANCE.createObservationRange(); + or.setText(createEDWithReference("Some sample text", "#1.2.3.4")); + rr.setObservationRange(or); + target.getReferenceRanges().add(rr); + + } + + @Override + protected void updateToPass(AssessmentScaleObservation target) { + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), + "1.2.3.4", "No particular health status observed."); + + // add a reference to the section text + ED txt = createEDWithReference("Some sample text", "#1.2.3.4"); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL()); + ReferenceRange rr = CDAFactory.eINSTANCE.createReferenceRange(); + ObservationRange or = CDAFactory.eINSTANCE.createObservationRange(); + or.setText(txt); + rr.setObservationRange(or); + target.getReferenceRanges().add(rr); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentScaleObservationOperations.validateAssessmentScaleObservationReferenceRangeObservationRangeReferenceValue( + (AssessmentScaleObservation) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentScaleObservationReferenceRangeObservationRangeReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAssessmentScaleObservationReferenceRangeObservationRangeText() { + OperationsTestCase validateAssessmentScaleObservationReferenceRangeObservationRangeTextTestCase = new OperationsTestCase( + "validateAssessmentScaleObservationReferenceRangeObservationRangeText", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_SCALE_OBSERVATION_REFERENCE_RANGE_OBSERVATION_RANGE_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentScaleObservation target) { + target.init(); + ReferenceRange rr = CDAFactory.eINSTANCE.createReferenceRange(); + ObservationRange or = CDAFactory.eINSTANCE.createObservationRange(); + rr.setObservationRange(or); + target.getReferenceRanges().add(rr); + } + + @Override + protected void updateToPass(AssessmentScaleObservation target) { + target.getReferenceRanges().clear(); + ReferenceRange rr = CDAFactory.eINSTANCE.createReferenceRange(); + ObservationRange or = CDAFactory.eINSTANCE.createObservationRange(); + or.setText(DatatypesFactory.eINSTANCE.createED()); + rr.setObservationRange(or); + target.getReferenceRanges().add(rr); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentScaleObservationOperations.validateAssessmentScaleObservationReferenceRangeObservationRangeText( + (AssessmentScaleObservation) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentScaleObservationReferenceRangeObservationRangeTextTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAssessmentScaleObservationReferenceRangeObservationRange() { + OperationsTestCase validateAssessmentScaleObservationReferenceRangeObservationRangeTestCase = new OperationsTestCase( + "validateAssessmentScaleObservationReferenceRangeObservationRange", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_SCALE_OBSERVATION_REFERENCE_RANGE_OBSERVATION_RANGE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentScaleObservation target) { + target.init(); + target.getReferenceRanges().add(CDAFactory.eINSTANCE.createReferenceRange()); + } + + @Override + protected void updateToPass(AssessmentScaleObservation target) { + target.getReferenceRanges().clear(); + ReferenceRange rr = CDAFactory.eINSTANCE.createReferenceRange(); + rr.setObservationRange(CDAFactory.eINSTANCE.createObservationRange()); + target.getReferenceRanges().add(rr); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentScaleObservationOperations.validateAssessmentScaleObservationReferenceRangeObservationRange( + (AssessmentScaleObservation) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentScaleObservationReferenceRangeObservationRangeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetAssessmentScaleSupportingObservations() { + + AssessmentScaleObservation target = objectFactory.create(); + target.getAssessmentScaleSupportingObservations(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends AssessmentScaleObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public AssessmentScaleObservation create() { + return ConsolFactory.eINSTANCE.createAssessmentScaleObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends AssessmentScaleObservationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // AssessmentScaleObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/AssessmentScaleSupportingObservationTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/AssessmentScaleSupportingObservationTest.java new file mode 100644 index 000000000..49bbac4b8 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/AssessmentScaleSupportingObservationTest.java @@ -0,0 +1,470 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.consol.AssessmentScaleSupportingObservation; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.operations.AssessmentScaleSupportingObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; + +/** + * + * A static utility class that provides operations related to 'Assessment Scale Supporting Observation' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AssessmentScaleSupportingObservation#validateAssessmentScaleSupportingObservationCodeCodeSystem(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment Scale Supporting Observation Code Code System}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AssessmentScaleSupportingObservation#validateAssessmentScaleSupportingObservationValueTranslation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment Scale Supporting Observation Value Translation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AssessmentScaleSupportingObservation#validateAssessmentScaleSupportingObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment Scale Supporting Observation Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AssessmentScaleSupportingObservation#validateAssessmentScaleSupportingObservationClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment Scale Supporting Observation Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AssessmentScaleSupportingObservation#validateAssessmentScaleSupportingObservationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment Scale Supporting Observation Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AssessmentScaleSupportingObservation#validateAssessmentScaleSupportingObservationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment Scale Supporting Observation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AssessmentScaleSupportingObservation#validateAssessmentScaleSupportingObservationId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment Scale Supporting Observation Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AssessmentScaleSupportingObservation#validateAssessmentScaleSupportingObservationStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment Scale Supporting Observation Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AssessmentScaleSupportingObservation#validateAssessmentScaleSupportingObservationStatusCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment Scale Supporting Observation Status Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AssessmentScaleSupportingObservation#validateAssessmentScaleSupportingObservationValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment Scale Supporting Observation Value}
  • + *
+ *

+ * + * @generated + */ + +public class AssessmentScaleSupportingObservationTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateAssessmentScaleSupportingObservationCodeCodeSystem() { + OperationsTestCase validateAssessmentScaleSupportingObservationCodeCodeSystemTestCase = new OperationsTestCase( + "validateAssessmentScaleSupportingObservationCodeCodeSystem", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_SCALE_SUPPORTING_OBSERVATION_CODE_CODE_SYSTEM__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentScaleSupportingObservation target) { + + } + + @Override + protected void updateToPass(AssessmentScaleSupportingObservation target) { + target.init(); + target.setCode(DatatypesFactory.eINSTANCE.createCD("", "2.16.840.1.113883.6.1", "", "")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentScaleSupportingObservationOperations.validateAssessmentScaleSupportingObservationCodeCodeSystem( + (AssessmentScaleSupportingObservation) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentScaleSupportingObservationCodeCodeSystemTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAssessmentScaleSupportingObservationValueTranslation() { + OperationsTestCase validateAssessmentScaleSupportingObservationValueTranslationTestCase = new OperationsTestCase( + "validateAssessmentScaleSupportingObservationValueTranslation", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_SCALE_SUPPORTING_OBSERVATION_VALUE_TRANSLATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentScaleSupportingObservation target) { + + } + + @Override + protected void updateToPass(AssessmentScaleSupportingObservation target) { + target.init(); + CD val = DatatypesFactory.eINSTANCE.createCD(); + val.getTranslations().add(DatatypesFactory.eINSTANCE.createCD()); + target.getValues().add(val); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentScaleSupportingObservationOperations.validateAssessmentScaleSupportingObservationValueTranslation( + (AssessmentScaleSupportingObservation) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentScaleSupportingObservationValueTranslationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAssessmentScaleSupportingObservationTemplateId() { + OperationsTestCase validateAssessmentScaleSupportingObservationTemplateIdTestCase = new OperationsTestCase( + "validateAssessmentScaleSupportingObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_SCALE_SUPPORTING_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentScaleSupportingObservation target) { + + } + + @Override + protected void updateToPass(AssessmentScaleSupportingObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentScaleSupportingObservationOperations.validateAssessmentScaleSupportingObservationTemplateId( + (AssessmentScaleSupportingObservation) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentScaleSupportingObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAssessmentScaleSupportingObservationClassCode() { + OperationsTestCase validateAssessmentScaleSupportingObservationClassCodeTestCase = new OperationsTestCase( + "validateAssessmentScaleSupportingObservationClassCode", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_SCALE_SUPPORTING_OBSERVATION_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentScaleSupportingObservation target) { + + } + + @Override + protected void updateToPass(AssessmentScaleSupportingObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentScaleSupportingObservationOperations.validateAssessmentScaleSupportingObservationClassCode( + (AssessmentScaleSupportingObservation) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentScaleSupportingObservationClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAssessmentScaleSupportingObservationMoodCode() { + OperationsTestCase validateAssessmentScaleSupportingObservationMoodCodeTestCase = new OperationsTestCase( + "validateAssessmentScaleSupportingObservationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_SCALE_SUPPORTING_OBSERVATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentScaleSupportingObservation target) { + + } + + @Override + protected void updateToPass(AssessmentScaleSupportingObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentScaleSupportingObservationOperations.validateAssessmentScaleSupportingObservationMoodCode( + (AssessmentScaleSupportingObservation) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentScaleSupportingObservationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAssessmentScaleSupportingObservationCode() { + OperationsTestCase validateAssessmentScaleSupportingObservationCodeTestCase = new OperationsTestCase( + "validateAssessmentScaleSupportingObservationCode", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_SCALE_SUPPORTING_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentScaleSupportingObservation target) { + + } + + @Override + protected void updateToPass(AssessmentScaleSupportingObservation target) { + target.init(); + + CE cd = DatatypesFactory.eINSTANCE.createCE(); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentScaleSupportingObservationOperations.validateAssessmentScaleSupportingObservationCode( + (AssessmentScaleSupportingObservation) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentScaleSupportingObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAssessmentScaleSupportingObservationId() { + OperationsTestCase validateAssessmentScaleSupportingObservationIdTestCase = new OperationsTestCase( + "validateAssessmentScaleSupportingObservationId", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_SCALE_SUPPORTING_OBSERVATION_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentScaleSupportingObservation target) { + + } + + @Override + protected void updateToPass(AssessmentScaleSupportingObservation target) { + target.init(); + + II ii = DatatypesFactory.eINSTANCE.createII(); + target.getIds().add(ii); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentScaleSupportingObservationOperations.validateAssessmentScaleSupportingObservationId( + (AssessmentScaleSupportingObservation) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentScaleSupportingObservationIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAssessmentScaleSupportingObservationStatusCode() { + OperationsTestCase validateAssessmentScaleSupportingObservationStatusCodeTestCase = new OperationsTestCase( + "validateAssessmentScaleSupportingObservationStatusCode", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_SCALE_SUPPORTING_OBSERVATION_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentScaleSupportingObservation target) { + + } + + @Override + protected void updateToPass(AssessmentScaleSupportingObservation target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentScaleSupportingObservationOperations.validateAssessmentScaleSupportingObservationStatusCode( + (AssessmentScaleSupportingObservation) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentScaleSupportingObservationStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAssessmentScaleSupportingObservationStatusCodeP() { + OperationsTestCase validateAssessmentScaleSupportingObservationStatusCodePTestCase = new OperationsTestCase( + "validateAssessmentScaleSupportingObservationStatusCodeP", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_SCALE_SUPPORTING_OBSERVATION_STATUS_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentScaleSupportingObservation target) { + + } + + @Override + protected void updateToPass(AssessmentScaleSupportingObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentScaleSupportingObservationOperations.validateAssessmentScaleSupportingObservationStatusCodeP( + (AssessmentScaleSupportingObservation) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentScaleSupportingObservationStatusCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAssessmentScaleSupportingObservationValue() { + OperationsTestCase validateAssessmentScaleSupportingObservationValueTestCase = new OperationsTestCase( + "validateAssessmentScaleSupportingObservationValue", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_SCALE_SUPPORTING_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentScaleSupportingObservation target) { + + } + + @Override + protected void updateToPass(AssessmentScaleSupportingObservation target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD(); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentScaleSupportingObservationOperations.validateAssessmentScaleSupportingObservationValue( + (AssessmentScaleSupportingObservation) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentScaleSupportingObservationValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends AssessmentScaleSupportingObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public AssessmentScaleSupportingObservation create() { + return ConsolFactory.eINSTANCE.createAssessmentScaleSupportingObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends AssessmentScaleSupportingObservationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // AssessmentScaleSupportingObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/AssessmentSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/AssessmentSectionTest.java new file mode 100644 index 000000000..3ac8a9f41 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/AssessmentSectionTest.java @@ -0,0 +1,290 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.AssessmentSection; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.operations.AssessmentSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Assessment Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AssessmentSection#validateAssessmentSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AssessmentSection#validateAssessmentSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AssessmentSection#validateAssessmentSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AssessmentSection#validateAssessmentSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AssessmentSection#validateAssessmentSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment Section Title}
  • + *
+ *

+ * + * @generated + */ + +public class AssessmentSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateAssessmentSectionTemplateId() { + OperationsTestCase validateAssessmentSectionTemplateIdTestCase = new OperationsTestCase( + "validateAssessmentSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentSection target) { + + } + + @Override + protected void updateToPass(AssessmentSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentSectionOperations.validateAssessmentSectionTemplateId( + (AssessmentSection) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAssessmentSectionCode() { + OperationsTestCase validateAssessmentSectionCodeTestCase = new OperationsTestCase( + "validateAssessmentSectionCode", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentSection target) { + + } + + @Override + protected void updateToPass(AssessmentSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentSectionOperations.validateAssessmentSectionCode( + (AssessmentSection) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAssessmentSectionCodeP() { + OperationsTestCase validateAssessmentSectionCodePTestCase = new OperationsTestCase( + "validateAssessmentSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentSection target) { + + } + + @Override + protected void updateToPass(AssessmentSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentSectionOperations.validateAssessmentSectionCodeP( + (AssessmentSection) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAssessmentSectionText() { + OperationsTestCase validateAssessmentSectionTextTestCase = new OperationsTestCase( + "validateAssessmentSectionText", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentSection target) { + + } + + @Override + protected void updateToPass(AssessmentSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentSectionOperations.validateAssessmentSectionText( + (AssessmentSection) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAssessmentSectionTitle() { + OperationsTestCase validateAssessmentSectionTitleTestCase = new OperationsTestCase( + "validateAssessmentSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentSection target) { + + } + + @Override + protected void updateToPass(AssessmentSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentSectionOperations.validateAssessmentSectionTitle( + (AssessmentSection) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends AssessmentSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public AssessmentSection create() { + return ConsolFactory.eINSTANCE.createAssessmentSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends AssessmentSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // AssessmentSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/AuthorizationActivityTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/AuthorizationActivityTest.java new file mode 100644 index 000000000..36beaa43b --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/AuthorizationActivityTest.java @@ -0,0 +1,970 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.Act; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Encounter; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.Observation; +import org.openhealthtools.mdht.uml.cda.ObservationMedia; +import org.openhealthtools.mdht.uml.cda.Organizer; +import org.openhealthtools.mdht.uml.cda.Procedure; +import org.openhealthtools.mdht.uml.cda.RegionOfInterest; +import org.openhealthtools.mdht.uml.cda.SubstanceAdministration; +import org.openhealthtools.mdht.uml.cda.Supply; +import org.openhealthtools.mdht.uml.cda.consol.AuthorizationActivity; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.operations.AuthorizationActivityOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.vocab.ActMood; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActMoodDocumentObservation; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; +import org.openhealthtools.mdht.uml.hl7.vocab.x_DocumentActMood; +import org.openhealthtools.mdht.uml.hl7.vocab.x_DocumentEncounterMood; +import org.openhealthtools.mdht.uml.hl7.vocab.x_DocumentProcedureMood; +import org.openhealthtools.mdht.uml.hl7.vocab.x_DocumentSubstanceMood; + +/** + * + * A static utility class that provides operations related to 'Authorization Activity' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AuthorizationActivity#validateAuthorizationActivityTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Authorization Activity Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AuthorizationActivity#validateAuthorizationActivityClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Authorization Activity Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AuthorizationActivity#validateAuthorizationActivityId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Authorization Activity Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AuthorizationActivity#validateAuthorizationActivityMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Authorization Activity Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AuthorizationActivity#validateAuthorizationActivityEntryRelationship(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Authorization Activity Entry Relationship}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AuthorizationActivity#validateAuthorizationActivityEntryRelationshipHasClinicalStatement(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Authorization Activity Entry Relationship Has Clinical Statement}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AuthorizationActivity#validateAuthorizationActivityEntryRelationshipHasAuthorizedPerformers(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Authorization Activity Entry Relationship Has Authorized Performers}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.AuthorizationActivity#validateAuthorizationActivityEntryRelationshipTypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Authorization Activity Entry Relationship Type Code}
  • + *
+ *

+ * + * @generated + */ + +public class AuthorizationActivityTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateAuthorizationActivityTemplateId() { + OperationsTestCase validateAuthorizationActivityTemplateIdTestCase = new OperationsTestCase( + "validateAuthorizationActivityTemplateId", + operationsForOCL.getOCLValue("VALIDATE_AUTHORIZATION_ACTIVITY_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AuthorizationActivity target) { + + } + + @Override + protected void updateToPass(AuthorizationActivity target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AuthorizationActivityOperations.validateAuthorizationActivityTemplateId( + (AuthorizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateAuthorizationActivityTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAuthorizationActivityClassCode() { + OperationsTestCase validateAuthorizationActivityClassCodeTestCase = new OperationsTestCase( + "validateAuthorizationActivityClassCode", + operationsForOCL.getOCLValue("VALIDATE_AUTHORIZATION_ACTIVITY_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AuthorizationActivity target) { + + } + + @Override + protected void updateToPass(AuthorizationActivity target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AuthorizationActivityOperations.validateAuthorizationActivityClassCode( + (AuthorizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateAuthorizationActivityClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAuthorizationActivityId() { + OperationsTestCase validateAuthorizationActivityIdTestCase = new OperationsTestCase( + "validateAuthorizationActivityId", + operationsForOCL.getOCLValue("VALIDATE_AUTHORIZATION_ACTIVITY_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AuthorizationActivity target) { + target.init(); + } + + @Override + protected void updateToPass(AuthorizationActivity target) { + + target.getIds().add(DatatypesFactory.eINSTANCE.createII()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AuthorizationActivityOperations.validateAuthorizationActivityId( + (AuthorizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateAuthorizationActivityIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAuthorizationActivityMoodCode() { + OperationsTestCase validateAuthorizationActivityMoodCodeTestCase = new OperationsTestCase( + "validateAuthorizationActivityMoodCode", + operationsForOCL.getOCLValue("VALIDATE_AUTHORIZATION_ACTIVITY_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AuthorizationActivity target) { + + } + + @Override + protected void updateToPass(AuthorizationActivity target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AuthorizationActivityOperations.validateAuthorizationActivityMoodCode( + (AuthorizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateAuthorizationActivityMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAuthorizationActivityEntryRelationship() { + OperationsTestCase validateAuthorizationActivityEntryRelationshipTestCase = new OperationsTestCase( + "validateAuthorizationActivityEntryRelationship", + operationsForOCL.getOCLValue("VALIDATE_AUTHORIZATION_ACTIVITY_ENTRY_RELATIONSHIP__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AuthorizationActivity target) { + target.init(); + } + + @Override + protected void updateToPass(AuthorizationActivity target) { + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AuthorizationActivityOperations.validateAuthorizationActivityEntryRelationship( + (AuthorizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateAuthorizationActivityEntryRelationshipTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAuthorizationActivityEntryRelationshipHasClinicalStatement() { + OperationsTestCase validateAuthorizationActivityEntryRelationshipHasClinicalStatementTestCase = new OperationsTestCase( + "validateAuthorizationActivityEntryRelationshipHasClinicalStatement", + operationsForOCL.getOCLValue("VALIDATE_AUTHORIZATION_ACTIVITY_ENTRY_RELATIONSHIP_HAS_CLINICAL_STATEMENT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + public void addFailTests() { + addFailTest(new FailTest() { + + @Override + public void updateToFail(AuthorizationActivity target) { + target.init(); + Act clinicalStatement = CDAFactory.eINSTANCE.createAct(); + // clinicalStatement.setMoodCode(x_DocumentActMood.PRMS); + target.addAct(clinicalStatement); + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + } + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(AuthorizationActivity target) { + target.init(); + Encounter clinicalStatement = CDAFactory.eINSTANCE.createEncounter(); + + target.addEncounter(clinicalStatement); + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + } + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(AuthorizationActivity target) { + target.init(); + Observation clinicalStatement = CDAFactory.eINSTANCE.createObservation(); + target.addObservation(clinicalStatement); + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + } + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(AuthorizationActivity target) { + target.init(); + ObservationMedia clinicalStatement = CDAFactory.eINSTANCE.createObservationMedia(); + target.addObservationMedia(clinicalStatement); + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + } + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(AuthorizationActivity target) { + target.init(); + Organizer clinicalStatement = CDAFactory.eINSTANCE.createOrganizer(); + target.addOrganizer(clinicalStatement); + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + } + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(AuthorizationActivity target) { + target.init(); + Procedure clinicalStatement = CDAFactory.eINSTANCE.createProcedure(); + target.addProcedure(clinicalStatement); + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + } + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(AuthorizationActivity target) { + target.init(); + RegionOfInterest clinicalStatement = CDAFactory.eINSTANCE.createRegionOfInterest(); + target.addRegionOfInterest(clinicalStatement); + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + } + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(AuthorizationActivity target) { + target.init(); + SubstanceAdministration clinicalStatement = CDAFactory.eINSTANCE.createSubstanceAdministration(); + target.addSubstanceAdministration(clinicalStatement); + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + } + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(AuthorizationActivity target) { + target.init(); + Supply clinicalStatement = CDAFactory.eINSTANCE.createSupply(); + target.addSupply(clinicalStatement); + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + } + } + }); + + } + + @Override + public void addPassTests() { + addPassTest(new PassTest() { + + @Override + public void updateToPass(AuthorizationActivity target) { + target.init(); + Act act = CDAFactory.eINSTANCE.createAct(); + act.getPerformers().add(CDAFactory.eINSTANCE.createPerformer2()); + act.setMoodCode(x_DocumentActMood.PRMS); + target.addAct(act); + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + } + } + }); + + addPassTest(new PassTest() { + + @Override + public void updateToPass(AuthorizationActivity target) { + target.init(); + Encounter clinicalStatement = CDAFactory.eINSTANCE.createEncounter(); + clinicalStatement.getPerformers().add(CDAFactory.eINSTANCE.createPerformer2()); + + clinicalStatement.setMoodCode(x_DocumentEncounterMood.PRMS); + target.addEncounter(clinicalStatement); + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + } + } + }); + + addPassTest(new PassTest() { + + @Override + public void updateToPass(AuthorizationActivity target) { + target.init(); + Observation clinicalStatement = CDAFactory.eINSTANCE.createObservation(); + clinicalStatement.setMoodCode(x_ActMoodDocumentObservation.PRMS); + clinicalStatement.getPerformers().add(CDAFactory.eINSTANCE.createPerformer2()); + target.addObservation(clinicalStatement); + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + } + } + }); + + addPassTest(new PassTest() { + + @Override + public void updateToPass(AuthorizationActivity target) { + target.init(); + ObservationMedia clinicalStatement = CDAFactory.eINSTANCE.createObservationMedia(); + + clinicalStatement.setMoodCode(ActMood.PRMS); + clinicalStatement.getPerformers().add(CDAFactory.eINSTANCE.createPerformer2()); + target.addObservationMedia(clinicalStatement); + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + } + } + }); + + addPassTest(new PassTest() { + + @Override + public void updateToPass(AuthorizationActivity target) { + target.init(); + Organizer clinicalStatement = CDAFactory.eINSTANCE.createOrganizer(); + + clinicalStatement.setMoodCode(ActMood.PRMS); + clinicalStatement.getPerformers().add(CDAFactory.eINSTANCE.createPerformer2()); + target.addOrganizer(clinicalStatement); + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + } + } + }); + + addPassTest(new PassTest() { + + @Override + public void updateToPass(AuthorizationActivity target) { + target.init(); + Procedure clinicalStatement = CDAFactory.eINSTANCE.createProcedure(); + + clinicalStatement.setMoodCode(x_DocumentProcedureMood.PRMS); + clinicalStatement.getPerformers().add(CDAFactory.eINSTANCE.createPerformer2()); + target.addProcedure(clinicalStatement); + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + } + } + }); + + addPassTest(new PassTest() { + + @Override + public void updateToPass(AuthorizationActivity target) { + target.init(); + RegionOfInterest clinicalStatement = CDAFactory.eINSTANCE.createRegionOfInterest(); + + clinicalStatement.setMoodCode(ActMood.PRMS); + clinicalStatement.getPerformers().add(CDAFactory.eINSTANCE.createPerformer2()); + target.addRegionOfInterest(clinicalStatement); + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + } + } + }); + + addPassTest(new PassTest() { + + @Override + public void updateToPass(AuthorizationActivity target) { + target.init(); + SubstanceAdministration clinicalStatement = CDAFactory.eINSTANCE.createSubstanceAdministration(); + + clinicalStatement.setMoodCode(x_DocumentSubstanceMood.PRMS); + clinicalStatement.getPerformers().add(CDAFactory.eINSTANCE.createPerformer2()); + target.addSubstanceAdministration(clinicalStatement); + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + } + } + }); + + addPassTest(new PassTest() { + + @Override + public void updateToPass(AuthorizationActivity target) { + target.init(); + Supply clinicalStatement = CDAFactory.eINSTANCE.createSupply(); + + clinicalStatement.setMoodCode(x_DocumentSubstanceMood.PRMS); + clinicalStatement.getPerformers().add(CDAFactory.eINSTANCE.createPerformer2()); + target.addSupply(clinicalStatement); + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + } + } + }); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AuthorizationActivityOperations.validateAuthorizationActivityEntryRelationshipHasClinicalStatement( + (AuthorizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateAuthorizationActivityEntryRelationshipHasClinicalStatementTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAuthorizationActivityEntryRelationshipHasAuthorizedPerformers() { + OperationsTestCase validateAuthorizationActivityEntryRelationshipHasAuthorizedPerformersTestCase = new OperationsTestCase( + "validateAuthorizationActivityEntryRelationshipHasAuthorizedPerformers", + operationsForOCL.getOCLValue("VALIDATE_AUTHORIZATION_ACTIVITY_ENTRY_RELATIONSHIP_HAS_AUTHORIZED_PERFORMERS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + public void addFailTests() { + addFailTest(new FailTest() { + + @Override + public void updateToFail(AuthorizationActivity target) { + target.init(); + Act act = CDAFactory.eINSTANCE.createAct(); + act.setMoodCode(x_DocumentActMood.PRMS); + target.addAct(act); + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + } + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(AuthorizationActivity target) { + target.init(); + Encounter clinicalStatement = CDAFactory.eINSTANCE.createEncounter(); + // clinicalStatement.getPerformers().add(CDAFactory.eINSTANCE.createPerformer2()); + + clinicalStatement.setMoodCode(x_DocumentEncounterMood.PRMS); + target.addEncounter(clinicalStatement); + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + } + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(AuthorizationActivity target) { + target.init(); + Observation clinicalStatement = CDAFactory.eINSTANCE.createObservation(); + clinicalStatement.setMoodCode(x_ActMoodDocumentObservation.PRMS); + // clinicalStatement.getPerformers().add(CDAFactory.eINSTANCE.createPerformer2()); + target.addObservation(clinicalStatement); + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + } + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(AuthorizationActivity target) { + target.init(); + ObservationMedia clinicalStatement = CDAFactory.eINSTANCE.createObservationMedia(); + + clinicalStatement.setMoodCode(ActMood.PRMS); + // clinicalStatement.getPerformers().add(CDAFactory.eINSTANCE.createPerformer2()); + target.addObservationMedia(clinicalStatement); + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + } + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(AuthorizationActivity target) { + target.init(); + Organizer clinicalStatement = CDAFactory.eINSTANCE.createOrganizer(); + + clinicalStatement.setMoodCode(ActMood.PRMS); + // clinicalStatement.getPerformers().add(CDAFactory.eINSTANCE.createPerformer2()); + target.addOrganizer(clinicalStatement); + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + } + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(AuthorizationActivity target) { + target.init(); + Procedure clinicalStatement = CDAFactory.eINSTANCE.createProcedure(); + + clinicalStatement.setMoodCode(x_DocumentProcedureMood.PRMS); + // clinicalStatement.getPerformers().add(CDAFactory.eINSTANCE.createPerformer2()); + target.addProcedure(clinicalStatement); + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + } + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(AuthorizationActivity target) { + target.init(); + RegionOfInterest clinicalStatement = CDAFactory.eINSTANCE.createRegionOfInterest(); + + clinicalStatement.setMoodCode(ActMood.PRMS); + // clinicalStatement.getPerformers().add(CDAFactory.eINSTANCE.createPerformer2()); + target.addRegionOfInterest(clinicalStatement); + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + } + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(AuthorizationActivity target) { + target.init(); + SubstanceAdministration clinicalStatement = CDAFactory.eINSTANCE.createSubstanceAdministration(); + + clinicalStatement.setMoodCode(x_DocumentSubstanceMood.PRMS); + // clinicalStatement.getPerformers().add(CDAFactory.eINSTANCE.createPerformer2()); + target.addSubstanceAdministration(clinicalStatement); + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + } + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(AuthorizationActivity target) { + target.init(); + Supply clinicalStatement = CDAFactory.eINSTANCE.createSupply(); + + clinicalStatement.setMoodCode(x_DocumentSubstanceMood.PRMS); + // clinicalStatement.getPerformers().add(CDAFactory.eINSTANCE.createPerformer2()); + target.addSupply(clinicalStatement); + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + } + } + }); + + } + + @Override + public void addPassTests() { + addPassTest(new PassTest() { + + @Override + public void updateToPass(AuthorizationActivity target) { + target.init(); + Act act = CDAFactory.eINSTANCE.createAct(); + act.getPerformers().add(CDAFactory.eINSTANCE.createPerformer2()); + act.setMoodCode(x_DocumentActMood.PRMS); + target.addAct(act); + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + } + } + }); + + addPassTest(new PassTest() { + + @Override + public void updateToPass(AuthorizationActivity target) { + target.init(); + Encounter clinicalStatement = CDAFactory.eINSTANCE.createEncounter(); + clinicalStatement.getPerformers().add(CDAFactory.eINSTANCE.createPerformer2()); + + clinicalStatement.setMoodCode(x_DocumentEncounterMood.PRMS); + target.addEncounter(clinicalStatement); + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + } + } + }); + + addPassTest(new PassTest() { + + @Override + public void updateToPass(AuthorizationActivity target) { + target.init(); + Observation clinicalStatement = CDAFactory.eINSTANCE.createObservation(); + clinicalStatement.setMoodCode(x_ActMoodDocumentObservation.PRMS); + clinicalStatement.getPerformers().add(CDAFactory.eINSTANCE.createPerformer2()); + target.addObservation(clinicalStatement); + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + } + } + }); + + addPassTest(new PassTest() { + + @Override + public void updateToPass(AuthorizationActivity target) { + target.init(); + ObservationMedia clinicalStatement = CDAFactory.eINSTANCE.createObservationMedia(); + + clinicalStatement.setMoodCode(ActMood.PRMS); + clinicalStatement.getPerformers().add(CDAFactory.eINSTANCE.createPerformer2()); + target.addObservationMedia(clinicalStatement); + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + } + } + }); + + addPassTest(new PassTest() { + + @Override + public void updateToPass(AuthorizationActivity target) { + target.init(); + Organizer clinicalStatement = CDAFactory.eINSTANCE.createOrganizer(); + + clinicalStatement.setMoodCode(ActMood.PRMS); + clinicalStatement.getPerformers().add(CDAFactory.eINSTANCE.createPerformer2()); + target.addOrganizer(clinicalStatement); + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + } + } + }); + + addPassTest(new PassTest() { + + @Override + public void updateToPass(AuthorizationActivity target) { + target.init(); + Procedure clinicalStatement = CDAFactory.eINSTANCE.createProcedure(); + + clinicalStatement.setMoodCode(x_DocumentProcedureMood.PRMS); + clinicalStatement.getPerformers().add(CDAFactory.eINSTANCE.createPerformer2()); + target.addProcedure(clinicalStatement); + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + } + } + }); + + addPassTest(new PassTest() { + + @Override + public void updateToPass(AuthorizationActivity target) { + target.init(); + RegionOfInterest clinicalStatement = CDAFactory.eINSTANCE.createRegionOfInterest(); + + clinicalStatement.setMoodCode(ActMood.PRMS); + clinicalStatement.getPerformers().add(CDAFactory.eINSTANCE.createPerformer2()); + target.addRegionOfInterest(clinicalStatement); + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + } + } + }); + + addPassTest(new PassTest() { + + @Override + public void updateToPass(AuthorizationActivity target) { + target.init(); + SubstanceAdministration clinicalStatement = CDAFactory.eINSTANCE.createSubstanceAdministration(); + + clinicalStatement.setMoodCode(x_DocumentSubstanceMood.PRMS); + clinicalStatement.getPerformers().add(CDAFactory.eINSTANCE.createPerformer2()); + target.addSubstanceAdministration(clinicalStatement); + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + } + } + }); + + addPassTest(new PassTest() { + + @Override + public void updateToPass(AuthorizationActivity target) { + target.init(); + Supply clinicalStatement = CDAFactory.eINSTANCE.createSupply(); + + clinicalStatement.setMoodCode(x_DocumentSubstanceMood.PRMS); + clinicalStatement.getPerformers().add(CDAFactory.eINSTANCE.createPerformer2()); + target.addSupply(clinicalStatement); + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + } + } + }); + + } + + // @Override + // protected void updateToFail(AuthorizationActivity target) { + // target.init(); + // Act clinicalStatement = CDAFactory.eINSTANCE.createAct(); + // clinicalStatement.getPerformers().add(CDAFactory.eINSTANCE.createPerformer2()); + // clinicalStatement.setMoodCode(x_DocumentActMood.PRMS); + // target.addAct(clinicalStatement); + // for (EntryRelationship er : target.getEntryRelationships()) { + // er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + // } + // } + // + // @Override + // protected void updateToPass(AuthorizationActivity target) { + // target.getEntryRelationships().clear(); + // Act clinicalStatement = CDAFactory.eINSTANCE.createAct(); + // clinicalStatement.getPerformers().add(CDAFactory.eINSTANCE.createPerformer2()); + // clinicalStatement.setMoodCode(x_DocumentActMood.PRMS); + // target.addAct(clinicalStatement); + // for (EntryRelationship er : target.getEntryRelationships()) { + // er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + // } + // } + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AuthorizationActivityOperations.validateAuthorizationActivityEntryRelationshipHasAuthorizedPerformers( + (AuthorizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateAuthorizationActivityEntryRelationshipHasAuthorizedPerformersTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAuthorizationActivityEntryRelationshipTypeCode() { + OperationsTestCase validateAuthorizationActivityEntryRelationshipTypeCodeTestCase = new OperationsTestCase( + "validateAuthorizationActivityEntryRelationshipTypeCode", + operationsForOCL.getOCLValue("VALIDATE_AUTHORIZATION_ACTIVITY_ENTRY_RELATIONSHIP_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + { + this.skipFailsTest(); + } + + @Override + protected void updateToPass(AuthorizationActivity target) { + target.init(); + target.getEntryRelationships().clear(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AuthorizationActivityOperations.validateAuthorizationActivityEntryRelationshipTypeCode( + (AuthorizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateAuthorizationActivityEntryRelationshipTypeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends AuthorizationActivityOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public AuthorizationActivity create() { + return ConsolFactory.eINSTANCE.createAuthorizationActivity(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends AuthorizationActivityOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // AuthorizationActivityOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/BoundaryObservationTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/BoundaryObservationTest.java new file mode 100644 index 000000000..1dfedbc43 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/BoundaryObservationTest.java @@ -0,0 +1,286 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.consol.BoundaryObservation; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.operations.BoundaryObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; + +/** + * + * A static utility class that provides operations related to 'Boundary Observation' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.BoundaryObservation#validateBoundaryObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Boundary Observation Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.BoundaryObservation#validateBoundaryObservationClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Boundary Observation Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.BoundaryObservation#validateBoundaryObservationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Boundary Observation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.BoundaryObservation#validateBoundaryObservationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Boundary Observation Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.BoundaryObservation#validateBoundaryObservationValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Boundary Observation Value}
  • + *
+ *

+ * + * @generated + */ + +public class BoundaryObservationTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateBoundaryObservationTemplateId() { + OperationsTestCase validateBoundaryObservationTemplateIdTestCase = new OperationsTestCase( + "validateBoundaryObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_BOUNDARY_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(BoundaryObservation target) { + + } + + @Override + protected void updateToPass(BoundaryObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return BoundaryObservationOperations.validateBoundaryObservationTemplateId( + (BoundaryObservation) objectToTest, diagnostician, map); + } + + }; + + validateBoundaryObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateBoundaryObservationClassCode() { + OperationsTestCase validateBoundaryObservationClassCodeTestCase = new OperationsTestCase( + "validateBoundaryObservationClassCode", + operationsForOCL.getOCLValue("VALIDATE_BOUNDARY_OBSERVATION_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(BoundaryObservation target) { + + } + + @Override + protected void updateToPass(BoundaryObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return BoundaryObservationOperations.validateBoundaryObservationClassCode( + (BoundaryObservation) objectToTest, diagnostician, map); + } + + }; + + validateBoundaryObservationClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateBoundaryObservationCode() { + OperationsTestCase validateBoundaryObservationCodeTestCase = new OperationsTestCase( + "validateBoundaryObservationCode", + operationsForOCL.getOCLValue("VALIDATE_BOUNDARY_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(BoundaryObservation target) { + + } + + @Override + protected void updateToPass(BoundaryObservation target) { + target.init(); + + CD cd = DatatypesFactory.eINSTANCE.createCD("113036", "1.2.840.10008.2.16.4", "", ""); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return BoundaryObservationOperations.validateBoundaryObservationCode( + (BoundaryObservation) objectToTest, diagnostician, map); + } + + }; + + validateBoundaryObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateBoundaryObservationMoodCode() { + OperationsTestCase validateBoundaryObservationMoodCodeTestCase = new OperationsTestCase( + "validateBoundaryObservationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_BOUNDARY_OBSERVATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(BoundaryObservation target) { + + } + + @Override + protected void updateToPass(BoundaryObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return BoundaryObservationOperations.validateBoundaryObservationMoodCode( + (BoundaryObservation) objectToTest, diagnostician, map); + } + + }; + + validateBoundaryObservationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateBoundaryObservationValue() { + OperationsTestCase validateBoundaryObservationValueTestCase = new OperationsTestCase( + "validateBoundaryObservationValue", + operationsForOCL.getOCLValue("VALIDATE_BOUNDARY_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(BoundaryObservation target) { + target.init(); + + } + + @Override + protected void updateToPass(BoundaryObservation target) { + target.getValues().add(DatatypesFactory.eINSTANCE.createINT()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return BoundaryObservationOperations.validateBoundaryObservationValue( + (BoundaryObservation) objectToTest, diagnostician, map); + } + + }; + + validateBoundaryObservationValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends BoundaryObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public BoundaryObservation create() { + return ConsolFactory.eINSTANCE.createBoundaryObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends BoundaryObservationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // BoundaryObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/CaregiverCharacteristicsTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/CaregiverCharacteristicsTest.java new file mode 100644 index 000000000..435792dd0 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/CaregiverCharacteristicsTest.java @@ -0,0 +1,672 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Participant2; +import org.openhealthtools.mdht.uml.cda.ParticipantRole; +import org.openhealthtools.mdht.uml.cda.consol.CaregiverCharacteristics; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.operations.CaregiverCharacteristicsOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.vocab.RoleClassRoot; + +/** + * + * A static utility class that provides operations related to 'Caregiver Characteristics' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CaregiverCharacteristics#validateCaregiverCharacteristicsValueCodeSystem(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Caregiver Characteristics Value Code System}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CaregiverCharacteristics#validateCaregiverCharacteristicsTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Caregiver Characteristics Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CaregiverCharacteristics#validateCaregiverCharacteristicsClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Caregiver Characteristics Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CaregiverCharacteristics#validateCaregiverCharacteristicsMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Caregiver Characteristics Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CaregiverCharacteristics#validateCaregiverCharacteristicsId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Caregiver Characteristics Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CaregiverCharacteristics#validateCaregiverCharacteristicsCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Caregiver Characteristics Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CaregiverCharacteristics#validateCaregiverCharacteristicsStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Caregiver Characteristics Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CaregiverCharacteristics#validateCaregiverCharacteristicsStatusCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Caregiver Characteristics Status Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CaregiverCharacteristics#validateCaregiverCharacteristicsValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Caregiver Characteristics Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CaregiverCharacteristics#validateCaregiverCharacteristicsParticipant(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Caregiver Characteristics Participant}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CaregiverCharacteristics#validateCaregiverCharacteristicsParticipantParticipantRoleClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Caregiver Characteristics Participant Participant Role Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CaregiverCharacteristics#validateCaregiverCharacteristicsParticipantTimeLow(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Caregiver Characteristics Participant Time Low}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CaregiverCharacteristics#validateCaregiverCharacteristicsParticipantTimeHigh(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Caregiver Characteristics Participant Time High}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CaregiverCharacteristics#validateCaregiverCharacteristicsParticipantTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Caregiver Characteristics Participant Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CaregiverCharacteristics#validateCaregiverCharacteristicsParticipantParticipantRole(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Caregiver Characteristics Participant Participant Role}
  • + *
+ *

+ * + * @generated + */ + +public class CaregiverCharacteristicsTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateCaregiverCharacteristicsValueCodeSystem() { + OperationsTestCase validateCaregiverCharacteristicsValueCodeSystemTestCase = new OperationsTestCase( + "validateCaregiverCharacteristicsValueCodeSystem", + operationsForOCL.getOCLValue("VALIDATE_CAREGIVER_CHARACTERISTICS_VALUE_CODE_SYSTEM__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CaregiverCharacteristics target) { + target.init(); + target.getValues().add(DatatypesFactory.eINSTANCE.createCD("", "1.2.3.4", "", "")); + } + + @Override + protected void updateToPass(CaregiverCharacteristics target) { + target.getValues().clear(); + target.getValues().add(DatatypesFactory.eINSTANCE.createCD("", "2.16.840.1.113883.6.1", "", "")); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CaregiverCharacteristicsOperations.validateCaregiverCharacteristicsValueCodeSystem( + (CaregiverCharacteristics) objectToTest, diagnostician, map); + } + + }; + + validateCaregiverCharacteristicsValueCodeSystemTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCaregiverCharacteristicsTemplateId() { + OperationsTestCase validateCaregiverCharacteristicsTemplateIdTestCase = new OperationsTestCase( + "validateCaregiverCharacteristicsTemplateId", + operationsForOCL.getOCLValue("VALIDATE_CAREGIVER_CHARACTERISTICS_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CaregiverCharacteristics target) { + + } + + @Override + protected void updateToPass(CaregiverCharacteristics target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CaregiverCharacteristicsOperations.validateCaregiverCharacteristicsTemplateId( + (CaregiverCharacteristics) objectToTest, diagnostician, map); + } + + }; + + validateCaregiverCharacteristicsTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCaregiverCharacteristicsClassCode() { + OperationsTestCase validateCaregiverCharacteristicsClassCodeTestCase = new OperationsTestCase( + "validateCaregiverCharacteristicsClassCode", + operationsForOCL.getOCLValue("VALIDATE_CAREGIVER_CHARACTERISTICS_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CaregiverCharacteristics target) { + + } + + @Override + protected void updateToPass(CaregiverCharacteristics target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CaregiverCharacteristicsOperations.validateCaregiverCharacteristicsClassCode( + (CaregiverCharacteristics) objectToTest, diagnostician, map); + } + + }; + + validateCaregiverCharacteristicsClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCaregiverCharacteristicsMoodCode() { + OperationsTestCase validateCaregiverCharacteristicsMoodCodeTestCase = new OperationsTestCase( + "validateCaregiverCharacteristicsMoodCode", + operationsForOCL.getOCLValue("VALIDATE_CAREGIVER_CHARACTERISTICS_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CaregiverCharacteristics target) { + + } + + @Override + protected void updateToPass(CaregiverCharacteristics target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CaregiverCharacteristicsOperations.validateCaregiverCharacteristicsMoodCode( + (CaregiverCharacteristics) objectToTest, diagnostician, map); + } + + }; + + validateCaregiverCharacteristicsMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCaregiverCharacteristicsId() { + OperationsTestCase validateCaregiverCharacteristicsIdTestCase = new OperationsTestCase( + "validateCaregiverCharacteristicsId", + operationsForOCL.getOCLValue("VALIDATE_CAREGIVER_CHARACTERISTICS_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CaregiverCharacteristics target) { + + } + + @Override + protected void updateToPass(CaregiverCharacteristics target) { + target.init(); + target.getIds().add(DatatypesFactory.eINSTANCE.createII()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CaregiverCharacteristicsOperations.validateCaregiverCharacteristicsId( + (CaregiverCharacteristics) objectToTest, diagnostician, map); + } + + }; + + validateCaregiverCharacteristicsIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCaregiverCharacteristicsCode() { + OperationsTestCase validateCaregiverCharacteristicsCodeTestCase = new OperationsTestCase( + "validateCaregiverCharacteristicsCode", + operationsForOCL.getOCLValue("VALIDATE_CAREGIVER_CHARACTERISTICS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CaregiverCharacteristics target) { + + } + + @Override + protected void updateToPass(CaregiverCharacteristics target) { + target.init(); + target.setCode(DatatypesFactory.eINSTANCE.createCE()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CaregiverCharacteristicsOperations.validateCaregiverCharacteristicsCode( + (CaregiverCharacteristics) objectToTest, diagnostician, map); + } + + }; + + validateCaregiverCharacteristicsCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCaregiverCharacteristicsStatusCode() { + OperationsTestCase validateCaregiverCharacteristicsStatusCodeTestCase = new OperationsTestCase( + "validateCaregiverCharacteristicsStatusCode", + operationsForOCL.getOCLValue("VALIDATE_CAREGIVER_CHARACTERISTICS_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CaregiverCharacteristics target) { + + } + + @Override + protected void updateToPass(CaregiverCharacteristics target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CaregiverCharacteristicsOperations.validateCaregiverCharacteristicsStatusCode( + (CaregiverCharacteristics) objectToTest, diagnostician, map); + } + + }; + + validateCaregiverCharacteristicsStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCaregiverCharacteristicsStatusCodeP() { + OperationsTestCase validateCaregiverCharacteristicsStatusCodePTestCase = new OperationsTestCase( + "validateCaregiverCharacteristicsStatusCodeP", + operationsForOCL.getOCLValue("VALIDATE_CAREGIVER_CHARACTERISTICS_STATUS_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CaregiverCharacteristics target) { + + } + + @Override + protected void updateToPass(CaregiverCharacteristics target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CaregiverCharacteristicsOperations.validateCaregiverCharacteristicsStatusCodeP( + (CaregiverCharacteristics) objectToTest, diagnostician, map); + } + + }; + + validateCaregiverCharacteristicsStatusCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCaregiverCharacteristicsValue() { + OperationsTestCase validateCaregiverCharacteristicsValueTestCase = new OperationsTestCase( + "validateCaregiverCharacteristicsValue", + operationsForOCL.getOCLValue("VALIDATE_CAREGIVER_CHARACTERISTICS_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CaregiverCharacteristics target) { + + } + + @Override + protected void updateToPass(CaregiverCharacteristics target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD(); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CaregiverCharacteristicsOperations.validateCaregiverCharacteristicsValue( + (CaregiverCharacteristics) objectToTest, diagnostician, map); + } + + }; + + validateCaregiverCharacteristicsValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCaregiverCharacteristicsParticipant() { + OperationsTestCase validateCaregiverCharacteristicsParticipantTestCase = new OperationsTestCase( + "validateCaregiverCharacteristicsParticipant", + operationsForOCL.getOCLValue("VALIDATE_CAREGIVER_CHARACTERISTICS_PARTICIPANT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CaregiverCharacteristics target) { + + } + + @Override + protected void updateToPass(CaregiverCharacteristics target) { + target.init(); + target.getParticipants().add(CDAFactory.eINSTANCE.createParticipant2()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CaregiverCharacteristicsOperations.validateCaregiverCharacteristicsParticipant( + (CaregiverCharacteristics) objectToTest, diagnostician, map); + } + + }; + + validateCaregiverCharacteristicsParticipantTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCaregiverCharacteristicsParticipantParticipantRoleClassCode() { + OperationsTestCase validateCaregiverCharacteristicsParticipantParticipantRoleClassCodeTestCase = new OperationsTestCase( + "validateCaregiverCharacteristicsParticipantParticipantRoleClassCode", + operationsForOCL.getOCLValue("VALIDATE_CAREGIVER_CHARACTERISTICS_PARTICIPANT_PARTICIPANT_ROLE_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CaregiverCharacteristics target) { + target.init(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + par.setParticipantRole(pr); + target.getParticipants().add(par); + } + + @Override + protected void updateToPass(CaregiverCharacteristics target) { + target.getParticipants().clear(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + pr.setClassCode(RoleClassRoot.PART); + par.setParticipantRole(pr); + target.getParticipants().add(par); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CaregiverCharacteristicsOperations.validateCaregiverCharacteristicsParticipantParticipantRoleClassCode( + (CaregiverCharacteristics) objectToTest, diagnostician, map); + } + + }; + + validateCaregiverCharacteristicsParticipantParticipantRoleClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCaregiverCharacteristicsParticipantTimeLow() { + OperationsTestCase validateCaregiverCharacteristicsParticipantTimeLowTestCase = new OperationsTestCase( + "validateCaregiverCharacteristicsParticipantTimeLow", + operationsForOCL.getOCLValue("VALIDATE_CAREGIVER_CHARACTERISTICS_PARTICIPANT_TIME_LOW__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CaregiverCharacteristics target) { + target.init(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setTime(DatatypesFactory.eINSTANCE.createIVL_TS()); + target.getParticipants().add(par); + } + + @Override + protected void updateToPass(CaregiverCharacteristics target) { + target.getParticipants().clear(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setTime(DatatypesFactory.eINSTANCE.createIVL_TS("1", "2")); + target.getParticipants().add(par); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CaregiverCharacteristicsOperations.validateCaregiverCharacteristicsParticipantTimeLow( + (CaregiverCharacteristics) objectToTest, diagnostician, map); + } + + }; + + validateCaregiverCharacteristicsParticipantTimeLowTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCaregiverCharacteristicsParticipantTimeHigh() { + OperationsTestCase validateCaregiverCharacteristicsParticipantTimeHighTestCase = new OperationsTestCase( + "validateCaregiverCharacteristicsParticipantTimeHigh", + operationsForOCL.getOCLValue("VALIDATE_CAREGIVER_CHARACTERISTICS_PARTICIPANT_TIME_HIGH__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CaregiverCharacteristics target) { + target.init(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setTime(DatatypesFactory.eINSTANCE.createIVL_TS()); + target.getParticipants().add(par); + } + + @Override + protected void updateToPass(CaregiverCharacteristics target) { + target.getParticipants().clear(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setTime(DatatypesFactory.eINSTANCE.createIVL_TS("1", "2")); + target.getParticipants().add(par); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CaregiverCharacteristicsOperations.validateCaregiverCharacteristicsParticipantTimeHigh( + (CaregiverCharacteristics) objectToTest, diagnostician, map); + } + + }; + + validateCaregiverCharacteristicsParticipantTimeHighTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCaregiverCharacteristicsParticipantTime() { + OperationsTestCase validateCaregiverCharacteristicsParticipantTimeTestCase = new OperationsTestCase( + "validateCaregiverCharacteristicsParticipantTime", + operationsForOCL.getOCLValue("VALIDATE_CAREGIVER_CHARACTERISTICS_PARTICIPANT_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CaregiverCharacteristics target) { + target.init(); + target.getParticipants().add(CDAFactory.eINSTANCE.createParticipant2()); + } + + @Override + protected void updateToPass(CaregiverCharacteristics target) { + target.getParticipants().clear(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setTime(DatatypesFactory.eINSTANCE.createIVL_TS("1", "2")); + target.getParticipants().add(par); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CaregiverCharacteristicsOperations.validateCaregiverCharacteristicsParticipantTime( + (CaregiverCharacteristics) objectToTest, diagnostician, map); + } + + }; + + validateCaregiverCharacteristicsParticipantTimeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCaregiverCharacteristicsParticipantParticipantRole() { + OperationsTestCase validateCaregiverCharacteristicsParticipantParticipantRoleTestCase = new OperationsTestCase( + "validateCaregiverCharacteristicsParticipantParticipantRole", + operationsForOCL.getOCLValue("VALIDATE_CAREGIVER_CHARACTERISTICS_PARTICIPANT_PARTICIPANT_ROLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CaregiverCharacteristics target) { + target.init(); + target.getParticipants().add(CDAFactory.eINSTANCE.createParticipant2()); + } + + @Override + protected void updateToPass(CaregiverCharacteristics target) { + target.getParticipants().clear(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + par.setParticipantRole(pr); + target.getParticipants().add(par); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CaregiverCharacteristicsOperations.validateCaregiverCharacteristicsParticipantParticipantRole( + (CaregiverCharacteristics) objectToTest, diagnostician, map); + } + + }; + + validateCaregiverCharacteristicsParticipantParticipantRoleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends CaregiverCharacteristicsOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public CaregiverCharacteristics create() { + return ConsolFactory.eINSTANCE.createCaregiverCharacteristics(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends CaregiverCharacteristicsOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // CaregiverCharacteristicsOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ChiefComplaintAndReasonForVisitSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ChiefComplaintAndReasonForVisitSectionTest.java new file mode 100644 index 000000000..7bfa4f640 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ChiefComplaintAndReasonForVisitSectionTest.java @@ -0,0 +1,290 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ChiefComplaintAndReasonForVisitSection; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.operations.ChiefComplaintAndReasonForVisitSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Chief Complaint And Reason For Visit Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ChiefComplaintAndReasonForVisitSection#validateChiefComplaintAndReasonForVisitSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Chief Complaint And Reason For Visit Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ChiefComplaintAndReasonForVisitSection#validateChiefComplaintAndReasonForVisitSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Chief Complaint And Reason For Visit Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ChiefComplaintAndReasonForVisitSection#validateChiefComplaintAndReasonForVisitSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Chief Complaint And Reason For Visit Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ChiefComplaintAndReasonForVisitSection#validateChiefComplaintAndReasonForVisitSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Chief Complaint And Reason For Visit Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ChiefComplaintAndReasonForVisitSection#validateChiefComplaintAndReasonForVisitSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Chief Complaint And Reason For Visit Section Title}
  • + *
+ *

+ * + * @generated + */ + +public class ChiefComplaintAndReasonForVisitSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateChiefComplaintAndReasonForVisitSectionTemplateId() { + OperationsTestCase validateChiefComplaintAndReasonForVisitSectionTemplateIdTestCase = new OperationsTestCase( + "validateChiefComplaintAndReasonForVisitSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_CHIEF_COMPLAINT_AND_REASON_FOR_VISIT_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ChiefComplaintAndReasonForVisitSection target) { + + } + + @Override + protected void updateToPass(ChiefComplaintAndReasonForVisitSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ChiefComplaintAndReasonForVisitSectionOperations.validateChiefComplaintAndReasonForVisitSectionTemplateId( + (ChiefComplaintAndReasonForVisitSection) objectToTest, diagnostician, map); + } + + }; + + validateChiefComplaintAndReasonForVisitSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateChiefComplaintAndReasonForVisitSectionCode() { + OperationsTestCase validateChiefComplaintAndReasonForVisitSectionCodeTestCase = new OperationsTestCase( + "validateChiefComplaintAndReasonForVisitSectionCode", + operationsForOCL.getOCLValue("VALIDATE_CHIEF_COMPLAINT_AND_REASON_FOR_VISIT_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ChiefComplaintAndReasonForVisitSection target) { + + } + + @Override + protected void updateToPass(ChiefComplaintAndReasonForVisitSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ChiefComplaintAndReasonForVisitSectionOperations.validateChiefComplaintAndReasonForVisitSectionCode( + (ChiefComplaintAndReasonForVisitSection) objectToTest, diagnostician, map); + } + + }; + + validateChiefComplaintAndReasonForVisitSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateChiefComplaintAndReasonForVisitSectionCodeP() { + OperationsTestCase validateChiefComplaintAndReasonForVisitSectionCodePTestCase = new OperationsTestCase( + "validateChiefComplaintAndReasonForVisitSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_CHIEF_COMPLAINT_AND_REASON_FOR_VISIT_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ChiefComplaintAndReasonForVisitSection target) { + + } + + @Override + protected void updateToPass(ChiefComplaintAndReasonForVisitSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ChiefComplaintAndReasonForVisitSectionOperations.validateChiefComplaintAndReasonForVisitSectionCodeP( + (ChiefComplaintAndReasonForVisitSection) objectToTest, diagnostician, map); + } + + }; + + validateChiefComplaintAndReasonForVisitSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateChiefComplaintAndReasonForVisitSectionText() { + OperationsTestCase validateChiefComplaintAndReasonForVisitSectionTextTestCase = new OperationsTestCase( + "validateChiefComplaintAndReasonForVisitSectionText", + operationsForOCL.getOCLValue("VALIDATE_CHIEF_COMPLAINT_AND_REASON_FOR_VISIT_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ChiefComplaintAndReasonForVisitSection target) { + + } + + @Override + protected void updateToPass(ChiefComplaintAndReasonForVisitSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ChiefComplaintAndReasonForVisitSectionOperations.validateChiefComplaintAndReasonForVisitSectionText( + (ChiefComplaintAndReasonForVisitSection) objectToTest, diagnostician, map); + } + + }; + + validateChiefComplaintAndReasonForVisitSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateChiefComplaintAndReasonForVisitSectionTitle() { + OperationsTestCase validateChiefComplaintAndReasonForVisitSectionTitleTestCase = new OperationsTestCase( + "validateChiefComplaintAndReasonForVisitSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_CHIEF_COMPLAINT_AND_REASON_FOR_VISIT_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ChiefComplaintAndReasonForVisitSection target) { + + } + + @Override + protected void updateToPass(ChiefComplaintAndReasonForVisitSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ChiefComplaintAndReasonForVisitSectionOperations.validateChiefComplaintAndReasonForVisitSectionTitle( + (ChiefComplaintAndReasonForVisitSection) objectToTest, diagnostician, map); + } + + }; + + validateChiefComplaintAndReasonForVisitSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ChiefComplaintAndReasonForVisitSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ChiefComplaintAndReasonForVisitSection create() { + return ConsolFactory.eINSTANCE.createChiefComplaintAndReasonForVisitSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ChiefComplaintAndReasonForVisitSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ChiefComplaintAndReasonForVisitSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ChiefComplaintSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ChiefComplaintSectionTest.java new file mode 100644 index 000000000..fa427b07f --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ChiefComplaintSectionTest.java @@ -0,0 +1,290 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ChiefComplaintSection; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.operations.ChiefComplaintSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Chief Complaint Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ChiefComplaintSection#validateChiefComplaintSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Chief Complaint Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ChiefComplaintSection#validateChiefComplaintSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Chief Complaint Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ChiefComplaintSection#validateChiefComplaintSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Chief Complaint Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ChiefComplaintSection#validateChiefComplaintSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Chief Complaint Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ChiefComplaintSection#validateChiefComplaintSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Chief Complaint Section Title}
  • + *
+ *

+ * + * @generated + */ + +public class ChiefComplaintSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateChiefComplaintSectionTemplateId() { + OperationsTestCase validateChiefComplaintSectionTemplateIdTestCase = new OperationsTestCase( + "validateChiefComplaintSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_CHIEF_COMPLAINT_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ChiefComplaintSection target) { + + } + + @Override + protected void updateToPass(ChiefComplaintSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ChiefComplaintSectionOperations.validateChiefComplaintSectionTemplateId( + (ChiefComplaintSection) objectToTest, diagnostician, map); + } + + }; + + validateChiefComplaintSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateChiefComplaintSectionCode() { + OperationsTestCase validateChiefComplaintSectionCodeTestCase = new OperationsTestCase( + "validateChiefComplaintSectionCode", + operationsForOCL.getOCLValue("VALIDATE_CHIEF_COMPLAINT_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ChiefComplaintSection target) { + + } + + @Override + protected void updateToPass(ChiefComplaintSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ChiefComplaintSectionOperations.validateChiefComplaintSectionCode( + (ChiefComplaintSection) objectToTest, diagnostician, map); + } + + }; + + validateChiefComplaintSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateChiefComplaintSectionCodeP() { + OperationsTestCase validateChiefComplaintSectionCodePTestCase = new OperationsTestCase( + "validateChiefComplaintSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_CHIEF_COMPLAINT_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ChiefComplaintSection target) { + + } + + @Override + protected void updateToPass(ChiefComplaintSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ChiefComplaintSectionOperations.validateChiefComplaintSectionCodeP( + (ChiefComplaintSection) objectToTest, diagnostician, map); + } + + }; + + validateChiefComplaintSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateChiefComplaintSectionText() { + OperationsTestCase validateChiefComplaintSectionTextTestCase = new OperationsTestCase( + "validateChiefComplaintSectionText", + operationsForOCL.getOCLValue("VALIDATE_CHIEF_COMPLAINT_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ChiefComplaintSection target) { + + } + + @Override + protected void updateToPass(ChiefComplaintSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ChiefComplaintSectionOperations.validateChiefComplaintSectionText( + (ChiefComplaintSection) objectToTest, diagnostician, map); + } + + }; + + validateChiefComplaintSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateChiefComplaintSectionTitle() { + OperationsTestCase validateChiefComplaintSectionTitleTestCase = new OperationsTestCase( + "validateChiefComplaintSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_CHIEF_COMPLAINT_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ChiefComplaintSection target) { + + } + + @Override + protected void updateToPass(ChiefComplaintSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ChiefComplaintSectionOperations.validateChiefComplaintSectionTitle( + (ChiefComplaintSection) objectToTest, diagnostician, map); + } + + }; + + validateChiefComplaintSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ChiefComplaintSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ChiefComplaintSection create() { + return ConsolFactory.eINSTANCE.createChiefComplaintSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ChiefComplaintSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ChiefComplaintSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/CodeObservationsTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/CodeObservationsTest.java new file mode 100644 index 000000000..47e1d4114 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/CodeObservationsTest.java @@ -0,0 +1,431 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.consol.CodeObservations; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.operations.CodeObservationsOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * + * A static utility class that provides operations related to 'Code Observations' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CodeObservations#validateCodeObservationsTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Code Observations Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CodeObservations#validateCodeObservationsClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Code Observations Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CodeObservations#validateCodeObservationsMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Code Observations Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CodeObservations#validateCodeObservationsCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Code Observations Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CodeObservations#validateCodeObservationsEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Code Observations Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CodeObservations#validateCodeObservationsValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Code Observations Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CodeObservations#validateCodeObservationsSOPInstanceObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Code Observations SOP Instance Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CodeObservations#validateCodeObservationsQuantityMeasurementObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Code Observations Quantity Measurement Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CodeObservations#getSOPInstanceObservations() Get SOP Instance Observations}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CodeObservations#getQuantityMeasurementObservations() Get Quantity Measurement Observations}
  • + *
+ *

+ * + * @generated + */ + +public class CodeObservationsTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateCodeObservationsTemplateId() { + OperationsTestCase validateCodeObservationsTemplateIdTestCase = new OperationsTestCase( + "validateCodeObservationsTemplateId", + operationsForOCL.getOCLValue("VALIDATE_CODE_OBSERVATIONS_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CodeObservations target) { + + } + + @Override + protected void updateToPass(CodeObservations target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CodeObservationsOperations.validateCodeObservationsTemplateId( + (CodeObservations) objectToTest, diagnostician, map); + } + + }; + + validateCodeObservationsTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCodeObservationsClassCode() { + OperationsTestCase validateCodeObservationsClassCodeTestCase = new OperationsTestCase( + "validateCodeObservationsClassCode", + operationsForOCL.getOCLValue("VALIDATE_CODE_OBSERVATIONS_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CodeObservations target) { + + } + + @Override + protected void updateToPass(CodeObservations target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CodeObservationsOperations.validateCodeObservationsClassCode( + (CodeObservations) objectToTest, diagnostician, map); + } + + }; + + validateCodeObservationsClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCodeObservationsMoodCode() { + OperationsTestCase validateCodeObservationsMoodCodeTestCase = new OperationsTestCase( + "validateCodeObservationsMoodCode", + operationsForOCL.getOCLValue("VALIDATE_CODE_OBSERVATIONS_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CodeObservations target) { + + } + + @Override + protected void updateToPass(CodeObservations target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CodeObservationsOperations.validateCodeObservationsMoodCode( + (CodeObservations) objectToTest, diagnostician, map); + } + + }; + + validateCodeObservationsMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCodeObservationsCode() { + OperationsTestCase validateCodeObservationsCodeTestCase = new OperationsTestCase( + "validateCodeObservationsCode", + operationsForOCL.getOCLValue("VALIDATE_CODE_OBSERVATIONS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CodeObservations target) { + + } + + @Override + protected void updateToPass(CodeObservations target) { + target.init(); + target.setCode(DatatypesFactory.eINSTANCE.createCE()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CodeObservationsOperations.validateCodeObservationsCode( + (CodeObservations) objectToTest, diagnostician, map); + } + + }; + + validateCodeObservationsCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCodeObservationsEffectiveTime() { + OperationsTestCase validateCodeObservationsEffectiveTimeTestCase = new OperationsTestCase( + "validateCodeObservationsEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_CODE_OBSERVATIONS_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CodeObservations target) { + + } + + @Override + protected void updateToPass(CodeObservations target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CodeObservationsOperations.validateCodeObservationsEffectiveTime( + (CodeObservations) objectToTest, diagnostician, map); + } + + }; + + validateCodeObservationsEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCodeObservationsValue() { + OperationsTestCase validateCodeObservationsValueTestCase = new OperationsTestCase( + "validateCodeObservationsValue", + operationsForOCL.getOCLValue("VALIDATE_CODE_OBSERVATIONS_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CodeObservations target) { + + } + + @Override + protected void updateToPass(CodeObservations target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD(); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CodeObservationsOperations.validateCodeObservationsValue( + (CodeObservations) objectToTest, diagnostician, map); + } + + }; + + validateCodeObservationsValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCodeObservationsSOPInstanceObservation() { + OperationsTestCase validateCodeObservationsSOPInstanceObservationTestCase = new OperationsTestCase( + "validateCodeObservationsSOPInstanceObservation", + operationsForOCL.getOCLValue("VALIDATE_CODE_OBSERVATIONS_SOP_INSTANCE_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CodeObservations target) { + + } + + @Override + protected void updateToPass(CodeObservations target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.SPRT); + er.setObservation(ConsolFactory.eINSTANCE.createSOPInstanceObservation()); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CodeObservationsOperations.validateCodeObservationsSOPInstanceObservation( + (CodeObservations) objectToTest, diagnostician, map); + } + + }; + + validateCodeObservationsSOPInstanceObservationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCodeObservationsQuantityMeasurementObservation() { + OperationsTestCase validateCodeObservationsQuantityMeasurementObservationTestCase = new OperationsTestCase( + "validateCodeObservationsQuantityMeasurementObservation", + operationsForOCL.getOCLValue("VALIDATE_CODE_OBSERVATIONS_QUANTITY_MEASUREMENT_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CodeObservations target) { + + } + + @Override + protected void updateToPass(CodeObservations target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.SPRT); + er.setObservation(ConsolFactory.eINSTANCE.createQuantityMeasurementObservation()); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CodeObservationsOperations.validateCodeObservationsQuantityMeasurementObservation( + (CodeObservations) objectToTest, diagnostician, map); + } + + }; + + validateCodeObservationsQuantityMeasurementObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetSOPInstanceObservations() { + + CodeObservations target = objectFactory.create(); + target.getSOPInstanceObservations(); + + } + + /** + * + * @generated + */ + @Test + public void testGetQuantityMeasurementObservations() { + + CodeObservations target = objectFactory.create(); + target.getQuantityMeasurementObservations(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends CodeObservationsOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public CodeObservations create() { + return ConsolFactory.eINSTANCE.createCodeObservations(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends CodeObservationsOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // CodeObservationsOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/CognitiveStatusProblemObservationTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/CognitiveStatusProblemObservationTest.java new file mode 100644 index 000000000..9b25d1406 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/CognitiveStatusProblemObservationTest.java @@ -0,0 +1,904 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusProblemObservation; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ConsolPackage; +import org.openhealthtools.mdht.uml.cda.consol.GeneralStatusSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.CognitiveStatusProblemObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * + * A static utility class that provides operations related to 'Cognitive Status Problem Observation' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusProblemObservation#validateCognitiveStatusProblemObservationHasTextReference(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Problem Observation Has Text Reference}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusProblemObservation#validateCognitiveStatusProblemObservationHasTextReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Problem Observation Has Text Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusProblemObservation#validateCognitiveStatusProblemObservationHasOnsetDate(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Problem Observation Has Onset Date}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusProblemObservation#validateCognitiveStatusProblemObservationHasResolutionDate(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Problem Observation Has Resolution Date}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusProblemObservation#validateCognitiveStatusProblemObservationClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Problem Observation Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusProblemObservation#validateCognitiveStatusProblemObservationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Problem Observation Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusProblemObservation#validateCognitiveStatusProblemObservationNegationInd(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Problem Observation Negation Ind}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusProblemObservation#validateCognitiveStatusProblemObservationId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Problem Observation Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusProblemObservation#validateCognitiveStatusProblemObservationCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Problem Observation Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusProblemObservation#validateCognitiveStatusProblemObservationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Problem Observation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusProblemObservation#validateCognitiveStatusProblemObservationText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Problem Observation Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusProblemObservation#validateCognitiveStatusProblemObservationStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Problem Observation Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusProblemObservation#validateCognitiveStatusProblemObservationEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Problem Observation Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusProblemObservation#validateCognitiveStatusProblemObservationMethodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Problem Observation Method Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusProblemObservation#validateCognitiveStatusProblemObservationValueP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Problem Observation Value P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusProblemObservation#validateCognitiveStatusProblemObservationValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Problem Observation Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusProblemObservation#validateCognitiveStatusProblemObservationNonMedicinalSupplyActivity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Problem Observation Non Medicinal Supply Activity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusProblemObservation#validateCognitiveStatusProblemObservationCaregiverCharacteristics(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Problem Observation Caregiver Characteristics}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusProblemObservation#validateCognitiveStatusProblemObservationAssessmentScaleObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Problem Observation Assessment Scale Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusProblemObservation#getNonMedicinalSupplyActivities() Get Non Medicinal Supply Activities}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusProblemObservation#getCaregiverCharacteristicss() Get Caregiver Characteristicss}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusProblemObservation#getAssessmentScaleObservations() Get Assessment Scale Observations}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusProblemObservation#validateProblemObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Observation Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class CognitiveStatusProblemObservationTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateCognitiveStatusProblemObservationHasTextReference() { + OperationsTestCase validateCognitiveStatusProblemObservationHasTextReferenceTestCase = new OperationsTestCase( + "validateCognitiveStatusProblemObservationHasTextReference", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_PROBLEM_OBSERVATION_HAS_TEXT_REFERENCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusProblemObservation target) { + target.init(); + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL()); + target.setText(txt); + } + + @Override + protected void updateToPass(CognitiveStatusProblemObservation target) { + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL("test")); + target.setText(txt); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusProblemObservationOperations.validateCognitiveStatusProblemObservationHasTextReference( + (CognitiveStatusProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusProblemObservationHasTextReferenceTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCognitiveStatusProblemObservationHasTextReferenceValue() { + OperationsTestCase validateCognitiveStatusProblemObservationHasTextReferenceValueTestCase = new NarrativeReferenceTestCase( + "validateCognitiveStatusProblemObservationHasTextReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_PROBLEM_OBSERVATION_HAS_TEXT_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusProblemObservation target) { + target.init(); + + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), "", + "No particular health status observed."); + + // add a reference to the section text + target.setText(createEDWithReference("Some sample text", "#1.2.3.4")); + } + + @Override + protected void updateToPass(CognitiveStatusProblemObservation target) { + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), + "1.2.3.4", "No particular health status observed."); + + // add a reference to the section text + target.setText(createEDWithReference("Some sample text", "#1.2.3.4")); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusProblemObservationOperations.validateCognitiveStatusProblemObservationHasTextReferenceValue( + (CognitiveStatusProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusProblemObservationHasTextReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCognitiveStatusProblemObservationHasOnsetDate() { + OperationsTestCase validateCognitiveStatusProblemObservationHasOnsetDateTestCase = new OperationsTestCase( + "validateCognitiveStatusProblemObservationHasOnsetDate", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_PROBLEM_OBSERVATION_HAS_ONSET_DATE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusProblemObservation target) { + + } + + @Override + protected void updateToPass(CognitiveStatusProblemObservation target) { + target.init(); + target.setEffectiveTime(DatatypesFactory.eINSTANCE.createIVL_TS("1", "2")); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusProblemObservationOperations.validateCognitiveStatusProblemObservationHasOnsetDate( + (CognitiveStatusProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusProblemObservationHasOnsetDateTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCognitiveStatusProblemObservationHasResolutionDate() { + OperationsTestCase validateCognitiveStatusProblemObservationHasResolutionDateTestCase = new OperationsTestCase( + "validateCognitiveStatusProblemObservationHasResolutionDate", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_PROBLEM_OBSERVATION_HAS_RESOLUTION_DATE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusProblemObservation target) { + + } + + @Override + protected void updateToPass(CognitiveStatusProblemObservation target) { + target.init(); + target.setEffectiveTime(DatatypesFactory.eINSTANCE.createIVL_TS("1", "2")); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusProblemObservationOperations.validateCognitiveStatusProblemObservationHasResolutionDate( + (CognitiveStatusProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusProblemObservationHasResolutionDateTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCognitiveStatusProblemObservationClassCode() { + OperationsTestCase validateCognitiveStatusProblemObservationClassCodeTestCase = new OperationsTestCase( + "validateCognitiveStatusProblemObservationClassCode", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_PROBLEM_OBSERVATION_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusProblemObservation target) { + + } + + @Override + protected void updateToPass(CognitiveStatusProblemObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusProblemObservationOperations.validateCognitiveStatusProblemObservationClassCode( + (CognitiveStatusProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusProblemObservationClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCognitiveStatusProblemObservationMoodCode() { + OperationsTestCase validateCognitiveStatusProblemObservationMoodCodeTestCase = new OperationsTestCase( + "validateCognitiveStatusProblemObservationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_PROBLEM_OBSERVATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusProblemObservation target) { + + } + + @Override + protected void updateToPass(CognitiveStatusProblemObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusProblemObservationOperations.validateCognitiveStatusProblemObservationMoodCode( + (CognitiveStatusProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusProblemObservationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCognitiveStatusProblemObservationNegationInd() { + OperationsTestCase validateCognitiveStatusProblemObservationNegationIndTestCase = new OperationsTestCase( + "validateCognitiveStatusProblemObservationNegationInd", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_PROBLEM_OBSERVATION_NEGATION_IND__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusProblemObservation target) { + + } + + @Override + protected void updateToPass(CognitiveStatusProblemObservation target) { + target.init(); + target.setNegationInd(true); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusProblemObservationOperations.validateCognitiveStatusProblemObservationNegationInd( + (CognitiveStatusProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusProblemObservationNegationIndTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCognitiveStatusProblemObservationId() { + OperationsTestCase validateCognitiveStatusProblemObservationIdTestCase = new OperationsTestCase( + "validateCognitiveStatusProblemObservationId", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_PROBLEM_OBSERVATION_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusProblemObservation target) { + + } + + @Override + protected void updateToPass(CognitiveStatusProblemObservation target) { + target.init(); + + II ii = DatatypesFactory.eINSTANCE.createII(); + target.getIds().add(ii); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusProblemObservationOperations.validateCognitiveStatusProblemObservationId( + (CognitiveStatusProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusProblemObservationIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCognitiveStatusProblemObservationCodeP() { + OperationsTestCase validateCognitiveStatusProblemObservationCodePTestCase = new OperationsTestCase( + "validateCognitiveStatusProblemObservationCodeP", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_PROBLEM_OBSERVATION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusProblemObservation target) { + + } + + @Override + protected void updateToPass(CognitiveStatusProblemObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusProblemObservationOperations.validateCognitiveStatusProblemObservationCodeP( + (CognitiveStatusProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusProblemObservationCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCognitiveStatusProblemObservationCode() { + OperationsTestCase validateCognitiveStatusProblemObservationCodeTestCase = new OperationsTestCase( + "validateCognitiveStatusProblemObservationCode", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_PROBLEM_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusProblemObservation target) { + + } + + @Override + protected void updateToPass(CognitiveStatusProblemObservation target) { + target.init(); + + CD cd = DatatypesFactory.eINSTANCE.createCD("373930000", "2.16.840.1.113883.6.1", "", ""); + target.setCode(cd); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusProblemObservationOperations.validateCognitiveStatusProblemObservationCode( + (CognitiveStatusProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusProblemObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCognitiveStatusProblemObservationText() { + OperationsTestCase validateCognitiveStatusProblemObservationTextTestCase = new OperationsTestCase( + "validateCognitiveStatusProblemObservationText", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_PROBLEM_OBSERVATION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusProblemObservation target) { + + } + + @Override + protected void updateToPass(CognitiveStatusProblemObservation target) { + target.init(); + + ED text = DatatypesFactory.eINSTANCE.createED(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusProblemObservationOperations.validateCognitiveStatusProblemObservationText( + (CognitiveStatusProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusProblemObservationTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCognitiveStatusProblemObservationStatusCode() { + OperationsTestCase validateCognitiveStatusProblemObservationStatusCodeTestCase = new OperationsTestCase( + "validateCognitiveStatusProblemObservationStatusCode", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_PROBLEM_OBSERVATION_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusProblemObservation target) { + + } + + @Override + protected void updateToPass(CognitiveStatusProblemObservation target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusProblemObservationOperations.validateCognitiveStatusProblemObservationStatusCode( + (CognitiveStatusProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusProblemObservationStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCognitiveStatusProblemObservationEffectiveTime() { + OperationsTestCase validateCognitiveStatusProblemObservationEffectiveTimeTestCase = new OperationsTestCase( + "validateCognitiveStatusProblemObservationEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_PROBLEM_OBSERVATION_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusProblemObservation target) { + + } + + @Override + protected void updateToPass(CognitiveStatusProblemObservation target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusProblemObservationOperations.validateCognitiveStatusProblemObservationEffectiveTime( + (CognitiveStatusProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusProblemObservationEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCognitiveStatusProblemObservationMethodCode() { + OperationsTestCase validateCognitiveStatusProblemObservationMethodCodeTestCase = new OperationsTestCase( + "validateCognitiveStatusProblemObservationMethodCode", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_PROBLEM_OBSERVATION_METHOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusProblemObservation target) { + + } + + @Override + protected void updateToPass(CognitiveStatusProblemObservation target) { + target.init(); + target.getMethodCodes().add(DatatypesFactory.eINSTANCE.createCE()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusProblemObservationOperations.validateCognitiveStatusProblemObservationMethodCode( + (CognitiveStatusProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusProblemObservationMethodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCognitiveStatusProblemObservationValueP() { + OperationsTestCase validateCognitiveStatusProblemObservationValuePTestCase = new OperationsTestCase( + "validateCognitiveStatusProblemObservationValueP", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_PROBLEM_OBSERVATION_VALUE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusProblemObservation target) { + + } + + @Override + protected void updateToPass(CognitiveStatusProblemObservation target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD("", "2.16.840.1.113883.6.96", "", ""); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusProblemObservationOperations.validateCognitiveStatusProblemObservationValueP( + (CognitiveStatusProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusProblemObservationValuePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCognitiveStatusProblemObservationValue() { + OperationsTestCase validateCognitiveStatusProblemObservationValueTestCase = new OperationsTestCase( + "validateCognitiveStatusProblemObservationValue", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_PROBLEM_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusProblemObservation target) { + + } + + @Override + protected void updateToPass(CognitiveStatusProblemObservation target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD("", "2.16.840.1.113883.6.96", "", ""); + target.getValues().add(value); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusProblemObservationOperations.validateCognitiveStatusProblemObservationValue( + (CognitiveStatusProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusProblemObservationValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCognitiveStatusProblemObservationNonMedicinalSupplyActivity() { + OperationsTestCase validateCognitiveStatusProblemObservationNonMedicinalSupplyActivityTestCase = new OperationsTestCase( + "validateCognitiveStatusProblemObservationNonMedicinalSupplyActivity", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_PROBLEM_OBSERVATION_NON_MEDICINAL_SUPPLY_ACTIVITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusProblemObservation target) { + + } + + @Override + protected void updateToPass(CognitiveStatusProblemObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.REFR); + er.setSupply(ConsolFactory.eINSTANCE.createNonMedicinalSupplyActivity()); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusProblemObservationOperations.validateCognitiveStatusProblemObservationNonMedicinalSupplyActivity( + (CognitiveStatusProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusProblemObservationNonMedicinalSupplyActivityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCognitiveStatusProblemObservationCaregiverCharacteristics() { + OperationsTestCase validateCognitiveStatusProblemObservationCaregiverCharacteristicsTestCase = new OperationsTestCase( + "validateCognitiveStatusProblemObservationCaregiverCharacteristics", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_PROBLEM_OBSERVATION_CAREGIVER_CHARACTERISTICS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusProblemObservation target) { + + } + + @Override + protected void updateToPass(CognitiveStatusProblemObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.REFR); + er.setObservation(ConsolFactory.eINSTANCE.createCaregiverCharacteristics()); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusProblemObservationOperations.validateCognitiveStatusProblemObservationCaregiverCharacteristics( + (CognitiveStatusProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusProblemObservationCaregiverCharacteristicsTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCognitiveStatusProblemObservationAssessmentScaleObservation() { + OperationsTestCase validateCognitiveStatusProblemObservationAssessmentScaleObservationTestCase = new OperationsTestCase( + "validateCognitiveStatusProblemObservationAssessmentScaleObservation", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_PROBLEM_OBSERVATION_ASSESSMENT_SCALE_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusProblemObservation target) { + + } + + @Override + protected void updateToPass(CognitiveStatusProblemObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + er.setObservation(ConsolFactory.eINSTANCE.createAssessmentScaleObservation()); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusProblemObservationOperations.validateCognitiveStatusProblemObservationAssessmentScaleObservation( + (CognitiveStatusProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusProblemObservationAssessmentScaleObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetNonMedicinalSupplyActivities() { + + CognitiveStatusProblemObservation target = objectFactory.create(); + target.getNonMedicinalSupplyActivities(); + + } + + /** + * + * @generated + */ + @Test + public void testGetCaregiverCharacteristicss() { + + CognitiveStatusProblemObservation target = objectFactory.create(); + target.getCaregiverCharacteristicss(); + + } + + /** + * + * @generated + */ + @Test + public void testGetAssessmentScaleObservations() { + + CognitiveStatusProblemObservation target = objectFactory.create(); + target.getAssessmentScaleObservations(); + + } + + /** + * + * @generated + */ + @Test + public void testValidateProblemObservationTemplateId() { + OperationsTestCase validateProblemObservationTemplateIdTestCase = new OperationsTestCase( + "validateProblemObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusProblemObservation target) { + + } + + @Override + protected void updateToPass(CognitiveStatusProblemObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusProblemObservationOperations.validateProblemObservationTemplateId( + (CognitiveStatusProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateProblemObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends CognitiveStatusProblemObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public CognitiveStatusProblemObservation create() { + return ConsolFactory.eINSTANCE.createCognitiveStatusProblemObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends CognitiveStatusProblemObservationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // CognitiveStatusProblemObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/CognitiveStatusResultObservationTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/CognitiveStatusResultObservationTest.java new file mode 100644 index 000000000..fcf31f7e7 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/CognitiveStatusResultObservationTest.java @@ -0,0 +1,1061 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.ObservationRange; +import org.openhealthtools.mdht.uml.cda.ReferenceRange; +import org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusResultObservation; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ConsolPackage; +import org.openhealthtools.mdht.uml.cda.consol.GeneralStatusSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.CognitiveStatusResultObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * + * A static utility class that provides operations related to 'Cognitive Status Result Observation' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusResultObservation#validateCognitiveStatusResultObservationTextReference(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Result Observation Text Reference}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusResultObservation#validateCognitiveStatusResultObservationTextReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Result Observation Text Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusResultObservation#validateCognitiveStatusResultObservationValueDatatype(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Result Observation Value Datatype}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusResultObservation#validateCognitiveStatusResultObservationClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Result Observation Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusResultObservation#validateCognitiveStatusResultObservationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Result Observation Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusResultObservation#validateCognitiveStatusResultObservationId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Result Observation Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusResultObservation#validateCognitiveStatusResultObservationCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Result Observation Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusResultObservation#validateCognitiveStatusResultObservationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Result Observation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusResultObservation#validateCognitiveStatusResultObservationText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Result Observation Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusResultObservation#validateCognitiveStatusResultObservationStatusCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Result Observation Status Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusResultObservation#validateCognitiveStatusResultObservationStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Result Observation Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusResultObservation#validateCognitiveStatusResultObservationEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Result Observation Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusResultObservation#validateCognitiveStatusResultObservationValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Result Observation Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusResultObservation#validateCognitiveStatusResultObservationInterpretationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Result Observation Interpretation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusResultObservation#validateCognitiveStatusResultObservationMethodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Result Observation Method Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusResultObservation#validateCognitiveStatusResultObservationTargetSiteCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Result Observation Target Site Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusResultObservation#validateCognitiveStatusResultObservationAuthor(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Result Observation Author}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusResultObservation#validateCognitiveStatusResultObservationNonMedicinalSupplyActivity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Result Observation Non Medicinal Supply Activity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusResultObservation#validateCognitiveStatusResultObservationCaregiverCharacteristics(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Result Observation Caregiver Characteristics}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusResultObservation#validateCognitiveStatusResultObservationAssessmentScaleObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Result Observation Assessment Scale Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusResultObservation#validateCognitiveStatusResultObservationReferenceRange(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Result Observation Reference Range}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusResultObservation#validateCognitiveStatusResultObservationReferenceRangeObservationRangeNoCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Result Observation Reference Range Observation Range No Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusResultObservation#validateCognitiveStatusResultObservationReferenceRangeObservationRange(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Result Observation Reference Range Observation Range}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusResultObservation#getNonMedicinalSupplyActivities() Get Non Medicinal Supply Activities}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusResultObservation#getCaregiverCharacteristicss() Get Caregiver Characteristicss}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusResultObservation#getAssessmentScaleObservations() Get Assessment Scale Observations}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusResultObservation#validateResultObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Observation Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class CognitiveStatusResultObservationTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateCognitiveStatusResultObservationTextReference() { + OperationsTestCase validateCognitiveStatusResultObservationTextReferenceTestCase = new OperationsTestCase( + "validateCognitiveStatusResultObservationTextReference", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_RESULT_OBSERVATION_TEXT_REFERENCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusResultObservation target) { + target.init(); + ED txt = DatatypesFactory.eINSTANCE.createED(); + target.setText(txt); + } + + @Override + protected void updateToPass(CognitiveStatusResultObservation target) { + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL("test")); + target.setText(txt); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusResultObservationOperations.validateCognitiveStatusResultObservationTextReference( + (CognitiveStatusResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusResultObservationTextReferenceTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCognitiveStatusResultObservationTextReferenceValue() { + OperationsTestCase validateCognitiveStatusResultObservationTextReferenceValueTestCase = new NarrativeReferenceTestCase( + "validateCognitiveStatusResultObservationTextReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_RESULT_OBSERVATION_TEXT_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusResultObservation target) { + target.init(); + + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), "", + "No particular health status observed."); + + // add a reference to the section text + target.setText(createEDWithReference("Some sample text", "#1.2.3.4")); + } + + @Override + protected void updateToPass(CognitiveStatusResultObservation target) { + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), + "1.2.3.4", "No particular health status observed."); + + // add a reference to the section text + target.setText(createEDWithReference("Some sample text", "#1.2.3.4")); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusResultObservationOperations.validateCognitiveStatusResultObservationTextReferenceValue( + (CognitiveStatusResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusResultObservationTextReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCognitiveStatusResultObservationValueDatatype() { + OperationsTestCase validateCognitiveStatusResultObservationValueDatatypeTestCase = new OperationsTestCase( + "validateCognitiveStatusResultObservationValueDatatype", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_RESULT_OBSERVATION_VALUE_DATATYPE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusResultObservation target) { + target.getValues().add(DatatypesFactory.eINSTANCE.createCD()); + } + + @Override + protected void updateToPass(CognitiveStatusResultObservation target) { + target.init(); + target.getValues().clear(); + target.getValues().add(DatatypesFactory.eINSTANCE.createCD("", "2.16.840.1.113883.6.96", "", "")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusResultObservationOperations.validateCognitiveStatusResultObservationValueDatatype( + (CognitiveStatusResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusResultObservationValueDatatypeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCognitiveStatusResultObservationClassCode() { + OperationsTestCase validateCognitiveStatusResultObservationClassCodeTestCase = new OperationsTestCase( + "validateCognitiveStatusResultObservationClassCode", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_RESULT_OBSERVATION_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusResultObservation target) { + + } + + @Override + protected void updateToPass(CognitiveStatusResultObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusResultObservationOperations.validateCognitiveStatusResultObservationClassCode( + (CognitiveStatusResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusResultObservationClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCognitiveStatusResultObservationMoodCode() { + OperationsTestCase validateCognitiveStatusResultObservationMoodCodeTestCase = new OperationsTestCase( + "validateCognitiveStatusResultObservationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_RESULT_OBSERVATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusResultObservation target) { + + } + + @Override + protected void updateToPass(CognitiveStatusResultObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusResultObservationOperations.validateCognitiveStatusResultObservationMoodCode( + (CognitiveStatusResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusResultObservationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCognitiveStatusResultObservationId() { + OperationsTestCase validateCognitiveStatusResultObservationIdTestCase = new OperationsTestCase( + "validateCognitiveStatusResultObservationId", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_RESULT_OBSERVATION_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusResultObservation target) { + + } + + @Override + protected void updateToPass(CognitiveStatusResultObservation target) { + target.init(); + + II ii = DatatypesFactory.eINSTANCE.createII(); + target.getIds().add(ii); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusResultObservationOperations.validateCognitiveStatusResultObservationId( + (CognitiveStatusResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusResultObservationIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCognitiveStatusResultObservationCodeP() { + OperationsTestCase validateCognitiveStatusResultObservationCodePTestCase = new OperationsTestCase( + "validateCognitiveStatusResultObservationCodeP", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_RESULT_OBSERVATION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusResultObservation target) { + + } + + @Override + protected void updateToPass(CognitiveStatusResultObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusResultObservationOperations.validateCognitiveStatusResultObservationCodeP( + (CognitiveStatusResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusResultObservationCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCognitiveStatusResultObservationCode() { + OperationsTestCase validateCognitiveStatusResultObservationCodeTestCase = new OperationsTestCase( + "validateCognitiveStatusResultObservationCode", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_RESULT_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusResultObservation target) { + + } + + @Override + protected void updateToPass(CognitiveStatusResultObservation target) { + target.init(); + + CE cd = DatatypesFactory.eINSTANCE.createCE("373930000", "2.16.840.1.113883.6.96"); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusResultObservationOperations.validateCognitiveStatusResultObservationCode( + (CognitiveStatusResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusResultObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCognitiveStatusResultObservationText() { + OperationsTestCase validateCognitiveStatusResultObservationTextTestCase = new OperationsTestCase( + "validateCognitiveStatusResultObservationText", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_RESULT_OBSERVATION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusResultObservation target) { + + } + + @Override + protected void updateToPass(CognitiveStatusResultObservation target) { + target.init(); + + ED text = DatatypesFactory.eINSTANCE.createED(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusResultObservationOperations.validateCognitiveStatusResultObservationText( + (CognitiveStatusResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusResultObservationTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCognitiveStatusResultObservationStatusCodeP() { + OperationsTestCase validateCognitiveStatusResultObservationStatusCodePTestCase = new OperationsTestCase( + "validateCognitiveStatusResultObservationStatusCodeP", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_RESULT_OBSERVATION_STATUS_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusResultObservation target) { + + } + + @Override + protected void updateToPass(CognitiveStatusResultObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusResultObservationOperations.validateCognitiveStatusResultObservationStatusCodeP( + (CognitiveStatusResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusResultObservationStatusCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCognitiveStatusResultObservationStatusCode() { + OperationsTestCase validateCognitiveStatusResultObservationStatusCodeTestCase = new OperationsTestCase( + "validateCognitiveStatusResultObservationStatusCode", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_RESULT_OBSERVATION_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusResultObservation target) { + + } + + @Override + protected void updateToPass(CognitiveStatusResultObservation target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusResultObservationOperations.validateCognitiveStatusResultObservationStatusCode( + (CognitiveStatusResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusResultObservationStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCognitiveStatusResultObservationEffectiveTime() { + OperationsTestCase validateCognitiveStatusResultObservationEffectiveTimeTestCase = new OperationsTestCase( + "validateCognitiveStatusResultObservationEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_RESULT_OBSERVATION_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusResultObservation target) { + + } + + @Override + protected void updateToPass(CognitiveStatusResultObservation target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusResultObservationOperations.validateCognitiveStatusResultObservationEffectiveTime( + (CognitiveStatusResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusResultObservationEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCognitiveStatusResultObservationValue() { + OperationsTestCase validateCognitiveStatusResultObservationValueTestCase = new OperationsTestCase( + "validateCognitiveStatusResultObservationValue", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_RESULT_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusResultObservation target) { + + } + + @Override + protected void updateToPass(CognitiveStatusResultObservation target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD(); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusResultObservationOperations.validateCognitiveStatusResultObservationValue( + (CognitiveStatusResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusResultObservationValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCognitiveStatusResultObservationInterpretationCode() { + OperationsTestCase validateCognitiveStatusResultObservationInterpretationCodeTestCase = new OperationsTestCase( + "validateCognitiveStatusResultObservationInterpretationCode", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_RESULT_OBSERVATION_INTERPRETATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusResultObservation target) { + + } + + @Override + protected void updateToPass(CognitiveStatusResultObservation target) { + target.init(); + target.getInterpretationCodes().add(DatatypesFactory.eINSTANCE.createCE()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusResultObservationOperations.validateCognitiveStatusResultObservationInterpretationCode( + (CognitiveStatusResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusResultObservationInterpretationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCognitiveStatusResultObservationMethodCode() { + OperationsTestCase validateCognitiveStatusResultObservationMethodCodeTestCase = new OperationsTestCase( + "validateCognitiveStatusResultObservationMethodCode", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_RESULT_OBSERVATION_METHOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusResultObservation target) { + + } + + @Override + protected void updateToPass(CognitiveStatusResultObservation target) { + target.init(); + target.getMethodCodes().add(DatatypesFactory.eINSTANCE.createCE()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusResultObservationOperations.validateCognitiveStatusResultObservationMethodCode( + (CognitiveStatusResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusResultObservationMethodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCognitiveStatusResultObservationTargetSiteCode() { + OperationsTestCase validateCognitiveStatusResultObservationTargetSiteCodeTestCase = new OperationsTestCase( + "validateCognitiveStatusResultObservationTargetSiteCode", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_RESULT_OBSERVATION_TARGET_SITE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusResultObservation target) { + + } + + @Override + protected void updateToPass(CognitiveStatusResultObservation target) { + target.init(); + target.getTargetSiteCodes().add(DatatypesFactory.eINSTANCE.createCD()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusResultObservationOperations.validateCognitiveStatusResultObservationTargetSiteCode( + (CognitiveStatusResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusResultObservationTargetSiteCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCognitiveStatusResultObservationAuthor() { + OperationsTestCase validateCognitiveStatusResultObservationAuthorTestCase = new OperationsTestCase( + "validateCognitiveStatusResultObservationAuthor", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_RESULT_OBSERVATION_AUTHOR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusResultObservation target) { + + } + + @Override + protected void updateToPass(CognitiveStatusResultObservation target) { + target.init(); + target.getAuthors().add(CDAFactory.eINSTANCE.createAuthor()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusResultObservationOperations.validateCognitiveStatusResultObservationAuthor( + (CognitiveStatusResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusResultObservationAuthorTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCognitiveStatusResultObservationNonMedicinalSupplyActivity() { + OperationsTestCase validateCognitiveStatusResultObservationNonMedicinalSupplyActivityTestCase = new OperationsTestCase( + "validateCognitiveStatusResultObservationNonMedicinalSupplyActivity", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_RESULT_OBSERVATION_NON_MEDICINAL_SUPPLY_ACTIVITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusResultObservation target) { + + } + + @Override + protected void updateToPass(CognitiveStatusResultObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.REFR); + er.setSupply(ConsolFactory.eINSTANCE.createNonMedicinalSupplyActivity()); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusResultObservationOperations.validateCognitiveStatusResultObservationNonMedicinalSupplyActivity( + (CognitiveStatusResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusResultObservationNonMedicinalSupplyActivityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCognitiveStatusResultObservationCaregiverCharacteristics() { + OperationsTestCase validateCognitiveStatusResultObservationCaregiverCharacteristicsTestCase = new OperationsTestCase( + "validateCognitiveStatusResultObservationCaregiverCharacteristics", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_RESULT_OBSERVATION_CAREGIVER_CHARACTERISTICS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusResultObservation target) { + + } + + @Override + protected void updateToPass(CognitiveStatusResultObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.REFR); + er.setObservation(ConsolFactory.eINSTANCE.createCaregiverCharacteristics()); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusResultObservationOperations.validateCognitiveStatusResultObservationCaregiverCharacteristics( + (CognitiveStatusResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusResultObservationCaregiverCharacteristicsTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCognitiveStatusResultObservationAssessmentScaleObservation() { + OperationsTestCase validateCognitiveStatusResultObservationAssessmentScaleObservationTestCase = new OperationsTestCase( + "validateCognitiveStatusResultObservationAssessmentScaleObservation", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_RESULT_OBSERVATION_ASSESSMENT_SCALE_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusResultObservation target) { + + } + + @Override + protected void updateToPass(CognitiveStatusResultObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + er.setObservation(ConsolFactory.eINSTANCE.createAssessmentScaleObservation()); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusResultObservationOperations.validateCognitiveStatusResultObservationAssessmentScaleObservation( + (CognitiveStatusResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusResultObservationAssessmentScaleObservationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCognitiveStatusResultObservationReferenceRange() { + OperationsTestCase validateCognitiveStatusResultObservationReferenceRangeTestCase = new OperationsTestCase( + "validateCognitiveStatusResultObservationReferenceRange", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_RESULT_OBSERVATION_REFERENCE_RANGE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusResultObservation target) { + + } + + @Override + protected void updateToPass(CognitiveStatusResultObservation target) { + target.init(); + target.getReferenceRanges().add(CDAFactory.eINSTANCE.createReferenceRange()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusResultObservationOperations.validateCognitiveStatusResultObservationReferenceRange( + (CognitiveStatusResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusResultObservationReferenceRangeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCognitiveStatusResultObservationReferenceRangeObservationRangeNoCode() { + OperationsTestCase validateCognitiveStatusResultObservationReferenceRangeObservationRangeNoCodeTestCase = new OperationsTestCase( + "validateCognitiveStatusResultObservationReferenceRangeObservationRangeNoCode", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_RESULT_OBSERVATION_REFERENCE_RANGE_OBSERVATION_RANGE_NO_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusResultObservation target) { + target.init(); + + ReferenceRange rr = CDAFactory.eINSTANCE.createReferenceRange(); + ObservationRange or = CDAFactory.eINSTANCE.createObservationRange(); + or.setCode(DatatypesFactory.eINSTANCE.createCD()); + rr.setObservationRange(or); + target.getReferenceRanges().add(rr); + + } + + @Override + protected void updateToPass(CognitiveStatusResultObservation target) { + target.getReferenceRanges().clear(); + + ReferenceRange rr = CDAFactory.eINSTANCE.createReferenceRange(); + ObservationRange or = CDAFactory.eINSTANCE.createObservationRange(); + rr.setObservationRange(or); + target.getReferenceRanges().add(rr); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusResultObservationOperations.validateCognitiveStatusResultObservationReferenceRangeObservationRangeNoCode( + (CognitiveStatusResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusResultObservationReferenceRangeObservationRangeNoCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCognitiveStatusResultObservationReferenceRangeObservationRange() { + OperationsTestCase validateCognitiveStatusResultObservationReferenceRangeObservationRangeTestCase = new OperationsTestCase( + "validateCognitiveStatusResultObservationReferenceRangeObservationRange", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_RESULT_OBSERVATION_REFERENCE_RANGE_OBSERVATION_RANGE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusResultObservation target) { + target.init(); + target.getReferenceRanges().add(CDAFactory.eINSTANCE.createReferenceRange()); + + } + + @Override + protected void updateToPass(CognitiveStatusResultObservation target) { + target.getReferenceRanges().clear(); + + ReferenceRange rr = CDAFactory.eINSTANCE.createReferenceRange(); + ObservationRange or = CDAFactory.eINSTANCE.createObservationRange(); + rr.setObservationRange(or); + target.getReferenceRanges().add(rr); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusResultObservationOperations.validateCognitiveStatusResultObservationReferenceRangeObservationRange( + (CognitiveStatusResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusResultObservationReferenceRangeObservationRangeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetNonMedicinalSupplyActivities() { + + CognitiveStatusResultObservation target = objectFactory.create(); + target.getNonMedicinalSupplyActivities(); + + } + + /** + * + * @generated + */ + @Test + public void testGetCaregiverCharacteristicss() { + + CognitiveStatusResultObservation target = objectFactory.create(); + target.getCaregiverCharacteristicss(); + + } + + /** + * + * @generated + */ + @Test + public void testGetAssessmentScaleObservations() { + + CognitiveStatusResultObservation target = objectFactory.create(); + target.getAssessmentScaleObservations(); + + } + + /** + * + * @generated + */ + @Test + public void testValidateResultObservationTemplateId() { + OperationsTestCase validateResultObservationTemplateIdTestCase = new OperationsTestCase( + "validateResultObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_RESULT_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusResultObservation target) { + + } + + @Override + protected void updateToPass(CognitiveStatusResultObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusResultObservationOperations.validateResultObservationTemplateId( + (CognitiveStatusResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateResultObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends CognitiveStatusResultObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public CognitiveStatusResultObservation create() { + return ConsolFactory.eINSTANCE.createCognitiveStatusResultObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends CognitiveStatusResultObservationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // CognitiveStatusResultObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/CognitiveStatusResultOrganizerTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/CognitiveStatusResultOrganizerTest.java new file mode 100644 index 000000000..4e1609f24 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/CognitiveStatusResultOrganizerTest.java @@ -0,0 +1,434 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusResultOrganizer; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.operations.CognitiveStatusResultOrganizerOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; + +/** + * + * A static utility class that provides operations related to 'Cognitive Status Result Organizer' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusResultOrganizer#validateCognitiveStatusResultOrganizerCodeCodeSystem(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Result Organizer Code Code System}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusResultOrganizer#validateCognitiveStatusResultOrganizerClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Result Organizer Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusResultOrganizer#validateCognitiveStatusResultOrganizerMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Result Organizer Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusResultOrganizer#validateCognitiveStatusResultOrganizerId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Result Organizer Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusResultOrganizer#validateCognitiveStatusResultOrganizerCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Result Organizer Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusResultOrganizer#validateCognitiveStatusResultOrganizerStatusCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Result Organizer Status Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusResultOrganizer#validateCognitiveStatusResultOrganizerStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Result Organizer Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusResultOrganizer#validateCognitiveStatusResultOrganizerCognitiveStatusResultObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Cognitive Status Result Organizer Cognitive Status Result Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusResultOrganizer#getCognitiveStatusResultObservations() Get Cognitive Status Result Observations}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusResultOrganizer#validateResultOrganizerTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Organizer Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class CognitiveStatusResultOrganizerTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateCognitiveStatusResultOrganizerCodeCodeSystem() { + OperationsTestCase validateCognitiveStatusResultOrganizerCodeCodeSystemTestCase = new OperationsTestCase( + "validateCognitiveStatusResultOrganizerCodeCodeSystem", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_RESULT_ORGANIZER_CODE_CODE_SYSTEM__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusResultOrganizer target) { + + } + + @Override + protected void updateToPass(CognitiveStatusResultOrganizer target) { + target.init(); + target.setCode(DatatypesFactory.eINSTANCE.createCE("", "2.16.840.1.113883.6.96")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusResultOrganizerOperations.validateCognitiveStatusResultOrganizerCodeCodeSystem( + (CognitiveStatusResultOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusResultOrganizerCodeCodeSystemTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCognitiveStatusResultOrganizerClassCode() { + OperationsTestCase validateCognitiveStatusResultOrganizerClassCodeTestCase = new OperationsTestCase( + "validateCognitiveStatusResultOrganizerClassCode", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_RESULT_ORGANIZER_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusResultOrganizer target) { + + } + + @Override + protected void updateToPass(CognitiveStatusResultOrganizer target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusResultOrganizerOperations.validateCognitiveStatusResultOrganizerClassCode( + (CognitiveStatusResultOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusResultOrganizerClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCognitiveStatusResultOrganizerMoodCode() { + OperationsTestCase validateCognitiveStatusResultOrganizerMoodCodeTestCase = new OperationsTestCase( + "validateCognitiveStatusResultOrganizerMoodCode", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_RESULT_ORGANIZER_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusResultOrganizer target) { + + } + + @Override + protected void updateToPass(CognitiveStatusResultOrganizer target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusResultOrganizerOperations.validateCognitiveStatusResultOrganizerMoodCode( + (CognitiveStatusResultOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusResultOrganizerMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCognitiveStatusResultOrganizerId() { + OperationsTestCase validateCognitiveStatusResultOrganizerIdTestCase = new OperationsTestCase( + "validateCognitiveStatusResultOrganizerId", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_RESULT_ORGANIZER_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusResultOrganizer target) { + + } + + @Override + protected void updateToPass(CognitiveStatusResultOrganizer target) { + target.init(); + target.getIds().add(DatatypesFactory.eINSTANCE.createII()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusResultOrganizerOperations.validateCognitiveStatusResultOrganizerId( + (CognitiveStatusResultOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusResultOrganizerIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCognitiveStatusResultOrganizerCode() { + OperationsTestCase validateCognitiveStatusResultOrganizerCodeTestCase = new OperationsTestCase( + "validateCognitiveStatusResultOrganizerCode", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_RESULT_ORGANIZER_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusResultOrganizer target) { + + } + + @Override + protected void updateToPass(CognitiveStatusResultOrganizer target) { + target.init(); + target.setCode(DatatypesFactory.eINSTANCE.createCE()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusResultOrganizerOperations.validateCognitiveStatusResultOrganizerCode( + (CognitiveStatusResultOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusResultOrganizerCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCognitiveStatusResultOrganizerStatusCodeP() { + OperationsTestCase validateCognitiveStatusResultOrganizerStatusCodePTestCase = new OperationsTestCase( + "validateCognitiveStatusResultOrganizerStatusCodeP", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_RESULT_ORGANIZER_STATUS_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusResultOrganizer target) { + + } + + @Override + protected void updateToPass(CognitiveStatusResultOrganizer target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusResultOrganizerOperations.validateCognitiveStatusResultOrganizerStatusCodeP( + (CognitiveStatusResultOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusResultOrganizerStatusCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCognitiveStatusResultOrganizerStatusCode() { + OperationsTestCase validateCognitiveStatusResultOrganizerStatusCodeTestCase = new OperationsTestCase( + "validateCognitiveStatusResultOrganizerStatusCode", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_RESULT_ORGANIZER_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusResultOrganizer target) { + + } + + @Override + protected void updateToPass(CognitiveStatusResultOrganizer target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusResultOrganizerOperations.validateCognitiveStatusResultOrganizerStatusCode( + (CognitiveStatusResultOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusResultOrganizerStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCognitiveStatusResultOrganizerCognitiveStatusResultObservation() { + OperationsTestCase validateCognitiveStatusResultOrganizerCognitiveStatusResultObservationTestCase = new OperationsTestCase( + "validateCognitiveStatusResultOrganizerCognitiveStatusResultObservation", + operationsForOCL.getOCLValue("VALIDATE_COGNITIVE_STATUS_RESULT_ORGANIZER_COGNITIVE_STATUS_RESULT_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusResultOrganizer target) { + + } + + @Override + protected void updateToPass(CognitiveStatusResultOrganizer target) { + target.init(); + target.addObservation(ConsolFactory.eINSTANCE.createCognitiveStatusResultObservation()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusResultOrganizerOperations.validateCognitiveStatusResultOrganizerCognitiveStatusResultObservation( + (CognitiveStatusResultOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateCognitiveStatusResultOrganizerCognitiveStatusResultObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetCognitiveStatusResultObservations() { + + CognitiveStatusResultOrganizer target = objectFactory.create(); + target.getCognitiveStatusResultObservations(); + + } + + /** + * + * @generated + */ + @Test + public void testValidateResultOrganizerTemplateId() { + OperationsTestCase validateResultOrganizerTemplateIdTestCase = new OperationsTestCase( + "validateResultOrganizerTemplateId", + operationsForOCL.getOCLValue("VALIDATE_RESULT_ORGANIZER_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CognitiveStatusResultOrganizer target) { + + } + + @Override + protected void updateToPass(CognitiveStatusResultOrganizer target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CognitiveStatusResultOrganizerOperations.validateResultOrganizerTemplateId( + (CognitiveStatusResultOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateResultOrganizerTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends CognitiveStatusResultOrganizerOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public CognitiveStatusResultOrganizer create() { + return ConsolFactory.eINSTANCE.createCognitiveStatusResultOrganizer(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends CognitiveStatusResultOrganizerOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // CognitiveStatusResultOrganizerOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/CommentActivityTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/CommentActivityTest.java new file mode 100644 index 000000000..3725b0e55 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/CommentActivityTest.java @@ -0,0 +1,1139 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.AssignedAuthor; +import org.openhealthtools.mdht.uml.cda.Author; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Person; +import org.openhealthtools.mdht.uml.cda.consol.CommentActivity; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ConsolPackage; +import org.openhealthtools.mdht.uml.cda.consol.GeneralStatusSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.CommentActivityOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.AD; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; +import org.openhealthtools.mdht.uml.hl7.vocab.PostalAddressUse; + +/** + * + * A static utility class that provides operations related to 'Comment Activity' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CommentActivity#validateCommentActivityTextReference(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Comment Activity Text Reference}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CommentActivity#validateCommentActivityTextReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Comment Activity Text Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CommentActivity#validateCommentActivityReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Comment Activity Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CommentActivity#validateCommentActivityTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Comment Activity Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CommentActivity#validateCommentActivityClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Comment Activity Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CommentActivity#validateCommentActivityMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Comment Activity Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CommentActivity#validateCommentActivityCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Comment Activity Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CommentActivity#validateCommentActivityText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Comment Activity Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CommentActivity#validateCommentActivityAuthor(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Comment Activity Author}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CommentActivity#validateCommentActivityAuthorAssignedAuthorUSRealmAddressStreet(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Comment Activity Author Assigned Author US Realm Address Street}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CommentActivity#validateCommentActivityAuthorAssignedAuthorUSRealmAddressCity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Comment Activity Author Assigned Author US Realm Address City}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CommentActivity#validateCommentActivityAuthorAssignedAuthorUSRealmAddressCountry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Comment Activity Author Assigned Author US Realm Address Country}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CommentActivity#validateCommentActivityAuthorAssignedAuthorUSRealmAddressPostalCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Comment Activity Author Assigned Author US Realm Address Postal Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CommentActivity#validateCommentActivityAuthorAssignedAuthorUSRealmAddressState(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Comment Activity Author Assigned Author US Realm Address State}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CommentActivity#validateCommentActivityAuthorAssignedAuthorUSRealmAddressStreetAddressLine(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Comment Activity Author Assigned Author US Realm Address Street Address Line}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CommentActivity#validateCommentActivityAuthorAssignedAuthorUSRealmAddressUseP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Comment Activity Author Assigned Author US Realm Address Use P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CommentActivity#validateCommentActivityAuthorAssignedAuthorUSRealmAddressUse(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Comment Activity Author Assigned Author US Realm Address Use}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CommentActivity#validateCommentActivityAuthorAssignedAuthorHasPersonOrOrganization(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Comment Activity Author Assigned Author Has Person Or Organization}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CommentActivity#validateCommentActivityAuthorAssignedAuthorAssignPersonName(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Comment Activity Author Assigned Author Assign Person Name}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CommentActivity#validateCommentActivityAuthorAssignedAuthorAddr(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Comment Activity Author Assigned Author Addr}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CommentActivity#validateCommentActivityAuthorAssignedAuthorId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Comment Activity Author Assigned Author Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CommentActivity#validateCommentActivityAuthorTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Comment Activity Author Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CommentActivity#validateCommentActivityAuthorAssignedAuthor(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Comment Activity Author Assigned Author}
  • + *
+ *

+ * + * @generated + */ + +public class CommentActivityTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateCommentActivityTextReference() { + OperationsTestCase validateCommentActivityTextReferenceTestCase = new OperationsTestCase( + "validateCommentActivityTextReference", + operationsForOCL.getOCLValue("VALIDATE_COMMENT_ACTIVITY_TEXT_REFERENCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CommentActivity target) { + target.init(); + ED txt = DatatypesFactory.eINSTANCE.createED(); + target.setText(txt); + } + + @Override + protected void updateToPass(CommentActivity target) { + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL("test")); + target.setText(txt); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CommentActivityOperations.validateCommentActivityTextReference( + (CommentActivity) objectToTest, diagnostician, map); + } + + }; + + validateCommentActivityTextReferenceTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCommentActivityTextReferenceValue() { + OperationsTestCase validateCommentActivityTextReferenceValueTestCase = new OperationsTestCase( + "validateCommentActivityTextReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_COMMENT_ACTIVITY_TEXT_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CommentActivity target) { + target.init(); + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL()); + target.setText(txt); + } + + @Override + protected void updateToPass(CommentActivity target) { + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL("test")); + target.setText(txt); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CommentActivityOperations.validateCommentActivityTextReferenceValue( + (CommentActivity) objectToTest, diagnostician, map); + } + + }; + + validateCommentActivityTextReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCommentActivityReferenceValue() { + OperationsTestCase validateCommentActivityReferenceValueTestCase = new NarrativeReferenceTestCase( + "validateCommentActivityReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_COMMENT_ACTIVITY_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CommentActivity target) { + target.init(); + + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), "", + "No particular health status observed."); + + // add a reference to the section text + target.setText(createEDWithReference("Some sample text", "#1.2.3.4")); + } + + @Override + protected void updateToPass(CommentActivity target) { + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), + "1.2.3.4", "No particular health status observed."); + + // add a reference to the section text + target.setText(createEDWithReference("Some sample text", "#1.2.3.4")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CommentActivityOperations.validateCommentActivityReferenceValue( + (CommentActivity) objectToTest, diagnostician, map); + } + + }; + + validateCommentActivityReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCommentActivityTemplateId() { + OperationsTestCase validateCommentActivityTemplateIdTestCase = new OperationsTestCase( + "validateCommentActivityTemplateId", + operationsForOCL.getOCLValue("VALIDATE_COMMENT_ACTIVITY_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CommentActivity target) { + + } + + @Override + protected void updateToPass(CommentActivity target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CommentActivityOperations.validateCommentActivityTemplateId( + (CommentActivity) objectToTest, diagnostician, map); + } + + }; + + validateCommentActivityTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCommentActivityClassCode() { + OperationsTestCase validateCommentActivityClassCodeTestCase = new OperationsTestCase( + "validateCommentActivityClassCode", + operationsForOCL.getOCLValue("VALIDATE_COMMENT_ACTIVITY_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CommentActivity target) { + + } + + @Override + protected void updateToPass(CommentActivity target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CommentActivityOperations.validateCommentActivityClassCode( + (CommentActivity) objectToTest, diagnostician, map); + } + + }; + + validateCommentActivityClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCommentActivityMoodCode() { + OperationsTestCase validateCommentActivityMoodCodeTestCase = new OperationsTestCase( + "validateCommentActivityMoodCode", + operationsForOCL.getOCLValue("VALIDATE_COMMENT_ACTIVITY_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CommentActivity target) { + + } + + @Override + protected void updateToPass(CommentActivity target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CommentActivityOperations.validateCommentActivityMoodCode( + (CommentActivity) objectToTest, diagnostician, map); + } + + }; + + validateCommentActivityMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCommentActivityCode() { + OperationsTestCase validateCommentActivityCodeTestCase = new OperationsTestCase( + "validateCommentActivityCode", + operationsForOCL.getOCLValue("VALIDATE_COMMENT_ACTIVITY_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CommentActivity target) { + + } + + @Override + protected void updateToPass(CommentActivity target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CommentActivityOperations.validateCommentActivityCode( + (CommentActivity) objectToTest, diagnostician, map); + } + + }; + + validateCommentActivityCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCommentActivityText() { + OperationsTestCase validateCommentActivityTextTestCase = new OperationsTestCase( + "validateCommentActivityText", + operationsForOCL.getOCLValue("VALIDATE_COMMENT_ACTIVITY_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CommentActivity target) { + + } + + @Override + protected void updateToPass(CommentActivity target) { + target.init(); + + ED text = DatatypesFactory.eINSTANCE.createED(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CommentActivityOperations.validateCommentActivityText( + (CommentActivity) objectToTest, diagnostician, map); + } + + }; + + validateCommentActivityTextTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCommentActivityAuthor() { + OperationsTestCase validateCommentActivityAuthorTestCase = new OperationsTestCase( + "validateCommentActivityAuthor", + operationsForOCL.getOCLValue("VALIDATE_COMMENT_ACTIVITY_AUTHOR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CommentActivity target) { + target.init(); + } + + @Override + protected void updateToPass(CommentActivity target) { + + target.getAuthors().add(CDAFactory.eINSTANCE.createAuthor()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CommentActivityOperations.validateCommentActivityAuthor( + (CommentActivity) objectToTest, diagnostician, map); + } + + }; + + validateCommentActivityAuthorTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCommentActivityAuthorAssignedAuthorUSRealmAddressStreet() { + OperationsTestCase validateCommentActivityAuthorAssignedAuthorUSRealmAddressStreetTestCase = new OperationsTestCase( + "validateCommentActivityAuthorAssignedAuthorUSRealmAddressStreet", + operationsForOCL.getOCLValue("VALIDATE_COMMENT_ACTIVITY_AUTHOR_ASSIGNED_AUTHOR_US_REALM_ADDRESS_STREET__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + public void addFailTests() { + + addFailTest(new FailTest() { + + @Override + public void updateToFail(CommentActivity target) { + target.init(); + Author auth = CDAFactory.eINSTANCE.createAuthor(); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + aa.getAddrs().add(ad); + auth.setAssignedAuthor(aa); + target.getAuthors().add(auth); + + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(CommentActivity target) { + target.init(); + Author auth = CDAFactory.eINSTANCE.createAuthor(); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + + aa.getAddrs().add(ad); + auth.setAssignedAuthor(aa); + target.getAuthors().add(auth); + } + }); + + } + + @Override + protected void updateToPass(CommentActivity target) { + target.getAuthors().clear(); + Author auth = CDAFactory.eINSTANCE.createAuthor(); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + aa.getAddrs().add(createUSRealmAddress()); + auth.setAssignedAuthor(aa); + target.getAuthors().add(auth); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CommentActivityOperations.validateCommentActivityAuthorAssignedAuthorUSRealmAddressStreet( + (CommentActivity) objectToTest, diagnostician, map); + } + + }; + + validateCommentActivityAuthorAssignedAuthorUSRealmAddressStreetTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCommentActivityAuthorAssignedAuthorUSRealmAddressCity() { + OperationsTestCase validateCommentActivityAuthorAssignedAuthorUSRealmAddressCityTestCase = new OperationsTestCase( + "validateCommentActivityAuthorAssignedAuthorUSRealmAddressCity", + operationsForOCL.getOCLValue("VALIDATE_COMMENT_ACTIVITY_AUTHOR_ASSIGNED_AUTHOR_US_REALM_ADDRESS_CITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CommentActivity target) { + target.init(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + author.setTime(DatatypesFactory.eINSTANCE.createTS()); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + aa.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + author.setAssignedAuthor(aa); + target.getAuthors().add(author); + } + + @Override + protected void updateToPass(CommentActivity target) { + target.getAuthors().clear(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + author.setTime(DatatypesFactory.eINSTANCE.createTS()); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + aa.getAddrs().add(createUSRealmAddress()); + author.setAssignedAuthor(aa); + target.getAuthors().add(author); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CommentActivityOperations.validateCommentActivityAuthorAssignedAuthorUSRealmAddressCity( + (CommentActivity) objectToTest, diagnostician, map); + } + + }; + + validateCommentActivityAuthorAssignedAuthorUSRealmAddressCityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCommentActivityAuthorAssignedAuthorUSRealmAddressCountry() { + OperationsTestCase validateCommentActivityAuthorAssignedAuthorUSRealmAddressCountryTestCase = new OperationsTestCase( + "validateCommentActivityAuthorAssignedAuthorUSRealmAddressCountry", + operationsForOCL.getOCLValue("VALIDATE_COMMENT_ACTIVITY_AUTHOR_ASSIGNED_AUTHOR_US_REALM_ADDRESS_COUNTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CommentActivity target) { + target.init(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + author.setTime(DatatypesFactory.eINSTANCE.createTS()); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + aa.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + author.setAssignedAuthor(aa); + target.getAuthors().add(author); + } + + @Override + protected void updateToPass(CommentActivity target) { + target.getAuthors().clear(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + author.setTime(DatatypesFactory.eINSTANCE.createTS()); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + aa.getAddrs().add(createUSRealmAddress()); + author.setAssignedAuthor(aa); + target.getAuthors().add(author); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CommentActivityOperations.validateCommentActivityAuthorAssignedAuthorUSRealmAddressCountry( + (CommentActivity) objectToTest, diagnostician, map); + } + + }; + + validateCommentActivityAuthorAssignedAuthorUSRealmAddressCountryTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCommentActivityAuthorAssignedAuthorUSRealmAddressPostalCode() { + OperationsTestCase validateCommentActivityAuthorAssignedAuthorUSRealmAddressPostalCodeTestCase = new OperationsTestCase( + "validateCommentActivityAuthorAssignedAuthorUSRealmAddressPostalCode", + operationsForOCL.getOCLValue("VALIDATE_COMMENT_ACTIVITY_AUTHOR_ASSIGNED_AUTHOR_US_REALM_ADDRESS_POSTAL_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CommentActivity target) { + target.init(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + author.setTime(DatatypesFactory.eINSTANCE.createTS()); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + aa.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + author.setAssignedAuthor(aa); + target.getAuthors().add(author); + } + + @Override + protected void updateToPass(CommentActivity target) { + target.getAuthors().clear(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + author.setTime(DatatypesFactory.eINSTANCE.createTS()); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + aa.getAddrs().add(createUSRealmAddress()); + author.setAssignedAuthor(aa); + target.getAuthors().add(author); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CommentActivityOperations.validateCommentActivityAuthorAssignedAuthorUSRealmAddressPostalCode( + (CommentActivity) objectToTest, diagnostician, map); + } + + }; + + validateCommentActivityAuthorAssignedAuthorUSRealmAddressPostalCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCommentActivityAuthorAssignedAuthorUSRealmAddressState() { + OperationsTestCase validateCommentActivityAuthorAssignedAuthorUSRealmAddressStateTestCase = new OperationsTestCase( + "validateCommentActivityAuthorAssignedAuthorUSRealmAddressState", + operationsForOCL.getOCLValue("VALIDATE_COMMENT_ACTIVITY_AUTHOR_ASSIGNED_AUTHOR_US_REALM_ADDRESS_STATE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CommentActivity target) { + target.init(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + author.setTime(DatatypesFactory.eINSTANCE.createTS()); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + aa.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + author.setAssignedAuthor(aa); + target.getAuthors().add(author); + } + + @Override + protected void updateToPass(CommentActivity target) { + target.getAuthors().clear(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + author.setTime(DatatypesFactory.eINSTANCE.createTS()); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + aa.getAddrs().add(createUSRealmAddress()); + author.setAssignedAuthor(aa); + target.getAuthors().add(author); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CommentActivityOperations.validateCommentActivityAuthorAssignedAuthorUSRealmAddressState( + (CommentActivity) objectToTest, diagnostician, map); + } + + }; + + validateCommentActivityAuthorAssignedAuthorUSRealmAddressStateTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCommentActivityAuthorAssignedAuthorUSRealmAddressStreetAddressLine() { + OperationsTestCase validateCommentActivityAuthorAssignedAuthorUSRealmAddressStreetAddressLineTestCase = new OperationsTestCase( + "validateCommentActivityAuthorAssignedAuthorUSRealmAddressStreetAddressLine", + operationsForOCL.getOCLValue("VALIDATE_COMMENT_ACTIVITY_AUTHOR_ASSIGNED_AUTHOR_US_REALM_ADDRESS_STREET_ADDRESS_LINE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CommentActivity target) { + target.init(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + author.setTime(DatatypesFactory.eINSTANCE.createTS()); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + aa.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + author.setAssignedAuthor(aa); + target.getAuthors().add(author); + } + + @Override + protected void updateToPass(CommentActivity target) { + target.getAuthors().clear(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + author.setTime(DatatypesFactory.eINSTANCE.createTS()); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + aa.getAddrs().add(createUSRealmAddress()); + author.setAssignedAuthor(aa); + target.getAuthors().add(author); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CommentActivityOperations.validateCommentActivityAuthorAssignedAuthorUSRealmAddressStreetAddressLine( + (CommentActivity) objectToTest, diagnostician, map); + } + + }; + + validateCommentActivityAuthorAssignedAuthorUSRealmAddressStreetAddressLineTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCommentActivityAuthorAssignedAuthorUSRealmAddressUseP() { + OperationsTestCase validateCommentActivityAuthorAssignedAuthorUSRealmAddressUsePTestCase = new OperationsTestCase( + "validateCommentActivityAuthorAssignedAuthorUSRealmAddressUseP", + operationsForOCL.getOCLValue("VALIDATE_COMMENT_ACTIVITY_AUTHOR_ASSIGNED_AUTHOR_US_REALM_ADDRESS_USE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CommentActivity target) { + target.init(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + author.setTime(DatatypesFactory.eINSTANCE.createTS()); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + aa.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + author.setAssignedAuthor(aa); + target.getAuthors().add(author); + } + + @Override + protected void updateToPass(CommentActivity target) { + target.getAuthors().clear(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + author.setTime(DatatypesFactory.eINSTANCE.createTS()); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + aa.getAddrs().add(createUSRealmAddress()); + author.setAssignedAuthor(aa); + target.getAuthors().add(author); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CommentActivityOperations.validateCommentActivityAuthorAssignedAuthorUSRealmAddressUseP( + (CommentActivity) objectToTest, diagnostician, map); + } + + }; + + validateCommentActivityAuthorAssignedAuthorUSRealmAddressUsePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCommentActivityAuthorAssignedAuthorUSRealmAddressUse() { + OperationsTestCase validateCommentActivityAuthorAssignedAuthorUSRealmAddressUseTestCase = new OperationsTestCase( + "validateCommentActivityAuthorAssignedAuthorUSRealmAddressUse", + operationsForOCL.getOCLValue("VALIDATE_COMMENT_ACTIVITY_AUTHOR_ASSIGNED_AUTHOR_US_REALM_ADDRESS_USE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CommentActivity target) { + target.init(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + author.setTime(DatatypesFactory.eINSTANCE.createTS()); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + ad.getUses().add(null); + + aa.getAddrs().add(ad); + author.setAssignedAuthor(aa); + target.getAuthors().add(author); + } + + @Override + protected void updateToPass(CommentActivity target) { + target.getAuthors().clear(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + author.setTime(DatatypesFactory.eINSTANCE.createTS()); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + aa.getAddrs().add(createUSRealmAddress()); + author.setAssignedAuthor(aa); + target.getAuthors().add(author); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CommentActivityOperations.validateCommentActivityAuthorAssignedAuthorUSRealmAddressUse( + (CommentActivity) objectToTest, diagnostician, map); + } + + }; + + validateCommentActivityAuthorAssignedAuthorUSRealmAddressUseTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCommentActivityAuthorAssignedAuthorHasPersonOrOrganization() { + OperationsTestCase validateCommentActivityAuthorAssignedAuthorHasPersonOrOrganizationTestCase = new OperationsTestCase( + "validateCommentActivityAuthorAssignedAuthorHasPersonOrOrganization", + operationsForOCL.getOCLValue("VALIDATE_COMMENT_ACTIVITY_AUTHOR_ASSIGNED_AUTHOR_HAS_PERSON_OR_ORGANIZATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CommentActivity target) { + target.init(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + author.setAssignedAuthor(aa); + target.getAuthors().add(author); + + } + + @Override + protected void updateToPass(CommentActivity target) { + target.getAuthors().clear(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + author.setTime(DatatypesFactory.eINSTANCE.createTS()); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + Person person = CDAFactory.eINSTANCE.createPerson(); + person.getNames().add(DatatypesFactory.eINSTANCE.createPN()); + aa.setAssignedPerson(person); + author.setAssignedAuthor(aa); + target.getAuthors().add(author); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CommentActivityOperations.validateCommentActivityAuthorAssignedAuthorHasPersonOrOrganization( + (CommentActivity) objectToTest, diagnostician, map); + } + + }; + + validateCommentActivityAuthorAssignedAuthorHasPersonOrOrganizationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCommentActivityAuthorAssignedAuthorAssignPersonName() { + OperationsTestCase validateCommentActivityAuthorAssignedAuthorAssignPersonNameTestCase = new OperationsTestCase( + "validateCommentActivityAuthorAssignedAuthorAssignPersonName", + operationsForOCL.getOCLValue("VALIDATE_COMMENT_ACTIVITY_AUTHOR_ASSIGNED_AUTHOR_ASSIGN_PERSON_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + { + this.skipFailsTest(); + } + + @Override + protected void updateToFail(CommentActivity target) { + + } + + @Override + protected void updateToPass(CommentActivity target) { + target.init(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + author.setTime(DatatypesFactory.eINSTANCE.createTS()); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + Person person = CDAFactory.eINSTANCE.createPerson(); + person.getNames().add(DatatypesFactory.eINSTANCE.createPN()); + aa.setAssignedPerson(person); + author.setAssignedAuthor(aa); + target.getAuthors().add(author); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CommentActivityOperations.validateCommentActivityAuthorAssignedAuthorAssignPersonName( + (CommentActivity) objectToTest, diagnostician, map); + } + + }; + + validateCommentActivityAuthorAssignedAuthorAssignPersonNameTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCommentActivityAuthorAssignedAuthorAddr() { + OperationsTestCase validateCommentActivityAuthorAssignedAuthorAddrTestCase = new OperationsTestCase( + "validateCommentActivityAuthorAssignedAuthorAddr", + operationsForOCL.getOCLValue("VALIDATE_COMMENT_ACTIVITY_AUTHOR_ASSIGNED_AUTHOR_ADDR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CommentActivity target) { + target.init(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + author.setTime(DatatypesFactory.eINSTANCE.createTS()); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + aa.getIds().add(DatatypesFactory.eINSTANCE.createII()); + author.setAssignedAuthor(aa); + target.getAuthors().add(author); + } + + @Override + protected void updateToPass(CommentActivity target) { + target.getAuthors().clear(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + author.setTime(DatatypesFactory.eINSTANCE.createTS()); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + aa.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + author.setAssignedAuthor(aa); + target.getAuthors().add(author); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CommentActivityOperations.validateCommentActivityAuthorAssignedAuthorAddr( + (CommentActivity) objectToTest, diagnostician, map); + } + + }; + + validateCommentActivityAuthorAssignedAuthorAddrTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCommentActivityAuthorAssignedAuthorId() { + OperationsTestCase validateCommentActivityAuthorAssignedAuthorIdTestCase = new OperationsTestCase( + "validateCommentActivityAuthorAssignedAuthorId", + operationsForOCL.getOCLValue("VALIDATE_COMMENT_ACTIVITY_AUTHOR_ASSIGNED_AUTHOR_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CommentActivity target) { + target.init(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + author.setTime(DatatypesFactory.eINSTANCE.createTS()); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + author.setAssignedAuthor(aa); + target.getAuthors().add(author); + } + + @Override + protected void updateToPass(CommentActivity target) { + target.getAuthors().clear(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + author.setTime(DatatypesFactory.eINSTANCE.createTS()); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + aa.getIds().add(DatatypesFactory.eINSTANCE.createII()); + author.setAssignedAuthor(aa); + target.getAuthors().add(author); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CommentActivityOperations.validateCommentActivityAuthorAssignedAuthorId( + (CommentActivity) objectToTest, diagnostician, map); + } + + }; + + validateCommentActivityAuthorAssignedAuthorIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCommentActivityAuthorTime() { + OperationsTestCase validateCommentActivityAuthorTimeTestCase = new OperationsTestCase( + "validateCommentActivityAuthorTime", + operationsForOCL.getOCLValue("VALIDATE_COMMENT_ACTIVITY_AUTHOR_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CommentActivity target) { + target.init(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + target.getAuthors().add(author); + } + + @Override + protected void updateToPass(CommentActivity target) { + + target.getAuthors().clear(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + author.setTime(DatatypesFactory.eINSTANCE.createTS()); + target.getAuthors().add(author); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CommentActivityOperations.validateCommentActivityAuthorTime( + (CommentActivity) objectToTest, diagnostician, map); + } + + }; + + validateCommentActivityAuthorTimeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCommentActivityAuthorAssignedAuthor() { + OperationsTestCase validateCommentActivityAuthorAssignedAuthorTestCase = new OperationsTestCase( + "validateCommentActivityAuthorAssignedAuthor", + operationsForOCL.getOCLValue("VALIDATE_COMMENT_ACTIVITY_AUTHOR_ASSIGNED_AUTHOR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CommentActivity target) { + target.init(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + author.setTime(DatatypesFactory.eINSTANCE.createTS()); + target.getAuthors().add(author); + + } + + @Override + protected void updateToPass(CommentActivity target) { + target.getAuthors().clear(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + author.setTime(DatatypesFactory.eINSTANCE.createTS()); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + author.setAssignedAuthor(aa); + target.getAuthors().add(author); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CommentActivityOperations.validateCommentActivityAuthorAssignedAuthor( + (CommentActivity) objectToTest, diagnostician, map); + } + + }; + + validateCommentActivityAuthorAssignedAuthorTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends CommentActivityOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public CommentActivity create() { + return ConsolFactory.eINSTANCE.createCommentActivity(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends CommentActivityOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + + private AD createUSRealmAddress() { + AD addr = DatatypesFactory.eINSTANCE.createAD(); + addr.getUses().add(PostalAddressUse.HP); + addr.addStreetAddressLine("123 Main Street"); + addr.addCity("Boston"); + addr.addState("MA"); + addr.addCountry("US"); + addr.addPostalCode("01001"); + + return addr; + + } + +} // CommentActivityOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ComplicationsSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ComplicationsSectionTest.java new file mode 100644 index 000000000..1c4996858 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ComplicationsSectionTest.java @@ -0,0 +1,338 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ComplicationsSection; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.operations.ComplicationsSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Complications Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ComplicationsSection#validateComplicationsSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Complications Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ComplicationsSection#validateComplicationsSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Complications Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ComplicationsSection#validateComplicationsSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Complications Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ComplicationsSection#validateComplicationsSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Complications Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ComplicationsSection#validateComplicationsSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Complications Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ComplicationsSection#validateComplicationsSectionProblemObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Complications Section Problem Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ComplicationsSection#getProblemObservations() Get Problem Observations}
  • + *
+ *

+ * + * @generated + */ + +public class ComplicationsSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateComplicationsSectionTemplateId() { + OperationsTestCase validateComplicationsSectionTemplateIdTestCase = new OperationsTestCase( + "validateComplicationsSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_COMPLICATIONS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ComplicationsSection target) { + + } + + @Override + protected void updateToPass(ComplicationsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ComplicationsSectionOperations.validateComplicationsSectionTemplateId( + (ComplicationsSection) objectToTest, diagnostician, map); + } + + }; + + validateComplicationsSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateComplicationsSectionCode() { + OperationsTestCase validateComplicationsSectionCodeTestCase = new OperationsTestCase( + "validateComplicationsSectionCode", + operationsForOCL.getOCLValue("VALIDATE_COMPLICATIONS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ComplicationsSection target) { + + } + + @Override + protected void updateToPass(ComplicationsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ComplicationsSectionOperations.validateComplicationsSectionCode( + (ComplicationsSection) objectToTest, diagnostician, map); + } + + }; + + validateComplicationsSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateComplicationsSectionCodeP() { + OperationsTestCase validateComplicationsSectionCodePTestCase = new OperationsTestCase( + "validateComplicationsSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_COMPLICATIONS_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ComplicationsSection target) { + + } + + @Override + protected void updateToPass(ComplicationsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ComplicationsSectionOperations.validateComplicationsSectionCodeP( + (ComplicationsSection) objectToTest, diagnostician, map); + } + + }; + + validateComplicationsSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateComplicationsSectionTitle() { + OperationsTestCase validateComplicationsSectionTitleTestCase = new OperationsTestCase( + "validateComplicationsSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_COMPLICATIONS_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ComplicationsSection target) { + + } + + @Override + protected void updateToPass(ComplicationsSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ComplicationsSectionOperations.validateComplicationsSectionTitle( + (ComplicationsSection) objectToTest, diagnostician, map); + } + + }; + + validateComplicationsSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateComplicationsSectionText() { + OperationsTestCase validateComplicationsSectionTextTestCase = new OperationsTestCase( + "validateComplicationsSectionText", + operationsForOCL.getOCLValue("VALIDATE_COMPLICATIONS_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ComplicationsSection target) { + + } + + @Override + protected void updateToPass(ComplicationsSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ComplicationsSectionOperations.validateComplicationsSectionText( + (ComplicationsSection) objectToTest, diagnostician, map); + } + + }; + + validateComplicationsSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateComplicationsSectionProblemObservation() { + OperationsTestCase validateComplicationsSectionProblemObservationTestCase = new OperationsTestCase( + "validateComplicationsSectionProblemObservation", + operationsForOCL.getOCLValue("VALIDATE_COMPLICATIONS_SECTION_PROBLEM_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ComplicationsSection target) { + + } + + @Override + protected void updateToPass(ComplicationsSection target) { + target.init(); + target.addObservation(ConsolFactory.eINSTANCE.createProblemObservation()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ComplicationsSectionOperations.validateComplicationsSectionProblemObservation( + (ComplicationsSection) objectToTest, diagnostician, map); + } + + }; + + validateComplicationsSectionProblemObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemObservations() { + + ComplicationsSection target = objectFactory.create(); + target.getProblemObservations(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ComplicationsSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ComplicationsSection create() { + return ConsolFactory.eINSTANCE.createComplicationsSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ComplicationsSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ComplicationsSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ConsolAllTests.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ConsolAllTests.java new file mode 100644 index 000000000..83b49e68d --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ConsolAllTests.java @@ -0,0 +1,54 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import junit.framework.Test; +import junit.framework.TestSuite; +import junit.textui.TestRunner; + +/** + * + * A test suite for the 'Consol' model. + * + * @generated + */ +public class ConsolAllTests extends TestSuite { + + /** + * + * + * @generated + */ + public static void main(String[] args) { + TestRunner.run(suite()); + } + + /** + * + * + * @generated + */ + public static Test suite() { + TestSuite suite = new ConsolAllTests("Consol Tests"); + suite.addTest(ConsolTests.suite()); + return suite; + } + + /** + * + * + * @generated + */ + public ConsolAllTests(String name) { + super(name); + } + +} // ConsolAllTests diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ConsolExample.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ConsolExample.java new file mode 100644 index 000000000..973212b7b --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ConsolExample.java @@ -0,0 +1,119 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.io.File; +import java.io.IOException; + +import org.eclipse.emf.common.util.Diagnostic; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; +import org.eclipse.emf.ecore.util.Diagnostician; +import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ConsolPackage; +import org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints; + +/** + * + * A sample utility for the 'consol' package. + * + * @generated + */ +public class ConsolExample { + /** + * + * Load all the argument file paths or URIs as instances of the model. + * + * @param args the file paths or URIs. + * @generated + */ + public static void main(String[] args) { + // Create a resource set to hold the resources. + // + ResourceSet resourceSet = new ResourceSetImpl(); + + // Register the appropriate resource factory to handle all file extensions. + // + resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put( + Resource.Factory.Registry.DEFAULT_EXTENSION, new XMIResourceFactoryImpl()); + + // Register the package to ensure it is available during loading. + // + resourceSet.getPackageRegistry().put(ConsolPackage.eNS_URI, ConsolPackage.eINSTANCE); + + // If there are no arguments, emit an appropriate usage message. + // + if (args.length == 0) { + System.out.println("Enter a list of file paths or URIs that have content like this:"); + try { + Resource resource = resourceSet.createResource(URI.createURI("http:///My.consol")); + GeneralHeaderConstraints root = ConsolFactory.eINSTANCE.createGeneralHeaderConstraints(); + resource.getContents().add(root); + resource.save(System.out, null); + } catch (IOException exception) { + exception.printStackTrace(); + } + } else { + // Iterate over all the arguments. + // + for (int i = 0; i < args.length; ++i) { + // Construct the URI for the instance file. + // The argument is treated as a file path only if it denotes an existing file. + // Otherwise, it's directly treated as a URL. + // + File file = new File(args[i]); + URI uri = file.isFile() + ? URI.createFileURI(file.getAbsolutePath()) + : URI.createURI(args[i]); + + try { + // Demand load resource for this file. + // + Resource resource = resourceSet.getResource(uri, true); + System.out.println("Loaded " + uri); + + // Validate the contents of the loaded resource. + // + for (EObject eObject : resource.getContents()) { + Diagnostic diagnostic = Diagnostician.INSTANCE.validate(eObject); + if (diagnostic.getSeverity() != Diagnostic.OK) { + printDiagnostic(diagnostic, ""); + } + } + } catch (RuntimeException exception) { + System.out.println("Problem loading " + uri); + exception.printStackTrace(); + } + } + } + } + + /** + * + * Prints diagnostics with indentation. + * + * @param diagnostic the diagnostic to print. + * @param indent the indentation for printing. + * @generated + */ + protected static void printDiagnostic(Diagnostic diagnostic, String indent) { + System.out.print(indent); + System.out.println(diagnostic.getMessage()); + for (Diagnostic child : diagnostic.getChildren()) { + printDiagnostic(child, indent + " "); + } + } + +} // ConsolExample diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ConsolTests.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ConsolTests.java new file mode 100644 index 000000000..ec4636547 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ConsolTests.java @@ -0,0 +1,99 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import junit.framework.JUnit4TestAdapter; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +/** + * + * A test suite for the 'consol' package. + * + * + + * @generated + */ +@RunWith(Suite.class) +@Suite.SuiteClasses({ + GeneralHeaderConstraintsTest.class, AllergyProblemActTest.class, AllergyObservationTest.class, + ReactionObservationTest.class, SeverityObservationTest.class, ProcedureActivityProcedureTest.class, + IndicationTest.class, ServiceDeliveryLocationTest.class, MedicationActivityTest.class, + MedicationSupplyOrderTest.class, InstructionsTest.class, MedicationDispenseTest.class, DrugVehicleTest.class, + ProductInstanceTest.class, AllergyStatusObservationTest.class, AgeObservationTest.class, + HealthStatusObservationTest.class, CommentActivityTest.class, NonMedicinalSupplyActivityTest.class, + ProblemConcernActTest.class, ProblemObservationTest.class, ProblemStatusTest.class, + ContinuityOfCareDocumentTest.class, AllergiesSectionTest.class, AllergiesSectionEntriesOptionalTest.class, + MedicationsSectionTest.class, MedicationsSectionEntriesOptionalTest.class, ProblemSectionTest.class, + ProblemSectionEntriesOptionalTest.class, ProceduresSectionTest.class, + ProceduresSectionEntriesOptionalTest.class, ProcedureActivityObservationTest.class, + ProcedureActivityActTest.class, ResultsSectionTest.class, ResultsSectionEntriesOptionalTest.class, + ResultOrganizerTest.class, ResultObservationTest.class, AdvanceDirectivesSectionTest.class, + AdvanceDirectivesSectionEntriesOptionalTest.class, AdvanceDirectiveObservationTest.class, + EncountersSectionTest.class, EncountersSectionEntriesOptionalTest.class, EncounterActivitiesTest.class, + EncounterDiagnosisTest.class, FamilyHistorySectionTest.class, FamilyHistoryOrganizerTest.class, + FamilyHistoryObservationTest.class, FamilyHistoryDeathObservationTest.class, FunctionalStatusSectionTest.class, + FunctionalStatusResultOrganizerTest.class, FunctionalStatusResultObservationTest.class, + CaregiverCharacteristicsTest.class, AssessmentScaleObservationTest.class, + AssessmentScaleSupportingObservationTest.class, CognitiveStatusResultOrganizerTest.class, + CognitiveStatusResultObservationTest.class, FunctionalStatusProblemObservationTest.class, + CognitiveStatusProblemObservationTest.class, PressureUlcerObservationTest.class, + NumberOfPressureUlcersObservationTest.class, HighestPressureUlcerStageTest.class, + ImmunizationsSectionEntriesOptionalTest.class, ImmunizationActivityTest.class, + ImmunizationRefusalReasonTest.class, MedicalEquipmentSectionTest.class, PayersSectionTest.class, + CoverageActivityTest.class, PolicyActivityTest.class, PlanOfCareSectionTest.class, + PlanOfCareActivityActTest.class, PlanOfCareActivityEncounterTest.class, + PlanOfCareActivityObservationTest.class, PlanOfCareActivityProcedureTest.class, + PlanOfCareActivitySubstanceAdministrationTest.class, PlanOfCareActivitySupplyTest.class, + SocialHistorySectionTest.class, SocialHistoryObservationTest.class, PregnancyObservationTest.class, + EstimatedDateOfDeliveryTest.class, SmokingStatusObservationTest.class, TobaccoUseTest.class, + VitalSignsSectionEntriesOptionalTest.class, VitalSignsOrganizerTest.class, VitalSignObservationTest.class, + ImmunizationsSectionTest.class, VitalSignsSectionTest.class, HistoryOfPastIllnessSectionTest.class, + ChiefComplaintSectionTest.class, ReasonForReferralSectionTest.class, HistoryOfPresentIllnessSectionTest.class, + HospitalAdmissionDiagnosisSectionTest.class, HospitalAdmissionDiagnosisTest.class, + HospitalAdmissionMedicationsSectionEntriesOptionalTest.class, AdmissionMedicationTest.class, + MedicationsAdministeredSectionTest.class, PhysicalExamSectionTest.class, GeneralStatusSectionTest.class, + ReviewOfSystemsSectionTest.class, AssessmentAndPlanSectionTest.class, SurgicalDrainsSectionTest.class, + UnstructuredDocumentTest.class, MedicationInformationTest.class, DischargeSummaryTest.class, + HospitalDischargeDiagnosisSectionTest.class, HospitalDischargeDiagnosisTest.class, + DischargeDietSectionTest.class, HospitalDischargeMedicationsSectionEntriesOptionalTest.class, + DischargeMedicationTest.class, HospitalCourseSectionTest.class, + ChiefComplaintAndReasonForVisitSectionTest.class, HospitalConsultationsSectionTest.class, + HospitalDischargeInstructionsSectionTest.class, HospitalDischargePhysicalSectionTest.class, + HospitalDischargeStudiesSummarySectionTest.class, ReasonForVisitSectionTest.class, + PreconditionForSubstanceAdministrationTest.class, ImmunizationMedicationInformationTest.class, + AuthorizationActivityTest.class, HospitalDischargeMedicationsSectionTest.class, AnesthesiaSectionTest.class, + ComplicationsSectionTest.class, DICOMObjectCatalogSectionTest.class, StudyActTest.class, SeriesActTest.class, + SOPInstanceObservationTest.class, PurposeofReferenceObservationTest.class, + ReferencedFramesObservationTest.class, BoundaryObservationTest.class, FindingsSectionTest.class, + InterventionsSectionTest.class, MedicalHistorySectionTest.class, ObjectiveSectionTest.class, + OperativeNoteFluidSectionTest.class, OperativeNoteSurgicalProcedureSectionTest.class, + PlannedProcedureSectionTest.class, PostoperativeDiagnosisSectionTest.class, + PostprocedureDiagnosisSectionTest.class, PostprocedureDiagnosisTest.class, + PreoperativeDiagnosisSectionTest.class, PreoperativeDiagnosisTest.class, ProcedureDescriptionSectionTest.class, + ProcedureDispositionSectionTest.class, ProcedureEstimatedBloodLossSectionTest.class, + ProcedureFindingsSectionTest.class, ProcedureImplantsSectionTest.class, ProcedureIndicationsSectionTest.class, + ProcedureSpecimensTakenSectionTest.class, SubjectiveSectionTest.class, ConsultationNoteTest.class, + AssessmentSectionTest.class, HistoryAndPhysicalNoteTest.class, OperativeNoteTest.class, + ProcedureNoteTest.class, ProgressNoteTest.class, InstructionsSectionTest.class, + DiagnosticImagingReportTest.class, PhysicianReadingStudyPerformerTest.class, + PhysicianofRecordParticipantTest.class, TextObservationTest.class, QuantityMeasurementObservationTest.class, + CodeObservationsTest.class, ProcedureContextTest.class, MedicationUseNoneKnownTest.class, + DeceasedObservationTest.class }) +public class ConsolTests { + + /** + * + * + * @generated + */ + public static junit.framework.Test suite() { + return new JUnit4TestAdapter(ConsolTests.class); + } + +} // ConsolTests diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ConsultationNoteTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ConsultationNoteTest.java new file mode 100644 index 000000000..28e665d50 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ConsultationNoteTest.java @@ -0,0 +1,2270 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Component1; +import org.openhealthtools.mdht.uml.cda.EncompassingEncounter; +import org.openhealthtools.mdht.uml.cda.EncounterParticipant; +import org.openhealthtools.mdht.uml.cda.InFulfillmentOf; +import org.openhealthtools.mdht.uml.cda.ResponsibleParty; +import org.openhealthtools.mdht.uml.cda.consol.AllergiesSection; +import org.openhealthtools.mdht.uml.cda.consol.AssessmentAndPlanSection; +import org.openhealthtools.mdht.uml.cda.consol.AssessmentSection; +import org.openhealthtools.mdht.uml.cda.consol.ChiefComplaintAndReasonForVisitSection; +import org.openhealthtools.mdht.uml.cda.consol.ChiefComplaintSection; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ConsultationNote; +import org.openhealthtools.mdht.uml.cda.consol.FamilyHistorySection; +import org.openhealthtools.mdht.uml.cda.consol.GeneralStatusSection; +import org.openhealthtools.mdht.uml.cda.consol.HistoryOfPastIllnessSection; +import org.openhealthtools.mdht.uml.cda.consol.ImmunizationsSection; +import org.openhealthtools.mdht.uml.cda.consol.MedicationsSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.PhysicalExamSection; +import org.openhealthtools.mdht.uml.cda.consol.PlanOfCareSection; +import org.openhealthtools.mdht.uml.cda.consol.ProblemSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.ProceduresSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.ReasonForReferralSection; +import org.openhealthtools.mdht.uml.cda.consol.ReasonForVisitSection; +import org.openhealthtools.mdht.uml.cda.consol.ResultsSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.ReviewOfSystemsSection; +import org.openhealthtools.mdht.uml.cda.consol.SocialHistorySection; +import org.openhealthtools.mdht.uml.cda.consol.VitalSignsSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.operations.ConsultationNoteOperations; +import org.openhealthtools.mdht.uml.cda.consol.operations.GeneralHeaderConstraintsOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; + +/** + * + * A static utility class that provides operations related to 'Consultation Note' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#validateConsultationNoteHasAnAssementAndPlanSectionOrIndividualAssementAndPlanSections(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note Has An Assement And Plan Section Or Individual Assement And Plan Sections}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#validateConsultationNoteDoesNotHaveIndividualAssementAndPlanSectionsWhenAssementAndPlanSectionPresent(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note Does Not Have Individual Assement And Plan Sections When Assement And Plan Section Present}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#validateConsultationNoteDoesNotHaveChiefComplaintAndReasonForVisitWithChiefComplaintSectionOrReasonSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note Does Not Have Chief Complaint And Reason For Visit With Chief Complaint Section Or Reason Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#validateConsultationNoteHasReasonForReferralOrReasonForVisit(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note Has Reason For Referral Or Reason For Visit}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#validateConsultationNoteTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#validateConsultationNoteCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#validateConsultationNoteCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#validateConsultationNoteComponentOf(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note Component Of}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#validateConsultationNoteAssessmentSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note Assessment Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#validateConsultationNoteAssessmentAndPlanSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note Assessment And Plan Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#validateConsultationNotePlanOfCareSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note Plan Of Care Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#validateConsultationNoteHistoryOfPresentIllness(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note History Of Present Illness}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#validateConsultationNotePhysicalExamSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note Physical Exam Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#validateConsultationNoteReasonForReferralSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note Reason For Referral Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#validateConsultationNoteReasonForVisitSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note Reason For Visit Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#validateConsultationNoteAllergiesSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note Allergies Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#validateConsultationNoteChiefComplaintSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note Chief Complaint Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#validateConsultationNoteChiefComplaintAndReasonForVisitSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note Chief Complaint And Reason For Visit Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#validateConsultationNoteFamilyHistorySection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note Family History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#validateConsultationNoteGeneralStatusSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note General Status Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#validateConsultationNoteHistoryOfPastIllnessSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note History Of Past Illness Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#validateConsultationNoteImmunizationsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note Immunizations Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#validateConsultationNoteMedicationsSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note Medications Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#validateConsultationNoteProblemSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note Problem Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#validateConsultationNoteProceduresSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note Procedures Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#validateConsultationNoteResultsSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note Results Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#validateConsultationNoteReviewOfSystemsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note Review Of Systems Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#validateConsultationNoteSocialHistorySection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note Social History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#validateConsultationNoteVitalSignsSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note Vital Signs Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#validateConsultationNoteInFulfillmentOf(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note In Fulfillment Of}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#validateConsultationNoteComponentOfEncompassingEncounter2ResponsiblePartyAssignedEntityHasPersonOrganizationOrBoth(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note Component Of Encompassing Encounter2 Responsible Party Assigned Entity Has Person Organization Or Both}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#validateConsultationNoteComponentOfEncompassingEncounter2ResponsiblePartyAssignedEntity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note Component Of Encompassing Encounter2 Responsible Party Assigned Entity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#validateConsultationNoteComponentOfEncompassingEncounter2EncounterParticipantAssignedEntityHasPersonOrganizationOrBoth(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note Component Of Encompassing Encounter2 Encounter Participant Assigned Entity Has Person Organization Or Both}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#validateConsultationNoteComponentOfEncompassingEncounter2EncounterParticipantAssignedEntity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note Component Of Encompassing Encounter2 Encounter Participant Assigned Entity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#validateConsultationNoteComponentOfEncompassingEncounter2EffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note Component Of Encompassing Encounter2 Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#validateConsultationNoteComponentOfEncompassingEncounter2Id(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note Component Of Encompassing Encounter2 Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#validateConsultationNoteComponentOfEncompassingEncounter2ResponsibleParty(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note Component Of Encompassing Encounter2 Responsible Party}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#validateConsultationNoteComponentOfEncompassingEncounter2EncounterParticipant(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note Component Of Encompassing Encounter2 Encounter Participant}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#validateConsultationNoteComponentOfEncompassingEncounter(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note Component Of Encompassing Encounter}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#validateConsultationNoteInFulfillmentOfOrderId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note In Fulfillment Of Order Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#validateConsultationNoteInFulfillmentOfOrder(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Note In Fulfillment Of Order}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#getAssessmentSection() Get Assessment Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#getAssessmentAndPlanSection() Get Assessment And Plan Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#getPlanOfCareSection() Get Plan Of Care Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#getHistoryOfPresentIllness() Get History Of Present Illness}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#getPhysicalExamSection() Get Physical Exam Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#getReasonForReferralSection() Get Reason For Referral Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#getReasonForVisitSection() Get Reason For Visit Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#getAllergiesSection() Get Allergies Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#getChiefComplaintSection() Get Chief Complaint Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#getChiefComplaintAndReasonForVisitSection() Get Chief Complaint And Reason For Visit Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#getFamilyHistorySection() Get Family History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#getGeneralStatusSection() Get General Status Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#getHistoryOfPastIllnessSection() Get History Of Past Illness Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#getImmunizationsSection() Get Immunizations Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#getMedicationsSectionEntriesOptional() Get Medications Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#getProblemSectionEntriesOptional() Get Problem Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#getProceduresSectionEntriesOptional() Get Procedures Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#getResultsSectionEntriesOptional() Get Results Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#getReviewOfSystemsSection() Get Review Of Systems Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#getSocialHistorySection() Get Social History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ConsultationNote#getVitalSignsSectionEntriesOptional() Get Vital Signs Section Entries Optional}
  • + *
+ *

+ * + * @generated + */ + +public class ConsultationNoteTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateConsultationNoteHasAnAssementAndPlanSectionOrIndividualAssementAndPlanSections() { + OperationsTestCase validateConsultationNoteHasAnAssementAndPlanSectionOrIndividualAssementAndPlanSectionsTestCase = new OperationsTestCase( + "validateConsultationNoteHasAnAssementAndPlanSectionOrIndividualAssementAndPlanSections", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_HAS_AN_ASSEMENT_AND_PLAN_SECTION_OR_INDIVIDUAL_ASSEMENT_AND_PLAN_SECTIONS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + public void addFailTests() { + + addFailTest(new FailTest() { + @Override + public void updateToFail(ConsultationNote target) { + target.init(); + } + + }); + + addFailTest(new FailTest() { + @Override + public void updateToFail(ConsultationNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createAssessmentSection().init()); + } + + }); + + addFailTest(new FailTest() { + @Override + public void updateToFail(ConsultationNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createPlanOfCareSection().init()); + } + + }); + + } + + /* + * (non-Javadoc) + * + * @see org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest.OperationsTestCase#addPassTests() + */ + @Override + public void addPassTests() { + addPassTest(new PassTest() { + @Override + public void updateToPass(ConsultationNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createAssessmentAndPlanSection().init()); + + } + }); + + addPassTest(new PassTest() { + @Override + public void updateToPass(ConsultationNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createAssessmentSection().init()); + target.addSection(ConsolFactory.eINSTANCE.createPlanOfCareSection().init()); + } + }); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteHasAnAssementAndPlanSectionOrIndividualAssementAndPlanSections( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteHasAnAssementAndPlanSectionOrIndividualAssementAndPlanSectionsTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateConsultationNoteDoesNotHaveIndividualAssementAndPlanSectionsWhenAssementAndPlanSectionPresent() { + OperationsTestCase validateConsultationNoteDoesNotHaveIndividualAssementAndPlanSectionsWhenAssementAndPlanSectionPresentTestCase = new OperationsTestCase( + "validateConsultationNoteDoesNotHaveIndividualAssementAndPlanSectionsWhenAssementAndPlanSectionPresent", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_DOES_NOT_HAVE_INDIVIDUAL_ASSEMENT_AND_PLAN_SECTIONS_WHEN_ASSEMENT_AND_PLAN_SECTION_PRESENT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + /* + * (non-Javadoc) + * + * @see org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest.OperationsTestCase#addFailTests() + */ + @Override + public void addFailTests() { + + addFailTest(new FailTest() { + @Override + public void updateToFail(ConsultationNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createAssessmentAndPlanSection().init()); + target.addSection(ConsolFactory.eINSTANCE.createPlanOfCareSection().init()); + } + + }); + + addFailTest(new FailTest() { + @Override + public void updateToFail(ConsultationNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createAssessmentAndPlanSection().init()); + target.addSection(ConsolFactory.eINSTANCE.createAssessmentSection().init()); + } + + }); + + addFailTest(new FailTest() { + @Override + public void updateToFail(ConsultationNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createAssessmentAndPlanSection().init()); + target.addSection(ConsolFactory.eINSTANCE.createAssessmentSection().init()); + target.addSection(ConsolFactory.eINSTANCE.createPlanOfCareSection().init()); + } + + }); + + } + + @Override + public void addPassTests() { + addPassTest(new PassTest() { + @Override + public void updateToPass(ConsultationNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createAssessmentAndPlanSection().init()); + + } + }); + + addPassTest(new PassTest() { + @Override + public void updateToPass(ConsultationNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createAssessmentSection().init()); + target.addSection(ConsolFactory.eINSTANCE.createPlanOfCareSection().init()); + } + }); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteDoesNotHaveIndividualAssementAndPlanSectionsWhenAssementAndPlanSectionPresent( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteDoesNotHaveIndividualAssementAndPlanSectionsWhenAssementAndPlanSectionPresentTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateConsultationNoteDoesNotHaveChiefComplaintAndReasonForVisitWithChiefComplaintSectionOrReasonSection() { + OperationsTestCase validateConsultationNoteDoesNotHaveChiefComplaintAndReasonForVisitWithChiefComplaintSectionOrReasonSectionTestCase = new OperationsTestCase( + "validateConsultationNoteDoesNotHaveChiefComplaintAndReasonForVisitWithChiefComplaintSectionOrReasonSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_DOES_NOT_HAVE_CHIEF_COMPLAINT_AND_REASON_FOR_VISIT_WITH_CHIEF_COMPLAINT_SECTION_OR_REASON_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + public void addFailTests() { + + addFailTest(new FailTest() { + @Override + public void updateToFail(ConsultationNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createChiefComplaintAndReasonForVisitSection().init()); + target.addSection(ConsolFactory.eINSTANCE.createChiefComplaintSection().init()); + } + + }); + + addFailTest(new FailTest() { + @Override + public void updateToFail(ConsultationNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createChiefComplaintAndReasonForVisitSection().init()); + target.addSection(ConsolFactory.eINSTANCE.createReasonForVisitSection().init()); + } + + }); + + addFailTest(new FailTest() { + @Override + public void updateToFail(ConsultationNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createChiefComplaintAndReasonForVisitSection().init()); + target.addSection(ConsolFactory.eINSTANCE.createChiefComplaintSection().init()); + target.addSection(ConsolFactory.eINSTANCE.createReasonForVisitSection().init()); + } + + }); + + } + + @Override + public void addPassTests() { + addPassTest(new PassTest() { + @Override + public void updateToPass(ConsultationNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createChiefComplaintAndReasonForVisitSection().init()); + + } + }); + + addPassTest(new PassTest() { + @Override + public void updateToPass(ConsultationNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createChiefComplaintSection().init()); + target.addSection(ConsolFactory.eINSTANCE.createReasonForVisitSection().init()); + } + }); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteDoesNotHaveChiefComplaintAndReasonForVisitWithChiefComplaintSectionOrReasonSection( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteDoesNotHaveChiefComplaintAndReasonForVisitWithChiefComplaintSectionOrReasonSectionTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateConsultationNoteHasReasonForReferralOrReasonForVisit() { + OperationsTestCase validateConsultationNoteHasReasonForReferralOrReasonForVisitTestCase = new OperationsTestCase( + "validateConsultationNoteHasReasonForReferralOrReasonForVisit", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_HAS_REASON_FOR_REFERRAL_OR_REASON_FOR_VISIT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + + } + + @Override + public void addPassTests() { + addPassTest(new PassTest() { + @Override + public void updateToPass(ConsultationNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createReasonForReferralSection().init()); + + } + }); + + addPassTest(new PassTest() { + @Override + public void updateToPass(ConsultationNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createReasonForVisitSection().init()); + } + }); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteHasReasonForReferralOrReasonForVisit( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteHasReasonForReferralOrReasonForVisitTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateConsultationNoteTemplateId() { + OperationsTestCase validateConsultationNoteTemplateIdTestCase = new OperationsTestCase( + "validateConsultationNoteTemplateId", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + + } + + @Override + protected void updateToPass(ConsultationNote target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteTemplateId( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateConsultationNoteCodeP() { + OperationsTestCase validateConsultationNoteCodePTestCase = new OperationsTestCase( + "validateConsultationNoteCodeP", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + + } + + @Override + protected void updateToPass(ConsultationNote target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteCodeP( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateConsultationNoteCode() { + OperationsTestCase validateConsultationNoteCodeTestCase = new OperationsTestCase( + "validateConsultationNoteCode", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + + } + + @Override + protected void updateToPass(ConsultationNote target) { + target.init(); + target.setCode(DatatypesFactory.eINSTANCE.createCE("11488-4", "2.16.840.1.113883.6.1")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteCode( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateConsultationNoteInFulfillmentOf() { + OperationsTestCase validateConsultationNoteInFulfillmentOfTestCase = new OperationsTestCase( + "validateConsultationNoteInFulfillmentOf", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_IN_FULFILLMENT_OF__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + target.init(); + + } + + @Override + protected void updateToPass(ConsultationNote target) { + InFulfillmentOf ifo = CDAFactory.eINSTANCE.createInFulfillmentOf(); + target.getInFulfillmentOfs().add(ifo); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteInFulfillmentOf( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteInFulfillmentOfTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateConsultationNoteComponentOf() { + OperationsTestCase validateConsultationNoteComponentOfTestCase = new OperationsTestCase( + "validateConsultationNoteComponentOf", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_COMPONENT_OF__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + target.init(); + } + + @Override + protected void updateToPass(ConsultationNote target) { + Component1 component = CDAFactory.eINSTANCE.createComponent1(); + target.setComponentOf(component); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteComponentOf( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteComponentOfTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateConsultationNoteAssessmentSection() { + OperationsTestCase validateConsultationNoteAssessmentSectionTestCase = new OperationsTestCase( + "validateConsultationNoteAssessmentSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_ASSESSMENT_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + + } + + @Override + protected void updateToPass(ConsultationNote target) { + target.init(); + + /* AssessmentSection */ + AssessmentSection section = + + ConsolFactory.eINSTANCE.createAssessmentSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteAssessmentSection( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteAssessmentSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateConsultationNoteAssessmentAndPlanSection() { + OperationsTestCase validateConsultationNoteAssessmentAndPlanSectionTestCase = new OperationsTestCase( + "validateConsultationNoteAssessmentAndPlanSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_ASSESSMENT_AND_PLAN_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + + } + + @Override + protected void updateToPass(ConsultationNote target) { + target.init(); + + /* AssessmentAndPlanSection */ + AssessmentAndPlanSection section = + + ConsolFactory.eINSTANCE.createAssessmentAndPlanSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteAssessmentAndPlanSection( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteAssessmentAndPlanSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateConsultationNotePlanOfCareSection() { + OperationsTestCase validateConsultationNotePlanOfCareSectionTestCase = new OperationsTestCase( + "validateConsultationNotePlanOfCareSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_PLAN_OF_CARE_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + + } + + @Override + protected void updateToPass(ConsultationNote target) { + target.init(); + + /* PlanOfCareSection */ + PlanOfCareSection section = + + ConsolFactory.eINSTANCE.createPlanOfCareSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNotePlanOfCareSection( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNotePlanOfCareSectionTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateConsultationNoteHistoryOfPresentIllness() { + OperationsTestCase validateConsultationNoteHistoryOfPresentIllnessTestCase = new OperationsTestCase( + "validateConsultationNoteHistoryOfPresentIllness", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_HISTORY_OF_PRESENT_ILLNESS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + target.init(); + } + + @Override + protected void updateToPass(ConsultationNote target) { + + target.addSection(ConsolFactory.eINSTANCE.createHistoryOfPresentIllnessSection()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteHistoryOfPresentIllness( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteHistoryOfPresentIllnessTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateConsultationNotePhysicalExamSection() { + OperationsTestCase validateConsultationNotePhysicalExamSectionTestCase = new OperationsTestCase( + "validateConsultationNotePhysicalExamSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_PHYSICAL_EXAM_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + + } + + @Override + protected void updateToPass(ConsultationNote target) { + target.init(); + + /* PhysicalExamSection */ + PhysicalExamSection section = + + ConsolFactory.eINSTANCE.createPhysicalExamSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNotePhysicalExamSection( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNotePhysicalExamSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateConsultationNoteReasonForReferralSection() { + OperationsTestCase validateConsultationNoteReasonForReferralSectionTestCase = new OperationsTestCase( + "validateConsultationNoteReasonForReferralSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_REASON_FOR_REFERRAL_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + + } + + @Override + protected void updateToPass(ConsultationNote target) { + target.init(); + + /* ReasonForReferralSection */ + ReasonForReferralSection section = + + ConsolFactory.eINSTANCE.createReasonForReferralSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteReasonForReferralSection( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteReasonForReferralSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateConsultationNoteReasonForVisitSection() { + OperationsTestCase validateConsultationNoteReasonForVisitSectionTestCase = new OperationsTestCase( + "validateConsultationNoteReasonForVisitSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_REASON_FOR_VISIT_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + + } + + @Override + protected void updateToPass(ConsultationNote target) { + target.init(); + + /* ReasonForVisitSection */ + ReasonForVisitSection section = + + ConsolFactory.eINSTANCE.createReasonForVisitSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteReasonForVisitSection( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteReasonForVisitSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateConsultationNoteAllergiesSection() { + OperationsTestCase validateConsultationNoteAllergiesSectionTestCase = new OperationsTestCase( + "validateConsultationNoteAllergiesSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_ALLERGIES_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + + } + + @Override + protected void updateToPass(ConsultationNote target) { + target.init(); + + /* AllergiesSection */ + AllergiesSection section = + + ConsolFactory.eINSTANCE.createAllergiesSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteAllergiesSection( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteAllergiesSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateConsultationNoteChiefComplaintSection() { + OperationsTestCase validateConsultationNoteChiefComplaintSectionTestCase = new OperationsTestCase( + "validateConsultationNoteChiefComplaintSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_CHIEF_COMPLAINT_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + + } + + @Override + protected void updateToPass(ConsultationNote target) { + target.init(); + + /* ChiefComplaintSection */ + ChiefComplaintSection section = + + ConsolFactory.eINSTANCE.createChiefComplaintSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteChiefComplaintSection( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteChiefComplaintSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateConsultationNoteChiefComplaintAndReasonForVisitSection() { + OperationsTestCase validateConsultationNoteChiefComplaintAndReasonForVisitSectionTestCase = new OperationsTestCase( + "validateConsultationNoteChiefComplaintAndReasonForVisitSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_CHIEF_COMPLAINT_AND_REASON_FOR_VISIT_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + + } + + @Override + protected void updateToPass(ConsultationNote target) { + target.init(); + + /* ChiefComplaintAndReasonForVisitSection */ + ChiefComplaintAndReasonForVisitSection section = + + ConsolFactory.eINSTANCE.createChiefComplaintAndReasonForVisitSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteChiefComplaintAndReasonForVisitSection( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteChiefComplaintAndReasonForVisitSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateConsultationNoteFamilyHistorySection() { + OperationsTestCase validateConsultationNoteFamilyHistorySectionTestCase = new OperationsTestCase( + "validateConsultationNoteFamilyHistorySection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_FAMILY_HISTORY_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + + } + + @Override + protected void updateToPass(ConsultationNote target) { + target.init(); + + /* FamilyHistorySection */ + FamilyHistorySection section = + + ConsolFactory.eINSTANCE.createFamilyHistorySection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteFamilyHistorySection( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteFamilyHistorySectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateConsultationNoteGeneralStatusSection() { + OperationsTestCase validateConsultationNoteGeneralStatusSectionTestCase = new OperationsTestCase( + "validateConsultationNoteGeneralStatusSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_GENERAL_STATUS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + + } + + @Override + protected void updateToPass(ConsultationNote target) { + target.init(); + + /* GeneralStatusSection */ + GeneralStatusSection section = + + ConsolFactory.eINSTANCE.createGeneralStatusSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteGeneralStatusSection( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteGeneralStatusSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateConsultationNoteHistoryOfPastIllnessSection() { + OperationsTestCase validateConsultationNoteHistoryOfPastIllnessSectionTestCase = new OperationsTestCase( + "validateConsultationNoteHistoryOfPastIllnessSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_HISTORY_OF_PAST_ILLNESS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + + } + + @Override + protected void updateToPass(ConsultationNote target) { + target.init(); + + /* HistoryOfPastIllnessSection */ + HistoryOfPastIllnessSection section = + + ConsolFactory.eINSTANCE.createHistoryOfPastIllnessSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteHistoryOfPastIllnessSection( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteHistoryOfPastIllnessSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateConsultationNoteImmunizationsSection() { + OperationsTestCase validateConsultationNoteImmunizationsSectionTestCase = new OperationsTestCase( + "validateConsultationNoteImmunizationsSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_IMMUNIZATIONS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + + } + + @Override + protected void updateToPass(ConsultationNote target) { + target.init(); + + /* ImmunizationsSection */ + ImmunizationsSection section = + + ConsolFactory.eINSTANCE.createImmunizationsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteImmunizationsSection( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteImmunizationsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateConsultationNoteMedicationsSectionEntriesOptional() { + OperationsTestCase validateConsultationNoteMedicationsSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateConsultationNoteMedicationsSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_MEDICATIONS_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + + } + + @Override + protected void updateToPass(ConsultationNote target) { + target.init(); + + /* MedicationsSectionEntriesOptional */ + MedicationsSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createMedicationsSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteMedicationsSectionEntriesOptional( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteMedicationsSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateConsultationNoteProblemSectionEntriesOptional() { + OperationsTestCase validateConsultationNoteProblemSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateConsultationNoteProblemSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_PROBLEM_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + + } + + @Override + protected void updateToPass(ConsultationNote target) { + target.init(); + + /* ProblemSectionEntriesOptional */ + ProblemSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createProblemSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteProblemSectionEntriesOptional( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteProblemSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateConsultationNoteProceduresSectionEntriesOptional() { + OperationsTestCase validateConsultationNoteProceduresSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateConsultationNoteProceduresSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_PROCEDURES_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + + } + + @Override + protected void updateToPass(ConsultationNote target) { + target.init(); + + /* ProceduresSectionEntriesOptional */ + ProceduresSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createProceduresSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteProceduresSectionEntriesOptional( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteProceduresSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateConsultationNoteResultsSectionEntriesOptional() { + OperationsTestCase validateConsultationNoteResultsSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateConsultationNoteResultsSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_RESULTS_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + + } + + @Override + protected void updateToPass(ConsultationNote target) { + target.init(); + + /* ResultsSectionEntriesOptional */ + ResultsSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createResultsSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteResultsSectionEntriesOptional( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteResultsSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateConsultationNoteReviewOfSystemsSection() { + OperationsTestCase validateConsultationNoteReviewOfSystemsSectionTestCase = new OperationsTestCase( + "validateConsultationNoteReviewOfSystemsSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_REVIEW_OF_SYSTEMS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + + } + + @Override + protected void updateToPass(ConsultationNote target) { + target.init(); + + /* ReviewOfSystemsSection */ + ReviewOfSystemsSection section = + + ConsolFactory.eINSTANCE.createReviewOfSystemsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteReviewOfSystemsSection( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteReviewOfSystemsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateConsultationNoteSocialHistorySection() { + OperationsTestCase validateConsultationNoteSocialHistorySectionTestCase = new OperationsTestCase( + "validateConsultationNoteSocialHistorySection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_SOCIAL_HISTORY_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + + } + + @Override + protected void updateToPass(ConsultationNote target) { + target.init(); + + /* SocialHistorySection */ + SocialHistorySection section = + + ConsolFactory.eINSTANCE.createSocialHistorySection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteSocialHistorySection( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteSocialHistorySectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateConsultationNoteVitalSignsSectionEntriesOptional() { + OperationsTestCase validateConsultationNoteVitalSignsSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateConsultationNoteVitalSignsSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_VITAL_SIGNS_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + + } + + @Override + protected void updateToPass(ConsultationNote target) { + target.init(); + + /* VitalSignsSectionEntriesOptional */ + VitalSignsSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createVitalSignsSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteVitalSignsSectionEntriesOptional( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteVitalSignsSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateConsultationNoteInFulfillmentOfOrderId() { + OperationsTestCase validateConsultationNoteInFulfillmentOfOrderIdTestCase = new OperationsTestCase( + "validateConsultationNoteInFulfillmentOfOrderId", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_IN_FULFILLMENT_OF_ORDER_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + target.init(); + InFulfillmentOf ifo = CDAFactory.eINSTANCE.createInFulfillmentOf(); + ifo.setOrder(CDAFactory.eINSTANCE.createOrder()); + target.getInFulfillmentOfs().add(ifo); + } + + @Override + protected void updateToPass(ConsultationNote target) { + target.getInFulfillmentOfs().clear(); + InFulfillmentOf ifo = CDAFactory.eINSTANCE.createInFulfillmentOf(); + ifo.setOrder(CDAFactory.eINSTANCE.createOrder()); + ifo.getOrder().getIds().add(DatatypesFactory.eINSTANCE.createII()); + target.getInFulfillmentOfs().add(ifo); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteInFulfillmentOfOrderId( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteInFulfillmentOfOrderIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateConsultationNoteInFulfillmentOfOrder() { + OperationsTestCase validateConsultationNoteInFulfillmentOfOrderTestCase = new OperationsTestCase( + "validateConsultationNoteInFulfillmentOfOrder", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_IN_FULFILLMENT_OF_ORDER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + target.init(); + InFulfillmentOf ifo = CDAFactory.eINSTANCE.createInFulfillmentOf(); + target.getInFulfillmentOfs().add(ifo); + } + + @Override + protected void updateToPass(ConsultationNote target) { + target.getInFulfillmentOfs().clear(); + InFulfillmentOf ifo = CDAFactory.eINSTANCE.createInFulfillmentOf(); + ifo.setOrder(CDAFactory.eINSTANCE.createOrder()); + target.getInFulfillmentOfs().add(ifo); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteInFulfillmentOfOrder( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteInFulfillmentOfOrderTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateConsultationNoteComponentOfEncompassingEncounter2EncounterParticipantAssignedEntityHasPersonOrganizationOrBoth() { + OperationsTestCase validateConsultationNoteComponentOfEncompassingEncounter2EncounterParticipantAssignedEntityHasPersonOrganizationOrBothTestCase = new OperationsTestCase( + "validateConsultationNoteComponentOfEncompassingEncounter2EncounterParticipantAssignedEntityHasPersonOrganizationOrBoth", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_COMPONENT_OF_ENCOMPASSING_ENCOUNTER2_ENCOUNTER_PARTICIPANT_ASSIGNED_ENTITY_HAS_PERSON_ORGANIZATION_OR_BOTH__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + target.init(); + Component1 component = CDAFactory.eINSTANCE.createComponent1(); + EncounterParticipant ep = CDAFactory.eINSTANCE.createEncounterParticipant(); + + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + + ep.setAssignedEntity(CDAFactory.eINSTANCE.createAssignedEntity()); + + ee.getEncounterParticipants().add(ep); + component.setEncompassingEncounter(ee); + + target.setComponentOf(component); + } + + @Override + protected void updateToPass(ConsultationNote target) { + target.getComponentOf().getEncompassingEncounter().getEncounterParticipants().clear(); + + EncounterParticipant ep = CDAFactory.eINSTANCE.createEncounterParticipant(); + + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + + ep.setAssignedEntity(CDAFactory.eINSTANCE.createAssignedEntity()); + ep.getAssignedEntity().setAssignedPerson(CDAFactory.eINSTANCE.createPerson()); + ee.getEncounterParticipants().add(ep); + + target.getComponentOf().getEncompassingEncounter().getEncounterParticipants().add(ep); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteComponentOfEncompassingEncounter2EncounterParticipantAssignedEntityHasPersonOrganizationOrBoth( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteComponentOfEncompassingEncounter2EncounterParticipantAssignedEntityHasPersonOrganizationOrBothTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateConsultationNoteComponentOfEncompassingEncounter2EncounterParticipantAssignedEntity() { + OperationsTestCase validateConsultationNoteComponentOfEncompassingEncounter2EncounterParticipantAssignedEntityTestCase = new OperationsTestCase( + "validateConsultationNoteComponentOfEncompassingEncounter2EncounterParticipantAssignedEntity", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_COMPONENT_OF_ENCOMPASSING_ENCOUNTER2_ENCOUNTER_PARTICIPANT_ASSIGNED_ENTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + target.init(); + Component1 component = CDAFactory.eINSTANCE.createComponent1(); + EncounterParticipant ep = CDAFactory.eINSTANCE.createEncounterParticipant(); + + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + ee.getEncounterParticipants().add(ep); + component.setEncompassingEncounter(ee); + + target.setComponentOf(component); + } + + @Override + protected void updateToPass(ConsultationNote target) { + target.getComponentOf().getEncompassingEncounter().getEncounterParticipants().clear(); + EncounterParticipant ep = CDAFactory.eINSTANCE.createEncounterParticipant(); + ep.setAssignedEntity(CDAFactory.eINSTANCE.createAssignedEntity()); + target.getComponentOf().getEncompassingEncounter().getEncounterParticipants().add(ep); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteComponentOfEncompassingEncounter2EncounterParticipantAssignedEntity( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteComponentOfEncompassingEncounter2EncounterParticipantAssignedEntityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateConsultationNoteComponentOfEncompassingEncounter2ResponsiblePartyAssignedEntityHasPersonOrganizationOrBoth() { + OperationsTestCase validateConsultationNoteComponentOfEncompassingEncounter2ResponsiblePartyAssignedEntityHasPersonOrganizationOrBothTestCase = new OperationsTestCase( + "validateConsultationNoteComponentOfEncompassingEncounter2ResponsiblePartyAssignedEntityHasPersonOrganizationOrBoth", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_COMPONENT_OF_ENCOMPASSING_ENCOUNTER2_RESPONSIBLE_PARTY_ASSIGNED_ENTITY_HAS_PERSON_ORGANIZATION_OR_BOTH__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + target.init(); + Component1 component = CDAFactory.eINSTANCE.createComponent1(); + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + ResponsibleParty rp = CDAFactory.eINSTANCE.createResponsibleParty(); + rp.setAssignedEntity(CDAFactory.eINSTANCE.createAssignedEntity()); + + ee.setResponsibleParty(rp); + + component.setEncompassingEncounter(ee); + target.setComponentOf(component); + } + + @Override + protected void updateToPass(ConsultationNote target) { + + target.getComponentOf().getEncompassingEncounter().getResponsibleParty().getAssignedEntity().getRepresentedOrganizations().add( + CDAFactory.eINSTANCE.createOrganization()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteComponentOfEncompassingEncounter2ResponsiblePartyAssignedEntityHasPersonOrganizationOrBoth( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteComponentOfEncompassingEncounter2ResponsiblePartyAssignedEntityHasPersonOrganizationOrBothTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateConsultationNoteComponentOfEncompassingEncounter2ResponsiblePartyAssignedEntity() { + OperationsTestCase validateConsultationNoteComponentOfEncompassingEncounter2ResponsiblePartyAssignedEntityTestCase = new OperationsTestCase( + "validateConsultationNoteComponentOfEncompassingEncounter2ResponsiblePartyAssignedEntity", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_COMPONENT_OF_ENCOMPASSING_ENCOUNTER2_RESPONSIBLE_PARTY_ASSIGNED_ENTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + target.init(); + Component1 component = CDAFactory.eINSTANCE.createComponent1(); + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + ResponsibleParty rp = CDAFactory.eINSTANCE.createResponsibleParty(); + ee.setResponsibleParty(rp); + component.setEncompassingEncounter(ee); + target.setComponentOf(component); + } + + @Override + protected void updateToPass(ConsultationNote target) { + target.getComponentOf().getEncompassingEncounter().getResponsibleParty().setAssignedEntity( + CDAFactory.eINSTANCE.createAssignedEntity()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteComponentOfEncompassingEncounter2ResponsiblePartyAssignedEntity( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteComponentOfEncompassingEncounter2ResponsiblePartyAssignedEntityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateConsultationNoteComponentOfEncompassingEncounter2EffectiveTime() { + OperationsTestCase validateConsultationNoteComponentOfEncompassingEncounter2EffectiveTimeTestCase = new OperationsTestCase( + "validateConsultationNoteComponentOfEncompassingEncounter2EffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_COMPONENT_OF_ENCOMPASSING_ENCOUNTER2_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + target.init(); + Component1 component = CDAFactory.eINSTANCE.createComponent1(); + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + component.setEncompassingEncounter(ee); + target.setComponentOf(component); + } + + @Override + protected void updateToPass(ConsultationNote target) { + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.getComponentOf().getEncompassingEncounter().setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteComponentOfEncompassingEncounter2EffectiveTime( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteComponentOfEncompassingEncounter2EffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateConsultationNoteComponentOfEncompassingEncounter2Id() { + OperationsTestCase validateConsultationNoteComponentOfEncompassingEncounter2IdTestCase = new OperationsTestCase( + "validateConsultationNoteComponentOfEncompassingEncounter2Id", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_COMPONENT_OF_ENCOMPASSING_ENCOUNTER2_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + target.init(); + Component1 component = CDAFactory.eINSTANCE.createComponent1(); + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + component.setEncompassingEncounter(ee); + target.setComponentOf(component); + } + + @Override + protected void updateToPass(ConsultationNote target) { + target.getComponentOf().getEncompassingEncounter().getIds().add(DatatypesFactory.eINSTANCE.createII()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteComponentOfEncompassingEncounter2Id( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteComponentOfEncompassingEncounter2IdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateConsultationNoteComponentOfEncompassingEncounter2ResponsibleParty() { + OperationsTestCase validateConsultationNoteComponentOfEncompassingEncounter2ResponsiblePartyTestCase = new OperationsTestCase( + "validateConsultationNoteComponentOfEncompassingEncounter2ResponsibleParty", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_COMPONENT_OF_ENCOMPASSING_ENCOUNTER2_RESPONSIBLE_PARTY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + target.init(); + Component1 component = CDAFactory.eINSTANCE.createComponent1(); + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + component.setEncompassingEncounter(ee); + target.setComponentOf(component); + } + + @Override + protected void updateToPass(ConsultationNote target) { + + ResponsibleParty rp = CDAFactory.eINSTANCE.createResponsibleParty(); + target.getComponentOf().getEncompassingEncounter().setResponsibleParty(rp); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteComponentOfEncompassingEncounter2ResponsibleParty( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteComponentOfEncompassingEncounter2ResponsiblePartyTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateConsultationNoteComponentOfEncompassingEncounter2EncounterParticipant() { + OperationsTestCase validateConsultationNoteComponentOfEncompassingEncounter2EncounterParticipantTestCase = new OperationsTestCase( + "validateConsultationNoteComponentOfEncompassingEncounter2EncounterParticipant", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_COMPONENT_OF_ENCOMPASSING_ENCOUNTER2_ENCOUNTER_PARTICIPANT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + target.init(); + Component1 component = CDAFactory.eINSTANCE.createComponent1(); + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + component.setEncompassingEncounter(ee); + target.setComponentOf(component); + + } + + @Override + protected void updateToPass(ConsultationNote target) { + + EncounterParticipant ep = CDAFactory.eINSTANCE.createEncounterParticipant(); + + target.getComponentOf().getEncompassingEncounter().getEncounterParticipants().add(ep); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteComponentOfEncompassingEncounter2EncounterParticipant( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteComponentOfEncompassingEncounter2EncounterParticipantTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateConsultationNoteComponentOfEncompassingEncounter() { + OperationsTestCase validateConsultationNoteComponentOfEncompassingEncounterTestCase = new OperationsTestCase( + "validateConsultationNoteComponentOfEncompassingEncounter", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_NOTE_COMPONENT_OF_ENCOMPASSING_ENCOUNTER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + target.init(); + Component1 component = CDAFactory.eINSTANCE.createComponent1(); + target.setComponentOf(component); + + } + + @Override + protected void updateToPass(ConsultationNote target) { + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + target.getComponentOf().setEncompassingEncounter(ee); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationNoteOperations.validateConsultationNoteComponentOfEncompassingEncounter( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateConsultationNoteComponentOfEncompassingEncounterTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetAssessmentSection() { + + ConsultationNote target = objectFactory.create(); + target.getAssessmentSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetAssessmentAndPlanSection() { + + ConsultationNote target = objectFactory.create(); + target.getAssessmentAndPlanSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPlanOfCareSection() { + + ConsultationNote target = objectFactory.create(); + target.getPlanOfCareSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetHistoryOfPresentIllness() { + + ConsultationNote target = objectFactory.create(); + target.getHistoryOfPresentIllness(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPhysicalExamSection() { + + ConsultationNote target = objectFactory.create(); + target.getPhysicalExamSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetReasonForReferralSection() { + + ConsultationNote target = objectFactory.create(); + target.getReasonForReferralSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetReasonForVisitSection() { + + ConsultationNote target = objectFactory.create(); + target.getReasonForVisitSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetAllergiesSection() { + + ConsultationNote target = objectFactory.create(); + target.getAllergiesSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetChiefComplaintSection() { + + ConsultationNote target = objectFactory.create(); + target.getChiefComplaintSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetChiefComplaintAndReasonForVisitSection() { + + ConsultationNote target = objectFactory.create(); + target.getChiefComplaintAndReasonForVisitSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetFamilyHistorySection() { + + ConsultationNote target = objectFactory.create(); + target.getFamilyHistorySection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetGeneralStatusSection() { + + ConsultationNote target = objectFactory.create(); + target.getGeneralStatusSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetHistoryOfPastIllnessSection() { + + ConsultationNote target = objectFactory.create(); + target.getHistoryOfPastIllnessSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetImmunizationsSection() { + + ConsultationNote target = objectFactory.create(); + target.getImmunizationsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetMedicationsSectionEntriesOptional() { + + ConsultationNote target = objectFactory.create(); + target.getMedicationsSectionEntriesOptional(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProblemSectionEntriesOptional() { + + ConsultationNote target = objectFactory.create(); + target.getProblemSectionEntriesOptional(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProceduresSectionEntriesOptional() { + + ConsultationNote target = objectFactory.create(); + target.getProceduresSectionEntriesOptional(); + + } + + /** + * + * @generated + */ + @Test + public void testGetResultsSectionEntriesOptional() { + + ConsultationNote target = objectFactory.create(); + target.getResultsSectionEntriesOptional(); + + } + + /** + * + * @generated + */ + @Test + public void testGetReviewOfSystemsSection() { + + ConsultationNote target = objectFactory.create(); + target.getReviewOfSystemsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetSocialHistorySection() { + + ConsultationNote target = objectFactory.create(); + target.getSocialHistorySection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetVitalSignsSectionEntriesOptional() { + + ConsultationNote target = objectFactory.create(); + target.getVitalSignsSectionEntriesOptional(); + + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsCode() { + OperationsTestCase validateGeneralHeaderConstraintsCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationNote target) { + + } + + @Override + protected void updateToPass(ConsultationNote target) { + target.init(); + + target.setCode(DatatypesFactory.eINSTANCE.createCE("", "2.16.840.1.113883.6.1")); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsCode( + (ConsultationNote) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ConsultationNoteOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ConsultationNote create() { + return ConsolFactory.eINSTANCE.createConsultationNote(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ConsultationNoteOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ConsultationNoteOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ContinuityOfCareDocumentTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ContinuityOfCareDocumentTest.java new file mode 100644 index 000000000..c45722d1f --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ContinuityOfCareDocumentTest.java @@ -0,0 +1,1796 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.AssignedAuthor; +import org.openhealthtools.mdht.uml.cda.AssignedEntity; +import org.openhealthtools.mdht.uml.cda.Author; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.DocumentationOf; +import org.openhealthtools.mdht.uml.cda.Performer1; +import org.openhealthtools.mdht.uml.cda.Person; +import org.openhealthtools.mdht.uml.cda.ServiceEvent; +import org.openhealthtools.mdht.uml.cda.consol.AdvanceDirectivesSection; +import org.openhealthtools.mdht.uml.cda.consol.AllergiesSection; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument; +import org.openhealthtools.mdht.uml.cda.consol.EncountersSection; +import org.openhealthtools.mdht.uml.cda.consol.FamilyHistorySection; +import org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusSection; +import org.openhealthtools.mdht.uml.cda.consol.ImmunizationsSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.MedicalEquipmentSection; +import org.openhealthtools.mdht.uml.cda.consol.MedicationsSection; +import org.openhealthtools.mdht.uml.cda.consol.PayersSection; +import org.openhealthtools.mdht.uml.cda.consol.PlanOfCareSection; +import org.openhealthtools.mdht.uml.cda.consol.ProblemSection; +import org.openhealthtools.mdht.uml.cda.consol.ProceduresSection; +import org.openhealthtools.mdht.uml.cda.consol.ResultsSection; +import org.openhealthtools.mdht.uml.cda.consol.SocialHistorySection; +import org.openhealthtools.mdht.uml.cda.consol.VitalSignsSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.operations.ContinuityOfCareDocumentOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.vocab.ActClassRoot; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ServiceEventPerformer; + +/** + * + * A static utility class that provides operations related to 'Continuity Of Care Document' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument#validateContinuityOfCareDocumentCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument#validateContinuityOfCareDocumentCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument#validateContinuityOfCareDocumentLanguageCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Language Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument#validateContinuityOfCareDocumentDocumentationOf(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Documentation Of}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument#validateContinuityOfCareDocumentAuthor(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Author}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument#validateContinuityOfCareDocumentAllergiesSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Allergies Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument#validateContinuityOfCareDocumentMedicationsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Medications Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument#validateContinuityOfCareDocumentProblemSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Problem Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument#validateContinuityOfCareDocumentProceduresSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Procedures Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument#validateContinuityOfCareDocumentResultsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Results Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument#validateContinuityOfCareDocumentAdvanceDirectivesSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Advance Directives Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument#validateContinuityOfCareDocumentEncountersSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Encounters Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument#validateContinuityOfCareDocumentFamilyHistorySection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Family History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument#validateContinuityOfCareDocumentFunctionalStatusSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Functional Status Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument#validateContinuityOfCareDocumentImmunizationsSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Immunizations Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument#validateContinuityOfCareDocumentMedicalEquipmentSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Medical Equipment Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument#validateContinuityOfCareDocumentPayersSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Payers Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument#validateContinuityOfCareDocumentPlanOfCareSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Plan Of Care Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument#validateContinuityOfCareDocumentSocialHistorySection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Social History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument#validateContinuityOfCareDocumentVitalSignsSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Vital Signs Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument#validateContinuityOfCareDocumentDocumentationOfServiceEventEffectiveTimeHigh(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Documentation Of Service Event Effective Time High}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument#validateContinuityOfCareDocumentDocumentationOfServiceEventEffectiveTimeLow(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Documentation Of Service Event Effective Time Low}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument#validateContinuityOfCareDocumentDocumentationOfServiceEventPerformerAssignedEntityHasNationalProviderIdentifier(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Documentation Of Service Event Performer Assigned Entity Has National Provider Identifier}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument#validateContinuityOfCareDocumentDocumentationOfServiceEventPerformerAssignedEntityCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Documentation Of Service Event Performer Assigned Entity Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument#validateContinuityOfCareDocumentDocumentationOfServiceEventPerformerAssignedEntityId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Documentation Of Service Event Performer Assigned Entity Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument#validateContinuityOfCareDocumentDocumentationOfServiceEventPerformerTypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Documentation Of Service Event Performer Type Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument#validateContinuityOfCareDocumentDocumentationOfServiceEventPerformerAssignedEntity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Documentation Of Service Event Performer Assigned Entity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument#validateContinuityOfCareDocumentDocumentationOfServiceEventClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Documentation Of Service Event Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument#validateContinuityOfCareDocumentDocumentationOfServiceEventEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Documentation Of Service Event Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument#validateContinuityOfCareDocumentDocumentationOfServiceEventPerformer(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Documentation Of Service Event Performer}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument#validateContinuityOfCareDocumentDocumentationOfServiceEvent(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Documentation Of Service Event}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument#validateContinuityOfCareDocumentAuthorAssignedAuthorHasAssignedPersonOrRepresentedOrganization(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Author Assigned Author Has Assigned Person Or Represented Organization}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument#validateContinuityOfCareDocumentAuthorAssignedAuthor(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Continuity Of Care Document Author Assigned Author}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument#getAllergiesSection() Get Allergies Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument#getMedicationsSection() Get Medications Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument#getProblemSection() Get Problem Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument#getProceduresSection() Get Procedures Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument#getResultsSection() Get Results Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument#getAdvanceDirectivesSection() Get Advance Directives Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument#getEncountersSection() Get Encounters Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument#getFamilyHistorySection() Get Family History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument#getFunctionalStatusSection() Get Functional Status Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument#getImmunizationsSectionEntriesOptional() Get Immunizations Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument#getMedicalEquipmentSection() Get Medical Equipment Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument#getPayersSection() Get Payers Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument#getPlanOfCareSection() Get Plan Of Care Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument#getSocialHistorySection() Get Social History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument#getVitalSignsSectionEntriesOptional() Get Vital Signs Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ContinuityOfCareDocument#validateGeneralHeaderConstraintsTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class ContinuityOfCareDocumentTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateContinuityOfCareDocumentCodeP() { + OperationsTestCase validateContinuityOfCareDocumentCodePTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentCodeP", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentCodeP( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateContinuityOfCareDocumentCode() { + OperationsTestCase validateContinuityOfCareDocumentCodeTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentCode", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentCode( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateContinuityOfCareDocumentLanguageCode() { + OperationsTestCase validateContinuityOfCareDocumentLanguageCodeTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentLanguageCode", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_LANGUAGE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + target.init(); + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.setLanguageCode(DatatypesFactory.eINSTANCE.createCS()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentLanguageCode( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentLanguageCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateContinuityOfCareDocumentDocumentationOf() { + OperationsTestCase validateContinuityOfCareDocumentDocumentationOfTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentDocumentationOf", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_DOCUMENTATION_OF__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + target.init(); + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentDocumentationOf( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentDocumentationOfTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateContinuityOfCareDocumentAuthor() { + OperationsTestCase validateContinuityOfCareDocumentAuthorTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentAuthor", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_AUTHOR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + target.init(); + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + + Author author = CDAFactory.eINSTANCE.createAuthor(); + target.getAuthors().add(author); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentAuthor( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentAuthorTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateContinuityOfCareDocumentAdvanceDirectivesSection() { + OperationsTestCase validateContinuityOfCareDocumentAdvanceDirectivesSectionTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentAdvanceDirectivesSection", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_ADVANCE_DIRECTIVES_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.init(); + + /* AdvanceDirectivesSection */ + AdvanceDirectivesSection section = + + ConsolFactory.eINSTANCE.createAdvanceDirectivesSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentAdvanceDirectivesSection( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentAdvanceDirectivesSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateContinuityOfCareDocumentAllergiesSection() { + OperationsTestCase validateContinuityOfCareDocumentAllergiesSectionTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentAllergiesSection", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_ALLERGIES_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.init(); + + /* AllergiesSection */ + AllergiesSection section = + + ConsolFactory.eINSTANCE.createAllergiesSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentAllergiesSection( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentAllergiesSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateContinuityOfCareDocumentEncountersSection() { + OperationsTestCase validateContinuityOfCareDocumentEncountersSectionTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentEncountersSection", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_ENCOUNTERS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.init(); + + /* EncountersSection */ + EncountersSection section = + + ConsolFactory.eINSTANCE.createEncountersSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentEncountersSection( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentEncountersSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateContinuityOfCareDocumentPayersSection() { + OperationsTestCase validateContinuityOfCareDocumentPayersSectionTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentPayersSection", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_PAYERS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.init(); + + /* PayersSection */ + PayersSection section = + + ConsolFactory.eINSTANCE.createPayersSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentPayersSection( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentPayersSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateContinuityOfCareDocumentMedicationsSection() { + OperationsTestCase validateContinuityOfCareDocumentMedicationsSectionTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentMedicationsSection", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_MEDICATIONS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.init(); + + /* MedicationsSection */ + MedicationsSection section = + + ConsolFactory.eINSTANCE.createMedicationsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentMedicationsSection( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentMedicationsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateContinuityOfCareDocumentPlanOfCareSection() { + OperationsTestCase validateContinuityOfCareDocumentPlanOfCareSectionTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentPlanOfCareSection", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_PLAN_OF_CARE_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.init(); + + /* PlanOfCareSection */ + PlanOfCareSection section = + + ConsolFactory.eINSTANCE.createPlanOfCareSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentPlanOfCareSection( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentPlanOfCareSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateContinuityOfCareDocumentProceduresSection() { + OperationsTestCase validateContinuityOfCareDocumentProceduresSectionTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentProceduresSection", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_PROCEDURES_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.init(); + + /* ProceduresSection */ + ProceduresSection section = + + ConsolFactory.eINSTANCE.createProceduresSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentProceduresSection( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentProceduresSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateContinuityOfCareDocumentFamilyHistorySection() { + OperationsTestCase validateContinuityOfCareDocumentFamilyHistorySectionTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentFamilyHistorySection", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_FAMILY_HISTORY_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.init(); + + /* FamilyHistorySection */ + FamilyHistorySection section = + + ConsolFactory.eINSTANCE.createFamilyHistorySection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentFamilyHistorySection( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentFamilyHistorySectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateContinuityOfCareDocumentSocialHistorySection() { + OperationsTestCase validateContinuityOfCareDocumentSocialHistorySectionTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentSocialHistorySection", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_SOCIAL_HISTORY_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.init(); + + /* SocialHistorySection */ + SocialHistorySection section = + + ConsolFactory.eINSTANCE.createSocialHistorySection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentSocialHistorySection( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentSocialHistorySectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateContinuityOfCareDocumentVitalSignsSectionEntriesOptional() { + OperationsTestCase validateContinuityOfCareDocumentVitalSignsSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentVitalSignsSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_VITAL_SIGNS_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.init(); + + /* VitalSignsSectionEntriesOptional */ + VitalSignsSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createVitalSignsSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentVitalSignsSectionEntriesOptional( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentVitalSignsSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateContinuityOfCareDocumentDocumentationOfServiceEventPerformerAssignedEntityHasNationalProviderIdentifier() { + OperationsTestCase validateContinuityOfCareDocumentDocumentationOfServiceEventPerformerAssignedEntityHasNationalProviderIdentifierTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentDocumentationOfServiceEventPerformerAssignedEntityHasNationalProviderIdentifier", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_DOCUMENTATION_OF_SERVICE_EVENT3_PERFORMER_ASSIGNED_ENTITY_HAS_NATIONAL_PROVIDER_IDENTIFIER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + Performer1 perf = CDAFactory.eINSTANCE.createPerformer1(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getIds().add(DatatypesFactory.eINSTANCE.createII("Not2.16.840.1.113883.4.6", "12345")); + perf.setAssignedEntity(ae); + se.getPerformers().add(perf); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + Performer1 perf = CDAFactory.eINSTANCE.createPerformer1(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getIds().add(DatatypesFactory.eINSTANCE.createII("2.16.840.1.113883.4.6", "12345")); + perf.setAssignedEntity(ae); + se.getPerformers().add(perf); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentDocumentationOfServiceEventPerformerAssignedEntityHasNationalProviderIdentifier( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentDocumentationOfServiceEventPerformerAssignedEntityHasNationalProviderIdentifierTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateContinuityOfCareDocumentDocumentationOfServiceEventPerformerAssignedEntityCode() { + OperationsTestCase validateContinuityOfCareDocumentDocumentationOfServiceEventPerformerAssignedEntityCodeTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentDocumentationOfServiceEventPerformerAssignedEntityCode", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_DOCUMENTATION_OF_SERVICE_EVENT_PERFORMER_ASSIGNED_ENTITY_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + Performer1 perf = CDAFactory.eINSTANCE.createPerformer1(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + perf.setAssignedEntity(ae); + se.getPerformers().add(perf); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.getDocumentationOfs().clear(); + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + Performer1 perf = CDAFactory.eINSTANCE.createPerformer1(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.setCode(DatatypesFactory.eINSTANCE.createCE("1111", "2.16.840.1.113883.6.101")); + perf.setAssignedEntity(ae); + se.getPerformers().add(perf); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentDocumentationOfServiceEventPerformerAssignedEntityCode( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentDocumentationOfServiceEventPerformerAssignedEntityCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateContinuityOfCareDocumentDocumentationOfServiceEventPerformerAssignedEntityId() { + OperationsTestCase validateContinuityOfCareDocumentDocumentationOfServiceEventPerformerAssignedEntityIdTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentDocumentationOfServiceEventPerformerAssignedEntityId", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_DOCUMENTATION_OF_SERVICE_EVENT3_PERFORMER_ASSIGNED_ENTITY_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + target.init(); + + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + Performer1 perf = CDAFactory.eINSTANCE.createPerformer1(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + perf.setAssignedEntity(ae); + se.getPerformers().add(perf); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.getDocumentationOfs().clear(); + + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + Performer1 perf = CDAFactory.eINSTANCE.createPerformer1(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getIds().add(DatatypesFactory.eINSTANCE.createII("2.16.840.1.113883.4.6", "12345")); + perf.setAssignedEntity(ae); + se.getPerformers().add(perf); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentDocumentationOfServiceEventPerformerAssignedEntityId( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentDocumentationOfServiceEventPerformerAssignedEntityIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateContinuityOfCareDocumentDocumentationOfServiceEventPerformerTypeCode() { + OperationsTestCase validateContinuityOfCareDocumentDocumentationOfServiceEventPerformerTypeCodeTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentDocumentationOfServiceEventPerformerTypeCode", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_DOCUMENTATION_OF_SERVICE_EVENT3_PERFORMER_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + { + skipFailsTest(); + + } + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + Performer1 perf = CDAFactory.eINSTANCE.createPerformer1(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + perf.setAssignedEntity(ae); + se.getPerformers().add(perf); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + Performer1 perf = CDAFactory.eINSTANCE.createPerformer1(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + perf.setAssignedEntity(ae); + perf.setTypeCode(x_ServiceEventPerformer.PRF); + se.getPerformers().add(perf); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentDocumentationOfServiceEventPerformerTypeCode( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentDocumentationOfServiceEventPerformerTypeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateContinuityOfCareDocumentDocumentationOfServiceEventPerformerAssignedEntity() { + OperationsTestCase validateContinuityOfCareDocumentDocumentationOfServiceEventPerformerAssignedEntityTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentDocumentationOfServiceEventPerformerAssignedEntity", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_DOCUMENTATION_OF_SERVICE_EVENT3_PERFORMER_ASSIGNED_ENTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + Performer1 perf = CDAFactory.eINSTANCE.createPerformer1(); + + se.getPerformers().add(perf); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + Performer1 perf = CDAFactory.eINSTANCE.createPerformer1(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + perf.setAssignedEntity(ae); + se.getPerformers().add(perf); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentDocumentationOfServiceEventPerformerAssignedEntity( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentDocumentationOfServiceEventPerformerAssignedEntityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateContinuityOfCareDocumentDocumentationOfServiceEventEffectiveTimeLow() { + OperationsTestCase validateContinuityOfCareDocumentDocumentationOfServiceEventEffectiveTimeLowTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentDocumentationOfServiceEventEffectiveTimeLow", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_DOCUMENTATION_OF_SERVICE_EVENT3_EFFECTIVE_TIME_LOW__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + se.setEffectiveTime(DatatypesFactory.eINSTANCE.createIVL_TS()); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + se.setEffectiveTime(DatatypesFactory.eINSTANCE.createIVL_TS("low", "high")); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentDocumentationOfServiceEventEffectiveTimeLow( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentDocumentationOfServiceEventEffectiveTimeLowTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateContinuityOfCareDocumentDocumentationOfServiceEventEffectiveTimeHigh() { + OperationsTestCase validateContinuityOfCareDocumentDocumentationOfServiceEventEffectiveTimeHighTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentDocumentationOfServiceEventEffectiveTimeHigh", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_DOCUMENTATION_OF_SERVICE_EVENT3_EFFECTIVE_TIME_HIGH__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + se.setEffectiveTime(DatatypesFactory.eINSTANCE.createIVL_TS()); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + se.setEffectiveTime(DatatypesFactory.eINSTANCE.createIVL_TS("low", "high")); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentDocumentationOfServiceEventEffectiveTimeHigh( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentDocumentationOfServiceEventEffectiveTimeHighTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateContinuityOfCareDocumentDocumentationOfServiceEventClassCode() { + OperationsTestCase validateContinuityOfCareDocumentDocumentationOfServiceEventClassCodeTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentDocumentationOfServiceEventClassCode", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_DOCUMENTATION_OF_SERVICE_EVENT3_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + se.setClassCode(ActClassRoot.PCPR); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentDocumentationOfServiceEventClassCode( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentDocumentationOfServiceEventClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateContinuityOfCareDocumentDocumentationOfServiceEventEffectiveTime() { + OperationsTestCase validateContinuityOfCareDocumentDocumentationOfServiceEventEffectiveTimeTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentDocumentationOfServiceEventEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_DOCUMENTATION_OF_SERVICE_EVENT3_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + se.setEffectiveTime(DatatypesFactory.eINSTANCE.createIVL_TS()); + dof.setServiceEvent(se); + + target.getDocumentationOfs().add(dof); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentDocumentationOfServiceEventEffectiveTime( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentDocumentationOfServiceEventEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateContinuityOfCareDocumentDocumentationOfServiceEventPerformer() { + OperationsTestCase validateContinuityOfCareDocumentDocumentationOfServiceEventPerformerTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentDocumentationOfServiceEventPerformer", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_DOCUMENTATION_OF_SERVICE_EVENT3_PERFORMER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + se.getPerformers().add(CDAFactory.eINSTANCE.createPerformer1()); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentDocumentationOfServiceEventPerformer( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentDocumentationOfServiceEventPerformerTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateContinuityOfCareDocumentDocumentationOfServiceEvent() { + OperationsTestCase validateContinuityOfCareDocumentDocumentationOfServiceEventTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentDocumentationOfServiceEvent", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_DOCUMENTATION_OF_SERVICE_EVENT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentDocumentationOfServiceEvent( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentDocumentationOfServiceEventTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateContinuityOfCareDocumentAuthorAssignedAuthorHasAssignedPersonOrRepresentedOrganization() { + OperationsTestCase validateContinuityOfCareDocumentAuthorAssignedAuthorHasAssignedPersonOrRepresentedOrganizationTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentAuthorAssignedAuthorHasAssignedPersonOrRepresentedOrganization", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_AUTHOR_ASSIGNED_AUTHOR_HAS_ASSIGNED_PERSON_OR_REPRESENTED_ORGANIZATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + target.init(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + author.setTime(DatatypesFactory.eINSTANCE.createTS()); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + author.setAssignedAuthor(aa); + target.getAuthors().add(author); + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.getAuthors().clear(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + author.setTime(DatatypesFactory.eINSTANCE.createTS()); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + Person person = CDAFactory.eINSTANCE.createPerson(); + aa.setAssignedPerson(person); + author.setAssignedAuthor(aa); + target.getAuthors().add(author); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentAuthorAssignedAuthorHasAssignedPersonOrRepresentedOrganization( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentAuthorAssignedAuthorHasAssignedPersonOrRepresentedOrganizationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateContinuityOfCareDocumentAuthorAssignedAuthor() { + OperationsTestCase validateContinuityOfCareDocumentAuthorAssignedAuthor3TestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentAuthorAssignedAuthor3", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_AUTHOR_ASSIGNED_AUTHOR3__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + + target.init(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + target.getAuthors().add(author); + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.getAuthors().clear(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + author.setAssignedAuthor(CDAFactory.eINSTANCE.createAssignedAuthor()); + target.getAuthors().add(author); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentAuthorAssignedAuthor( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentAuthorAssignedAuthor3TestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateContinuityOfCareDocumentResultsSection() { + OperationsTestCase validateContinuityOfCareDocumentResultsSectionTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentResultsSection", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_RESULTS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.init(); + + /* ResultsSection */ + ResultsSection section = + + ConsolFactory.eINSTANCE.createResultsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentResultsSection( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentResultsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateContinuityOfCareDocumentMedicalEquipmentSection() { + OperationsTestCase validateContinuityOfCareDocumentMedicalEquipmentSectionTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentMedicalEquipmentSection", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_MEDICAL_EQUIPMENT_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.init(); + + /* MedicalEquipmentSection */ + MedicalEquipmentSection section = + + ConsolFactory.eINSTANCE.createMedicalEquipmentSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentMedicalEquipmentSection( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentMedicalEquipmentSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateContinuityOfCareDocumentFunctionalStatusSection() { + OperationsTestCase validateContinuityOfCareDocumentFunctionalStatusSectionTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentFunctionalStatusSection", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_FUNCTIONAL_STATUS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.init(); + + /* FunctionalStatusSection */ + FunctionalStatusSection section = + + ConsolFactory.eINSTANCE.createFunctionalStatusSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentFunctionalStatusSection( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentFunctionalStatusSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateContinuityOfCareDocumentImmunizationsSectionEntriesOptional() { + OperationsTestCase validateContinuityOfCareDocumentImmunizationsSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentImmunizationsSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_IMMUNIZATIONS_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.init(); + + /* ImmunizationsSectionEntriesOptional */ + ImmunizationsSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createImmunizationsSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentImmunizationsSectionEntriesOptional( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentImmunizationsSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateContinuityOfCareDocumentProblemSection() { + OperationsTestCase validateContinuityOfCareDocumentProblemSectionTestCase = new OperationsTestCase( + "validateContinuityOfCareDocumentProblemSection", + operationsForOCL.getOCLValue("VALIDATE_CONTINUITY_OF_CARE_DOCUMENT_PROBLEM_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.init(); + + /* ProblemSection */ + ProblemSection section = + + ConsolFactory.eINSTANCE.createProblemSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateContinuityOfCareDocumentProblemSection( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateContinuityOfCareDocumentProblemSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetAdvanceDirectivesSection() { + + ContinuityOfCareDocument target = objectFactory.create(); + target.getAdvanceDirectivesSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetAllergiesSection() { + + ContinuityOfCareDocument target = objectFactory.create(); + target.getAllergiesSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetEncountersSection() { + + ContinuityOfCareDocument target = objectFactory.create(); + target.getEncountersSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPayersSection() { + + ContinuityOfCareDocument target = objectFactory.create(); + target.getPayersSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetMedicationsSection() { + + ContinuityOfCareDocument target = objectFactory.create(); + target.getMedicationsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPlanOfCareSection() { + + ContinuityOfCareDocument target = objectFactory.create(); + target.getPlanOfCareSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProceduresSection() { + + ContinuityOfCareDocument target = objectFactory.create(); + target.getProceduresSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetFamilyHistorySection() { + + ContinuityOfCareDocument target = objectFactory.create(); + target.getFamilyHistorySection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetSocialHistorySection() { + + ContinuityOfCareDocument target = objectFactory.create(); + target.getSocialHistorySection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetVitalSignsSectionEntriesOptional() { + + ContinuityOfCareDocument target = objectFactory.create(); + target.getVitalSignsSectionEntriesOptional(); + + } + + /** + * + * @generated + */ + @Test + public void testValidateGeneralHeaderConstraintsTemplateId() { + OperationsTestCase validateGeneralHeaderConstraintsTemplateIdTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsTemplateId", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ContinuityOfCareDocument target) { + + } + + @Override + protected void updateToPass(ContinuityOfCareDocument target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ContinuityOfCareDocumentOperations.validateGeneralHeaderConstraintsTemplateId( + (ContinuityOfCareDocument) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetResultsSection() { + + ContinuityOfCareDocument target = objectFactory.create(); + target.getResultsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetMedicalEquipmentSection() { + + ContinuityOfCareDocument target = objectFactory.create(); + target.getMedicalEquipmentSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetFunctionalStatusSection() { + + ContinuityOfCareDocument target = objectFactory.create(); + target.getFunctionalStatusSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetImmunizationsSectionEntriesOptional() { + + ContinuityOfCareDocument target = objectFactory.create(); + target.getImmunizationsSectionEntriesOptional(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProblemSection() { + + ContinuityOfCareDocument target = objectFactory.create(); + target.getProblemSection(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ContinuityOfCareDocumentOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ContinuityOfCareDocument create() { + return ConsolFactory.eINSTANCE.createContinuityOfCareDocument(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ContinuityOfCareDocumentOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ContinuityOfCareDocumentOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/CoverageActivityTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/CoverageActivityTest.java new file mode 100644 index 000000000..bb5e5f03e --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/CoverageActivityTest.java @@ -0,0 +1,413 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.CoverageActivity; +import org.openhealthtools.mdht.uml.cda.consol.operations.CoverageActivityOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * + * A static utility class that provides operations related to 'Coverage Activity' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CoverageActivity#validateCoverageActivityRelationshipSequenceNumber(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Coverage Activity Relationship Sequence Number}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CoverageActivity#validateCoverageActivityTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Coverage Activity Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CoverageActivity#validateCoverageActivityClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Coverage Activity Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CoverageActivity#validateCoverageActivityCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Coverage Activity Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CoverageActivity#validateCoverageActivityId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Coverage Activity Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CoverageActivity#validateCoverageActivityMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Coverage Activity Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CoverageActivity#validateCoverageActivityStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Coverage Activity Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CoverageActivity#validateCoverageActivityPolicyActivity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Coverage Activity Policy Activity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.CoverageActivity#getPolicyActivities() Get Policy Activities}
  • + *
+ *

+ * + * @generated + */ + +public class CoverageActivityTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateCoverageActivityRelationshipSequenceNumber() { + OperationsTestCase validateCoverageActivityRelationshipSequenceNumberTestCase = new OperationsTestCase( + "validateCoverageActivityRelationshipSequenceNumber", + operationsForOCL.getOCLValue("VALIDATE_COVERAGE_ACTIVITY_RELATIONSHIP_SEQUENCE_NUMBER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CoverageActivity target) { + target.init(); + target.getEntryRelationships().add(CDAFactory.eINSTANCE.createEntryRelationship()); + } + + @Override + protected void updateToPass(CoverageActivity target) { + target.getEntryRelationships().clear(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setAct(ConsolFactory.eINSTANCE.createPolicyActivity()); + er.setSequenceNumber(DatatypesFactory.eINSTANCE.createINT()); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CoverageActivityOperations.validateCoverageActivityRelationshipSequenceNumber( + (CoverageActivity) objectToTest, diagnostician, map); + } + + }; + + validateCoverageActivityRelationshipSequenceNumberTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCoverageActivityTemplateId() { + OperationsTestCase validateCoverageActivityTemplateIdTestCase = new OperationsTestCase( + "validateCoverageActivityTemplateId", + operationsForOCL.getOCLValue("VALIDATE_COVERAGE_ACTIVITY_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CoverageActivity target) { + + } + + @Override + protected void updateToPass(CoverageActivity target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CoverageActivityOperations.validateCoverageActivityTemplateId( + (CoverageActivity) objectToTest, diagnostician, map); + } + + }; + + validateCoverageActivityTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCoverageActivityClassCode() { + OperationsTestCase validateCoverageActivityClassCodeTestCase = new OperationsTestCase( + "validateCoverageActivityClassCode", + operationsForOCL.getOCLValue("VALIDATE_COVERAGE_ACTIVITY_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CoverageActivity target) { + + } + + @Override + protected void updateToPass(CoverageActivity target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CoverageActivityOperations.validateCoverageActivityClassCode( + (CoverageActivity) objectToTest, diagnostician, map); + } + + }; + + validateCoverageActivityClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCoverageActivityCode() { + OperationsTestCase validateCoverageActivityCodeTestCase = new OperationsTestCase( + "validateCoverageActivityCode", + operationsForOCL.getOCLValue("VALIDATE_COVERAGE_ACTIVITY_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CoverageActivity target) { + + } + + @Override + protected void updateToPass(CoverageActivity target) { + target.init(); + target.setCode(DatatypesFactory.eINSTANCE.createCE("48768-6", "2.16.840.1.113883.6.1")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CoverageActivityOperations.validateCoverageActivityCode( + (CoverageActivity) objectToTest, diagnostician, map); + } + + }; + + validateCoverageActivityCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCoverageActivityId() { + OperationsTestCase validateCoverageActivityIdTestCase = new OperationsTestCase( + "validateCoverageActivityId", + operationsForOCL.getOCLValue("VALIDATE_COVERAGE_ACTIVITY_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CoverageActivity target) { + target.init(); + } + + @Override + protected void updateToPass(CoverageActivity target) { + target.getIds().add(DatatypesFactory.eINSTANCE.createII()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CoverageActivityOperations.validateCoverageActivityId( + (CoverageActivity) objectToTest, diagnostician, map); + } + + }; + + validateCoverageActivityIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCoverageActivityMoodCode() { + OperationsTestCase validateCoverageActivityMoodCodeTestCase = new OperationsTestCase( + "validateCoverageActivityMoodCode", + operationsForOCL.getOCLValue("VALIDATE_COVERAGE_ACTIVITY_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CoverageActivity target) { + + } + + @Override + protected void updateToPass(CoverageActivity target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CoverageActivityOperations.validateCoverageActivityMoodCode( + (CoverageActivity) objectToTest, diagnostician, map); + } + + }; + + validateCoverageActivityMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCoverageActivityStatusCode() { + OperationsTestCase validateCoverageActivityStatusCodeTestCase = new OperationsTestCase( + "validateCoverageActivityStatusCode", + operationsForOCL.getOCLValue("VALIDATE_COVERAGE_ACTIVITY_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CoverageActivity target) { + + } + + @Override + protected void updateToPass(CoverageActivity target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CoverageActivityOperations.validateCoverageActivityStatusCode( + (CoverageActivity) objectToTest, diagnostician, map); + } + + }; + + validateCoverageActivityStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCoverageActivityPolicyActivity() { + OperationsTestCase validateCoverageActivityPolicyActivityTestCase = new OperationsTestCase( + "validateCoverageActivityPolicyActivity", + operationsForOCL.getOCLValue("VALIDATE_COVERAGE_ACTIVITY_POLICY_ACTIVITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CoverageActivity target) { + target.init(); + + } + + @Override + protected void updateToPass(CoverageActivity target) { + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + er.setAct(ConsolFactory.eINSTANCE.createPolicyActivity().init()); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CoverageActivityOperations.validateCoverageActivityPolicyActivity( + (CoverageActivity) objectToTest, diagnostician, map); + } + + }; + + validateCoverageActivityPolicyActivityTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetPolicyActivities() { + + CoverageActivity target = objectFactory.create(); + target.getPolicyActivities(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends CoverageActivityOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public CoverageActivity create() { + return ConsolFactory.eINSTANCE.createCoverageActivity(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends CoverageActivityOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // CoverageActivityOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/DICOMObjectCatalogSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/DICOMObjectCatalogSectionTest.java new file mode 100644 index 000000000..1333f68d4 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/DICOMObjectCatalogSectionTest.java @@ -0,0 +1,260 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.DICOMObjectCatalogSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.DICOMObjectCatalogSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'DICOM Object Catalog Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DICOMObjectCatalogSection#validateDICOMObjectCatalogSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate DICOM Object Catalog Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DICOMObjectCatalogSection#validateDICOMObjectCatalogSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate DICOM Object Catalog Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DICOMObjectCatalogSection#validateDICOMObjectCatalogSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate DICOM Object Catalog Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DICOMObjectCatalogSection#validateDICOMObjectCatalogSectionStudyAct(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate DICOM Object Catalog Section Study Act}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DICOMObjectCatalogSection#getStudyActs() Get Study Acts}
  • + *
+ *

+ * + * @generated + */ + +public class DICOMObjectCatalogSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateDICOMObjectCatalogSectionTemplateId() { + OperationsTestCase validateDICOMObjectCatalogSectionTemplateIdTestCase = new OperationsTestCase( + "validateDICOMObjectCatalogSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_DICOM_OBJECT_CATALOG_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DICOMObjectCatalogSection target) { + + } + + @Override + protected void updateToPass(DICOMObjectCatalogSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DICOMObjectCatalogSectionOperations.validateDICOMObjectCatalogSectionTemplateId( + (DICOMObjectCatalogSection) objectToTest, diagnostician, map); + } + + }; + + validateDICOMObjectCatalogSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDICOMObjectCatalogSectionCode() { + OperationsTestCase validateDICOMObjectCatalogSectionCodeTestCase = new OperationsTestCase( + "validateDICOMObjectCatalogSectionCode", + operationsForOCL.getOCLValue("VALIDATE_DICOM_OBJECT_CATALOG_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DICOMObjectCatalogSection target) { + + } + + @Override + protected void updateToPass(DICOMObjectCatalogSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DICOMObjectCatalogSectionOperations.validateDICOMObjectCatalogSectionCode( + (DICOMObjectCatalogSection) objectToTest, diagnostician, map); + } + + }; + + validateDICOMObjectCatalogSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDICOMObjectCatalogSectionCodeP() { + OperationsTestCase validateDICOMObjectCatalogSectionCodePTestCase = new OperationsTestCase( + "validateDICOMObjectCatalogSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_DICOM_OBJECT_CATALOG_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DICOMObjectCatalogSection target) { + + } + + @Override + protected void updateToPass(DICOMObjectCatalogSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DICOMObjectCatalogSectionOperations.validateDICOMObjectCatalogSectionCodeP( + (DICOMObjectCatalogSection) objectToTest, diagnostician, map); + } + + }; + + validateDICOMObjectCatalogSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDICOMObjectCatalogSectionStudyAct() { + OperationsTestCase validateDICOMObjectCatalogSectionStudyActTestCase = new OperationsTestCase( + "validateDICOMObjectCatalogSectionStudyAct", + operationsForOCL.getOCLValue("VALIDATE_DICOM_OBJECT_CATALOG_SECTION_STUDY_ACT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DICOMObjectCatalogSection target) { + + } + + @Override + protected void updateToPass(DICOMObjectCatalogSection target) { + target.init(); + + target.addAct(ConsolFactory.eINSTANCE.createStudyAct().init()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DICOMObjectCatalogSectionOperations.validateDICOMObjectCatalogSectionStudyAct( + (DICOMObjectCatalogSection) objectToTest, diagnostician, map); + } + + }; + + validateDICOMObjectCatalogSectionStudyActTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetStudyActs() { + + DICOMObjectCatalogSection target = objectFactory.create(); + target.getStudyActs(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends DICOMObjectCatalogSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public DICOMObjectCatalogSection create() { + return ConsolFactory.eINSTANCE.createDICOMObjectCatalogSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends DICOMObjectCatalogSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // DICOMObjectCatalogSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/DataEntererTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/DataEntererTest.java new file mode 100644 index 000000000..93bbf8846 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/DataEntererTest.java @@ -0,0 +1,45 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Data Enterer' model objects. + * + * + * + * @generated + */ + +public class DataEntererTest extends CDAValidationTest { + + /** + * No Operations Test + * @generated + */ + @Test + public void testNoOperations() { + } + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // DataEntererOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/DeceasedObservationTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/DeceasedObservationTest.java new file mode 100644 index 000000000..072efee78 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/DeceasedObservationTest.java @@ -0,0 +1,600 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.DeceasedObservation; +import org.openhealthtools.mdht.uml.cda.consol.operations.DeceasedObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * + * A static utility class that provides operations related to 'Deceased Observation' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DeceasedObservation#validateDeceasedObservationEffectiveTimeLow(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Deceased Observation Effective Time Low}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DeceasedObservation#validateDeceasedObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Deceased Observation Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DeceasedObservation#validateDeceasedObservationClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Deceased Observation Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DeceasedObservation#validateDeceasedObservationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Deceased Observation Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DeceasedObservation#validateDeceasedObservationId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Deceased Observation Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DeceasedObservation#validateDeceasedObservationCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Deceased Observation Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DeceasedObservation#validateDeceasedObservationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Deceased Observation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DeceasedObservation#validateDeceasedObservationStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Deceased Observation Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DeceasedObservation#validateDeceasedObservationStatusCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Deceased Observation Status Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DeceasedObservation#validateDeceasedObservationEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Deceased Observation Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DeceasedObservation#validateDeceasedObservationValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Deceased Observation Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DeceasedObservation#validateDeceasedObservationValueP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Deceased Observation Value P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DeceasedObservation#validateDeceasedObservationProblemObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Deceased Observation Problem Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DeceasedObservation#getProblemObservation() Get Problem Observation}
  • + *
+ *

+ * + * @generated + */ + +public class DeceasedObservationTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateDeceasedObservationEffectiveTimeLow() { + OperationsTestCase validateDeceasedObservationEffectiveTimeLowTestCase = new OperationsTestCase( + "validateDeceasedObservationEffectiveTimeLow", + operationsForOCL.getOCLValue("VALIDATE_DECEASED_OBSERVATION_EFFECTIVE_TIME_LOW__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DeceasedObservation target) { + target.init(); + target.setEffectiveTime(DatatypesFactory.eINSTANCE.createIVL_TS()); + } + + @Override + protected void updateToPass(DeceasedObservation target) { + + target.setEffectiveTime(DatatypesFactory.eINSTANCE.createIVL_TS("1", "2")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DeceasedObservationOperations.validateDeceasedObservationEffectiveTimeLow( + (DeceasedObservation) objectToTest, diagnostician, map); + } + + }; + + validateDeceasedObservationEffectiveTimeLowTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDeceasedObservationTemplateId() { + OperationsTestCase validateDeceasedObservationTemplateIdTestCase = new OperationsTestCase( + "validateDeceasedObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_DECEASED_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DeceasedObservation target) { + + } + + @Override + protected void updateToPass(DeceasedObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DeceasedObservationOperations.validateDeceasedObservationTemplateId( + (DeceasedObservation) objectToTest, diagnostician, map); + } + + }; + + validateDeceasedObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDeceasedObservationClassCode() { + OperationsTestCase validateDeceasedObservationClassCodeTestCase = new OperationsTestCase( + "validateDeceasedObservationClassCode", + operationsForOCL.getOCLValue("VALIDATE_DECEASED_OBSERVATION_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DeceasedObservation target) { + + } + + @Override + protected void updateToPass(DeceasedObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DeceasedObservationOperations.validateDeceasedObservationClassCode( + (DeceasedObservation) objectToTest, diagnostician, map); + } + + }; + + validateDeceasedObservationClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDeceasedObservationMoodCode() { + OperationsTestCase validateDeceasedObservationMoodCodeTestCase = new OperationsTestCase( + "validateDeceasedObservationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_DECEASED_OBSERVATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DeceasedObservation target) { + + } + + @Override + protected void updateToPass(DeceasedObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DeceasedObservationOperations.validateDeceasedObservationMoodCode( + (DeceasedObservation) objectToTest, diagnostician, map); + } + + }; + + validateDeceasedObservationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDeceasedObservationId() { + OperationsTestCase validateDeceasedObservationIdTestCase = new OperationsTestCase( + "validateDeceasedObservationId", + operationsForOCL.getOCLValue("VALIDATE_DECEASED_OBSERVATION_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DeceasedObservation target) { + + } + + @Override + protected void updateToPass(DeceasedObservation target) { + target.init(); + + II ii = DatatypesFactory.eINSTANCE.createII(); + target.getIds().add(ii); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DeceasedObservationOperations.validateDeceasedObservationId( + (DeceasedObservation) objectToTest, diagnostician, map); + } + + }; + + validateDeceasedObservationIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDeceasedObservationCodeP() { + OperationsTestCase validateDeceasedObservationCodePTestCase = new OperationsTestCase( + "validateDeceasedObservationCodeP", + operationsForOCL.getOCLValue("VALIDATE_DECEASED_OBSERVATION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DeceasedObservation target) { + + } + + @Override + protected void updateToPass(DeceasedObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DeceasedObservationOperations.validateDeceasedObservationCodeP( + (DeceasedObservation) objectToTest, diagnostician, map); + } + + }; + + validateDeceasedObservationCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDeceasedObservationCode() { + OperationsTestCase validateDeceasedObservationCodeTestCase = new OperationsTestCase( + "validateDeceasedObservationCode", + operationsForOCL.getOCLValue("VALIDATE_DECEASED_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DeceasedObservation target) { + + } + + @Override + protected void updateToPass(DeceasedObservation target) { + target.init(); + + CE cd = DatatypesFactory.eINSTANCE.createCE("ASSERTION", "2.16.840.1.113883.5.4"); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DeceasedObservationOperations.validateDeceasedObservationCode( + (DeceasedObservation) objectToTest, diagnostician, map); + } + + }; + + validateDeceasedObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDeceasedObservationStatusCode() { + OperationsTestCase validateDeceasedObservationStatusCodeTestCase = new OperationsTestCase( + "validateDeceasedObservationStatusCode", + operationsForOCL.getOCLValue("VALIDATE_DECEASED_OBSERVATION_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DeceasedObservation target) { + + } + + @Override + protected void updateToPass(DeceasedObservation target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DeceasedObservationOperations.validateDeceasedObservationStatusCode( + (DeceasedObservation) objectToTest, diagnostician, map); + } + + }; + + validateDeceasedObservationStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDeceasedObservationStatusCodeP() { + OperationsTestCase validateDeceasedObservationStatusCodePTestCase = new OperationsTestCase( + "validateDeceasedObservationStatusCodeP", + operationsForOCL.getOCLValue("VALIDATE_DECEASED_OBSERVATION_STATUS_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DeceasedObservation target) { + + } + + @Override + protected void updateToPass(DeceasedObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DeceasedObservationOperations.validateDeceasedObservationStatusCodeP( + (DeceasedObservation) objectToTest, diagnostician, map); + } + + }; + + validateDeceasedObservationStatusCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDeceasedObservationEffectiveTime() { + OperationsTestCase validateDeceasedObservationEffectiveTimeTestCase = new OperationsTestCase( + "validateDeceasedObservationEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_DECEASED_OBSERVATION_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DeceasedObservation target) { + + } + + @Override + protected void updateToPass(DeceasedObservation target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DeceasedObservationOperations.validateDeceasedObservationEffectiveTime( + (DeceasedObservation) objectToTest, diagnostician, map); + } + + }; + + validateDeceasedObservationEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDeceasedObservationValue() { + OperationsTestCase validateDeceasedObservationValueTestCase = new OperationsTestCase( + "validateDeceasedObservationValue", + operationsForOCL.getOCLValue("VALIDATE_DECEASED_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DeceasedObservation target) { + + } + + @Override + protected void updateToPass(DeceasedObservation target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD("419099009", "2.16.840.1.113883.6.96", "", ""); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DeceasedObservationOperations.validateDeceasedObservationValue( + (DeceasedObservation) objectToTest, diagnostician, map); + } + + }; + + validateDeceasedObservationValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDeceasedObservationValueP() { + OperationsTestCase validateDeceasedObservationValuePTestCase = new OperationsTestCase( + "validateDeceasedObservationValueP", + operationsForOCL.getOCLValue("VALIDATE_DECEASED_OBSERVATION_VALUE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DeceasedObservation target) { + + } + + @Override + protected void updateToPass(DeceasedObservation target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD("419099009", "2.16.840.1.113883.6.96", "", ""); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DeceasedObservationOperations.validateDeceasedObservationValueP( + (DeceasedObservation) objectToTest, diagnostician, map); + } + + }; + + validateDeceasedObservationValuePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDeceasedObservationProblemObservation() { + OperationsTestCase validateDeceasedObservationProblemObservationTestCase = new OperationsTestCase( + "validateDeceasedObservationProblemObservation", + operationsForOCL.getOCLValue("VALIDATE_DECEASED_OBSERVATION_PROBLEM_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DeceasedObservation target) { + + } + + @Override + protected void updateToPass(DeceasedObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.CAUS); + er.setObservation(ConsolFactory.eINSTANCE.createProblemObservation()); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DeceasedObservationOperations.validateDeceasedObservationProblemObservation( + (DeceasedObservation) objectToTest, diagnostician, map); + } + + }; + + validateDeceasedObservationProblemObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemObservation() { + + DeceasedObservation target = objectFactory.create(); + target.getProblemObservation(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends DeceasedObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public DeceasedObservation create() { + return ConsolFactory.eINSTANCE.createDeceasedObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends DeceasedObservationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // DeceasedObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/DiagnosticImagingReportTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/DiagnosticImagingReportTest.java new file mode 100644 index 000000000..a72c05974 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/DiagnosticImagingReportTest.java @@ -0,0 +1,1451 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.AssignedEntity; +import org.openhealthtools.mdht.uml.cda.AssociatedEntity; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Component1; +import org.openhealthtools.mdht.uml.cda.DocumentationOf; +import org.openhealthtools.mdht.uml.cda.EncompassingEncounter; +import org.openhealthtools.mdht.uml.cda.Participant1; +import org.openhealthtools.mdht.uml.cda.Person; +import org.openhealthtools.mdht.uml.cda.ResponsibleParty; +import org.openhealthtools.mdht.uml.cda.Section; +import org.openhealthtools.mdht.uml.cda.ServiceEvent; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.DICOMObjectCatalogSection; +import org.openhealthtools.mdht.uml.cda.consol.DiagnosticImagingReport; +import org.openhealthtools.mdht.uml.cda.consol.FindingsSection; +import org.openhealthtools.mdht.uml.cda.consol.PhysicianReadingStudyPerformer; +import org.openhealthtools.mdht.uml.cda.consol.PhysicianofRecordParticipant; +import org.openhealthtools.mdht.uml.cda.consol.operations.DiagnosticImagingReportOperations; +import org.openhealthtools.mdht.uml.cda.consol.operations.GeneralHeaderConstraintsOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; +import org.openhealthtools.mdht.uml.hl7.vocab.ActClassRoot; + +/** + * + * A static utility class that provides operations related to 'Diagnostic Imaging Report' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DiagnosticImagingReport#validateDiagnosticImagingReportUseDiagnosticImagingCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Diagnostic Imaging Report Use Diagnostic Imaging Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DiagnosticImagingReport#validateDiagnosticImagingReportAllSectionsHaveTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Diagnostic Imaging Report All Sections Have Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DiagnosticImagingReport#validateDiagnosticImagingReportSectionsHaveText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Diagnostic Imaging Report Sections Have Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DiagnosticImagingReport#validateDiagnosticImagingReportTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Diagnostic Imaging Report Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DiagnosticImagingReport#validateDiagnosticImagingReportCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Diagnostic Imaging Report Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DiagnosticImagingReport#validateDiagnosticImagingReportCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Diagnostic Imaging Report Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DiagnosticImagingReport#validateDiagnosticImagingReportId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Diagnostic Imaging Report Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DiagnosticImagingReport#validateDiagnosticImagingReportInformant(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Diagnostic Imaging Report Informant}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DiagnosticImagingReport#validateDiagnosticImagingReportInformationRecipient(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Diagnostic Imaging Report Information Recipient}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DiagnosticImagingReport#validateDiagnosticImagingReportParticipant1(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Diagnostic Imaging Report Participant1}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DiagnosticImagingReport#validateDiagnosticImagingReportInFulfillmentOf(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Diagnostic Imaging Report In Fulfillment Of}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DiagnosticImagingReport#validateDiagnosticImagingReportDocumentationOf(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Diagnostic Imaging Report Documentation Of}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DiagnosticImagingReport#validateDiagnosticImagingReportRelatedDocument(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Diagnostic Imaging Report Related Document}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DiagnosticImagingReport#validateDiagnosticImagingReportComponentOf(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Diagnostic Imaging Report Component Of}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DiagnosticImagingReport#validateDiagnosticImagingReportFindingsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Diagnostic Imaging Report Findings Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DiagnosticImagingReport#validateDiagnosticImagingReportDICOMObjectCatalogSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Diagnostic Imaging Report DICOM Object Catalog Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DiagnosticImagingReport#validateDiagnosticImagingReportParticipantAssociatedEntityPersonName(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Diagnostic Imaging Report Participant Associated Entity Person Name}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DiagnosticImagingReport#validateDiagnosticImagingReportParticipantAssociatedEntityAssociatedPerson(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Diagnostic Imaging Report Participant Associated Entity Associated Person}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DiagnosticImagingReport#validateDiagnosticImagingReportParticipantAssociatedEntity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Diagnostic Imaging Report Participant Associated Entity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DiagnosticImagingReport#validateDiagnosticImagingReportDocumentationOfServiceEvent4ClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Diagnostic Imaging Report Documentation Of Service Event4 Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DiagnosticImagingReport#validateDiagnosticImagingReportDocumentationOfServiceEvent4Code(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Diagnostic Imaging Report Documentation Of Service Event4 Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DiagnosticImagingReport#validateDiagnosticImagingReportDocumentationOfServiceEvent4Id(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Diagnostic Imaging Report Documentation Of Service Event4 Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DiagnosticImagingReport#validateDiagnosticImagingReportDocumentationOfServiceEvent4PhysicianReadingStudyPerformer(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Diagnostic Imaging Report Documentation Of Service Event4 Physician Reading Study Performer}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DiagnosticImagingReport#validateDiagnosticImagingReportDocumentationOfServiceEvent3(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Diagnostic Imaging Report Documentation Of Service Event3}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DiagnosticImagingReport#validateDiagnosticImagingReportComponentOfEncompassingEncounter7ResponsiblePartyAssignedEntityHasAssignPersonOrRepresentedOrganization(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Diagnostic Imaging Report Component Of Encompassing Encounter7 Responsible Party Assigned Entity Has Assign Person Or Represented Organization}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DiagnosticImagingReport#validateDiagnosticImagingReportComponentOfEncompassingEncounter7ResponsiblePartyAssignedEntity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Diagnostic Imaging Report Component Of Encompassing Encounter7 Responsible Party Assigned Entity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DiagnosticImagingReport#validateDiagnosticImagingReportComponentOfEncompassingEncounter7EffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Diagnostic Imaging Report Component Of Encompassing Encounter7 Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DiagnosticImagingReport#validateDiagnosticImagingReportComponentOfEncompassingEncounter7Id(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Diagnostic Imaging Report Component Of Encompassing Encounter7 Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DiagnosticImagingReport#validateDiagnosticImagingReportComponentOfEncompassingEncounter7PhysicianofRecordParticipant(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Diagnostic Imaging Report Component Of Encompassing Encounter7 Physicianof Record Participant}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DiagnosticImagingReport#validateDiagnosticImagingReportComponentOfEncompassingEncounter7ResponsibleParty(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Diagnostic Imaging Report Component Of Encompassing Encounter7 Responsible Party}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DiagnosticImagingReport#validateDiagnosticImagingReportComponentOfEncompassingEncounter(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Diagnostic Imaging Report Component Of Encompassing Encounter}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DiagnosticImagingReport#getFindingsSection() Get Findings Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DiagnosticImagingReport#getDICOMObjectCatalogSection() Get DICOM Object Catalog Section}
  • + *
+ *

+ * + * @generated + */ + +public class DiagnosticImagingReportTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateDiagnosticImagingReportUseDiagnosticImagingCode() { + OperationsTestCase validateDiagnosticImagingReportUseDiagnosticImagingCodeTestCase = new OperationsTestCase( + "validateDiagnosticImagingReportUseDiagnosticImagingCode", + operationsForOCL.getOCLValue("VALIDATE_DIAGNOSTIC_IMAGING_REPORT_USE_DIAGNOSTIC_IMAGING_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DiagnosticImagingReport target) { + + } + + @Override + protected void updateToPass(DiagnosticImagingReport target) { + target.init(); + CE code = DatatypesFactory.eINSTANCE.createCE(); + code.setCode("18748-4"); + code.setCodeSystem("2.16.840.1.113883.6.1"); + target.setCode(code); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DiagnosticImagingReportOperations.validateDiagnosticImagingReportUseDiagnosticImagingCode( + (DiagnosticImagingReport) objectToTest, diagnostician, map); + } + + }; + + validateDiagnosticImagingReportUseDiagnosticImagingCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDiagnosticImagingReportAllSectionsHaveTitle() { + OperationsTestCase validateDiagnosticImagingReportAllSectionsHaveTitleTestCase = new OperationsTestCase( + "validateDiagnosticImagingReportAllSectionsHaveTitle", + operationsForOCL.getOCLValue("VALIDATE_DIAGNOSTIC_IMAGING_REPORT_ALL_SECTIONS_HAVE_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DiagnosticImagingReport target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createAllergiesSection()); + target.addSection(ConsolFactory.eINSTANCE.createAdvanceDirectivesSection()); + } + + @Override + protected void updateToPass(DiagnosticImagingReport target) { + for (Section sec : target.getAllSections()) { + ST title = DatatypesFactory.eINSTANCE.createST("title"); + sec.setTitle(title); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DiagnosticImagingReportOperations.validateDiagnosticImagingReportAllSectionsHaveTitle( + (DiagnosticImagingReport) objectToTest, diagnostician, map); + } + + }; + + validateDiagnosticImagingReportAllSectionsHaveTitleTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDiagnosticImagingReportSectionsHaveText() { + OperationsTestCase validateDiagnosticImagingReportSectionsHaveTextTestCase = new OperationsTestCase( + "validateDiagnosticImagingReportSectionsHaveText", + operationsForOCL.getOCLValue("VALIDATE_DIAGNOSTIC_IMAGING_REPORT_SECTIONS_HAVE_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DiagnosticImagingReport target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createAllergiesSection()); + target.addSection(ConsolFactory.eINSTANCE.createAdvanceDirectivesSection()); + } + + @Override + protected void updateToPass(DiagnosticImagingReport target) { + for (Section sec : target.getAllSections()) { + sec.createStrucDocText("Sample Narrative Text"); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DiagnosticImagingReportOperations.validateDiagnosticImagingReportSectionsHaveText( + (DiagnosticImagingReport) objectToTest, diagnostician, map); + } + + }; + + validateDiagnosticImagingReportSectionsHaveTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDiagnosticImagingReportTemplateId() { + OperationsTestCase validateDiagnosticImagingReportTemplateIdTestCase = new OperationsTestCase( + "validateDiagnosticImagingReportTemplateId", + operationsForOCL.getOCLValue("VALIDATE_DIAGNOSTIC_IMAGING_REPORT_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DiagnosticImagingReport target) { + + } + + @Override + protected void updateToPass(DiagnosticImagingReport target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DiagnosticImagingReportOperations.validateDiagnosticImagingReportTemplateId( + (DiagnosticImagingReport) objectToTest, diagnostician, map); + } + + }; + + validateDiagnosticImagingReportTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDiagnosticImagingReportCodeP() { + OperationsTestCase validateDiagnosticImagingReportCodePTestCase = new OperationsTestCase( + "validateDiagnosticImagingReportCodeP", + operationsForOCL.getOCLValue("VALIDATE_DIAGNOSTIC_IMAGING_REPORT_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DiagnosticImagingReport target) { + + } + + @Override + protected void updateToPass(DiagnosticImagingReport target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DiagnosticImagingReportOperations.validateDiagnosticImagingReportCodeP( + (DiagnosticImagingReport) objectToTest, diagnostician, map); + } + + }; + + validateDiagnosticImagingReportCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDiagnosticImagingReportCode() { + OperationsTestCase validateDiagnosticImagingReportCodeTestCase = new OperationsTestCase( + "validateDiagnosticImagingReportCode", + operationsForOCL.getOCLValue("VALIDATE_DIAGNOSTIC_IMAGING_REPORT_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DiagnosticImagingReport target) { + + } + + @Override + protected void updateToPass(DiagnosticImagingReport target) { + target.init(); + target.setCode(DatatypesFactory.eINSTANCE.createCE("11522-0", "2.16.840.1.113883.6.1")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DiagnosticImagingReportOperations.validateDiagnosticImagingReportCode( + (DiagnosticImagingReport) objectToTest, diagnostician, map); + } + + }; + + validateDiagnosticImagingReportCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDiagnosticImagingReportId() { + OperationsTestCase validateDiagnosticImagingReportIdTestCase = new OperationsTestCase( + "validateDiagnosticImagingReportId", + operationsForOCL.getOCLValue("VALIDATE_DIAGNOSTIC_IMAGING_REPORT_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DiagnosticImagingReport target) { + target.init(); + } + + @Override + protected void updateToPass(DiagnosticImagingReport target) { + target.setId(DatatypesFactory.eINSTANCE.createII()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DiagnosticImagingReportOperations.validateDiagnosticImagingReportId( + (DiagnosticImagingReport) objectToTest, diagnostician, map); + } + + }; + + validateDiagnosticImagingReportIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDiagnosticImagingReportInformant() { + OperationsTestCase validateDiagnosticImagingReportInformantTestCase = new OperationsTestCase( + "validateDiagnosticImagingReportInformant", + operationsForOCL.getOCLValue("VALIDATE_DIAGNOSTIC_IMAGING_REPORT_INFORMANT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DiagnosticImagingReport target) { + target.init(); + target.getInformants().add(CDAFactory.eINSTANCE.createInformant12()); + + } + + @Override + protected void updateToPass(DiagnosticImagingReport target) { + target.getInformants().clear(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DiagnosticImagingReportOperations.validateDiagnosticImagingReportInformant( + (DiagnosticImagingReport) objectToTest, diagnostician, map); + } + + }; + + validateDiagnosticImagingReportInformantTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDiagnosticImagingReportInformationRecipient() { + OperationsTestCase validateDiagnosticImagingReportInformationRecipientTestCase = new OperationsTestCase( + "validateDiagnosticImagingReportInformationRecipient", + operationsForOCL.getOCLValue("VALIDATE_DIAGNOSTIC_IMAGING_REPORT_INFORMATION_RECIPIENT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DiagnosticImagingReport target) { + target.init(); + } + + @Override + protected void updateToPass(DiagnosticImagingReport target) { + target.getInformationRecipients().add(CDAFactory.eINSTANCE.createInformationRecipient()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DiagnosticImagingReportOperations.validateDiagnosticImagingReportInformationRecipient( + (DiagnosticImagingReport) objectToTest, diagnostician, map); + } + + }; + + validateDiagnosticImagingReportInformationRecipientTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDiagnosticImagingReportParticipant1() { + OperationsTestCase validateDiagnosticImagingReportParticipant1TestCase = new OperationsTestCase( + "validateDiagnosticImagingReportParticipant1", + operationsForOCL.getOCLValue("VALIDATE_DIAGNOSTIC_IMAGING_REPORT_PARTICIPANT1__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DiagnosticImagingReport target) { + target.init(); + } + + @Override + protected void updateToPass(DiagnosticImagingReport target) { + target.getParticipants().add(CDAFactory.eINSTANCE.createParticipant1()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DiagnosticImagingReportOperations.validateDiagnosticImagingReportParticipant1( + (DiagnosticImagingReport) objectToTest, diagnostician, map); + } + + }; + + validateDiagnosticImagingReportParticipant1TestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDiagnosticImagingReportInFulfillmentOf() { + OperationsTestCase validateDiagnosticImagingReportInFulfillmentOfTestCase = new OperationsTestCase( + "validateDiagnosticImagingReportInFulfillmentOf", + operationsForOCL.getOCLValue("VALIDATE_DIAGNOSTIC_IMAGING_REPORT_IN_FULFILLMENT_OF__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DiagnosticImagingReport target) { + target.init(); + } + + @Override + protected void updateToPass(DiagnosticImagingReport target) { + target.getInFulfillmentOfs().add(CDAFactory.eINSTANCE.createInFulfillmentOf()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DiagnosticImagingReportOperations.validateDiagnosticImagingReportInFulfillmentOf( + (DiagnosticImagingReport) objectToTest, diagnostician, map); + } + + }; + + validateDiagnosticImagingReportInFulfillmentOfTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDiagnosticImagingReportDocumentationOf() { + OperationsTestCase validateDiagnosticImagingReportDocumentationOfTestCase = new OperationsTestCase( + "validateDiagnosticImagingReportDocumentationOf", + operationsForOCL.getOCLValue("VALIDATE_DIAGNOSTIC_IMAGING_REPORT_DOCUMENTATION_OF__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DiagnosticImagingReport target) { + target.init(); + } + + @Override + protected void updateToPass(DiagnosticImagingReport target) { + target.getDocumentationOfs().add(CDAFactory.eINSTANCE.createDocumentationOf()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DiagnosticImagingReportOperations.validateDiagnosticImagingReportDocumentationOf( + (DiagnosticImagingReport) objectToTest, diagnostician, map); + } + + }; + + validateDiagnosticImagingReportDocumentationOfTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDiagnosticImagingReportRelatedDocument() { + OperationsTestCase validateDiagnosticImagingReportRelatedDocumentTestCase = new OperationsTestCase( + "validateDiagnosticImagingReportRelatedDocument", + operationsForOCL.getOCLValue("VALIDATE_DIAGNOSTIC_IMAGING_REPORT_RELATED_DOCUMENT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DiagnosticImagingReport target) { + target.init(); + } + + @Override + protected void updateToPass(DiagnosticImagingReport target) { + target.getRelatedDocuments().add(CDAFactory.eINSTANCE.createRelatedDocument()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DiagnosticImagingReportOperations.validateDiagnosticImagingReportRelatedDocument( + (DiagnosticImagingReport) objectToTest, diagnostician, map); + } + + }; + + validateDiagnosticImagingReportRelatedDocumentTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDiagnosticImagingReportComponentOf() { + OperationsTestCase validateDiagnosticImagingReportComponentOfTestCase = new OperationsTestCase( + "validateDiagnosticImagingReportComponentOf", + operationsForOCL.getOCLValue("VALIDATE_DIAGNOSTIC_IMAGING_REPORT_COMPONENT_OF__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DiagnosticImagingReport target) { + target.init(); + } + + @Override + protected void updateToPass(DiagnosticImagingReport target) { + target.setComponentOf(CDAFactory.eINSTANCE.createComponent1()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DiagnosticImagingReportOperations.validateDiagnosticImagingReportComponentOf( + (DiagnosticImagingReport) objectToTest, diagnostician, map); + } + + }; + + validateDiagnosticImagingReportComponentOfTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDiagnosticImagingReportFindingsSection() { + OperationsTestCase validateDiagnosticImagingReportFindingsSectionTestCase = new OperationsTestCase( + "validateDiagnosticImagingReportFindingsSection", + operationsForOCL.getOCLValue("VALIDATE_DIAGNOSTIC_IMAGING_REPORT_FINDINGS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DiagnosticImagingReport target) { + + } + + @Override + protected void updateToPass(DiagnosticImagingReport target) { + target.init(); + + /* FindingsSection */ + FindingsSection section = + + ConsolFactory.eINSTANCE.createFindingsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DiagnosticImagingReportOperations.validateDiagnosticImagingReportFindingsSection( + (DiagnosticImagingReport) objectToTest, diagnostician, map); + } + + }; + + validateDiagnosticImagingReportFindingsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDiagnosticImagingReportDICOMObjectCatalogSection() { + OperationsTestCase validateDiagnosticImagingReportDICOMObjectCatalogSectionTestCase = new OperationsTestCase( + "validateDiagnosticImagingReportDICOMObjectCatalogSection", + operationsForOCL.getOCLValue("VALIDATE_DIAGNOSTIC_IMAGING_REPORT_DICOM_OBJECT_CATALOG_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DiagnosticImagingReport target) { + + } + + @Override + protected void updateToPass(DiagnosticImagingReport target) { + target.init(); + + /* DICOMObjectCatalogSection */ + DICOMObjectCatalogSection section = + + ConsolFactory.eINSTANCE.createDICOMObjectCatalogSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DiagnosticImagingReportOperations.validateDiagnosticImagingReportDICOMObjectCatalogSection( + (DiagnosticImagingReport) objectToTest, diagnostician, map); + } + + }; + + validateDiagnosticImagingReportDICOMObjectCatalogSectionTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDiagnosticImagingReportParticipantAssociatedEntityPersonName() { + OperationsTestCase validateDiagnosticImagingReportParticipantAssociatedEntityPersonNameTestCase = new OperationsTestCase( + "validateDiagnosticImagingReportParticipantAssociatedEntityPersonName", + operationsForOCL.getOCLValue("VALIDATE_DIAGNOSTIC_IMAGING_REPORT_PARTICIPANT_ASSOCIATED_ENTITY_PERSON_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DiagnosticImagingReport target) { + target.init(); + AssociatedEntity ae = CDAFactory.eINSTANCE.createAssociatedEntity(); + Participant1 par = CDAFactory.eINSTANCE.createParticipant1(); + Person ap = CDAFactory.eINSTANCE.createPerson(); + ae.setAssociatedPerson(ap); + par.setAssociatedEntity(ae); + target.getParticipants().add(par); + + } + + @Override + protected void updateToPass(DiagnosticImagingReport target) { + + target.getParticipants().clear(); + AssociatedEntity ae = CDAFactory.eINSTANCE.createAssociatedEntity(); + Participant1 par = CDAFactory.eINSTANCE.createParticipant1(); + Person ap = CDAFactory.eINSTANCE.createPerson(); + ap.getNames().add(DatatypesFactory.eINSTANCE.createPN()); + ae.setAssociatedPerson(ap); + par.setAssociatedEntity(ae); + target.getParticipants().add(par); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DiagnosticImagingReportOperations.validateDiagnosticImagingReportParticipantAssociatedEntityPersonName( + (DiagnosticImagingReport) objectToTest, diagnostician, map); + } + + }; + + validateDiagnosticImagingReportParticipantAssociatedEntityPersonNameTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDiagnosticImagingReportParticipantAssociatedEntityAssociatedPerson() { + OperationsTestCase validateDiagnosticImagingReportParticipantAssociatedEntityAssociatedPersonTestCase = new OperationsTestCase( + "validateDiagnosticImagingReportParticipantAssociatedEntityAssociatedPerson", + operationsForOCL.getOCLValue("VALIDATE_DIAGNOSTIC_IMAGING_REPORT_PARTICIPANT_ASSOCIATED_ENTITY_ASSOCIATED_PERSON__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DiagnosticImagingReport target) { + target.init(); + AssociatedEntity ae = CDAFactory.eINSTANCE.createAssociatedEntity(); + Participant1 par = CDAFactory.eINSTANCE.createParticipant1(); + par.setAssociatedEntity(ae); + target.getParticipants().add(par); + } + + @Override + protected void updateToPass(DiagnosticImagingReport target) { + target.getParticipants().clear(); + AssociatedEntity ae = CDAFactory.eINSTANCE.createAssociatedEntity(); + Participant1 par = CDAFactory.eINSTANCE.createParticipant1(); + Person ap = CDAFactory.eINSTANCE.createPerson(); + ae.setAssociatedPerson(ap); + par.setAssociatedEntity(ae); + target.getParticipants().add(par); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DiagnosticImagingReportOperations.validateDiagnosticImagingReportParticipantAssociatedEntityAssociatedPerson( + (DiagnosticImagingReport) objectToTest, diagnostician, map); + } + + }; + + validateDiagnosticImagingReportParticipantAssociatedEntityAssociatedPersonTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDiagnosticImagingReportParticipantAssociatedEntity() { + OperationsTestCase validateDiagnosticImagingReportParticipantAssociatedEntityTestCase = new OperationsTestCase( + "validateDiagnosticImagingReportParticipantAssociatedEntity", + operationsForOCL.getOCLValue("VALIDATE_DIAGNOSTIC_IMAGING_REPORT_PARTICIPANT_ASSOCIATED_ENTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DiagnosticImagingReport target) { + target.init(); + target.getParticipants().add(CDAFactory.eINSTANCE.createParticipant1()); + } + + @Override + protected void updateToPass(DiagnosticImagingReport target) { + target.getParticipants().clear(); + AssociatedEntity ae = CDAFactory.eINSTANCE.createAssociatedEntity(); + Participant1 par = CDAFactory.eINSTANCE.createParticipant1(); + par.setAssociatedEntity(ae); + target.getParticipants().add(par); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DiagnosticImagingReportOperations.validateDiagnosticImagingReportParticipantAssociatedEntity( + (DiagnosticImagingReport) objectToTest, diagnostician, map); + } + + }; + + validateDiagnosticImagingReportParticipantAssociatedEntityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDiagnosticImagingReportDocumentationOfServiceEvent4ClassCode() { + OperationsTestCase validateDiagnosticImagingReportDocumentationOfServiceEvent4ClassCodeTestCase = new OperationsTestCase( + "validateDiagnosticImagingReportDocumentationOfServiceEvent4ClassCode", + operationsForOCL.getOCLValue("VALIDATE_DIAGNOSTIC_IMAGING_REPORT_DOCUMENTATION_OF_SERVICE_EVENT4_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DiagnosticImagingReport target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected void updateToPass(DiagnosticImagingReport target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + se.setClassCode(ActClassRoot.ACT); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DiagnosticImagingReportOperations.validateDiagnosticImagingReportDocumentationOfServiceEvent4ClassCode( + (DiagnosticImagingReport) objectToTest, diagnostician, map); + } + + }; + + validateDiagnosticImagingReportDocumentationOfServiceEvent4ClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDiagnosticImagingReportDocumentationOfServiceEvent4Code() { + OperationsTestCase validateDiagnosticImagingReportDocumentationOfServiceEvent4CodeTestCase = new OperationsTestCase( + "validateDiagnosticImagingReportDocumentationOfServiceEvent4Code", + operationsForOCL.getOCLValue("VALIDATE_DIAGNOSTIC_IMAGING_REPORT_DOCUMENTATION_OF_SERVICE_EVENT4_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DiagnosticImagingReport target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected void updateToPass(DiagnosticImagingReport target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + se.setCode(DatatypesFactory.eINSTANCE.createCE()); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DiagnosticImagingReportOperations.validateDiagnosticImagingReportDocumentationOfServiceEvent4Code( + (DiagnosticImagingReport) objectToTest, diagnostician, map); + } + + }; + + validateDiagnosticImagingReportDocumentationOfServiceEvent4CodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDiagnosticImagingReportDocumentationOfServiceEvent4Id() { + OperationsTestCase validateDiagnosticImagingReportDocumentationOfServiceEvent4IdTestCase = new OperationsTestCase( + "validateDiagnosticImagingReportDocumentationOfServiceEvent4Id", + operationsForOCL.getOCLValue("VALIDATE_DIAGNOSTIC_IMAGING_REPORT_DOCUMENTATION_OF_SERVICE_EVENT4_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DiagnosticImagingReport target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected void updateToPass(DiagnosticImagingReport target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + se.getIds().add(DatatypesFactory.eINSTANCE.createII()); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DiagnosticImagingReportOperations.validateDiagnosticImagingReportDocumentationOfServiceEvent4Id( + (DiagnosticImagingReport) objectToTest, diagnostician, map); + } + + }; + + validateDiagnosticImagingReportDocumentationOfServiceEvent4IdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDiagnosticImagingReportDocumentationOfServiceEvent4PhysicianReadingStudyPerformer() { + OperationsTestCase validateDiagnosticImagingReportDocumentationOfServiceEvent4PhysicianReadingStudyPerformerTestCase = new OperationsTestCase( + "validateDiagnosticImagingReportDocumentationOfServiceEvent4PhysicianReadingStudyPerformer", + operationsForOCL.getOCLValue("VALIDATE_DIAGNOSTIC_IMAGING_REPORT_DOCUMENTATION_OF_SERVICE_EVENT4_PHYSICIAN_READING_STUDY_PERFORMER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DiagnosticImagingReport target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected void updateToPass(DiagnosticImagingReport target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + PhysicianReadingStudyPerformer phy = ConsolFactory.eINSTANCE.createPhysicianReadingStudyPerformer(); + se.getPerformers().add(phy); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DiagnosticImagingReportOperations.validateDiagnosticImagingReportDocumentationOfServiceEvent4PhysicianReadingStudyPerformer( + (DiagnosticImagingReport) objectToTest, diagnostician, map); + } + + }; + + validateDiagnosticImagingReportDocumentationOfServiceEvent4PhysicianReadingStudyPerformerTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDiagnosticImagingReportDocumentationOfServiceEvent3() { + OperationsTestCase validateDiagnosticImagingReportDocumentationOfServiceEvent3TestCase = new OperationsTestCase( + "validateDiagnosticImagingReportDocumentationOfServiceEvent3", + operationsForOCL.getOCLValue("VALIDATE_DIAGNOSTIC_IMAGING_REPORT_DOCUMENTATION_OF_SERVICE_EVENT3__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DiagnosticImagingReport target) { + target.init(); + target.getDocumentationOfs().add(CDAFactory.eINSTANCE.createDocumentationOf()); + } + + @Override + protected void updateToPass(DiagnosticImagingReport target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DiagnosticImagingReportOperations.validateDiagnosticImagingReportDocumentationOfServiceEvent3( + (DiagnosticImagingReport) objectToTest, diagnostician, map); + } + + }; + + validateDiagnosticImagingReportDocumentationOfServiceEvent3TestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDiagnosticImagingReportComponentOfEncompassingEncounter7ResponsiblePartyAssignedEntityHasAssignPersonOrRepresentedOrganization() { + OperationsTestCase validateDiagnosticImagingReportComponentOfEncompassingEncounter7ResponsiblePartyAssignedEntityHasAssignPersonOrRepresentedOrganizationTestCase = new OperationsTestCase( + "validateDiagnosticImagingReportComponentOfEncompassingEncounter7ResponsiblePartyAssignedEntityHasAssignPersonOrRepresentedOrganization", + operationsForOCL.getOCLValue("VALIDATE_DIAGNOSTIC_IMAGING_REPORT_COMPONENT_OF_ENCOMPASSING_ENCOUNTER7_RESPONSIBLE_PARTY_ASSIGNED_ENTITY_HAS_ASSIGN_PERSON_OR_REPRESENTED_ORGANIZATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DiagnosticImagingReport target) { + target.init(); + Component1 comp = CDAFactory.eINSTANCE.createComponent1(); + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + ResponsibleParty rp = CDAFactory.eINSTANCE.createResponsibleParty(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + + rp.setAssignedEntity(ae); + ee.setResponsibleParty(rp); + comp.setEncompassingEncounter(ee); + target.setComponentOf(comp); + } + + @Override + protected void updateToPass(DiagnosticImagingReport target) { + Component1 comp = CDAFactory.eINSTANCE.createComponent1(); + + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + ResponsibleParty rp = CDAFactory.eINSTANCE.createResponsibleParty(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.setAssignedPerson(CDAFactory.eINSTANCE.createPerson()); + rp.setAssignedEntity(ae); + ee.setResponsibleParty(rp); + comp.setEncompassingEncounter(ee); + target.setComponentOf(comp); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DiagnosticImagingReportOperations.validateDiagnosticImagingReportComponentOfEncompassingEncounter7ResponsiblePartyAssignedEntityHasAssignPersonOrRepresentedOrganization( + (DiagnosticImagingReport) objectToTest, diagnostician, map); + } + + }; + + validateDiagnosticImagingReportComponentOfEncompassingEncounter7ResponsiblePartyAssignedEntityHasAssignPersonOrRepresentedOrganizationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDiagnosticImagingReportComponentOfEncompassingEncounter7ResponsiblePartyAssignedEntity() { + OperationsTestCase validateDiagnosticImagingReportComponentOfEncompassingEncounter7ResponsiblePartyAssignedEntityTestCase = new OperationsTestCase( + "validateDiagnosticImagingReportComponentOfEncompassingEncounter7ResponsiblePartyAssignedEntity", + operationsForOCL.getOCLValue("VALIDATE_DIAGNOSTIC_IMAGING_REPORT_COMPONENT_OF_ENCOMPASSING_ENCOUNTER7_RESPONSIBLE_PARTY_ASSIGNED_ENTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DiagnosticImagingReport target) { + target.init(); + Component1 comp = CDAFactory.eINSTANCE.createComponent1(); + + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + ResponsibleParty rp = CDAFactory.eINSTANCE.createResponsibleParty(); + ee.setResponsibleParty(rp); + comp.setEncompassingEncounter(ee); + target.setComponentOf(comp); + } + + @Override + protected void updateToPass(DiagnosticImagingReport target) { + Component1 comp = CDAFactory.eINSTANCE.createComponent1(); + + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + ResponsibleParty rp = CDAFactory.eINSTANCE.createResponsibleParty(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + rp.setAssignedEntity(ae); + ee.setResponsibleParty(rp); + comp.setEncompassingEncounter(ee); + target.setComponentOf(comp); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DiagnosticImagingReportOperations.validateDiagnosticImagingReportComponentOfEncompassingEncounter7ResponsiblePartyAssignedEntity( + (DiagnosticImagingReport) objectToTest, diagnostician, map); + } + + }; + + validateDiagnosticImagingReportComponentOfEncompassingEncounter7ResponsiblePartyAssignedEntityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDiagnosticImagingReportComponentOfEncompassingEncounter7EffectiveTime() { + OperationsTestCase validateDiagnosticImagingReportComponentOfEncompassingEncounter7EffectiveTimeTestCase = new OperationsTestCase( + "validateDiagnosticImagingReportComponentOfEncompassingEncounter7EffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_DIAGNOSTIC_IMAGING_REPORT_COMPONENT_OF_ENCOMPASSING_ENCOUNTER7_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DiagnosticImagingReport target) { + target.init(); + Component1 comp = CDAFactory.eINSTANCE.createComponent1(); + + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + comp.setEncompassingEncounter(ee); + target.setComponentOf(comp); + } + + @Override + protected void updateToPass(DiagnosticImagingReport target) { + Component1 comp = CDAFactory.eINSTANCE.createComponent1(); + + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + ee.setEffectiveTime(DatatypesFactory.eINSTANCE.createIVL_TS()); + comp.setEncompassingEncounter(ee); + target.setComponentOf(comp); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DiagnosticImagingReportOperations.validateDiagnosticImagingReportComponentOfEncompassingEncounter7EffectiveTime( + (DiagnosticImagingReport) objectToTest, diagnostician, map); + } + + }; + + validateDiagnosticImagingReportComponentOfEncompassingEncounter7EffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDiagnosticImagingReportComponentOfEncompassingEncounter7Id() { + OperationsTestCase validateDiagnosticImagingReportComponentOfEncompassingEncounter7IdTestCase = new OperationsTestCase( + "validateDiagnosticImagingReportComponentOfEncompassingEncounter7Id", + operationsForOCL.getOCLValue("VALIDATE_DIAGNOSTIC_IMAGING_REPORT_COMPONENT_OF_ENCOMPASSING_ENCOUNTER7_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DiagnosticImagingReport target) { + target.init(); + Component1 comp = CDAFactory.eINSTANCE.createComponent1(); + + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + comp.setEncompassingEncounter(ee); + target.setComponentOf(comp); + } + + @Override + protected void updateToPass(DiagnosticImagingReport target) { + Component1 comp = CDAFactory.eINSTANCE.createComponent1(); + + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + ee.getIds().add(DatatypesFactory.eINSTANCE.createII()); + comp.setEncompassingEncounter(ee); + target.setComponentOf(comp); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DiagnosticImagingReportOperations.validateDiagnosticImagingReportComponentOfEncompassingEncounter7Id( + (DiagnosticImagingReport) objectToTest, diagnostician, map); + } + + }; + + validateDiagnosticImagingReportComponentOfEncompassingEncounter7IdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDiagnosticImagingReportComponentOfEncompassingEncounter7PhysicianofRecordParticipant() { + OperationsTestCase validateDiagnosticImagingReportComponentOfEncompassingEncounter7PhysicianofRecordParticipantTestCase = new OperationsTestCase( + "validateDiagnosticImagingReportComponentOfEncompassingEncounter7PhysicianofRecordParticipant", + operationsForOCL.getOCLValue("VALIDATE_DIAGNOSTIC_IMAGING_REPORT_COMPONENT_OF_ENCOMPASSING_ENCOUNTER7_PHYSICIANOF_RECORD_PARTICIPANT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DiagnosticImagingReport target) { + target.init(); + Component1 comp = CDAFactory.eINSTANCE.createComponent1(); + + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + comp.setEncompassingEncounter(ee); + target.setComponentOf(comp); + } + + @Override + protected void updateToPass(DiagnosticImagingReport target) { + Component1 comp = CDAFactory.eINSTANCE.createComponent1(); + + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + PhysicianofRecordParticipant rp = ConsolFactory.eINSTANCE.createPhysicianofRecordParticipant(); + ee.getEncounterParticipants().add(rp); + comp.setEncompassingEncounter(ee); + target.setComponentOf(comp); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DiagnosticImagingReportOperations.validateDiagnosticImagingReportComponentOfEncompassingEncounter7PhysicianofRecordParticipant( + (DiagnosticImagingReport) objectToTest, diagnostician, map); + } + + }; + + validateDiagnosticImagingReportComponentOfEncompassingEncounter7PhysicianofRecordParticipantTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDiagnosticImagingReportComponentOfEncompassingEncounter7ResponsibleParty() { + OperationsTestCase validateDiagnosticImagingReportComponentOfEncompassingEncounter7ResponsiblePartyTestCase = new OperationsTestCase( + "validateDiagnosticImagingReportComponentOfEncompassingEncounter7ResponsibleParty", + operationsForOCL.getOCLValue("VALIDATE_DIAGNOSTIC_IMAGING_REPORT_COMPONENT_OF_ENCOMPASSING_ENCOUNTER7_RESPONSIBLE_PARTY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DiagnosticImagingReport target) { + target.init(); + Component1 comp = CDAFactory.eINSTANCE.createComponent1(); + + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + comp.setEncompassingEncounter(ee); + target.setComponentOf(comp); + } + + @Override + protected void updateToPass(DiagnosticImagingReport target) { + Component1 comp = CDAFactory.eINSTANCE.createComponent1(); + + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + ResponsibleParty rp = CDAFactory.eINSTANCE.createResponsibleParty(); + ee.setResponsibleParty(rp); + comp.setEncompassingEncounter(ee); + target.setComponentOf(comp); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DiagnosticImagingReportOperations.validateDiagnosticImagingReportComponentOfEncompassingEncounter7ResponsibleParty( + (DiagnosticImagingReport) objectToTest, diagnostician, map); + } + + }; + + validateDiagnosticImagingReportComponentOfEncompassingEncounter7ResponsiblePartyTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDiagnosticImagingReportComponentOfEncompassingEncounter() { + OperationsTestCase validateDiagnosticImagingReportComponentOfEncompassingEncounterTestCase = new OperationsTestCase( + "validateDiagnosticImagingReportComponentOfEncompassingEncounter", + operationsForOCL.getOCLValue("VALIDATE_DIAGNOSTIC_IMAGING_REPORT_COMPONENT_OF_ENCOMPASSING_ENCOUNTER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DiagnosticImagingReport target) { + target.init(); + target.setComponentOf(CDAFactory.eINSTANCE.createComponent1()); + } + + @Override + protected void updateToPass(DiagnosticImagingReport target) { + Component1 comp = CDAFactory.eINSTANCE.createComponent1(); + + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + comp.setEncompassingEncounter(ee); + target.setComponentOf(comp); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DiagnosticImagingReportOperations.validateDiagnosticImagingReportComponentOfEncompassingEncounter( + (DiagnosticImagingReport) objectToTest, diagnostician, map); + } + + }; + + validateDiagnosticImagingReportComponentOfEncompassingEncounterTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetFindingsSection() { + + DiagnosticImagingReport target = objectFactory.create(); + target.getFindingsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetDICOMObjectCatalogSection() { + + DiagnosticImagingReport target = objectFactory.create(); + target.getDICOMObjectCatalogSection(); + + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsCode() { + OperationsTestCase validateGeneralHeaderConstraintsCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DiagnosticImagingReport target) { + + } + + @Override + protected void updateToPass(DiagnosticImagingReport target) { + target.init(); + target.getCode().setCode("code"); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsCode( + (DiagnosticImagingReport) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends DiagnosticImagingReportOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public DiagnosticImagingReport create() { + return ConsolFactory.eINSTANCE.createDiagnosticImagingReport(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends DiagnosticImagingReportOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // DiagnosticImagingReportOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/DischargeDietSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/DischargeDietSectionTest.java new file mode 100644 index 000000000..21468bc9c --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/DischargeDietSectionTest.java @@ -0,0 +1,290 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.DischargeDietSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.DischargeDietSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Discharge Diet Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeDietSection#validateDischargeDietSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Diet Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeDietSection#validateDischargeDietSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Diet Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeDietSection#validateDischargeDietSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Diet Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeDietSection#validateDischargeDietSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Diet Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeDietSection#validateDischargeDietSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Diet Section Text}
  • + *
+ *

+ * + * @generated + */ + +public class DischargeDietSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateDischargeDietSectionTemplateId() { + OperationsTestCase validateDischargeDietSectionTemplateIdTestCase = new OperationsTestCase( + "validateDischargeDietSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_DIET_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeDietSection target) { + + } + + @Override + protected void updateToPass(DischargeDietSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeDietSectionOperations.validateDischargeDietSectionTemplateId( + (DischargeDietSection) objectToTest, diagnostician, map); + } + + }; + + validateDischargeDietSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeDietSectionCode() { + OperationsTestCase validateDischargeDietSectionCodeTestCase = new OperationsTestCase( + "validateDischargeDietSectionCode", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_DIET_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeDietSection target) { + + } + + @Override + protected void updateToPass(DischargeDietSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeDietSectionOperations.validateDischargeDietSectionCode( + (DischargeDietSection) objectToTest, diagnostician, map); + } + + }; + + validateDischargeDietSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeDietSectionCodeP() { + OperationsTestCase validateDischargeDietSectionCodePTestCase = new OperationsTestCase( + "validateDischargeDietSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_DIET_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeDietSection target) { + + } + + @Override + protected void updateToPass(DischargeDietSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeDietSectionOperations.validateDischargeDietSectionCodeP( + (DischargeDietSection) objectToTest, diagnostician, map); + } + + }; + + validateDischargeDietSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeDietSectionTitle() { + OperationsTestCase validateDischargeDietSectionTitleTestCase = new OperationsTestCase( + "validateDischargeDietSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_DIET_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeDietSection target) { + + } + + @Override + protected void updateToPass(DischargeDietSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeDietSectionOperations.validateDischargeDietSectionTitle( + (DischargeDietSection) objectToTest, diagnostician, map); + } + + }; + + validateDischargeDietSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeDietSectionText() { + OperationsTestCase validateDischargeDietSectionTextTestCase = new OperationsTestCase( + "validateDischargeDietSectionText", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_DIET_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeDietSection target) { + + } + + @Override + protected void updateToPass(DischargeDietSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeDietSectionOperations.validateDischargeDietSectionText( + (DischargeDietSection) objectToTest, diagnostician, map); + } + + }; + + validateDischargeDietSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends DischargeDietSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public DischargeDietSection create() { + return ConsolFactory.eINSTANCE.createDischargeDietSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends DischargeDietSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // DischargeDietSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/DischargeMedicationTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/DischargeMedicationTest.java new file mode 100644 index 000000000..c3b004866 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/DischargeMedicationTest.java @@ -0,0 +1,299 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.DischargeMedication; +import org.openhealthtools.mdht.uml.cda.consol.operations.DischargeMedicationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * + * A static utility class that provides operations related to 'Discharge Medication' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeMedication#validateDischargeMedicationMedicationActivity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Medication Medication Activity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeMedication#validateDischargeMedicationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Medication Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeMedication#validateDischargeMedicationClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Medication Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeMedication#validateDischargeMedicationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Medication Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeMedication#validateDischargeMedicationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Medication Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeMedication#getMedicationActivities() Get Medication Activities}
  • + *
+ *

+ * + * @generated + */ + +public class DischargeMedicationTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateDischargeMedicationMedicationActivity() { + OperationsTestCase validateDischargeMedicationMedicationActivityTestCase = new OperationsTestCase( + "validateDischargeMedicationMedicationActivity", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_MEDICATION_MEDICATION_ACTIVITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeMedication target) { + + } + + @Override + protected void updateToPass(DischargeMedication target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setSubstanceAdministration(ConsolFactory.eINSTANCE.createMedicationActivity()); + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeMedicationOperations.validateDischargeMedicationMedicationActivity( + (DischargeMedication) objectToTest, diagnostician, map); + } + + }; + + validateDischargeMedicationMedicationActivityTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeMedicationTemplateId() { + OperationsTestCase validateDischargeMedicationTemplateIdTestCase = new OperationsTestCase( + "validateDischargeMedicationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_MEDICATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeMedication target) { + + } + + @Override + protected void updateToPass(DischargeMedication target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeMedicationOperations.validateDischargeMedicationTemplateId( + (DischargeMedication) objectToTest, diagnostician, map); + } + + }; + + validateDischargeMedicationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeMedicationClassCode() { + OperationsTestCase validateDischargeMedicationClassCodeTestCase = new OperationsTestCase( + "validateDischargeMedicationClassCode", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_MEDICATION_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeMedication target) { + + } + + @Override + protected void updateToPass(DischargeMedication target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeMedicationOperations.validateDischargeMedicationClassCode( + (DischargeMedication) objectToTest, diagnostician, map); + } + + }; + + validateDischargeMedicationClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeMedicationMoodCode() { + OperationsTestCase validateDischargeMedicationMoodCodeTestCase = new OperationsTestCase( + "validateDischargeMedicationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_MEDICATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeMedication target) { + + } + + @Override + protected void updateToPass(DischargeMedication target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeMedicationOperations.validateDischargeMedicationMoodCode( + (DischargeMedication) objectToTest, diagnostician, map); + } + + }; + + validateDischargeMedicationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeMedicationCode() { + OperationsTestCase validateDischargeMedicationCodeTestCase = new OperationsTestCase( + "validateDischargeMedicationCode", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_MEDICATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeMedication target) { + + } + + @Override + protected void updateToPass(DischargeMedication target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeMedicationOperations.validateDischargeMedicationCode( + (DischargeMedication) objectToTest, diagnostician, map); + } + + }; + + validateDischargeMedicationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetMedicationActivities() { + + DischargeMedication target = objectFactory.create(); + target.getMedicationActivities(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends DischargeMedicationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public DischargeMedication create() { + return ConsolFactory.eINSTANCE.createDischargeMedication(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends DischargeMedicationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // DischargeMedicationOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/DischargeSummaryTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/DischargeSummaryTest.java new file mode 100644 index 000000000..abdfc1828 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/DischargeSummaryTest.java @@ -0,0 +1,2295 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.AssignedEntity; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Component1; +import org.openhealthtools.mdht.uml.cda.EncompassingEncounter; +import org.openhealthtools.mdht.uml.cda.EncounterParticipant; +import org.openhealthtools.mdht.uml.cda.Person; +import org.openhealthtools.mdht.uml.cda.ResponsibleParty; +import org.openhealthtools.mdht.uml.cda.consol.AllergiesSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.ChiefComplaintAndReasonForVisitSection; +import org.openhealthtools.mdht.uml.cda.consol.ChiefComplaintSection; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.DischargeDietSection; +import org.openhealthtools.mdht.uml.cda.consol.DischargeSummary; +import org.openhealthtools.mdht.uml.cda.consol.FamilyHistorySection; +import org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusSection; +import org.openhealthtools.mdht.uml.cda.consol.HistoryOfPastIllnessSection; +import org.openhealthtools.mdht.uml.cda.consol.HistoryOfPresentIllnessSection; +import org.openhealthtools.mdht.uml.cda.consol.HospitalAdmissionDiagnosisSection; +import org.openhealthtools.mdht.uml.cda.consol.HospitalAdmissionMedicationsSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.HospitalConsultationsSection; +import org.openhealthtools.mdht.uml.cda.consol.HospitalCourseSection; +import org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeDiagnosisSection; +import org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeInstructionsSection; +import org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeMedicationsSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.HospitalDischargePhysicalSection; +import org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeStudiesSummarySection; +import org.openhealthtools.mdht.uml.cda.consol.ImmunizationsSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.PlanOfCareSection; +import org.openhealthtools.mdht.uml.cda.consol.ProblemSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.ProceduresSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.ReasonForVisitSection; +import org.openhealthtools.mdht.uml.cda.consol.ReviewOfSystemsSection; +import org.openhealthtools.mdht.uml.cda.consol.SocialHistorySection; +import org.openhealthtools.mdht.uml.cda.consol.VitalSignsSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.operations.DischargeSummaryOperations; +import org.openhealthtools.mdht.uml.cda.consol.operations.GeneralHeaderConstraintsOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; + +/** + * + * A static utility class that provides operations related to 'Discharge Summary' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#validateDischargeSummaryDoesNotHaveChiefComplaintAndReasonForVisitWithChiefComplaintSectionOrReasonSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Does Not Have Chief Complaint And Reason For Visit With Chief Complaint Section Or Reason Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#validateDischargeSummaryCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#validateDischargeSummaryCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#validateDischargeSummaryHospitalAdmissionMedicationsSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Hospital Admission Medications Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#validateDischargeSummaryHospitalAdmissionDiagnosisSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Hospital Admission Diagnosis Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#validateDischargeSummaryHospitalDischargeDiagnosisSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Hospital Discharge Diagnosis Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#validateDischargeSummaryDischargeDietSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Discharge Diet Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#validateDischargeSummaryHospitalDischargeMedicationsSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Hospital Discharge Medications Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#validateDischargeSummaryFunctionalStatusSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Functional Status Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#validateDischargeSummaryHistoryOfPresentIllnessSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary History Of Present Illness Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#validateDischargeSummaryHospitalCourseSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Hospital Course Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#validateDischargeSummaryPlanOfCareSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Plan Of Care Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#validateDischargeSummaryHistoryOfPastIllnessSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary History Of Past Illness Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#validateDischargeSummaryComponentOf(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Component Of}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#validateDischargeSummaryChiefComplaintAndReasonForVisitSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Chief Complaint And Reason For Visit Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#validateDischargeSummaryChiefComplaintSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Chief Complaint Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#validateDischargeSummaryFamilyHistorySection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Family History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#validateDischargeSummaryHospitalConsultationsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Hospital Consultations Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#validateDischargeSummaryHospitalDischargeInstructionsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Hospital Discharge Instructions Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#validateDischargeSummaryHospitalDischargePhysicalSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Hospital Discharge Physical Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#validateDischargeSummaryHospitalDischargeStudiesSummarySection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Hospital Discharge Studies Summary Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#validateDischargeSummaryImmunizationsSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Immunizations Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#validateDischargeSummaryProblemSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Problem Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#validateDischargeSummaryProceduresSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Procedures Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#validateDischargeSummaryReasonForVisitSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Reason For Visit Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#validateDischargeSummaryReviewOfSystemsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Review Of Systems Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#validateDischargeSummarySocialHistorySection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Social History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#validateDischargeSummaryAllergiesSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Allergies Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#validateDischargeSummaryVitalSignsSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Vital Signs Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#validateDischargeSummaryComponentOfEncompassingEncounter3ResponsiblePartyAssignedEntityHasPersonOrOrganization(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Component Of Encompassing Encounter3 Responsible Party Assigned Entity Has Person Or Organization}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#validateDischargeSummaryComponentOfEncompassingEncounter3ResponsiblePartyAssignedEntity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Component Of Encompassing Encounter3 Responsible Party Assigned Entity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#validateDischargeSummaryComponentOfEncompassingEncounter3EncounterParticipantAssignedEntityHasPersonOrOrganization(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Component Of Encompassing Encounter3 Encounter Participant Assigned Entity Has Person Or Organization}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#validateDischargeSummaryComponentOfEncompassingEncounter3EncounterParticipantAssignedEntity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Component Of Encompassing Encounter3 Encounter Participant Assigned Entity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#validateDischargeSummaryComponentOfEncompassingEncounter3EncompassingEncounterHasEffectiveTimeLow(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Component Of Encompassing Encounter3 Encompassing Encounter Has Effective Time Low}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#validateDischargeSummaryComponentOfEncompassingEncounter3EncompassingEncounterHasEffectiveTimeHigh(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Component Of Encompassing Encounter3 Encompassing Encounter Has Effective Time High}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#validateDischargeSummaryComponentOfEncompassingEncounter3DischargeDispositionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Component Of Encompassing Encounter3 Discharge Disposition Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#validateDischargeSummaryComponentOfEncompassingEncounter3EffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Component Of Encompassing Encounter3 Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#validateDischargeSummaryComponentOfEncompassingEncounter3ResponsibleParty(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Component Of Encompassing Encounter3 Responsible Party}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#validateDischargeSummaryComponentOfEncompassingEncounter3EncounterParticipant(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Component Of Encompassing Encounter3 Encounter Participant}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#validateDischargeSummaryComponentOfEncompassingEncounter(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Component Of Encompassing Encounter}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#getHospitalAdmissionMedicationsSectionEntriesOptional() Get Hospital Admission Medications Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#getHospitalAdmissionDiagnosisSection() Get Hospital Admission Diagnosis Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#getHospitalDischargeDiagnosisSection() Get Hospital Discharge Diagnosis Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#getDischargeDietSection() Get Discharge Diet Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#getHospitalDischargeMedicationsSectionEntriesOptional() Get Hospital Discharge Medications Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#getFunctionalStatusSection() Get Functional Status Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#getHistoryOfPresentIllnessSection() Get History Of Present Illness Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#getHospitalCourseSection() Get Hospital Course Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#getPlanOfCareSection() Get Plan Of Care Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#getHistoryOfPastIllnessSection() Get History Of Past Illness Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#getChiefComplaintAndReasonForVisitSection() Get Chief Complaint And Reason For Visit Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#getChiefComplaintSection() Get Chief Complaint Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#getFamilyHistorySection() Get Family History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#getHospitalConsultationsSection() Get Hospital Consultations Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#getHospitalDischargeInstructionsSection() Get Hospital Discharge Instructions Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#getHospitalDischargePhysicalSection() Get Hospital Discharge Physical Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#getHospitalDischargeStudiesSummarySection() Get Hospital Discharge Studies Summary Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#getImmunizationsSectionEntriesOptional() Get Immunizations Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#getProblemSectionEntriesOptional() Get Problem Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#getProceduresSectionEntriesOptional() Get Procedures Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#getReasonForVisitSection() Get Reason For Visit Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#getReviewOfSystemsSection() Get Review Of Systems Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#getSocialHistorySection() Get Social History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#getAllergiesSectionEntriesOptional() Get Allergies Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#getVitalSignsSectionEntriesOptional() Get Vital Signs Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DischargeSummary#validateGeneralHeaderConstraintsTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class DischargeSummaryTest extends CDAValidationTest { + + /** + * + * @generated noy + */ + @Test + public void testValidateDischargeSummaryDoesNotHaveChiefComplaintAndReasonForVisitWithChiefComplaintSectionOrReasonSection() { + OperationsTestCase validateDischargeSummaryDoesNotHaveChiefComplaintAndReasonForVisitWithChiefComplaintSectionOrReasonSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryDoesNotHaveChiefComplaintAndReasonForVisitWithChiefComplaintSectionOrReasonSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_DOES_NOT_HAVE_CHIEF_COMPLAINT_AND_REASON_FOR_VISIT_WITH_CHIEF_COMPLAINT_SECTION_OR_REASON_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + public void addFailTests() { + + addFailTest(new FailTest() { + @Override + public void updateToFail(DischargeSummary target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createChiefComplaintAndReasonForVisitSection().init()); + target.addSection(ConsolFactory.eINSTANCE.createChiefComplaintSection().init()); + } + + }); + + addFailTest(new FailTest() { + @Override + public void updateToFail(DischargeSummary target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createChiefComplaintAndReasonForVisitSection().init()); + target.addSection(ConsolFactory.eINSTANCE.createReasonForVisitSection().init()); + } + + }); + + addFailTest(new FailTest() { + @Override + public void updateToFail(DischargeSummary target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createChiefComplaintAndReasonForVisitSection().init()); + target.addSection(ConsolFactory.eINSTANCE.createChiefComplaintSection().init()); + target.addSection(ConsolFactory.eINSTANCE.createReasonForVisitSection().init()); + } + + }); + + } + + @Override + public void addPassTests() { + addPassTest(new PassTest() { + @Override + public void updateToPass(DischargeSummary target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createChiefComplaintAndReasonForVisitSection().init()); + + } + }); + + addPassTest(new PassTest() { + @Override + public void updateToPass(DischargeSummary target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createChiefComplaintSection().init()); + target.addSection(ConsolFactory.eINSTANCE.createReasonForVisitSection().init()); + } + }); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryDoesNotHaveChiefComplaintAndReasonForVisitWithChiefComplaintSectionOrReasonSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryDoesNotHaveChiefComplaintAndReasonForVisitWithChiefComplaintSectionOrReasonSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryCodeP() { + OperationsTestCase validateDischargeSummaryCodePTestCase = new OperationsTestCase( + "validateDischargeSummaryCodeP", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryCodeP( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDischargeSummaryCode() { + OperationsTestCase validateDischargeSummaryCodeTestCase = new OperationsTestCase( + "validateDischargeSummaryCode", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + target.setCode(DatatypesFactory.eINSTANCE.createCE("11490-0", "2.16.840.1.113883.6.1")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryCode( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryHospitalAdmissionMedicationsSectionEntriesOptional() { + OperationsTestCase validateDischargeSummaryHospitalAdmissionMedicationsSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateDischargeSummaryHospitalAdmissionMedicationsSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_HOSPITAL_ADMISSION_MEDICATIONS_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* HospitalAdmissionMedicationsSectionEntriesOptional */ + HospitalAdmissionMedicationsSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createHospitalAdmissionMedicationsSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryHospitalAdmissionMedicationsSectionEntriesOptional( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryHospitalAdmissionMedicationsSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryHospitalAdmissionDiagnosisSection() { + OperationsTestCase validateDischargeSummaryHospitalAdmissionDiagnosisSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryHospitalAdmissionDiagnosisSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_HOSPITAL_ADMISSION_DIAGNOSIS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* HospitalAdmissionDiagnosisSection */ + HospitalAdmissionDiagnosisSection section = + + ConsolFactory.eINSTANCE.createHospitalAdmissionDiagnosisSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryHospitalAdmissionDiagnosisSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryHospitalAdmissionDiagnosisSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryHospitalDischargeDiagnosisSection() { + OperationsTestCase validateDischargeSummaryHospitalDischargeDiagnosisSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryHospitalDischargeDiagnosisSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_HOSPITAL_DISCHARGE_DIAGNOSIS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* HospitalDischargeDiagnosisSection */ + HospitalDischargeDiagnosisSection section = + + ConsolFactory.eINSTANCE.createHospitalDischargeDiagnosisSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryHospitalDischargeDiagnosisSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryHospitalDischargeDiagnosisSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryDischargeDietSection() { + OperationsTestCase validateDischargeSummaryDischargeDietSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryDischargeDietSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_DISCHARGE_DIET_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* DischargeDietSection */ + DischargeDietSection section = + + ConsolFactory.eINSTANCE.createDischargeDietSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryDischargeDietSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryDischargeDietSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryHospitalDischargeMedicationsSectionEntriesOptional() { + OperationsTestCase validateDischargeSummaryHospitalDischargeMedicationsSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateDischargeSummaryHospitalDischargeMedicationsSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_HOSPITAL_DISCHARGE_MEDICATIONS_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* HospitalDischargeMedicationsSectionEntriesOptional */ + HospitalDischargeMedicationsSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createHospitalDischargeMedicationsSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryHospitalDischargeMedicationsSectionEntriesOptional( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryHospitalDischargeMedicationsSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryFunctionalStatusSection() { + OperationsTestCase validateDischargeSummaryFunctionalStatusSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryFunctionalStatusSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_FUNCTIONAL_STATUS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* FunctionalStatusSection */ + FunctionalStatusSection section = + + ConsolFactory.eINSTANCE.createFunctionalStatusSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryFunctionalStatusSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryFunctionalStatusSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryHistoryOfPresentIllnessSection() { + OperationsTestCase validateDischargeSummaryHistoryOfPresentIllnessSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryHistoryOfPresentIllnessSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_HISTORY_OF_PRESENT_ILLNESS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* HistoryOfPresentIllnessSection */ + HistoryOfPresentIllnessSection section = + + ConsolFactory.eINSTANCE.createHistoryOfPresentIllnessSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryHistoryOfPresentIllnessSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryHistoryOfPresentIllnessSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryHospitalCourseSection() { + OperationsTestCase validateDischargeSummaryHospitalCourseSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryHospitalCourseSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_HOSPITAL_COURSE_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* HospitalCourseSection */ + HospitalCourseSection section = + + ConsolFactory.eINSTANCE.createHospitalCourseSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryHospitalCourseSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryHospitalCourseSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryPlanOfCareSection() { + OperationsTestCase validateDischargeSummaryPlanOfCareSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryPlanOfCareSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_PLAN_OF_CARE_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* PlanOfCareSection */ + PlanOfCareSection section = + + ConsolFactory.eINSTANCE.createPlanOfCareSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryPlanOfCareSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryPlanOfCareSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryHistoryOfPastIllnessSection() { + OperationsTestCase validateDischargeSummaryHistoryOfPastIllnessSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryHistoryOfPastIllnessSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_HISTORY_OF_PAST_ILLNESS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* HistoryOfPastIllnessSection */ + HistoryOfPastIllnessSection section = + + ConsolFactory.eINSTANCE.createHistoryOfPastIllnessSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryHistoryOfPastIllnessSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryHistoryOfPastIllnessSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryReviewOfSystemsSection() { + OperationsTestCase validateDischargeSummaryReviewOfSystemsSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryReviewOfSystemsSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_REVIEW_OF_SYSTEMS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* ReviewOfSystemsSection */ + ReviewOfSystemsSection section = + + ConsolFactory.eINSTANCE.createReviewOfSystemsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryReviewOfSystemsSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryReviewOfSystemsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDischargeSummaryComponentOf() { + OperationsTestCase validateDischargeSummaryComponentOfTestCase = new OperationsTestCase( + "validateDischargeSummaryComponentOf", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_COMPONENT_OF__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + target.init(); + } + + @Override + protected void updateToPass(DischargeSummary target) { + + Component1 cof = CDAFactory.eINSTANCE.createComponent1(); + + target.setComponentOf(cof); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryComponentOf( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryComponentOfTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryChiefComplaintAndReasonForVisitSection() { + OperationsTestCase validateDischargeSummaryChiefComplaintAndReasonForVisitSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryChiefComplaintAndReasonForVisitSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_CHIEF_COMPLAINT_AND_REASON_FOR_VISIT_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* ChiefComplaintAndReasonForVisitSection */ + ChiefComplaintAndReasonForVisitSection section = + + ConsolFactory.eINSTANCE.createChiefComplaintAndReasonForVisitSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryChiefComplaintAndReasonForVisitSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryChiefComplaintAndReasonForVisitSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryChiefComplaintSection() { + OperationsTestCase validateDischargeSummaryChiefComplaintSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryChiefComplaintSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_CHIEF_COMPLAINT_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* ChiefComplaintSection */ + ChiefComplaintSection section = + + ConsolFactory.eINSTANCE.createChiefComplaintSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryChiefComplaintSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryChiefComplaintSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryFamilyHistorySection() { + OperationsTestCase validateDischargeSummaryFamilyHistorySectionTestCase = new OperationsTestCase( + "validateDischargeSummaryFamilyHistorySection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_FAMILY_HISTORY_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* FamilyHistorySection */ + FamilyHistorySection section = + + ConsolFactory.eINSTANCE.createFamilyHistorySection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryFamilyHistorySection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryFamilyHistorySectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryHospitalConsultationsSection() { + OperationsTestCase validateDischargeSummaryHospitalConsultationsSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryHospitalConsultationsSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_HOSPITAL_CONSULTATIONS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* HospitalConsultationsSection */ + HospitalConsultationsSection section = + + ConsolFactory.eINSTANCE.createHospitalConsultationsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryHospitalConsultationsSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryHospitalConsultationsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryHospitalDischargeInstructionsSection() { + OperationsTestCase validateDischargeSummaryHospitalDischargeInstructionsSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryHospitalDischargeInstructionsSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_HOSPITAL_DISCHARGE_INSTRUCTIONS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* HospitalDischargeInstructionsSection */ + HospitalDischargeInstructionsSection section = + + ConsolFactory.eINSTANCE.createHospitalDischargeInstructionsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryHospitalDischargeInstructionsSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryHospitalDischargeInstructionsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryHospitalDischargePhysicalSection() { + OperationsTestCase validateDischargeSummaryHospitalDischargePhysicalSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryHospitalDischargePhysicalSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_HOSPITAL_DISCHARGE_PHYSICAL_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* HospitalDischargePhysicalSection */ + HospitalDischargePhysicalSection section = + + ConsolFactory.eINSTANCE.createHospitalDischargePhysicalSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryHospitalDischargePhysicalSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryHospitalDischargePhysicalSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryHospitalDischargeStudiesSummarySection() { + OperationsTestCase validateDischargeSummaryHospitalDischargeStudiesSummarySectionTestCase = new OperationsTestCase( + "validateDischargeSummaryHospitalDischargeStudiesSummarySection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_HOSPITAL_DISCHARGE_STUDIES_SUMMARY_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* HospitalDischargeStudiesSummarySection */ + HospitalDischargeStudiesSummarySection section = + + ConsolFactory.eINSTANCE.createHospitalDischargeStudiesSummarySection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryHospitalDischargeStudiesSummarySection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryHospitalDischargeStudiesSummarySectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryImmunizationsSectionEntriesOptional() { + OperationsTestCase validateDischargeSummaryImmunizationsSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateDischargeSummaryImmunizationsSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_IMMUNIZATIONS_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* ImmunizationsSectionEntriesOptional */ + ImmunizationsSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createImmunizationsSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryImmunizationsSectionEntriesOptional( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryImmunizationsSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryProblemSectionEntriesOptional() { + OperationsTestCase validateDischargeSummaryProblemSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateDischargeSummaryProblemSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_PROBLEM_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* ProblemSectionEntriesOptional */ + ProblemSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createProblemSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryProblemSectionEntriesOptional( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryProblemSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryProceduresSectionEntriesOptional() { + OperationsTestCase validateDischargeSummaryProceduresSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateDischargeSummaryProceduresSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_PROCEDURES_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* ProceduresSectionEntriesOptional */ + ProceduresSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createProceduresSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryProceduresSectionEntriesOptional( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryProceduresSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryReasonForVisitSection() { + OperationsTestCase validateDischargeSummaryReasonForVisitSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryReasonForVisitSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_REASON_FOR_VISIT_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* ReasonForVisitSection */ + ReasonForVisitSection section = + + ConsolFactory.eINSTANCE.createReasonForVisitSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryReasonForVisitSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryReasonForVisitSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummarySocialHistorySection() { + OperationsTestCase validateDischargeSummarySocialHistorySectionTestCase = new OperationsTestCase( + "validateDischargeSummarySocialHistorySection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_SOCIAL_HISTORY_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* SocialHistorySection */ + SocialHistorySection section = + + ConsolFactory.eINSTANCE.createSocialHistorySection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummarySocialHistorySection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummarySocialHistorySectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryAllergiesSectionEntriesOptional() { + OperationsTestCase validateDischargeSummaryAllergiesSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateDischargeSummaryAllergiesSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_ALLERGIES_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* AllergiesSectionEntriesOptional */ + AllergiesSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createAllergiesSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryAllergiesSectionEntriesOptional( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryAllergiesSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryVitalSignsSectionEntriesOptional() { + OperationsTestCase validateDischargeSummaryVitalSignsSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateDischargeSummaryVitalSignsSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_VITAL_SIGNS_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* VitalSignsSectionEntriesOptional */ + VitalSignsSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createVitalSignsSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryVitalSignsSectionEntriesOptional( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryVitalSignsSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDischargeSummaryComponentOfEncompassingEncounter3ResponsiblePartyAssignedEntityHasPersonOrOrganization() { + OperationsTestCase validateDischargeSummaryComponentOfEncompassingEncounter3ResponsiblePartyAssignedEntityHasPersonOrOrganizationTestCase = new OperationsTestCase( + "validateDischargeSummaryComponentOfEncompassingEncounter3ResponsiblePartyAssignedEntityHasPersonOrOrganization", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_COMPONENT_OF_ENCOMPASSING_ENCOUNTER3_RESPONSIBLE_PARTY_ASSIGNED_ENTITY_HAS_PERSON_OR_ORGANIZATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + target.init(); + Component1 cof = CDAFactory.eINSTANCE.createComponent1(); + + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + + ResponsibleParty rp = CDAFactory.eINSTANCE.createResponsibleParty(); + + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + + rp.setAssignedEntity(ae); + ee.setResponsibleParty(rp); + + cof.setEncompassingEncounter(ee); + target.setComponentOf(cof); + + } + + @Override + protected void updateToPass(DischargeSummary target) { + + Person person = CDAFactory.eINSTANCE.createPerson(); + + target.getComponentOf().getEncompassingEncounter().getResponsibleParty().getAssignedEntity().setAssignedPerson( + person); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryComponentOfEncompassingEncounter3ResponsiblePartyAssignedEntityHasPersonOrOrganization( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryComponentOfEncompassingEncounter3ResponsiblePartyAssignedEntityHasPersonOrOrganizationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDischargeSummaryComponentOfEncompassingEncounter3ResponsiblePartyAssignedEntity() { + OperationsTestCase validateDischargeSummaryComponentOfEncompassingEncounter3ResponsiblePartyAssignedEntityTestCase = new OperationsTestCase( + "validateDischargeSummaryComponentOfEncompassingEncounter3ResponsiblePartyAssignedEntity", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_COMPONENT_OF_ENCOMPASSING_ENCOUNTER3_RESPONSIBLE_PARTY_ASSIGNED_ENTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + target.init(); + Component1 cof = CDAFactory.eINSTANCE.createComponent1(); + + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + + ResponsibleParty rp = CDAFactory.eINSTANCE.createResponsibleParty(); + + ee.setResponsibleParty(rp); + + cof.setEncompassingEncounter(ee); + target.setComponentOf(cof); + + } + + @Override + protected void updateToPass(DischargeSummary target) { + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + + target.getComponentOf().getEncompassingEncounter().getResponsibleParty().setAssignedEntity(ae); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryComponentOfEncompassingEncounter3ResponsiblePartyAssignedEntity( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryComponentOfEncompassingEncounter3ResponsiblePartyAssignedEntityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDischargeSummaryComponentOfEncompassingEncounter3EncounterParticipantAssignedEntityHasPersonOrOrganization() { + OperationsTestCase validateDischargeSummaryComponentOfEncompassingEncounter3EncounterParticipantAssignedEntityHasPersonOrOrganizationTestCase = new OperationsTestCase( + "validateDischargeSummaryComponentOfEncompassingEncounter3EncounterParticipantAssignedEntityHasPersonOrOrganization", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_COMPONENT_OF_ENCOMPASSING_ENCOUNTER3_ENCOUNTER_PARTICIPANT_ASSIGNED_ENTITY_HAS_PERSON_OR_ORGANIZATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + target.init(); + Component1 cof = CDAFactory.eINSTANCE.createComponent1(); + + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + + EncounterParticipant ep = CDAFactory.eINSTANCE.createEncounterParticipant(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + + ep.setAssignedEntity(ae); + ee.getEncounterParticipants().add(ep); + + cof.setEncompassingEncounter(ee); + target.setComponentOf(cof); + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.getComponentOf().getEncompassingEncounter().getEncounterParticipants().clear(); + + EncounterParticipant ep = CDAFactory.eINSTANCE.createEncounterParticipant(); + + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + + Person person = CDAFactory.eINSTANCE.createPerson(); + + ae.setAssignedPerson(person); + + ep.setAssignedEntity(ae); + + target.getComponentOf().getEncompassingEncounter().getEncounterParticipants().add(ep); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryComponentOfEncompassingEncounter3EncounterParticipantAssignedEntityHasPersonOrOrganization( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryComponentOfEncompassingEncounter3EncounterParticipantAssignedEntityHasPersonOrOrganizationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDischargeSummaryComponentOfEncompassingEncounter3EncounterParticipantAssignedEntity() { + OperationsTestCase validateDischargeSummaryComponentOfEncompassingEncounter3EncounterParticipantAssignedEntityTestCase = new OperationsTestCase( + "validateDischargeSummaryComponentOfEncompassingEncounter3EncounterParticipantAssignedEntity", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_COMPONENT_OF_ENCOMPASSING_ENCOUNTER3_ENCOUNTER_PARTICIPANT_ASSIGNED_ENTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + target.init(); + Component1 cof = CDAFactory.eINSTANCE.createComponent1(); + + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + + EncounterParticipant ep = CDAFactory.eINSTANCE.createEncounterParticipant(); + + ee.getEncounterParticipants().add(ep); + + cof.setEncompassingEncounter(ee); + target.setComponentOf(cof); + } + + @Override + protected void updateToPass(DischargeSummary target) { + + target.getComponentOf().getEncompassingEncounter().getEncounterParticipants().clear(); + + EncounterParticipant ep = CDAFactory.eINSTANCE.createEncounterParticipant(); + + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + + ep.setAssignedEntity(ae); + + target.getComponentOf().getEncompassingEncounter().getEncounterParticipants().add(ep); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryComponentOfEncompassingEncounter3EncounterParticipantAssignedEntity( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryComponentOfEncompassingEncounter3EncounterParticipantAssignedEntityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDischargeSummaryComponentOfEncompassingEncounter3EncompassingEncounterHasEffectiveTimeLow() { + OperationsTestCase validateDischargeSummaryComponentOfEncompassingEncounter3EncompassingEncounterHasEffectiveTimeLowTestCase = new OperationsTestCase( + "validateDischargeSummaryComponentOfEncompassingEncounter3EncompassingEncounterHasEffectiveTimeLow", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_COMPONENT_OF_ENCOMPASSING_ENCOUNTER3_ENCOMPASSING_ENCOUNTER_HAS_EFFECTIVE_TIME_LOW__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + target.init(); + Component1 cof = CDAFactory.eINSTANCE.createComponent1(); + + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + + ee.setEffectiveTime(DatatypesFactory.eINSTANCE.createIVL_TS()); + cof.setEncompassingEncounter(ee); + + target.setComponentOf(cof); + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.getComponentOf().getEncompassingEncounter().getEffectiveTime().setLow( + DatatypesFactory.eINSTANCE.createIVXB_TS()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryComponentOfEncompassingEncounter3EncompassingEncounterHasEffectiveTimeLow( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryComponentOfEncompassingEncounter3EncompassingEncounterHasEffectiveTimeLowTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDischargeSummaryComponentOfEncompassingEncounter3EncompassingEncounterHasEffectiveTimeHigh() { + OperationsTestCase validateDischargeSummaryComponentOfEncompassingEncounter3EncompassingEncounterHasEffectiveTimeHighTestCase = new OperationsTestCase( + "validateDischargeSummaryComponentOfEncompassingEncounter3EncompassingEncounterHasEffectiveTimeHigh", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_COMPONENT_OF_ENCOMPASSING_ENCOUNTER3_ENCOMPASSING_ENCOUNTER_HAS_EFFECTIVE_TIME_HIGH__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + target.init(); + Component1 cof = CDAFactory.eINSTANCE.createComponent1(); + + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + + ee.setEffectiveTime(DatatypesFactory.eINSTANCE.createIVL_TS()); + cof.setEncompassingEncounter(ee); + + target.setComponentOf(cof); + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.getComponentOf().getEncompassingEncounter().getEffectiveTime().setHigh( + DatatypesFactory.eINSTANCE.createIVXB_TS()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryComponentOfEncompassingEncounter3EncompassingEncounterHasEffectiveTimeHigh( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryComponentOfEncompassingEncounter3EncompassingEncounterHasEffectiveTimeHighTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDischargeSummaryComponentOfEncompassingEncounter3DischargeDispositionCode() { + OperationsTestCase validateDischargeSummaryComponentOfEncompassingEncounter3DischargeDispositionCodeTestCase = new OperationsTestCase( + "validateDischargeSummaryComponentOfEncompassingEncounter3DischargeDispositionCode", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_COMPONENT_OF_ENCOMPASSING_ENCOUNTER3_DISCHARGE_DISPOSITION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + target.init(); + Component1 cof = CDAFactory.eINSTANCE.createComponent1(); + + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + + cof.setEncompassingEncounter(ee); + target.setComponentOf(cof); + + } + + @Override + protected void updateToPass(DischargeSummary target) { + EncounterParticipant ep = CDAFactory.eINSTANCE.createEncounterParticipant(); + target.getComponentOf().getEncompassingEncounter().setDischargeDispositionCode( + DatatypesFactory.eINSTANCE.createCE()); + target.getComponentOf().getEncompassingEncounter().getEncounterParticipants().add(ep); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryComponentOfEncompassingEncounter3DischargeDispositionCode( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryComponentOfEncompassingEncounter3DischargeDispositionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDischargeSummaryComponentOfEncompassingEncounter3EffectiveTime() { + OperationsTestCase validateDischargeSummaryComponentOfEncompassingEncounter3EffectiveTimeTestCase = new OperationsTestCase( + "validateDischargeSummaryComponentOfEncompassingEncounter3EffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_COMPONENT_OF_ENCOMPASSING_ENCOUNTER3_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + target.init(); + Component1 cof = CDAFactory.eINSTANCE.createComponent1(); + + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + + cof.setEncompassingEncounter(ee); + target.setComponentOf(cof); + + } + + @Override + protected void updateToPass(DischargeSummary target) { + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + target.getComponentOf().getEncompassingEncounter().setEffectiveTime(ts); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryComponentOfEncompassingEncounter3EffectiveTime( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryComponentOfEncompassingEncounter3EffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDischargeSummaryComponentOfEncompassingEncounter3ResponsibleParty() { + OperationsTestCase validateDischargeSummaryComponentOfEncompassingEncounter3ResponsiblePartyTestCase = new OperationsTestCase( + "validateDischargeSummaryComponentOfEncompassingEncounter3ResponsibleParty", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_COMPONENT_OF_ENCOMPASSING_ENCOUNTER3_RESPONSIBLE_PARTY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + target.init(); + Component1 cof = CDAFactory.eINSTANCE.createComponent1(); + + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + + cof.setEncompassingEncounter(ee); + target.setComponentOf(cof); + + } + + @Override + protected void updateToPass(DischargeSummary target) { + ResponsibleParty rp = CDAFactory.eINSTANCE.createResponsibleParty(); + + target.getComponentOf().getEncompassingEncounter().setResponsibleParty(rp); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryComponentOfEncompassingEncounter3ResponsibleParty( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryComponentOfEncompassingEncounter3ResponsiblePartyTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDischargeSummaryComponentOfEncompassingEncounter3EncounterParticipant() { + OperationsTestCase validateDischargeSummaryComponentOfEncompassingEncounter3EncounterParticipantTestCase = new OperationsTestCase( + "validateDischargeSummaryComponentOfEncompassingEncounter3EncounterParticipant", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_COMPONENT_OF_ENCOMPASSING_ENCOUNTER3_ENCOUNTER_PARTICIPANT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + target.init(); + Component1 cof = CDAFactory.eINSTANCE.createComponent1(); + + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + + cof.setEncompassingEncounter(ee); + target.setComponentOf(cof); + + } + + @Override + protected void updateToPass(DischargeSummary target) { + EncounterParticipant ep = CDAFactory.eINSTANCE.createEncounterParticipant(); + + target.getComponentOf().getEncompassingEncounter().getEncounterParticipants().add(ep); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryComponentOfEncompassingEncounter3EncounterParticipant( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryComponentOfEncompassingEncounter3EncounterParticipantTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDischargeSummaryComponentOfEncompassingEncounter() { + OperationsTestCase validateDischargeSummaryComponentOfEncompassingEncounterTestCase = new OperationsTestCase( + "validateDischargeSummaryComponentOfEncompassingEncounter", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_COMPONENT_OF_ENCOMPASSING_ENCOUNTER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + target.init(); + Component1 cof = CDAFactory.eINSTANCE.createComponent1(); + + target.setComponentOf(cof); + + } + + @Override + protected void updateToPass(DischargeSummary target) { + + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + + target.getComponentOf().setEncompassingEncounter(ee); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryComponentOfEncompassingEncounter( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryComponentOfEncompassingEncounterTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetHospitalAdmissionMedicationsSectionEntriesOptional() { + + DischargeSummary target = objectFactory.create(); + target.getHospitalAdmissionMedicationsSectionEntriesOptional(); + + } + + /** + * + * @generated + */ + @Test + public void testGetHospitalAdmissionDiagnosisSection() { + + DischargeSummary target = objectFactory.create(); + target.getHospitalAdmissionDiagnosisSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetHospitalDischargeDiagnosisSection() { + + DischargeSummary target = objectFactory.create(); + target.getHospitalDischargeDiagnosisSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetDischargeDietSection() { + + DischargeSummary target = objectFactory.create(); + target.getDischargeDietSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetHospitalDischargeMedicationsSectionEntriesOptional() { + + DischargeSummary target = objectFactory.create(); + target.getHospitalDischargeMedicationsSectionEntriesOptional(); + + } + + /** + * + * @generated + */ + @Test + public void testGetFunctionalStatusSection() { + + DischargeSummary target = objectFactory.create(); + target.getFunctionalStatusSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetHistoryOfPresentIllnessSection() { + + DischargeSummary target = objectFactory.create(); + target.getHistoryOfPresentIllnessSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetHospitalCourseSection() { + + DischargeSummary target = objectFactory.create(); + target.getHospitalCourseSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPlanOfCareSection() { + + DischargeSummary target = objectFactory.create(); + target.getPlanOfCareSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetHistoryOfPastIllnessSection() { + + DischargeSummary target = objectFactory.create(); + target.getHistoryOfPastIllnessSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetReviewOfSystemsSection() { + + DischargeSummary target = objectFactory.create(); + target.getReviewOfSystemsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetChiefComplaintAndReasonForVisitSection() { + + DischargeSummary target = objectFactory.create(); + target.getChiefComplaintAndReasonForVisitSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetChiefComplaintSection() { + + DischargeSummary target = objectFactory.create(); + target.getChiefComplaintSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetFamilyHistorySection() { + + DischargeSummary target = objectFactory.create(); + target.getFamilyHistorySection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetHospitalConsultationsSection() { + + DischargeSummary target = objectFactory.create(); + target.getHospitalConsultationsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetHospitalDischargeInstructionsSection() { + + DischargeSummary target = objectFactory.create(); + target.getHospitalDischargeInstructionsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetHospitalDischargePhysicalSection() { + + DischargeSummary target = objectFactory.create(); + target.getHospitalDischargePhysicalSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetHospitalDischargeStudiesSummarySection() { + + DischargeSummary target = objectFactory.create(); + target.getHospitalDischargeStudiesSummarySection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetImmunizationsSectionEntriesOptional() { + + DischargeSummary target = objectFactory.create(); + target.getImmunizationsSectionEntriesOptional(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProblemSectionEntriesOptional() { + + DischargeSummary target = objectFactory.create(); + target.getProblemSectionEntriesOptional(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProceduresSectionEntriesOptional() { + + DischargeSummary target = objectFactory.create(); + target.getProceduresSectionEntriesOptional(); + + } + + /** + * + * @generated + */ + @Test + public void testGetReasonForVisitSection() { + + DischargeSummary target = objectFactory.create(); + target.getReasonForVisitSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetSocialHistorySection() { + + DischargeSummary target = objectFactory.create(); + target.getSocialHistorySection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetAllergiesSectionEntriesOptional() { + + DischargeSummary target = objectFactory.create(); + target.getAllergiesSectionEntriesOptional(); + + } + + /** + * + * @generated + */ + @Test + public void testGetVitalSignsSectionEntriesOptional() { + + DischargeSummary target = objectFactory.create(); + target.getVitalSignsSectionEntriesOptional(); + + } + + /** + * + * @generated + */ + @Test + public void testValidateGeneralHeaderConstraintsTemplateId() { + OperationsTestCase validateGeneralHeaderConstraintsTemplateIdTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsTemplateId", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateGeneralHeaderConstraintsTemplateId( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsCode() { + OperationsTestCase validateGeneralHeaderConstraintsCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + target.getCode().setCode("code"); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsCode( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends DischargeSummaryOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public DischargeSummary create() { + return ConsolFactory.eINSTANCE.createDischargeSummary(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends DischargeSummaryOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // DischargeSummaryOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/DrugVehicleTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/DrugVehicleTest.java new file mode 100644 index 000000000..29d91a7bd --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/DrugVehicleTest.java @@ -0,0 +1,321 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.PlayingEntity; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.DrugVehicle; +import org.openhealthtools.mdht.uml.cda.consol.operations.DrugVehicleOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; + +/** + * + * A static utility class that provides operations related to 'Drug Vehicle' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DrugVehicle#validateDrugVehiclePlayingEntityCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Drug Vehicle Playing Entity Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DrugVehicle#validateDrugVehiclePlayingEntityName(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Drug Vehicle Playing Entity Name}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DrugVehicle#validateDrugVehicleTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Drug Vehicle Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DrugVehicle#validateDrugVehicleClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Drug Vehicle Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DrugVehicle#validateDrugVehicleCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Drug Vehicle Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.DrugVehicle#validateDrugVehiclePlayingEntity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Drug Vehicle Playing Entity}
  • + *
+ *

+ * + * @generated + */ + +public class DrugVehicleTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateDrugVehiclePlayingEntityCode() { + OperationsTestCase validateDrugVehiclePlayingEntityCodeTestCase = new OperationsTestCase( + "validateDrugVehiclePlayingEntityCode", + operationsForOCL.getOCLValue("VALIDATE_DRUG_VEHICLE_PLAYING_ENTITY_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DrugVehicle target) { + target.init(); + + target.setPlayingEntity(CDAFactory.eINSTANCE.createPlayingEntity()); + } + + @Override + protected void updateToPass(DrugVehicle target) { + + target.getPlayingEntity().setCode(DatatypesFactory.eINSTANCE.createCE()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DrugVehicleOperations.validateDrugVehiclePlayingEntityCode( + (DrugVehicle) objectToTest, diagnostician, map); + } + + }; + + validateDrugVehiclePlayingEntityCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDrugVehiclePlayingEntityName() { + OperationsTestCase validateDrugVehiclePlayingEntityNameTestCase = new OperationsTestCase( + "validateDrugVehiclePlayingEntityName", + operationsForOCL.getOCLValue("VALIDATE_DRUG_VEHICLE_PLAYING_ENTITY_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DrugVehicle target) { + target.init(); + target.setPlayingEntity(CDAFactory.eINSTANCE.createPlayingEntity()); + } + + @Override + protected void updateToPass(DrugVehicle target) { + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + pe.getNames().add(DatatypesFactory.eINSTANCE.createPN()); + target.setPlayingEntity(pe); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DrugVehicleOperations.validateDrugVehiclePlayingEntityName( + (DrugVehicle) objectToTest, diagnostician, map); + } + + }; + + validateDrugVehiclePlayingEntityNameTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDrugVehicleTemplateId() { + OperationsTestCase validateDrugVehicleTemplateIdTestCase = new OperationsTestCase( + "validateDrugVehicleTemplateId", + operationsForOCL.getOCLValue("VALIDATE_DRUG_VEHICLE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DrugVehicle target) { + + } + + @Override + protected void updateToPass(DrugVehicle target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DrugVehicleOperations.validateDrugVehicleTemplateId( + (DrugVehicle) objectToTest, diagnostician, map); + } + + }; + + validateDrugVehicleTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDrugVehicleClassCode() { + OperationsTestCase validateDrugVehicleClassCodeTestCase = new OperationsTestCase( + "validateDrugVehicleClassCode", + operationsForOCL.getOCLValue("VALIDATE_DRUG_VEHICLE_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DrugVehicle target) { + + } + + @Override + protected void updateToPass(DrugVehicle target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DrugVehicleOperations.validateDrugVehicleClassCode( + (DrugVehicle) objectToTest, diagnostician, map); + } + + }; + + validateDrugVehicleClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDrugVehicleCode() { + OperationsTestCase validateDrugVehicleCodeTestCase = new OperationsTestCase( + "validateDrugVehicleCode", + operationsForOCL.getOCLValue("VALIDATE_DRUG_VEHICLE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(DrugVehicle target) { + + } + + @Override + protected void updateToPass(DrugVehicle target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DrugVehicleOperations.validateDrugVehicleCode((DrugVehicle) objectToTest, diagnostician, map); + } + + }; + + validateDrugVehicleCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDrugVehiclePlayingEntity() { + OperationsTestCase validateDrugVehiclePlayingEntityTestCase = new OperationsTestCase( + "validateDrugVehiclePlayingEntity", + operationsForOCL.getOCLValue("VALIDATE_DRUG_VEHICLE_PLAYING_ENTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DrugVehicle target) { + + } + + @Override + protected void updateToPass(DrugVehicle target) { + target.init(); + target.setPlayingEntity(CDAFactory.eINSTANCE.createPlayingEntity()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DrugVehicleOperations.validateDrugVehiclePlayingEntity( + (DrugVehicle) objectToTest, diagnostician, map); + } + + }; + + validateDrugVehiclePlayingEntityTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends DrugVehicleOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public DrugVehicle create() { + return ConsolFactory.eINSTANCE.createDrugVehicle(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends DrugVehicleOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // DrugVehicleOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/EncounterActivitiesTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/EncounterActivitiesTest.java new file mode 100644 index 000000000..06f0b361e --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/EncounterActivitiesTest.java @@ -0,0 +1,826 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.AssignedEntity; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.Participant2; +import org.openhealthtools.mdht.uml.cda.Performer2; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ConsolPackage; +import org.openhealthtools.mdht.uml.cda.consol.EncounterActivities; +import org.openhealthtools.mdht.uml.cda.consol.GeneralStatusSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.EncounterActivitiesOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.vocab.ParticipationType; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * + * A static utility class that provides operations related to 'Encounter Activities' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.EncounterActivities#validateEncounterActivitiesCodeOriginalText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounter Activities Code Original Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.EncounterActivities#validateEncounterActivitiesCodeOriginalTextReference(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounter Activities Code Original Text Reference}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.EncounterActivities#validateEncounterActivitiesReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounter Activities Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.EncounterActivities#validateEncounterActivitiesCodeOriginalTextReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounter Activities Code Original Text Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.EncounterActivities#validateEncounterActivitiesServiceDeliveryTypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounter Activities Service Delivery Type Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.EncounterActivities#validateEncounterActivitiesTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounter Activities Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.EncounterActivities#validateEncounterActivitiesClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounter Activities Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.EncounterActivities#validateEncounterActivitiesMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounter Activities Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.EncounterActivities#validateEncounterActivitiesId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounter Activities Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.EncounterActivities#validateEncounterActivitiesCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounter Activities Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.EncounterActivities#validateEncounterActivitiesEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounter Activities Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.EncounterActivities#validateEncounterActivitiesServiceDeliveryLocation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounter Activities Service Delivery Location}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.EncounterActivities#validateEncounterActivitiesIndication(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounter Activities Indication}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.EncounterActivities#validateEncounterActivitiesEncounterPerformer(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounter Activities Encounter Performer}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.EncounterActivities#validateEncounterActivitiesEncounterDiagnosis(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounter Activities Encounter Diagnosis}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.EncounterActivities#validateEncounterActivitiesEncounterPerformerEncounterPerformerAssignedEntityCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounter Activities Encounter Performer Encounter Performer Assigned Entity Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.EncounterActivities#validateEncounterActivitiesEncounterPerformerEncounterPerformerAssignedEntity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounter Activities Encounter Performer Encounter Performer Assigned Entity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.EncounterActivities#getServiceDeliveryLocations() Get Service Delivery Locations}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.EncounterActivities#getIndications() Get Indications}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.EncounterActivities#getEncounterDiagnosiss() Get Encounter Diagnosiss}
  • + *
+ *

+ * + * @generated + */ + +public class EncounterActivitiesTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateEncounterActivitiesCodeOriginalText() { + OperationsTestCase validateEncounterActivitiesCodeOriginalTextTestCase = new OperationsTestCase( + "validateEncounterActivitiesCodeOriginalText", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTER_ACTIVITIES_CODE_ORIGINAL_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncounterActivities target) { + target.init(); + CD code = DatatypesFactory.eINSTANCE.createCD(); + + target.setCode(code); + } + + @Override + protected void updateToPass(EncounterActivities target) { + + CD code = DatatypesFactory.eINSTANCE.createCD(); + code.setOriginalText(DatatypesFactory.eINSTANCE.createED()); + target.setCode(code); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncounterActivitiesOperations.validateEncounterActivitiesCodeOriginalText( + (EncounterActivities) objectToTest, diagnostician, map); + } + + }; + + validateEncounterActivitiesCodeOriginalTextTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateEncounterActivitiesCodeOriginalTextReference() { + OperationsTestCase validateEncounterActivitiesCodeOriginalTextReferenceTestCase = new OperationsTestCase( + "validateEncounterActivitiesCodeOriginalTextReference", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTER_ACTIVITIES_CODE_ORIGINAL_TEXT_REFERENCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncounterActivities target) { + target.init(); + CD code = DatatypesFactory.eINSTANCE.createCD(); + code.setOriginalText(DatatypesFactory.eINSTANCE.createED()); + target.setCode(code); + } + + @Override + protected void updateToPass(EncounterActivities target) { + + CD code = DatatypesFactory.eINSTANCE.createCD(); + ED ot = DatatypesFactory.eINSTANCE.createED(); + ot.setReference(DatatypesFactory.eINSTANCE.createTEL("test")); + code.setOriginalText(ot); + + target.setCode(code); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncounterActivitiesOperations.validateEncounterActivitiesCodeOriginalTextReference( + (EncounterActivities) objectToTest, diagnostician, map); + } + + }; + + validateEncounterActivitiesCodeOriginalTextReferenceTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateEncounterActivitiesReferenceValue() { + OperationsTestCase validateEncounterActivitiesReferenceValueTestCase = new OperationsTestCase( + "validateEncounterActivitiesReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTER_ACTIVITIES_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncounterActivities target) { + target.init(); + CD code = DatatypesFactory.eINSTANCE.createCD(); + ED ot = DatatypesFactory.eINSTANCE.createED(); + ot.setReference(DatatypesFactory.eINSTANCE.createTEL()); + code.setOriginalText(ot); + target.setCode(code); + } + + @Override + protected void updateToPass(EncounterActivities target) { + + CD code = DatatypesFactory.eINSTANCE.createCD(); + ED ot = DatatypesFactory.eINSTANCE.createED(); + ot.setReference(DatatypesFactory.eINSTANCE.createTEL("test")); + code.setOriginalText(ot); + + target.setCode(code); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncounterActivitiesOperations.validateEncounterActivitiesReferenceValue( + (EncounterActivities) objectToTest, diagnostician, map); + } + + }; + + validateEncounterActivitiesReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + + @Test + public void testValidateEncounterActivitiesCodeOriginalTextReferenceValue() { + OperationsTestCase validateEncounterActivitiesCodeOriginalTextReferenceValueTestCase = new NarrativeReferenceTestCase( + "validateEncounterActivitiesCodeOriginalTextReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTER_ACTIVITIES_CODE_ORIGINAL_TEXT_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncounterActivities target) { + target.init(); + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), "", + "No particular encounter."); + + // add a reference to the section text + target.setCode(createCDWithOriginalTextReference("Some sample text", "#1.2.3.4")); + + } + + @Override + protected void updateToPass(EncounterActivities target) { + + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), + "1.2.3.4", "No particular encounter."); + + // add a reference to the section text + target.setCode(createCDWithOriginalTextReference("Some sample text", "#1.2.3.4")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncounterActivitiesOperations.validateEncounterActivitiesCodeOriginalTextReferenceValue( + (EncounterActivities) objectToTest, diagnostician, map); + } + + }; + + validateEncounterActivitiesCodeOriginalTextReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateEncounterActivitiesServiceDeliveryTypeCode() { + OperationsTestCase validateEncounterActivitiesServiceDeliveryTypeCodeTestCase = new OperationsTestCase( + "validateEncounterActivitiesServiceDeliveryTypeCode", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTER_ACTIVITIES_SERVICE_DELIVERY_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncounterActivities target) { + target.init(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setParticipantRole(ConsolFactory.eINSTANCE.createServiceDeliveryLocation()); + target.getParticipants().add(par); + } + + @Override + protected void updateToPass(EncounterActivities target) { + target.getParticipants().clear(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setTypeCode(ParticipationType.LOC); + par.setParticipantRole(ConsolFactory.eINSTANCE.createServiceDeliveryLocation()); + target.getParticipants().add(par); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncounterActivitiesOperations.validateEncounterActivitiesServiceDeliveryTypeCode( + (EncounterActivities) objectToTest, diagnostician, map); + } + + }; + + validateEncounterActivitiesServiceDeliveryTypeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateEncounterActivitiesTemplateId() { + OperationsTestCase validateEncounterActivitiesTemplateIdTestCase = new OperationsTestCase( + "validateEncounterActivitiesTemplateId", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTER_ACTIVITIES_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncounterActivities target) { + + } + + @Override + protected void updateToPass(EncounterActivities target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncounterActivitiesOperations.validateEncounterActivitiesTemplateId( + (EncounterActivities) objectToTest, diagnostician, map); + } + + }; + + validateEncounterActivitiesTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateEncounterActivitiesClassCode() { + OperationsTestCase validateEncounterActivitiesClassCodeTestCase = new OperationsTestCase( + "validateEncounterActivitiesClassCode", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTER_ACTIVITIES_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncounterActivities target) { + + } + + @Override + protected void updateToPass(EncounterActivities target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncounterActivitiesOperations.validateEncounterActivitiesClassCode( + (EncounterActivities) objectToTest, diagnostician, map); + } + + }; + + validateEncounterActivitiesClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateEncounterActivitiesMoodCode() { + OperationsTestCase validateEncounterActivitiesMoodCodeTestCase = new OperationsTestCase( + "validateEncounterActivitiesMoodCode", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTER_ACTIVITIES_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncounterActivities target) { + + } + + @Override + protected void updateToPass(EncounterActivities target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncounterActivitiesOperations.validateEncounterActivitiesMoodCode( + (EncounterActivities) objectToTest, diagnostician, map); + } + + }; + + validateEncounterActivitiesMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateEncounterActivitiesId() { + OperationsTestCase validateEncounterActivitiesIdTestCase = new OperationsTestCase( + "validateEncounterActivitiesId", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTER_ACTIVITIES_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncounterActivities target) { + + } + + @Override + protected void updateToPass(EncounterActivities target) { + target.init(); + target.getIds().add(DatatypesFactory.eINSTANCE.createII()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncounterActivitiesOperations.validateEncounterActivitiesId( + (EncounterActivities) objectToTest, diagnostician, map); + } + + }; + + validateEncounterActivitiesIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateEncounterActivitiesCode() { + OperationsTestCase validateEncounterActivitiesCodeTestCase = new OperationsTestCase( + "validateEncounterActivitiesCode", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTER_ACTIVITIES_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncounterActivities target) { + + } + + @Override + protected void updateToPass(EncounterActivities target) { + target.init(); + CD code = DatatypesFactory.eINSTANCE.createCD(); + code.setCode("test"); + code.setCodeSystem("2.16.840.1.113883.6.12"); + target.setCode(code); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncounterActivitiesOperations.validateEncounterActivitiesCode( + (EncounterActivities) objectToTest, diagnostician, map); + } + + }; + + validateEncounterActivitiesCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateEncounterActivitiesEffectiveTime() { + OperationsTestCase validateEncounterActivitiesEffectiveTimeTestCase = new OperationsTestCase( + "validateEncounterActivitiesEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTER_ACTIVITIES_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncounterActivities target) { + + } + + @Override + protected void updateToPass(EncounterActivities target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncounterActivitiesOperations.validateEncounterActivitiesEffectiveTime( + (EncounterActivities) objectToTest, diagnostician, map); + } + + }; + + validateEncounterActivitiesEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateEncounterActivitiesServiceDeliveryLocation() { + OperationsTestCase validateEncounterActivitiesServiceDeliveryLocationTestCase = new OperationsTestCase( + "validateEncounterActivitiesServiceDeliveryLocation", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTER_ACTIVITIES_SERVICE_DELIVERY_LOCATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncounterActivities target) { + + } + + @Override + protected void updateToPass(EncounterActivities target) { + target.init(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setTypeCode(ParticipationType.LOC); + par.setParticipantRole(ConsolFactory.eINSTANCE.createServiceDeliveryLocation()); + target.getParticipants().add(par); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncounterActivitiesOperations.validateEncounterActivitiesServiceDeliveryLocation( + (EncounterActivities) objectToTest, diagnostician, map); + } + + }; + + validateEncounterActivitiesServiceDeliveryLocationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateEncounterActivitiesIndication() { + OperationsTestCase validateEncounterActivitiesIndicationTestCase = new OperationsTestCase( + "validateEncounterActivitiesIndication", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTER_ACTIVITIES_INDICATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncounterActivities target) { + target.init(); + } + + @Override + protected void updateToPass(EncounterActivities target) { + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setObservation(ConsolFactory.eINSTANCE.createIndication().init()); + er.setTypeCode(x_ActRelationshipEntryRelationship.RSON); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncounterActivitiesOperations.validateEncounterActivitiesIndication( + (EncounterActivities) objectToTest, diagnostician, map); + } + + }; + + validateEncounterActivitiesIndicationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateEncounterActivitiesEncounterPerformer() { + OperationsTestCase validateEncounterActivitiesEncounterPerformerTestCase = new OperationsTestCase( + "validateEncounterActivitiesEncounterPerformer", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTER_ACTIVITIES_ENCOUNTER_PERFORMER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncounterActivities target) { + target.init(); + } + + @Override + protected void updateToPass(EncounterActivities target) { + target.getPerformers().add(CDAFactory.eINSTANCE.createPerformer2()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncounterActivitiesOperations.validateEncounterActivitiesEncounterPerformer( + (EncounterActivities) objectToTest, diagnostician, map); + } + + }; + + validateEncounterActivitiesEncounterPerformerTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateEncounterActivitiesEncounterDiagnosis() { + OperationsTestCase validateEncounterActivitiesEncounterDiagnosisTestCase = new OperationsTestCase( + "validateEncounterActivitiesEncounterDiagnosis", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTER_ACTIVITIES_ENCOUNTER_DIAGNOSIS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncounterActivities target) { + + } + + @Override + protected void updateToPass(EncounterActivities target) { + target.init(); + target.addAct(ConsolFactory.eINSTANCE.createEncounterDiagnosis()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncounterActivitiesOperations.validateEncounterActivitiesEncounterDiagnosis( + (EncounterActivities) objectToTest, diagnostician, map); + } + + }; + + validateEncounterActivitiesEncounterDiagnosisTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateEncounterActivitiesEncounterPerformerEncounterPerformerAssignedEntityCode() { + OperationsTestCase validateEncounterActivitiesEncounterPerformerEncounterPerformerAssignedEntityCodeTestCase = new OperationsTestCase( + "validateEncounterActivitiesEncounterPerformerEncounterPerformerAssignedEntityCode", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTER_ACTIVITIES_ENCOUNTER_PERFORMER_ENCOUNTER_PERFORMER_ASSIGNED_ENTITY_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncounterActivities target) { + target.init(); + Performer2 perf = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + perf.setAssignedEntity(ae); + + target.getPerformers().add(perf); + + } + + @Override + protected void updateToPass(EncounterActivities target) { + target.getPerformers().clear(); + Performer2 perf = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.setCode(DatatypesFactory.eINSTANCE.createCE()); + perf.setAssignedEntity(ae); + target.getPerformers().add(perf); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncounterActivitiesOperations.validateEncounterActivitiesEncounterPerformerEncounterPerformerAssignedEntityCode( + (EncounterActivities) objectToTest, diagnostician, map); + } + + }; + + validateEncounterActivitiesEncounterPerformerEncounterPerformerAssignedEntityCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateEncounterActivitiesEncounterPerformerEncounterPerformerAssignedEntity() { + OperationsTestCase validateEncounterActivitiesEncounterPerformerEncounterPerformerAssignedEntityTestCase = new OperationsTestCase( + "validateEncounterActivitiesEncounterPerformerEncounterPerformerAssignedEntity", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTER_ACTIVITIES_ENCOUNTER_PERFORMER_ENCOUNTER_PERFORMER_ASSIGNED_ENTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncounterActivities target) { + target.init(); + Performer2 perf = CDAFactory.eINSTANCE.createPerformer2(); + target.getPerformers().add(perf); + + } + + @Override + protected void updateToPass(EncounterActivities target) { + target.getPerformers().clear(); + Performer2 perf = CDAFactory.eINSTANCE.createPerformer2(); + perf.setAssignedEntity(CDAFactory.eINSTANCE.createAssignedEntity()); + target.getPerformers().add(perf); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncounterActivitiesOperations.validateEncounterActivitiesEncounterPerformerEncounterPerformerAssignedEntity( + (EncounterActivities) objectToTest, diagnostician, map); + } + + }; + + validateEncounterActivitiesEncounterPerformerEncounterPerformerAssignedEntityTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetServiceDeliveryLocations() { + + EncounterActivities target = objectFactory.create(); + target.getServiceDeliveryLocations(); + + } + + /** + * + * @generated + */ + @Test + public void testGetIndications() { + + EncounterActivities target = objectFactory.create(); + target.getIndications(); + + } + + /** + * + * @generated + */ + @Test + public void testGetEncounterDiagnosiss() { + + EncounterActivities target = objectFactory.create(); + target.getEncounterDiagnosiss(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends EncounterActivitiesOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public EncounterActivities create() { + return ConsolFactory.eINSTANCE.createEncounterActivities(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends EncounterActivitiesOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // EncounterActivitiesOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/EncounterDiagnosisTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/EncounterDiagnosisTest.java new file mode 100644 index 000000000..2b38ec743 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/EncounterDiagnosisTest.java @@ -0,0 +1,331 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.EncounterDiagnosis; +import org.openhealthtools.mdht.uml.cda.consol.operations.EncounterDiagnosisOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * + * A static utility class that provides operations related to 'Encounter Diagnosis' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.EncounterDiagnosis#validateEncounterDiagnosisTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounter Diagnosis Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.EncounterDiagnosis#validateEncounterDiagnosisClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounter Diagnosis Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.EncounterDiagnosis#validateEncounterDiagnosisMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounter Diagnosis Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.EncounterDiagnosis#validateEncounterDiagnosisCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounter Diagnosis Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.EncounterDiagnosis#validateEncounterDiagnosisCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounter Diagnosis Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.EncounterDiagnosis#validateEncounterDiagnosisProblemObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounter Diagnosis Problem Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.EncounterDiagnosis#getProblemObservations() Get Problem Observations}
  • + *
+ *

+ * + * @generated + */ + +public class EncounterDiagnosisTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateEncounterDiagnosisTemplateId() { + OperationsTestCase validateEncounterDiagnosisTemplateIdTestCase = new OperationsTestCase( + "validateEncounterDiagnosisTemplateId", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTER_DIAGNOSIS_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncounterDiagnosis target) { + + } + + @Override + protected void updateToPass(EncounterDiagnosis target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncounterDiagnosisOperations.validateEncounterDiagnosisTemplateId( + (EncounterDiagnosis) objectToTest, diagnostician, map); + } + + }; + + validateEncounterDiagnosisTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateEncounterDiagnosisClassCode() { + OperationsTestCase validateEncounterDiagnosisClassCodeTestCase = new OperationsTestCase( + "validateEncounterDiagnosisClassCode", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTER_DIAGNOSIS_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncounterDiagnosis target) { + + } + + @Override + protected void updateToPass(EncounterDiagnosis target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncounterDiagnosisOperations.validateEncounterDiagnosisClassCode( + (EncounterDiagnosis) objectToTest, diagnostician, map); + } + + }; + + validateEncounterDiagnosisClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateEncounterDiagnosisMoodCode() { + OperationsTestCase validateEncounterDiagnosisMoodCodeTestCase = new OperationsTestCase( + "validateEncounterDiagnosisMoodCode", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTER_DIAGNOSIS_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncounterDiagnosis target) { + + } + + @Override + protected void updateToPass(EncounterDiagnosis target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncounterDiagnosisOperations.validateEncounterDiagnosisMoodCode( + (EncounterDiagnosis) objectToTest, diagnostician, map); + } + + }; + + validateEncounterDiagnosisMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateEncounterDiagnosisCode() { + OperationsTestCase validateEncounterDiagnosisCodeTestCase = new OperationsTestCase( + "validateEncounterDiagnosisCode", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTER_DIAGNOSIS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncounterDiagnosis target) { + + } + + @Override + protected void updateToPass(EncounterDiagnosis target) { + target.init(); + target.setCode(DatatypesFactory.eINSTANCE.createCE("29308-4", "2.16.840.1.113883.6.1")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncounterDiagnosisOperations.validateEncounterDiagnosisCode( + (EncounterDiagnosis) objectToTest, diagnostician, map); + } + + }; + + validateEncounterDiagnosisCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateEncounterDiagnosisCodeP() { + OperationsTestCase validateEncounterDiagnosisCodePTestCase = new OperationsTestCase( + "validateEncounterDiagnosisCodeP", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTER_DIAGNOSIS_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncounterDiagnosis target) { + + } + + @Override + protected void updateToPass(EncounterDiagnosis target) { + target.init(); + target.setCode(DatatypesFactory.eINSTANCE.createCE("29308-4", "2.16.840.1.113883.6.1")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncounterDiagnosisOperations.validateEncounterDiagnosisCodeP( + (EncounterDiagnosis) objectToTest, diagnostician, map); + } + + }; + + validateEncounterDiagnosisCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateEncounterDiagnosisProblemObservation() { + OperationsTestCase validateEncounterDiagnosisProblemObservationTestCase = new OperationsTestCase( + "validateEncounterDiagnosisProblemObservation", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTER_DIAGNOSIS_PROBLEM_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncounterDiagnosis target) { + + } + + @Override + protected void updateToPass(EncounterDiagnosis target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + er.setObservation(ConsolFactory.eINSTANCE.createProblemObservation()); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncounterDiagnosisOperations.validateEncounterDiagnosisProblemObservation( + (EncounterDiagnosis) objectToTest, diagnostician, map); + } + + }; + + validateEncounterDiagnosisProblemObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemObservations() { + + EncounterDiagnosis target = objectFactory.create(); + target.getProblemObservations(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends EncounterDiagnosisOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public EncounterDiagnosis create() { + return ConsolFactory.eINSTANCE.createEncounterDiagnosis(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends EncounterDiagnosisOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // EncounterDiagnosisOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/EncountersSectionEntriesOptionalTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/EncountersSectionEntriesOptionalTest.java new file mode 100644 index 000000000..4c1e6be86 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/EncountersSectionEntriesOptionalTest.java @@ -0,0 +1,339 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.EncountersSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.operations.EncountersSectionEntriesOptionalOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Encounters Section Entries Optional' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.EncountersSectionEntriesOptional#validateEncountersSectionEntriesOptionalTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounters Section Entries Optional Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.EncountersSectionEntriesOptional#validateEncountersSectionEntriesOptionalCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounters Section Entries Optional Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.EncountersSectionEntriesOptional#validateEncountersSectionEntriesOptionalCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounters Section Entries Optional Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.EncountersSectionEntriesOptional#validateEncountersSectionEntriesOptionalTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounters Section Entries Optional Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.EncountersSectionEntriesOptional#validateEncountersSectionEntriesOptionalText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounters Section Entries Optional Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.EncountersSectionEntriesOptional#validateEncountersSectionEntriesOptionalEncounterActivities(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounters Section Entries Optional Encounter Activities}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.EncountersSectionEntriesOptional#getEncounterActivitiess() Get Encounter Activitiess}
  • + *
+ *

+ * + * @generated + */ + +public class EncountersSectionEntriesOptionalTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateEncountersSectionEntriesOptionalTemplateId() { + OperationsTestCase validateEncountersSectionEntriesOptionalTemplateIdTestCase = new OperationsTestCase( + "validateEncountersSectionEntriesOptionalTemplateId", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTERS_SECTION_ENTRIES_OPTIONAL_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncountersSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(EncountersSectionEntriesOptional target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncountersSectionEntriesOptionalOperations.validateEncountersSectionEntriesOptionalTemplateId( + (EncountersSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateEncountersSectionEntriesOptionalTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateEncountersSectionEntriesOptionalCode() { + OperationsTestCase validateEncountersSectionEntriesOptionalCodeTestCase = new OperationsTestCase( + "validateEncountersSectionEntriesOptionalCode", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTERS_SECTION_ENTRIES_OPTIONAL_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncountersSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(EncountersSectionEntriesOptional target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncountersSectionEntriesOptionalOperations.validateEncountersSectionEntriesOptionalCode( + (EncountersSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateEncountersSectionEntriesOptionalCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateEncountersSectionEntriesOptionalCodeP() { + OperationsTestCase validateEncountersSectionEntriesOptionalCodePTestCase = new OperationsTestCase( + "validateEncountersSectionEntriesOptionalCodeP", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTERS_SECTION_ENTRIES_OPTIONAL_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncountersSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(EncountersSectionEntriesOptional target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncountersSectionEntriesOptionalOperations.validateEncountersSectionEntriesOptionalCodeP( + (EncountersSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateEncountersSectionEntriesOptionalCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateEncountersSectionEntriesOptionalTitle() { + OperationsTestCase validateEncountersSectionEntriesOptionalTitleTestCase = new OperationsTestCase( + "validateEncountersSectionEntriesOptionalTitle", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTERS_SECTION_ENTRIES_OPTIONAL_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncountersSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(EncountersSectionEntriesOptional target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncountersSectionEntriesOptionalOperations.validateEncountersSectionEntriesOptionalTitle( + (EncountersSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateEncountersSectionEntriesOptionalTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateEncountersSectionEntriesOptionalText() { + OperationsTestCase validateEncountersSectionEntriesOptionalTextTestCase = new OperationsTestCase( + "validateEncountersSectionEntriesOptionalText", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTERS_SECTION_ENTRIES_OPTIONAL_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncountersSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(EncountersSectionEntriesOptional target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncountersSectionEntriesOptionalOperations.validateEncountersSectionEntriesOptionalText( + (EncountersSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateEncountersSectionEntriesOptionalTextTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateEncountersSectionEntriesOptionalEncounterActivities() { + OperationsTestCase validateEncountersSectionEntriesOptionalEncounterActivitiesTestCase = new OperationsTestCase( + "validateEncountersSectionEntriesOptionalEncounterActivities", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTERS_SECTION_ENTRIES_OPTIONAL_ENCOUNTER_ACTIVITIES__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncountersSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(EncountersSectionEntriesOptional target) { + target.init(); + target.addEncounter(ConsolFactory.eINSTANCE.createEncounterActivities().init()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncountersSectionEntriesOptionalOperations.validateEncountersSectionEntriesOptionalEncounterActivities( + (EncountersSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateEncountersSectionEntriesOptionalEncounterActivitiesTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetEncounterActivitiess() { + + EncountersSectionEntriesOptional target = objectFactory.create(); + target.getEncounterActivitiess(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends EncountersSectionEntriesOptionalOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public EncountersSectionEntriesOptional create() { + return ConsolFactory.eINSTANCE.createEncountersSectionEntriesOptional(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends EncountersSectionEntriesOptionalOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // EncountersSectionEntriesOptionalOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/EncountersSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/EncountersSectionTest.java new file mode 100644 index 000000000..65afc7993 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/EncountersSectionTest.java @@ -0,0 +1,339 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.EncountersSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.EncountersSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Encounters Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.EncountersSection#validateEncountersSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounters Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.EncountersSection#validateEncountersSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounters Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.EncountersSection#validateEncountersSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounters Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.EncountersSection#validateEncountersSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounters Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.EncountersSection#validateEncountersSectionEncounterActivities(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounters Section Encounter Activities}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.EncountersSection#getConsolEncounterActivitiess() Get Consol Encounter Activitiess}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.EncountersSection#validateEncountersSectionEntriesOptionalTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounters Section Entries Optional Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class EncountersSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateEncountersSectionCodeP() { + OperationsTestCase validateEncountersSectionCodePTestCase = new OperationsTestCase( + "validateEncountersSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTERS_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncountersSection target) { + + } + + @Override + protected void updateToPass(EncountersSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncountersSectionOperations.validateEncountersSectionCodeP( + (EncountersSection) objectToTest, diagnostician, map); + } + + }; + + validateEncountersSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateEncountersSectionCode() { + OperationsTestCase validateEncountersSectionCodeTestCase = new OperationsTestCase( + "validateEncountersSectionCode", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTERS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncountersSection target) { + + } + + @Override + protected void updateToPass(EncountersSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncountersSectionOperations.validateEncountersSectionCode( + (EncountersSection) objectToTest, diagnostician, map); + } + + }; + + validateEncountersSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateEncountersSectionText() { + OperationsTestCase validateEncountersSectionTextTestCase = new OperationsTestCase( + "validateEncountersSectionText", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTERS_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncountersSection target) { + + } + + @Override + protected void updateToPass(EncountersSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncountersSectionOperations.validateEncountersSectionText( + (EncountersSection) objectToTest, diagnostician, map); + } + + }; + + validateEncountersSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateEncountersSectionTitle() { + OperationsTestCase validateEncountersSectionTitleTestCase = new OperationsTestCase( + "validateEncountersSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTERS_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncountersSection target) { + + } + + @Override + protected void updateToPass(EncountersSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncountersSectionOperations.validateEncountersSectionTitle( + (EncountersSection) objectToTest, diagnostician, map); + } + + }; + + validateEncountersSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateEncountersSectionEncounterActivities() { + OperationsTestCase validateEncountersSectionEncounterActivitiesTestCase = new OperationsTestCase( + "validateEncountersSectionEncounterActivities", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTERS_SECTION_ENCOUNTER_ACTIVITIES__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncountersSection target) { + + } + + @Override + protected void updateToPass(EncountersSection target) { + target.init(); + target.addEncounter(ConsolFactory.eINSTANCE.createEncounterActivities().init()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncountersSectionOperations.validateEncountersSectionEncounterActivities( + (EncountersSection) objectToTest, diagnostician, map); + } + + }; + + validateEncountersSectionEncounterActivitiesTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetConsolEncounterActivitiess() { + + EncountersSection target = objectFactory.create(); + target.getConsolEncounterActivitiess(); + + } + + /** + * + * @generated + */ + @Test + public void testValidateEncountersSectionEntriesOptionalTemplateId() { + OperationsTestCase validateEncountersSectionEntriesOptionalTemplateIdTestCase = new OperationsTestCase( + "validateEncountersSectionEntriesOptionalTemplateId", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTERS_SECTION_ENTRIES_OPTIONAL_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncountersSection target) { + + } + + @Override + protected void updateToPass(EncountersSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncountersSectionOperations.validateEncountersSectionEntriesOptionalTemplateId( + (EncountersSection) objectToTest, diagnostician, map); + } + + }; + + validateEncountersSectionEntriesOptionalTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends EncountersSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public EncountersSection create() { + return ConsolFactory.eINSTANCE.createEncountersSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends EncountersSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // EncountersSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/EstimatedDateOfDeliveryTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/EstimatedDateOfDeliveryTest.java new file mode 100644 index 000000000..c7fe33f57 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/EstimatedDateOfDeliveryTest.java @@ -0,0 +1,324 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.EstimatedDateOfDelivery; +import org.openhealthtools.mdht.uml.cda.consol.operations.EstimatedDateOfDeliveryOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.TS; + +/** + * + * A static utility class that provides operations related to 'Estimated Date Of Delivery' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.EstimatedDateOfDelivery#validateEstimatedDateOfDeliveryTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Estimated Date Of Delivery Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.EstimatedDateOfDelivery#validateEstimatedDateOfDeliveryClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Estimated Date Of Delivery Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.EstimatedDateOfDelivery#validateEstimatedDateOfDeliveryCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Estimated Date Of Delivery Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.EstimatedDateOfDelivery#validateEstimatedDateOfDeliveryMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Estimated Date Of Delivery Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.EstimatedDateOfDelivery#validateEstimatedDateOfDeliveryStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Estimated Date Of Delivery Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.EstimatedDateOfDelivery#validateEstimatedDateOfDeliveryValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Estimated Date Of Delivery Value}
  • + *
+ *

+ * + * @generated + */ + +public class EstimatedDateOfDeliveryTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateEstimatedDateOfDeliveryTemplateId() { + OperationsTestCase validateEstimatedDateOfDeliveryTemplateIdTestCase = new OperationsTestCase( + "validateEstimatedDateOfDeliveryTemplateId", + operationsForOCL.getOCLValue("VALIDATE_ESTIMATED_DATE_OF_DELIVERY_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EstimatedDateOfDelivery target) { + + } + + @Override + protected void updateToPass(EstimatedDateOfDelivery target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EstimatedDateOfDeliveryOperations.validateEstimatedDateOfDeliveryTemplateId( + (EstimatedDateOfDelivery) objectToTest, diagnostician, map); + } + + }; + + validateEstimatedDateOfDeliveryTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateEstimatedDateOfDeliveryClassCode() { + OperationsTestCase validateEstimatedDateOfDeliveryClassCodeTestCase = new OperationsTestCase( + "validateEstimatedDateOfDeliveryClassCode", + operationsForOCL.getOCLValue("VALIDATE_ESTIMATED_DATE_OF_DELIVERY_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EstimatedDateOfDelivery target) { + + } + + @Override + protected void updateToPass(EstimatedDateOfDelivery target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EstimatedDateOfDeliveryOperations.validateEstimatedDateOfDeliveryClassCode( + (EstimatedDateOfDelivery) objectToTest, diagnostician, map); + } + + }; + + validateEstimatedDateOfDeliveryClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateEstimatedDateOfDeliveryCode() { + OperationsTestCase validateEstimatedDateOfDeliveryCodeTestCase = new OperationsTestCase( + "validateEstimatedDateOfDeliveryCode", + operationsForOCL.getOCLValue("VALIDATE_ESTIMATED_DATE_OF_DELIVERY_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EstimatedDateOfDelivery target) { + + } + + @Override + protected void updateToPass(EstimatedDateOfDelivery target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EstimatedDateOfDeliveryOperations.validateEstimatedDateOfDeliveryCode( + (EstimatedDateOfDelivery) objectToTest, diagnostician, map); + } + + }; + + validateEstimatedDateOfDeliveryCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateEstimatedDateOfDeliveryMoodCode() { + OperationsTestCase validateEstimatedDateOfDeliveryMoodCodeTestCase = new OperationsTestCase( + "validateEstimatedDateOfDeliveryMoodCode", + operationsForOCL.getOCLValue("VALIDATE_ESTIMATED_DATE_OF_DELIVERY_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EstimatedDateOfDelivery target) { + + } + + @Override + protected void updateToPass(EstimatedDateOfDelivery target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EstimatedDateOfDeliveryOperations.validateEstimatedDateOfDeliveryMoodCode( + (EstimatedDateOfDelivery) objectToTest, diagnostician, map); + } + + }; + + validateEstimatedDateOfDeliveryMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateEstimatedDateOfDeliveryStatusCode() { + OperationsTestCase validateEstimatedDateOfDeliveryStatusCodeTestCase = new OperationsTestCase( + "validateEstimatedDateOfDeliveryStatusCode", + operationsForOCL.getOCLValue("VALIDATE_ESTIMATED_DATE_OF_DELIVERY_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EstimatedDateOfDelivery target) { + + } + + @Override + protected void updateToPass(EstimatedDateOfDelivery target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EstimatedDateOfDeliveryOperations.validateEstimatedDateOfDeliveryStatusCode( + (EstimatedDateOfDelivery) objectToTest, diagnostician, map); + } + + }; + + validateEstimatedDateOfDeliveryStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateEstimatedDateOfDeliveryValue() { + OperationsTestCase validateEstimatedDateOfDeliveryValueTestCase = new OperationsTestCase( + "validateEstimatedDateOfDeliveryValue", + operationsForOCL.getOCLValue("VALIDATE_ESTIMATED_DATE_OF_DELIVERY_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EstimatedDateOfDelivery target) { + + } + + @Override + protected void updateToPass(EstimatedDateOfDelivery target) { + target.init(); + + TS value = DatatypesFactory.eINSTANCE.createTS(); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EstimatedDateOfDeliveryOperations.validateEstimatedDateOfDeliveryValue( + (EstimatedDateOfDelivery) objectToTest, diagnostician, map); + } + + }; + + validateEstimatedDateOfDeliveryValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends EstimatedDateOfDeliveryOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public EstimatedDateOfDelivery create() { + return ConsolFactory.eINSTANCE.createEstimatedDateOfDelivery(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends EstimatedDateOfDeliveryOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // EstimatedDateOfDeliveryOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/FamilyHistoryDeathObservationTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/FamilyHistoryDeathObservationTest.java new file mode 100644 index 000000000..a1ef2a435 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/FamilyHistoryDeathObservationTest.java @@ -0,0 +1,331 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.FamilyHistoryDeathObservation; +import org.openhealthtools.mdht.uml.cda.consol.operations.FamilyHistoryDeathObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; + +/** + * + * A static utility class that provides operations related to 'Family History Death Observation' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FamilyHistoryDeathObservation#validateFamilyHistoryDeathObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Death Observation Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FamilyHistoryDeathObservation#validateFamilyHistoryDeathObservationClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Death Observation Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FamilyHistoryDeathObservation#validateFamilyHistoryDeathObservationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Death Observation Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FamilyHistoryDeathObservation#validateFamilyHistoryDeathObservationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Death Observation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FamilyHistoryDeathObservation#validateFamilyHistoryDeathObservationStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Death Observation Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FamilyHistoryDeathObservation#validateFamilyHistoryDeathObservationValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Death Observation Value}
  • + *
+ *

+ * + * @generated + */ + +public class FamilyHistoryDeathObservationTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateFamilyHistoryDeathObservationTemplateId() { + OperationsTestCase validateFamilyHistoryDeathObservationTemplateIdTestCase = new OperationsTestCase( + "validateFamilyHistoryDeathObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_DEATH_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryDeathObservation target) { + + } + + @Override + protected void updateToPass(FamilyHistoryDeathObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryDeathObservationOperations.validateFamilyHistoryDeathObservationTemplateId( + (FamilyHistoryDeathObservation) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryDeathObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFamilyHistoryDeathObservationClassCode() { + OperationsTestCase validateFamilyHistoryDeathObservationClassCodeTestCase = new OperationsTestCase( + "validateFamilyHistoryDeathObservationClassCode", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_DEATH_OBSERVATION_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryDeathObservation target) { + + } + + @Override + protected void updateToPass(FamilyHistoryDeathObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryDeathObservationOperations.validateFamilyHistoryDeathObservationClassCode( + (FamilyHistoryDeathObservation) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryDeathObservationClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFamilyHistoryDeathObservationMoodCode() { + OperationsTestCase validateFamilyHistoryDeathObservationMoodCodeTestCase = new OperationsTestCase( + "validateFamilyHistoryDeathObservationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_DEATH_OBSERVATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryDeathObservation target) { + + } + + @Override + protected void updateToPass(FamilyHistoryDeathObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryDeathObservationOperations.validateFamilyHistoryDeathObservationMoodCode( + (FamilyHistoryDeathObservation) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryDeathObservationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateFamilyHistoryDeathObservationCode() { + OperationsTestCase validateFamilyHistoryDeathObservationCodeTestCase = new OperationsTestCase( + "validateFamilyHistoryDeathObservationCode", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_DEATH_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryDeathObservation target) { + + } + + @Override + protected void updateToPass(FamilyHistoryDeathObservation target) { + target.init(); + + CD cd = DatatypesFactory.eINSTANCE.createCD(); + cd.setCodeSystem("2.16.840.1.113883.5.4"); + cd.setCode("ASSERTION"); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryDeathObservationOperations.validateFamilyHistoryDeathObservationCode( + (FamilyHistoryDeathObservation) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryDeathObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFamilyHistoryDeathObservationStatusCode() { + OperationsTestCase validateFamilyHistoryDeathObservationStatusCodeTestCase = new OperationsTestCase( + "validateFamilyHistoryDeathObservationStatusCode", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_DEATH_OBSERVATION_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryDeathObservation target) { + + } + + @Override + protected void updateToPass(FamilyHistoryDeathObservation target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryDeathObservationOperations.validateFamilyHistoryDeathObservationStatusCode( + (FamilyHistoryDeathObservation) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryDeathObservationStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateFamilyHistoryDeathObservationValue() { + OperationsTestCase validateFamilyHistoryDeathObservationValueTestCase = new OperationsTestCase( + "validateFamilyHistoryDeathObservationValue", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_DEATH_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryDeathObservation target) { + + } + + @Override + protected void updateToPass(FamilyHistoryDeathObservation target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD(); + value.setCodeSystem("2.16.840.1.113883.6.96"); + value.setCode("419099009"); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryDeathObservationOperations.validateFamilyHistoryDeathObservationValue( + (FamilyHistoryDeathObservation) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryDeathObservationValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends FamilyHistoryDeathObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public FamilyHistoryDeathObservation create() { + return ConsolFactory.eINSTANCE.createFamilyHistoryDeathObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends FamilyHistoryDeathObservationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // FamilyHistoryDeathObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/FamilyHistoryObservationTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/FamilyHistoryObservationTest.java new file mode 100644 index 000000000..a9efb9fb6 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/FamilyHistoryObservationTest.java @@ -0,0 +1,675 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import static org.junit.Assert.assertEquals; + +import java.util.List; +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.common.util.Diagnostic; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.util.Diagnostician; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.FamilyHistoryObservation; +import org.openhealthtools.mdht.uml.cda.consol.operations.FamilyHistoryObservationOperations; +import org.openhealthtools.mdht.uml.cda.consol.util.ConsolValidator; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * + * A static utility class that provides operations related to 'Family History Observation' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FamilyHistoryObservation#validateFamilyHistoryObservationAgeObservationInversion(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Observation Age Observation Inversion}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FamilyHistoryObservation#validateFamilyHistoryObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Observation Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FamilyHistoryObservation#validateFamilyHistoryObservationClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Observation Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FamilyHistoryObservation#validateFamilyHistoryObservationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Observation Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FamilyHistoryObservation#validateFamilyHistoryObservationId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Observation Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FamilyHistoryObservation#validateFamilyHistoryObservationCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Observation Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FamilyHistoryObservation#validateFamilyHistoryObservationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Observation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FamilyHistoryObservation#validateFamilyHistoryObservationStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Observation Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FamilyHistoryObservation#validateFamilyHistoryObservationEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Observation Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FamilyHistoryObservation#validateFamilyHistoryObservationValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Observation Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FamilyHistoryObservation#validateFamilyHistoryObservationAgeObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Observation Age Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FamilyHistoryObservation#validateFamilyHistoryObservationFamilyHistoryDeathObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Observation Family History Death Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FamilyHistoryObservation#getAgeObservation() Get Age Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FamilyHistoryObservation#getFamilyHistoryDeathObservation() Get Family History Death Observation}
  • + *
+ *

+ * + * @generated + */ + +public class FamilyHistoryObservationTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateFamilyHistoryObservationAgeObservationInversion() { + OperationsTestCase validateFamilyHistoryObservationAgeObservationInversionTestCase = new OperationsTestCase( + "validateFamilyHistoryObservationAgeObservationInversion", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_OBSERVATION_AGE_OBSERVATION_INVERSION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setObservation(ConsolFactory.eINSTANCE.createAgeObservation()); + target.getEntryRelationships().add(er); + } + + @Override + public void addPassTests() { + + addPassTest(new PassTest() { + + @Override + public void updateToPass(FamilyHistoryObservation target) { + // Test case with only entry Relationship + // Should pass + target.getEntryRelationships().clear(); + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + target.getEntryRelationships().add(er); + } + + }); + } + + @Override + protected void updateToPass(FamilyHistoryObservation target) { + target.getEntryRelationships().clear(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setObservation(ConsolFactory.eINSTANCE.createAgeObservation()); + er.setInversionInd(true); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryObservationOperations.validateFamilyHistoryObservationAgeObservationInversion( + (FamilyHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryObservationAgeObservationInversionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFamilyHistoryObservationTemplateId() { + OperationsTestCase validateFamilyHistoryObservationTemplateIdTestCase = new OperationsTestCase( + "validateFamilyHistoryObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryObservation target) { + + } + + @Override + protected void updateToPass(FamilyHistoryObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryObservationOperations.validateFamilyHistoryObservationTemplateId( + (FamilyHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFamilyHistoryObservationClassCode() { + OperationsTestCase validateFamilyHistoryObservationClassCodeTestCase = new OperationsTestCase( + "validateFamilyHistoryObservationClassCode", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_OBSERVATION_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryObservation target) { + + } + + @Override + protected void updateToPass(FamilyHistoryObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryObservationOperations.validateFamilyHistoryObservationClassCode( + (FamilyHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryObservationClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFamilyHistoryObservationMoodCode() { + OperationsTestCase validateFamilyHistoryObservationMoodCodeTestCase = new OperationsTestCase( + "validateFamilyHistoryObservationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_OBSERVATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryObservation target) { + + } + + @Override + protected void updateToPass(FamilyHistoryObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryObservationOperations.validateFamilyHistoryObservationMoodCode( + (FamilyHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryObservationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFamilyHistoryObservationId() { + OperationsTestCase validateFamilyHistoryObservationIdTestCase = new OperationsTestCase( + "validateFamilyHistoryObservationId", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_OBSERVATION_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryObservation target) { + + } + + @Override + protected void updateToPass(FamilyHistoryObservation target) { + target.init(); + + II ii = DatatypesFactory.eINSTANCE.createII(); + target.getIds().add(ii); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryObservationOperations.validateFamilyHistoryObservationId( + (FamilyHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryObservationIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateFamilyHistoryObservationCode() { + OperationsTestCase validateFamilyHistoryObservationCodeTestCase = new OperationsTestCase( + "validateFamilyHistoryObservationCode", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryObservation target) { + + } + + @Override + protected void updateToPass(FamilyHistoryObservation target) { + target.init(); + + CD cd = DatatypesFactory.eINSTANCE.createCD(); + cd.setCodeSystem("2.16.840.1.113883.6.96"); + cd.setCode("418799008"); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryObservationOperations.validateFamilyHistoryObservationCode( + (FamilyHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFamilyHistoryObservationCodeP() { + OperationsTestCase validateFamilyHistoryObservationCodePTestCase = new OperationsTestCase( + "validateFamilyHistoryObservationCodeP", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_OBSERVATION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryObservation target) { + + } + + @Override + protected void updateToPass(FamilyHistoryObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryObservationOperations.validateFamilyHistoryObservationCodeP( + (FamilyHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryObservationCodePTestCase.doValidationTest(); + } + + /** + * Test the dependency interaction of the Code and CodeP constraints. + */ + @Test + public void integrationTestValidateFamilyHistoryObservationCode() { + FamilyHistoryObservation fixture = ConsolFactory.eINSTANCE.createFamilyHistoryObservation(); + + Diagnostic problems = Diagnostician.INSTANCE.validate(fixture); + + // because the property constraint failed, the terminology constraint should short-circuit + assertEquals( + 1, + getDiagnostics(problems, ConsolValidator.FAMILY_HISTORY_OBSERVATION__FAMILY_HISTORY_OBSERVATION_CODE_P).size()); + assertEquals( + 0, + getDiagnostics(problems, ConsolValidator.FAMILY_HISTORY_OBSERVATION__FAMILY_HISTORY_OBSERVATION_CODE).size()); + + fixture.init(); + + CD cd = DatatypesFactory.eINSTANCE.createCD(); + cd.setCodeSystem("2.16.840.1.113883.6.96"); + cd.setCode("1234"); + fixture.setCode(cd); + + problems = Diagnostician.INSTANCE.validate(fixture); + + // because the property constraint passed, the terminology constraint should be evaluated + assertEquals( + 0, + getDiagnostics(problems, ConsolValidator.FAMILY_HISTORY_OBSERVATION__FAMILY_HISTORY_OBSERVATION_CODE_P).size()); + assertEquals( + 1, + getDiagnostics(problems, ConsolValidator.FAMILY_HISTORY_OBSERVATION__FAMILY_HISTORY_OBSERVATION_CODE).size()); + + cd.setCode("418799008"); + + problems = Diagnostician.INSTANCE.validate(fixture); + + // both constraints now should be satisfied + assertEquals( + 0, + getDiagnostics(problems, ConsolValidator.FAMILY_HISTORY_OBSERVATION__FAMILY_HISTORY_OBSERVATION_CODE_P).size()); + assertEquals( + 0, + getDiagnostics(problems, ConsolValidator.FAMILY_HISTORY_OBSERVATION__FAMILY_HISTORY_OBSERVATION_CODE).size()); + } + + static List getDiagnostics(Diagnostic diagnostic, int code) { + List result = new java.util.ArrayList(3); + + for (Diagnostic next : diagnostic.getChildren()) { + if (ConsolValidator.DIAGNOSTIC_SOURCE.equals(next.getSource()) && (next.getCode() == code)) { + result.add(next); + } + } + + return result; + } + + /** + * + * @generated + */ + @Test + public void testValidateFamilyHistoryObservationStatusCode() { + OperationsTestCase validateFamilyHistoryObservationStatusCodeTestCase = new OperationsTestCase( + "validateFamilyHistoryObservationStatusCode", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_OBSERVATION_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryObservation target) { + + } + + @Override + protected void updateToPass(FamilyHistoryObservation target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryObservationOperations.validateFamilyHistoryObservationStatusCode( + (FamilyHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryObservationStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFamilyHistoryObservationEffectiveTime() { + OperationsTestCase validateFamilyHistoryObservationEffectiveTimeTestCase = new OperationsTestCase( + "validateFamilyHistoryObservationEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_OBSERVATION_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryObservation target) { + + } + + @Override + protected void updateToPass(FamilyHistoryObservation target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryObservationOperations.validateFamilyHistoryObservationEffectiveTime( + (FamilyHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryObservationEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateFamilyHistoryObservationValue() { + OperationsTestCase validateFamilyHistoryObservationValueTestCase = new OperationsTestCase( + "validateFamilyHistoryObservationValue", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryObservation target) { + + } + + @Override + protected void updateToPass(FamilyHistoryObservation target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD(); + value.setCodeSystem("2.16.840.1.113883.6.96"); + value.setCode("234422006"); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryObservationOperations.validateFamilyHistoryObservationValue( + (FamilyHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryObservationValueTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateFamilyHistoryObservationAgeObservation() { + OperationsTestCase validateFamilyHistoryObservationAgeObservationTestCase = new OperationsTestCase( + "validateFamilyHistoryObservationAgeObservation", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_OBSERVATION_AGE_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryObservation target) { + + } + + @Override + protected void updateToPass(FamilyHistoryObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setObservation(ConsolFactory.eINSTANCE.createAgeObservation()); + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryObservationOperations.validateFamilyHistoryObservationAgeObservation( + (FamilyHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryObservationAgeObservationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateFamilyHistoryObservationFamilyHistoryDeathObservation() { + OperationsTestCase validateFamilyHistoryObservationFamilyHistoryDeathObservationTestCase = new OperationsTestCase( + "validateFamilyHistoryObservationFamilyHistoryDeathObservation", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_OBSERVATION_FAMILY_HISTORY_DEATH_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryObservation target) { + + } + + @Override + protected void updateToPass(FamilyHistoryObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setObservation(ConsolFactory.eINSTANCE.createFamilyHistoryDeathObservation()); + er.setTypeCode(x_ActRelationshipEntryRelationship.CAUS); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryObservationOperations.validateFamilyHistoryObservationFamilyHistoryDeathObservation( + (FamilyHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryObservationFamilyHistoryDeathObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetAgeObservation() { + + FamilyHistoryObservation target = objectFactory.create(); + target.getAgeObservation(); + + } + + /** + * + * @generated + */ + @Test + public void testGetFamilyHistoryDeathObservation() { + + FamilyHistoryObservation target = objectFactory.create(); + target.getFamilyHistoryDeathObservation(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends FamilyHistoryObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public FamilyHistoryObservation create() { + return ConsolFactory.eINSTANCE.createFamilyHistoryObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends FamilyHistoryObservationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // FamilyHistoryObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/FamilyHistoryOrganizerTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/FamilyHistoryOrganizerTest.java new file mode 100644 index 000000000..e5a10405e --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/FamilyHistoryOrganizerTest.java @@ -0,0 +1,758 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.RelatedSubject; +import org.openhealthtools.mdht.uml.cda.Subject; +import org.openhealthtools.mdht.uml.cda.SubjectPerson; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.FamilyHistoryOrganizer; +import org.openhealthtools.mdht.uml.cda.consol.operations.FamilyHistoryOrganizerOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.vocab.x_DocumentSubject; + +/** + * + * A static utility class that provides operations related to 'Family History Organizer' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FamilyHistoryOrganizer#validateFamilyHistoryOrganizerTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Organizer Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FamilyHistoryOrganizer#validateFamilyHistoryOrganizerClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Organizer Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FamilyHistoryOrganizer#validateFamilyHistoryOrganizerMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Organizer Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FamilyHistoryOrganizer#validateFamilyHistoryOrganizerFamilyHistoryObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Organizer Family History Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FamilyHistoryOrganizer#validateFamilyHistoryOrganizerSubject(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Organizer Subject}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FamilyHistoryOrganizer#validateFamilyHistoryOrganizerSubjectRelatedSubjectSubjectPersonAdministrativeGenderCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Organizer Subject Related Subject Subject Person Administrative Gender Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FamilyHistoryOrganizer#validateFamilyHistoryOrganizerSubjectRelatedSubjectSubjectPersonAdministrativeGenderCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Organizer Subject Related Subject Subject Person Administrative Gender Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FamilyHistoryOrganizer#validateFamilyHistoryOrganizerSubjectRelatedSubjectSubjectPersonBirthTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Organizer Subject Related Subject Subject Person Birth Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FamilyHistoryOrganizer#validateFamilyHistoryOrganizerSubjectRelatedSubjectSubjectPersonSDTCDeceasedInd(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Organizer Subject Related Subject Subject Person SDTC Deceased Ind}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FamilyHistoryOrganizer#validateFamilyHistoryOrganizerSubjectRelatedSubjectSubjectPersonSDTCDeceasedTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Organizer Subject Related Subject Subject Person SDTC Deceased Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FamilyHistoryOrganizer#validateFamilyHistoryOrganizerSubjectRelatedSubjectSubjectPersonSDTCId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Organizer Subject Related Subject Subject Person SDTC Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FamilyHistoryOrganizer#validateFamilyHistoryOrganizerSubjectRelatedSubjectClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Organizer Subject Related Subject Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FamilyHistoryOrganizer#validateFamilyHistoryOrganizerSubjectRelatedSubjectCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Organizer Subject Related Subject Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FamilyHistoryOrganizer#validateFamilyHistoryOrganizerSubjectRelatedSubjectCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Organizer Subject Related Subject Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FamilyHistoryOrganizer#validateFamilyHistoryOrganizerSubjectRelatedSubjectSubject(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Organizer Subject Related Subject Subject}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FamilyHistoryOrganizer#validateFamilyHistoryOrganizerSubjectRelatedSubject(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Organizer Subject Related Subject}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FamilyHistoryOrganizer#getFamilyHistoryObservations() Get Family History Observations}
  • + *
+ *

+ * + * @generated + */ + +public class FamilyHistoryOrganizerTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateFamilyHistoryOrganizerTemplateId() { + OperationsTestCase validateFamilyHistoryOrganizerTemplateIdTestCase = new OperationsTestCase( + "validateFamilyHistoryOrganizerTemplateId", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_ORGANIZER_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryOrganizer target) { + + } + + @Override + protected void updateToPass(FamilyHistoryOrganizer target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryOrganizerOperations.validateFamilyHistoryOrganizerTemplateId( + (FamilyHistoryOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryOrganizerTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFamilyHistoryOrganizerClassCode() { + OperationsTestCase validateFamilyHistoryOrganizerClassCodeTestCase = new OperationsTestCase( + "validateFamilyHistoryOrganizerClassCode", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_ORGANIZER_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryOrganizer target) { + + } + + @Override + protected void updateToPass(FamilyHistoryOrganizer target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryOrganizerOperations.validateFamilyHistoryOrganizerClassCode( + (FamilyHistoryOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryOrganizerClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFamilyHistoryOrganizerMoodCode() { + OperationsTestCase validateFamilyHistoryOrganizerMoodCodeTestCase = new OperationsTestCase( + "validateFamilyHistoryOrganizerMoodCode", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_ORGANIZER_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryOrganizer target) { + + } + + @Override + protected void updateToPass(FamilyHistoryOrganizer target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryOrganizerOperations.validateFamilyHistoryOrganizerMoodCode( + (FamilyHistoryOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryOrganizerMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateFamilyHistoryOrganizerFamilyHistoryObservation() { + OperationsTestCase validateFamilyHistoryOrganizerFamilyHistoryObservationTestCase = new OperationsTestCase( + "validateFamilyHistoryOrganizerFamilyHistoryObservation", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_ORGANIZER_FAMILY_HISTORY_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryOrganizer target) { + + } + + @Override + protected void updateToPass(FamilyHistoryOrganizer target) { + target.init(); + target.addObservation(ConsolFactory.eINSTANCE.createFamilyHistoryObservation()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryOrganizerOperations.validateFamilyHistoryOrganizerFamilyHistoryObservation( + (FamilyHistoryOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryOrganizerFamilyHistoryObservationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFamilyHistoryOrganizerSubject() { + OperationsTestCase validateFamilyHistoryOrganizerSubjectTestCase = new OperationsTestCase( + "validateFamilyHistoryOrganizerSubject", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_ORGANIZER_SUBJECT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryOrganizer target) { + target.init(); + } + + @Override + protected void updateToPass(FamilyHistoryOrganizer target) { + + target.setSubject(CDAFactory.eINSTANCE.createSubject()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryOrganizerOperations.validateFamilyHistoryOrganizerSubject( + (FamilyHistoryOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryOrganizerSubjectTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFamilyHistoryOrganizerSubjectRelatedSubjectSubjectPersonAdministrativeGenderCode() { + OperationsTestCase validateFamilyHistoryOrganizerSubjectRelatedSubjectSubjectPersonAdministrativeGenderCodeTestCase = new OperationsTestCase( + "validateFamilyHistoryOrganizerSubjectRelatedSubjectSubjectPersonAdministrativeGenderCode", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_ORGANIZER_SUBJECT_RELATED_SUBJECT_SUBJECT_PERSON_ADMINISTRATIVE_GENDER_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryOrganizer target) { + target.init(); + Subject subject = CDAFactory.eINSTANCE.createSubject(); + target.setSubject(subject); + RelatedSubject relatedSubject = CDAFactory.eINSTANCE.createRelatedSubject(); + SubjectPerson subjectPerson = CDAFactory.eINSTANCE.createSubjectPerson(); + relatedSubject.setSubject(subjectPerson); + target.getSubject().setRelatedSubject(relatedSubject); + } + + @Override + protected void updateToPass(FamilyHistoryOrganizer target) { + target.getSubject().getRelatedSubject().getSubject().setAdministrativeGenderCode( + DatatypesFactory.eINSTANCE.createCE("F", "2.16.840.1.113883.5.1")); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryOrganizerOperations.validateFamilyHistoryOrganizerSubjectRelatedSubjectSubjectPersonAdministrativeGenderCode( + (FamilyHistoryOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryOrganizerSubjectRelatedSubjectSubjectPersonAdministrativeGenderCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFamilyHistoryOrganizerSubjectRelatedSubjectSubjectPersonAdministrativeGenderCodeP() { + OperationsTestCase validateFamilyHistoryOrganizerSubjectRelatedSubjectSubjectPersonAdministrativeGenderCodePTestCase = new OperationsTestCase( + "validateFamilyHistoryOrganizerSubjectRelatedSubjectSubjectPersonAdministrativeGenderCodeP", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_ORGANIZER_SUBJECT_RELATED_SUBJECT_SUBJECT_PERSON_ADMINISTRATIVE_GENDER_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryOrganizer target) { + target.init(); + Subject subject = CDAFactory.eINSTANCE.createSubject(); + target.setSubject(subject); + RelatedSubject relatedSubject = CDAFactory.eINSTANCE.createRelatedSubject(); + SubjectPerson subjectPerson = CDAFactory.eINSTANCE.createSubjectPerson(); + relatedSubject.setSubject(subjectPerson); + target.getSubject().setRelatedSubject(relatedSubject); + } + + @Override + protected void updateToPass(FamilyHistoryOrganizer target) { + Subject subject = CDAFactory.eINSTANCE.createSubject(); + target.setSubject(subject); + RelatedSubject relatedSubject = CDAFactory.eINSTANCE.createRelatedSubject(); + target.getSubject().setRelatedSubject(relatedSubject); + SubjectPerson subjectPerson = CDAFactory.eINSTANCE.createSubjectPerson(); + relatedSubject.setSubject(subjectPerson); + relatedSubject.getSubject().setAdministrativeGenderCode(DatatypesFactory.eINSTANCE.createCE()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryOrganizerOperations.validateFamilyHistoryOrganizerSubjectRelatedSubjectSubjectPersonAdministrativeGenderCodeP( + (FamilyHistoryOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryOrganizerSubjectRelatedSubjectSubjectPersonAdministrativeGenderCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFamilyHistoryOrganizerSubjectRelatedSubjectSubjectPersonBirthTime() { + OperationsTestCase validateFamilyHistoryOrganizerSubjectRelatedSubjectSubjectPersonBirthTimeTestCase = new OperationsTestCase( + "validateFamilyHistoryOrganizerSubjectRelatedSubjectSubjectPersonBirthTime", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_ORGANIZER_SUBJECT_RELATED_SUBJECT_SUBJECT_PERSON_BIRTH_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryOrganizer target) { + target.init(); + Subject subject = CDAFactory.eINSTANCE.createSubject(); + target.setSubject(subject); + RelatedSubject relatedSubject = CDAFactory.eINSTANCE.createRelatedSubject(); + SubjectPerson subjectPerson = CDAFactory.eINSTANCE.createSubjectPerson(); + relatedSubject.setSubject(subjectPerson); + + target.getSubject().setRelatedSubject(relatedSubject); + } + + @Override + protected void updateToPass(FamilyHistoryOrganizer target) { + target.getSubject().getRelatedSubject().getSubject().setBirthTime(DatatypesFactory.eINSTANCE.createTS()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryOrganizerOperations.validateFamilyHistoryOrganizerSubjectRelatedSubjectSubjectPersonBirthTime( + (FamilyHistoryOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryOrganizerSubjectRelatedSubjectSubjectPersonBirthTimeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFamilyHistoryOrganizerSubjectRelatedSubjectSubjectPersonSDTCDeceasedInd() { + OperationsTestCase validateFamilyHistoryOrganizerSubjectRelatedSubjectSubjectPersonSDTCDeceasedIndTestCase = new OperationsTestCase( + "validateFamilyHistoryOrganizerSubjectRelatedSubjectSubjectPersonSDTCDeceasedInd", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_ORGANIZER_SUBJECT_RELATED_SUBJECT_SUBJECT_PERSON_SDTC_DECEASED_IND__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryOrganizer target) { + target.init(); + Subject subject = CDAFactory.eINSTANCE.createSubject(); + target.setSubject(subject); + RelatedSubject relatedSubject = CDAFactory.eINSTANCE.createRelatedSubject(); + SubjectPerson subjectPerson = CDAFactory.eINSTANCE.createSubjectPerson(); + relatedSubject.setSubject(subjectPerson); + + target.getSubject().setRelatedSubject(relatedSubject); + } + + @Override + protected void updateToPass(FamilyHistoryOrganizer target) { + target.getSubject().getRelatedSubject().getSubject().setSDTCDeceasedInd( + DatatypesFactory.eINSTANCE.createBL()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryOrganizerOperations.validateFamilyHistoryOrganizerSubjectRelatedSubjectSubjectPersonSDTCDeceasedInd( + (FamilyHistoryOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryOrganizerSubjectRelatedSubjectSubjectPersonSDTCDeceasedIndTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFamilyHistoryOrganizerSubjectRelatedSubjectSubjectPersonSDTCDeceasedTime() { + OperationsTestCase validateFamilyHistoryOrganizerSubjectRelatedSubjectSubjectPersonSDTCDeceasedTimeTestCase = new OperationsTestCase( + "validateFamilyHistoryOrganizerSubjectRelatedSubjectSubjectPersonSDTCDeceasedTime", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_ORGANIZER_SUBJECT_RELATED_SUBJECT_SUBJECT_PERSON_SDTC_DECEASED_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryOrganizer target) { + target.init(); + Subject subject = CDAFactory.eINSTANCE.createSubject(); + target.setSubject(subject); + RelatedSubject relatedSubject = CDAFactory.eINSTANCE.createRelatedSubject(); + SubjectPerson subjectPerson = CDAFactory.eINSTANCE.createSubjectPerson(); + relatedSubject.setSubject(subjectPerson); + + target.getSubject().setRelatedSubject(relatedSubject); + } + + @Override + protected void updateToPass(FamilyHistoryOrganizer target) { + target.getSubject().getRelatedSubject().getSubject().setSDTCDeceasedTime( + DatatypesFactory.eINSTANCE.createTS()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryOrganizerOperations.validateFamilyHistoryOrganizerSubjectRelatedSubjectSubjectPersonSDTCDeceasedTime( + (FamilyHistoryOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryOrganizerSubjectRelatedSubjectSubjectPersonSDTCDeceasedTimeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFamilyHistoryOrganizerSubjectRelatedSubjectSubjectPersonSDTCId() { + OperationsTestCase validateFamilyHistoryOrganizerSubjectRelatedSubjectSubjectPersonSDTCIdTestCase = new OperationsTestCase( + "validateFamilyHistoryOrganizerSubjectRelatedSubjectSubjectPersonSDTCId", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_ORGANIZER_SUBJECT_RELATED_SUBJECT_SUBJECT_PERSON_SDTC_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryOrganizer target) { + target.init(); + Subject subject = CDAFactory.eINSTANCE.createSubject(); + target.setSubject(subject); + RelatedSubject relatedSubject = CDAFactory.eINSTANCE.createRelatedSubject(); + SubjectPerson subjectPerson = CDAFactory.eINSTANCE.createSubjectPerson(); + relatedSubject.setSubject(subjectPerson); + target.getSubject().setRelatedSubject(relatedSubject); + + } + + @Override + protected void updateToPass(FamilyHistoryOrganizer target) { + target.getSubject().getRelatedSubject().getSubject().getSDTCIds().add( + DatatypesFactory.eINSTANCE.createII()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryOrganizerOperations.validateFamilyHistoryOrganizerSubjectRelatedSubjectSubjectPersonSDTCId( + (FamilyHistoryOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryOrganizerSubjectRelatedSubjectSubjectPersonSDTCIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFamilyHistoryOrganizerSubjectRelatedSubjectClassCode() { + OperationsTestCase validateFamilyHistoryOrganizerSubjectRelatedSubjectClassCodeTestCase = new OperationsTestCase( + "validateFamilyHistoryOrganizerSubjectRelatedSubjectClassCode", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_ORGANIZER_SUBJECT_RELATED_SUBJECT_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryOrganizer target) { + target.init(); + Subject subject = CDAFactory.eINSTANCE.createSubject(); + target.setSubject(subject); + RelatedSubject relatedSubject = CDAFactory.eINSTANCE.createRelatedSubject(); + relatedSubject.setClassCode(x_DocumentSubject.PAT); + target.getSubject().setRelatedSubject(relatedSubject); + + } + + @Override + protected void updateToPass(FamilyHistoryOrganizer target) { + target.getSubject().getRelatedSubject().setClassCode(x_DocumentSubject.PRS); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryOrganizerOperations.validateFamilyHistoryOrganizerSubjectRelatedSubjectClassCode( + (FamilyHistoryOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryOrganizerSubjectRelatedSubjectClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFamilyHistoryOrganizerSubjectRelatedSubjectCode() { + OperationsTestCase validateFamilyHistoryOrganizerSubjectRelatedSubjectCodeTestCase = new OperationsTestCase( + "validateFamilyHistoryOrganizerSubjectRelatedSubjectCode", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_ORGANIZER_SUBJECT_RELATED_SUBJECT_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryOrganizer target) { + target.init(); + Subject subject = CDAFactory.eINSTANCE.createSubject(); + target.setSubject(subject); + RelatedSubject relatedSubject = CDAFactory.eINSTANCE.createRelatedSubject(); + target.getSubject().setRelatedSubject(relatedSubject); + + } + + @Override + protected void updateToPass(FamilyHistoryOrganizer target) { + target.getSubject().getRelatedSubject().setCode( + DatatypesFactory.eINSTANCE.createCE("CHILD", "2.16.840.1.113883.5.111")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryOrganizerOperations.validateFamilyHistoryOrganizerSubjectRelatedSubjectCode( + (FamilyHistoryOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryOrganizerSubjectRelatedSubjectCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFamilyHistoryOrganizerSubjectRelatedSubjectCodeP() { + OperationsTestCase validateFamilyHistoryOrganizerSubjectRelatedSubjectCodePTestCase = new OperationsTestCase( + "validateFamilyHistoryOrganizerSubjectRelatedSubjectCodeP", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_ORGANIZER_SUBJECT_RELATED_SUBJECT_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryOrganizer target) { + target.init(); + Subject subject = CDAFactory.eINSTANCE.createSubject(); + target.setSubject(subject); + RelatedSubject relatedSubject = CDAFactory.eINSTANCE.createRelatedSubject(); + target.getSubject().setRelatedSubject(relatedSubject); + + } + + @Override + protected void updateToPass(FamilyHistoryOrganizer target) { + target.getSubject().getRelatedSubject().setCode( + DatatypesFactory.eINSTANCE.createCE("1234", "2.16.840.1.113883.5.111")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryOrganizerOperations.validateFamilyHistoryOrganizerSubjectRelatedSubjectCodeP( + (FamilyHistoryOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryOrganizerSubjectRelatedSubjectCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFamilyHistoryOrganizerSubjectRelatedSubjectSubject() { + OperationsTestCase validateFamilyHistoryOrganizerSubjectRelatedSubjectSubjectTestCase = new OperationsTestCase( + "validateFamilyHistoryOrganizerSubjectRelatedSubjectSubject", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_ORGANIZER_SUBJECT_RELATED_SUBJECT_SUBJECT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryOrganizer target) { + target.init(); + Subject subject = CDAFactory.eINSTANCE.createSubject(); + target.setSubject(subject); + RelatedSubject relatedSubject = CDAFactory.eINSTANCE.createRelatedSubject(); + target.getSubject().setRelatedSubject(relatedSubject); + + } + + @Override + protected void updateToPass(FamilyHistoryOrganizer target) { + SubjectPerson subjectPerson = CDAFactory.eINSTANCE.createSubjectPerson(); + target.getSubject().getRelatedSubject().setSubject(subjectPerson); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryOrganizerOperations.validateFamilyHistoryOrganizerSubjectRelatedSubjectSubject( + (FamilyHistoryOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryOrganizerSubjectRelatedSubjectSubjectTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFamilyHistoryOrganizerSubjectRelatedSubject() { + OperationsTestCase validateFamilyHistoryOrganizerSubjectRelatedSubjectTestCase = new OperationsTestCase( + "validateFamilyHistoryOrganizerSubjectRelatedSubject", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_ORGANIZER_SUBJECT_RELATED_SUBJECT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryOrganizer target) { + target.init(); + Subject subject = CDAFactory.eINSTANCE.createSubject(); + + target.setSubject(subject); + } + + @Override + protected void updateToPass(FamilyHistoryOrganizer target) { + + RelatedSubject relatedSubject = CDAFactory.eINSTANCE.createRelatedSubject(); + target.getSubject().setRelatedSubject(relatedSubject); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryOrganizerOperations.validateFamilyHistoryOrganizerSubjectRelatedSubject( + (FamilyHistoryOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryOrganizerSubjectRelatedSubjectTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetFamilyHistoryObservations() { + + FamilyHistoryOrganizer target = objectFactory.create(); + target.getFamilyHistoryObservations(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends FamilyHistoryOrganizerOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public FamilyHistoryOrganizer create() { + return ConsolFactory.eINSTANCE.createFamilyHistoryOrganizer(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends FamilyHistoryOrganizerOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // FamilyHistoryOrganizerOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/FamilyHistorySectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/FamilyHistorySectionTest.java new file mode 100644 index 000000000..b25fb7f2c --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/FamilyHistorySectionTest.java @@ -0,0 +1,338 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.FamilyHistorySection; +import org.openhealthtools.mdht.uml.cda.consol.operations.FamilyHistorySectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Family History Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FamilyHistorySection#validateFamilyHistorySectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FamilyHistorySection#validateFamilyHistorySectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FamilyHistorySection#validateFamilyHistorySectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FamilyHistorySection#validateFamilyHistorySectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FamilyHistorySection#validateFamilyHistorySectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FamilyHistorySection#validateFamilyHistorySectionFamilyHistory(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Section Family History}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FamilyHistorySection#getFamilyHistories() Get Family Histories}
  • + *
+ *

+ * + * @generated + */ + +public class FamilyHistorySectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateFamilyHistorySectionTemplateId() { + OperationsTestCase validateFamilyHistorySectionTemplateIdTestCase = new OperationsTestCase( + "validateFamilyHistorySectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistorySection target) { + + } + + @Override + protected void updateToPass(FamilyHistorySection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistorySectionOperations.validateFamilyHistorySectionTemplateId( + (FamilyHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistorySectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFamilyHistorySectionCode() { + OperationsTestCase validateFamilyHistorySectionCodeTestCase = new OperationsTestCase( + "validateFamilyHistorySectionCode", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistorySection target) { + + } + + @Override + protected void updateToPass(FamilyHistorySection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistorySectionOperations.validateFamilyHistorySectionCode( + (FamilyHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistorySectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFamilyHistorySectionCodeP() { + OperationsTestCase validateFamilyHistorySectionCodePTestCase = new OperationsTestCase( + "validateFamilyHistorySectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistorySection target) { + + } + + @Override + protected void updateToPass(FamilyHistorySection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistorySectionOperations.validateFamilyHistorySectionCodeP( + (FamilyHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistorySectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFamilyHistorySectionTitle() { + OperationsTestCase validateFamilyHistorySectionTitleTestCase = new OperationsTestCase( + "validateFamilyHistorySectionTitle", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistorySection target) { + + } + + @Override + protected void updateToPass(FamilyHistorySection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistorySectionOperations.validateFamilyHistorySectionTitle( + (FamilyHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistorySectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFamilyHistorySectionText() { + OperationsTestCase validateFamilyHistorySectionTextTestCase = new OperationsTestCase( + "validateFamilyHistorySectionText", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistorySection target) { + + } + + @Override + protected void updateToPass(FamilyHistorySection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistorySectionOperations.validateFamilyHistorySectionText( + (FamilyHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistorySectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateFamilyHistorySectionFamilyHistory() { + OperationsTestCase validateFamilyHistorySectionFamilyHistoryTestCase = new OperationsTestCase( + "validateFamilyHistorySectionFamilyHistory", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_SECTION_FAMILY_HISTORY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistorySection target) { + + } + + @Override + protected void updateToPass(FamilyHistorySection target) { + target.init(); + target.addOrganizer(ConsolFactory.eINSTANCE.createFamilyHistoryOrganizer()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistorySectionOperations.validateFamilyHistorySectionFamilyHistory( + (FamilyHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistorySectionFamilyHistoryTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetFamilyHistories() { + + FamilyHistorySection target = objectFactory.create(); + target.getFamilyHistories(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends FamilyHistorySectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public FamilyHistorySection create() { + return ConsolFactory.eINSTANCE.createFamilyHistorySection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends FamilyHistorySectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // FamilyHistorySectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/FetusSubjectContextTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/FetusSubjectContextTest.java new file mode 100644 index 000000000..cecbf0a7e --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/FetusSubjectContextTest.java @@ -0,0 +1,206 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.FetusSubjectContext; +import org.openhealthtools.mdht.uml.cda.consol.operations.FetusSubjectContextOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Fetus Subject Context' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FetusSubjectContext#validateFetusSubjectContextTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Fetus Subject Context Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FetusSubjectContext#validateFetusSubjectContextCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Fetus Subject Context Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FetusSubjectContext#validateFetusSubjectContextSubject(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Fetus Subject Context Subject}
  • + *
+ *

+ * + * @generated + */ + +public class FetusSubjectContextTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateFetusSubjectContextTemplateId() { + OperationsTestCase validateFetusSubjectContextTemplateIdTestCase = new OperationsTestCase( + "validateFetusSubjectContextTemplateId", + operationsForOCL.getOCLValue("VALIDATE_FETUS_SUBJECT_CONTEXT_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FetusSubjectContext target) { + + } + + @Override + protected void updateToPass(FetusSubjectContext target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FetusSubjectContextOperations.validateFetusSubjectContextTemplateId( + (FetusSubjectContext) objectToTest, diagnostician, map); + } + + }; + + validateFetusSubjectContextTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFetusSubjectContextCode() { + OperationsTestCase validateFetusSubjectContextCodeTestCase = new OperationsTestCase( + "validateFetusSubjectContextCode", + operationsForOCL.getOCLValue("VALIDATE_FETUS_SUBJECT_CONTEXT_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FetusSubjectContext target) { + + } + + @Override + protected void updateToPass(FetusSubjectContext target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FetusSubjectContextOperations.validateFetusSubjectContextCode( + (FetusSubjectContext) objectToTest, diagnostician, map); + } + + }; + + validateFetusSubjectContextCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFetusSubjectContextSubject() { + OperationsTestCase validateFetusSubjectContextSubjectTestCase = new OperationsTestCase( + "validateFetusSubjectContextSubject", + operationsForOCL.getOCLValue("VALIDATE_FETUS_SUBJECT_CONTEXT_SUBJECT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FetusSubjectContext target) { + target.init(); + } + + @Override + protected void updateToPass(FetusSubjectContext target) { + target.setSubject(CDAFactory.eINSTANCE.createSubjectPerson()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FetusSubjectContextOperations.validateFetusSubjectContextSubject( + (FetusSubjectContext) objectToTest, diagnostician, map); + } + + }; + + validateFetusSubjectContextSubjectTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends FetusSubjectContextOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public FetusSubjectContext create() { + return ConsolFactory.eINSTANCE.createFetusSubjectContext(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends FetusSubjectContextOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // FetusSubjectContextOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/FindingsSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/FindingsSectionTest.java new file mode 100644 index 000000000..4e1f960e6 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/FindingsSectionTest.java @@ -0,0 +1,140 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.FindingsSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.FindingsSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Findings Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FindingsSection#validateFindingsSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Findings Section Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class FindingsSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateFindingsSectionTemplateId() { + OperationsTestCase validateFindingsSectionTemplateIdTestCase = new OperationsTestCase( + "validateFindingsSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_FINDINGS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FindingsSection target) { + + } + + @Override + protected void updateToPass(FindingsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FindingsSectionOperations.validateFindingsSectionTemplateId( + (FindingsSection) objectToTest, diagnostician, map); + } + + }; + + validateFindingsSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends FindingsSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public FindingsSection create() { + return ConsolFactory.eINSTANCE.createFindingsSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends FindingsSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // FindingsSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/FunctionalStatusProblemObservationTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/FunctionalStatusProblemObservationTest.java new file mode 100644 index 000000000..0bc6bf3ef --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/FunctionalStatusProblemObservationTest.java @@ -0,0 +1,979 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ConsolPackage; +import org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusProblemObservation; +import org.openhealthtools.mdht.uml.cda.consol.GeneralStatusSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.FunctionalStatusProblemObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.vocab.NullFlavor; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * + * A static utility class that provides operations related to 'Functional Status Problem Observation' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusProblemObservation#validateFunctionalStatusProblemObservationHasTextReference(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Problem Observation Has Text Reference}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusProblemObservation#validateFunctionalStatusProblemObservationTextReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Problem Observation Text Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusProblemObservation#validateFunctionalStatusProblemObservationHasTextReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Problem Observation Has Text Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusProblemObservation#validateFunctionalStatusProblemObservationHasOnsetDate(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Problem Observation Has Onset Date}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusProblemObservation#validateFunctionalStatusProblemObservationHasResolutionDate(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Problem Observation Has Resolution Date}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusProblemObservation#validateFunctionalStatusProblemObservationValueNullFlavor(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Problem Observation Value Null Flavor}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusProblemObservation#validateFunctionalStatusProblemObservationClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Problem Observation Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusProblemObservation#validateFunctionalStatusProblemObservationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Problem Observation Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusProblemObservation#validateFunctionalStatusProblemObservationNegationInd(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Problem Observation Negation Ind}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusProblemObservation#validateFunctionalStatusProblemObservationId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Problem Observation Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusProblemObservation#validateFunctionalStatusProblemObservationCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Problem Observation Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusProblemObservation#validateFunctionalStatusProblemObservationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Problem Observation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusProblemObservation#validateFunctionalStatusProblemObservationText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Problem Observation Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusProblemObservation#validateFunctionalStatusProblemObservationStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Problem Observation Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusProblemObservation#validateFunctionalStatusProblemObservationEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Problem Observation Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusProblemObservation#validateFunctionalStatusProblemObservationValueP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Problem Observation Value P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusProblemObservation#validateFunctionalStatusProblemObservationValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Problem Observation Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusProblemObservation#validateFunctionalStatusProblemObservationMethodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Problem Observation Method Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusProblemObservation#validateFunctionalStatusProblemObservationNonMedicinalSupplyActivity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Problem Observation Non Medicinal Supply Activity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusProblemObservation#validateFunctionalStatusProblemObservationCaregiverCharacteristics(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Problem Observation Caregiver Characteristics}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusProblemObservation#validateFunctionalStatusProblemObservationAssessmentScaleObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Problem Observation Assessment Scale Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusProblemObservation#getNonMedicinalSupplyActivities() Get Non Medicinal Supply Activities}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusProblemObservation#getCaregiverCharacteristicss() Get Caregiver Characteristicss}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusProblemObservation#getAssessmentScaleObservations() Get Assessment Scale Observations}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusProblemObservation#validateProblemObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Observation Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class FunctionalStatusProblemObservationTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateFunctionalStatusProblemObservationHasTextReference() { + OperationsTestCase validateFunctionalStatusProblemObservationHasTextReferenceTestCase = new OperationsTestCase( + "validateFunctionalStatusProblemObservationHasTextReference", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_PROBLEM_OBSERVATION_HAS_TEXT_REFERENCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusProblemObservation target) { + target.init(); + ED txt = DatatypesFactory.eINSTANCE.createED(); + target.setText(txt); + } + + @Override + protected void updateToPass(FunctionalStatusProblemObservation target) { + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL()); + target.setText(txt); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusProblemObservationOperations.validateFunctionalStatusProblemObservationHasTextReference( + (FunctionalStatusProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusProblemObservationHasTextReferenceTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFunctionalStatusProblemObservationTextReferenceValue() { + OperationsTestCase validateFunctionalStatusProblemObservationTextReferenceValueTestCase = new OperationsTestCase( + "validateFunctionalStatusProblemObservationTextReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_PROBLEM_OBSERVATION_TEXT_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusProblemObservation target) { + target.init(); + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL()); + target.setText(txt); + } + + @Override + protected void updateToPass(FunctionalStatusProblemObservation target) { + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL("test")); + target.setText(txt); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusProblemObservationOperations.validateFunctionalStatusProblemObservationTextReferenceValue( + (FunctionalStatusProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusProblemObservationTextReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFunctionalStatusProblemObservationHasTextReferenceValue() { + OperationsTestCase validateFunctionalStatusProblemObservationHasTextReferenceValueTestCase = new NarrativeReferenceTestCase( + "validateFunctionalStatusProblemObservationHasTextReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_PROBLEM_OBSERVATION_HAS_TEXT_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusProblemObservation target) { + target.init(); + + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), "", + "No particular health status observed."); + + // add a reference to the section text + target.setText(createEDWithReference("Some sample text", "#1.2.3.4")); + } + + @Override + protected void updateToPass(FunctionalStatusProblemObservation target) { + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), + "1.2.3.4", "No particular health status observed."); + + // add a reference to the section text + target.setText(createEDWithReference("Some sample text", "#1.2.3.4")); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusProblemObservationOperations.validateFunctionalStatusProblemObservationHasTextReferenceValue( + (FunctionalStatusProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusProblemObservationHasTextReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFunctionalStatusProblemObservationHasOnsetDate() { + OperationsTestCase validateFunctionalStatusProblemObservationHasOnsetDateTestCase = new OperationsTestCase( + "validateFunctionalStatusProblemObservationHasOnsetDate", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_PROBLEM_OBSERVATION_HAS_ONSET_DATE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusProblemObservation target) { + + } + + @Override + protected void updateToPass(FunctionalStatusProblemObservation target) { + target.init(); + target.setEffectiveTime(DatatypesFactory.eINSTANCE.createIVL_TS("1", "2")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusProblemObservationOperations.validateFunctionalStatusProblemObservationHasOnsetDate( + (FunctionalStatusProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusProblemObservationHasOnsetDateTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFunctionalStatusProblemObservationHasResolutionDate() { + OperationsTestCase validateFunctionalStatusProblemObservationHasResolutionDateTestCase = new OperationsTestCase( + "validateFunctionalStatusProblemObservationHasResolutionDate", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_PROBLEM_OBSERVATION_HAS_RESOLUTION_DATE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusProblemObservation target) { + + } + + @Override + protected void updateToPass(FunctionalStatusProblemObservation target) { + target.init(); + target.setEffectiveTime(DatatypesFactory.eINSTANCE.createIVL_TS("1", "2")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusProblemObservationOperations.validateFunctionalStatusProblemObservationHasResolutionDate( + (FunctionalStatusProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusProblemObservationHasResolutionDateTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFunctionalStatusProblemObservationValueNullFlavor() { + OperationsTestCase validateFunctionalStatusProblemObservationValueNullFlavorTestCase = new OperationsTestCase( + "validateFunctionalStatusProblemObservationValueNullFlavor", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_PROBLEM_OBSERVATION_VALUE_NULL_FLAVOR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusProblemObservation target) { + target.init(); + target.getValues().add(DatatypesFactory.eINSTANCE.createCD()); + } + + @Override + protected void updateToPass(FunctionalStatusProblemObservation target) { + target.getValues().get(0).setNullFlavor(NullFlavor.NA); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusProblemObservationOperations.validateFunctionalStatusProblemObservationValueNullFlavor( + (FunctionalStatusProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusProblemObservationValueNullFlavorTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFunctionalStatusProblemObservationClassCode() { + OperationsTestCase validateFunctionalStatusProblemObservationClassCodeTestCase = new OperationsTestCase( + "validateFunctionalStatusProblemObservationClassCode", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_PROBLEM_OBSERVATION_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusProblemObservation target) { + + } + + @Override + protected void updateToPass(FunctionalStatusProblemObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusProblemObservationOperations.validateFunctionalStatusProblemObservationClassCode( + (FunctionalStatusProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusProblemObservationClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFunctionalStatusProblemObservationMoodCode() { + OperationsTestCase validateFunctionalStatusProblemObservationMoodCodeTestCase = new OperationsTestCase( + "validateFunctionalStatusProblemObservationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_PROBLEM_OBSERVATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusProblemObservation target) { + + } + + @Override + protected void updateToPass(FunctionalStatusProblemObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusProblemObservationOperations.validateFunctionalStatusProblemObservationMoodCode( + (FunctionalStatusProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusProblemObservationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFunctionalStatusProblemObservationNegationInd() { + OperationsTestCase validateFunctionalStatusProblemObservationNegationIndTestCase = new OperationsTestCase( + "validateFunctionalStatusProblemObservationNegationInd", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_PROBLEM_OBSERVATION_NEGATION_IND__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusProblemObservation target) { + + } + + @Override + protected void updateToPass(FunctionalStatusProblemObservation target) { + target.init(); + target.setNegationInd(true); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusProblemObservationOperations.validateFunctionalStatusProblemObservationNegationInd( + (FunctionalStatusProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusProblemObservationNegationIndTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFunctionalStatusProblemObservationId() { + OperationsTestCase validateFunctionalStatusProblemObservationIdTestCase = new OperationsTestCase( + "validateFunctionalStatusProblemObservationId", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_PROBLEM_OBSERVATION_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusProblemObservation target) { + + } + + @Override + protected void updateToPass(FunctionalStatusProblemObservation target) { + target.init(); + + II ii = DatatypesFactory.eINSTANCE.createII(); + target.getIds().add(ii); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusProblemObservationOperations.validateFunctionalStatusProblemObservationId( + (FunctionalStatusProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusProblemObservationIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFunctionalStatusProblemObservationCodeP() { + OperationsTestCase validateFunctionalStatusProblemObservationCodePTestCase = new OperationsTestCase( + "validateFunctionalStatusProblemObservationCodeP", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_PROBLEM_OBSERVATION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusProblemObservation target) { + + } + + @Override + protected void updateToPass(FunctionalStatusProblemObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusProblemObservationOperations.validateFunctionalStatusProblemObservationCodeP( + (FunctionalStatusProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusProblemObservationCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFunctionalStatusProblemObservationCode() { + OperationsTestCase validateFunctionalStatusProblemObservationCodeTestCase = new OperationsTestCase( + "validateFunctionalStatusProblemObservationCode", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_PROBLEM_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusProblemObservation target) { + + } + + @Override + protected void updateToPass(FunctionalStatusProblemObservation target) { + target.init(); + + CD cd = DatatypesFactory.eINSTANCE.createCD("248536006", "2.16.840.1.113883.6.96", "", ""); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusProblemObservationOperations.validateFunctionalStatusProblemObservationCode( + (FunctionalStatusProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusProblemObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFunctionalStatusProblemObservationText() { + OperationsTestCase validateFunctionalStatusProblemObservationTextTestCase = new OperationsTestCase( + "validateFunctionalStatusProblemObservationText", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_PROBLEM_OBSERVATION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusProblemObservation target) { + + } + + @Override + protected void updateToPass(FunctionalStatusProblemObservation target) { + target.init(); + + ED text = DatatypesFactory.eINSTANCE.createED(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusProblemObservationOperations.validateFunctionalStatusProblemObservationText( + (FunctionalStatusProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusProblemObservationTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFunctionalStatusProblemObservationStatusCode() { + OperationsTestCase validateFunctionalStatusProblemObservationStatusCodeTestCase = new OperationsTestCase( + "validateFunctionalStatusProblemObservationStatusCode", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_PROBLEM_OBSERVATION_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusProblemObservation target) { + + } + + @Override + protected void updateToPass(FunctionalStatusProblemObservation target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusProblemObservationOperations.validateFunctionalStatusProblemObservationStatusCode( + (FunctionalStatusProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusProblemObservationStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFunctionalStatusProblemObservationEffectiveTime() { + OperationsTestCase validateFunctionalStatusProblemObservationEffectiveTimeTestCase = new OperationsTestCase( + "validateFunctionalStatusProblemObservationEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_PROBLEM_OBSERVATION_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusProblemObservation target) { + + } + + @Override + protected void updateToPass(FunctionalStatusProblemObservation target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusProblemObservationOperations.validateFunctionalStatusProblemObservationEffectiveTime( + (FunctionalStatusProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusProblemObservationEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFunctionalStatusProblemObservationValueP() { + OperationsTestCase validateFunctionalStatusProblemObservationValuePTestCase = new OperationsTestCase( + "validateFunctionalStatusProblemObservationValueP", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_PROBLEM_OBSERVATION_VALUE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusProblemObservation target) { + + } + + @Override + protected void updateToPass(FunctionalStatusProblemObservation target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD("", "2.16.840.1.113883.6.96", "", ""); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusProblemObservationOperations.validateFunctionalStatusProblemObservationValueP( + (FunctionalStatusProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusProblemObservationValuePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFunctionalStatusProblemObservationValue() { + OperationsTestCase validateFunctionalStatusProblemObservationValueTestCase = new OperationsTestCase( + "validateFunctionalStatusProblemObservationValue", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_PROBLEM_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusProblemObservation target) { + + } + + @Override + protected void updateToPass(FunctionalStatusProblemObservation target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD("", "2.16.840.1.113883.6.96", "", ""); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusProblemObservationOperations.validateFunctionalStatusProblemObservationValue( + (FunctionalStatusProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusProblemObservationValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFunctionalStatusProblemObservationMethodCode() { + OperationsTestCase validateFunctionalStatusProblemObservationMethodCodeTestCase = new OperationsTestCase( + "validateFunctionalStatusProblemObservationMethodCode", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_PROBLEM_OBSERVATION_METHOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusProblemObservation target) { + + } + + @Override + protected void updateToPass(FunctionalStatusProblemObservation target) { + target.init(); + target.getMethodCodes().add(DatatypesFactory.eINSTANCE.createCE()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusProblemObservationOperations.validateFunctionalStatusProblemObservationMethodCode( + (FunctionalStatusProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusProblemObservationMethodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFunctionalStatusProblemObservationNonMedicinalSupplyActivity() { + OperationsTestCase validateFunctionalStatusProblemObservationNonMedicinalSupplyActivityTestCase = new OperationsTestCase( + "validateFunctionalStatusProblemObservationNonMedicinalSupplyActivity", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_PROBLEM_OBSERVATION_NON_MEDICINAL_SUPPLY_ACTIVITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusProblemObservation target) { + + } + + @Override + protected void updateToPass(FunctionalStatusProblemObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.REFR); + er.setSupply(ConsolFactory.eINSTANCE.createNonMedicinalSupplyActivity()); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusProblemObservationOperations.validateFunctionalStatusProblemObservationNonMedicinalSupplyActivity( + (FunctionalStatusProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusProblemObservationNonMedicinalSupplyActivityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFunctionalStatusProblemObservationCaregiverCharacteristics() { + OperationsTestCase validateFunctionalStatusProblemObservationCaregiverCharacteristicsTestCase = new OperationsTestCase( + "validateFunctionalStatusProblemObservationCaregiverCharacteristics", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_PROBLEM_OBSERVATION_CAREGIVER_CHARACTERISTICS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusProblemObservation target) { + + } + + @Override + protected void updateToPass(FunctionalStatusProblemObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.REFR); + er.setObservation(ConsolFactory.eINSTANCE.createCaregiverCharacteristics()); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusProblemObservationOperations.validateFunctionalStatusProblemObservationCaregiverCharacteristics( + (FunctionalStatusProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusProblemObservationCaregiverCharacteristicsTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFunctionalStatusProblemObservationAssessmentScaleObservation() { + OperationsTestCase validateFunctionalStatusProblemObservationAssessmentScaleObservationTestCase = new OperationsTestCase( + "validateFunctionalStatusProblemObservationAssessmentScaleObservation", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_PROBLEM_OBSERVATION_ASSESSMENT_SCALE_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusProblemObservation target) { + + } + + @Override + protected void updateToPass(FunctionalStatusProblemObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + er.setObservation(ConsolFactory.eINSTANCE.createAssessmentScaleObservation()); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusProblemObservationOperations.validateFunctionalStatusProblemObservationAssessmentScaleObservation( + (FunctionalStatusProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusProblemObservationAssessmentScaleObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetNonMedicinalSupplyActivities() { + + FunctionalStatusProblemObservation target = objectFactory.create(); + target.getNonMedicinalSupplyActivities(); + + } + + /** + * + * @generated + */ + @Test + public void testGetCaregiverCharacteristicss() { + + FunctionalStatusProblemObservation target = objectFactory.create(); + target.getCaregiverCharacteristicss(); + + } + + /** + * + * @generated + */ + @Test + public void testGetAssessmentScaleObservations() { + + FunctionalStatusProblemObservation target = objectFactory.create(); + target.getAssessmentScaleObservations(); + + } + + /** + * + * @generated + */ + @Test + public void testValidateProblemObservationTemplateId() { + OperationsTestCase validateProblemObservationTemplateIdTestCase = new OperationsTestCase( + "validateProblemObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusProblemObservation target) { + + } + + @Override + protected void updateToPass(FunctionalStatusProblemObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusProblemObservationOperations.validateProblemObservationTemplateId( + (FunctionalStatusProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateProblemObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends FunctionalStatusProblemObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public FunctionalStatusProblemObservation create() { + return ConsolFactory.eINSTANCE.createFunctionalStatusProblemObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends FunctionalStatusProblemObservationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // FunctionalStatusProblemObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/FunctionalStatusResultObservationTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/FunctionalStatusResultObservationTest.java new file mode 100644 index 000000000..4d015bb85 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/FunctionalStatusResultObservationTest.java @@ -0,0 +1,1054 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.ObservationRange; +import org.openhealthtools.mdht.uml.cda.ReferenceRange; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ConsolPackage; +import org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusResultObservation; +import org.openhealthtools.mdht.uml.cda.consol.GeneralStatusSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.FunctionalStatusResultObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * + * A static utility class that provides operations related to 'Functional Status Result Observation' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusResultObservation#validateFunctionalStatusResultObservationTextReference(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Result Observation Text Reference}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusResultObservation#validateFunctionalStatusResultObservationTextReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Result Observation Text Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusResultObservation#validateFunctionalStatusResultObservationValueDatatype(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Result Observation Value Datatype}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusResultObservation#validateFunctionalStatusResultObservationClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Result Observation Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusResultObservation#validateFunctionalStatusResultObservationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Result Observation Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusResultObservation#validateFunctionalStatusResultObservationId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Result Observation Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusResultObservation#validateFunctionalStatusResultObservationCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Result Observation Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusResultObservation#validateFunctionalStatusResultObservationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Result Observation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusResultObservation#validateFunctionalStatusResultObservationText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Result Observation Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusResultObservation#validateFunctionalStatusResultObservationStatusCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Result Observation Status Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusResultObservation#validateFunctionalStatusResultObservationStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Result Observation Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusResultObservation#validateFunctionalStatusResultObservationEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Result Observation Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusResultObservation#validateFunctionalStatusResultObservationValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Result Observation Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusResultObservation#validateFunctionalStatusResultObservationInterpretationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Result Observation Interpretation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusResultObservation#validateFunctionalStatusResultObservationMethodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Result Observation Method Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusResultObservation#validateFunctionalStatusResultObservationTargetSiteCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Result Observation Target Site Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusResultObservation#validateFunctionalStatusResultObservationAuthor(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Result Observation Author}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusResultObservation#validateFunctionalStatusResultObservationNonMedicinalSupplyActivity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Result Observation Non Medicinal Supply Activity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusResultObservation#validateFunctionalStatusResultObservationCaregiverCharacteristics(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Result Observation Caregiver Characteristics}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusResultObservation#validateFunctionalStatusResultObservationAssessmentScaleObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Result Observation Assessment Scale Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusResultObservation#validateFunctionalStatusResultObservationReferenceRange(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Result Observation Reference Range}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusResultObservation#validateFunctionalStatusResultObservationReferenceRangeObservationRangeNoCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Result Observation Reference Range Observation Range No Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusResultObservation#validateFunctionalStatusResultObservationReferenceRangeObservationRange(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Result Observation Reference Range Observation Range}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusResultObservation#getNonMedicinalSupplyActivity() Get Non Medicinal Supply Activity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusResultObservation#getCaregiverCharacteristics() Get Caregiver Characteristics}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusResultObservation#getAssessmentScaleObservation() Get Assessment Scale Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusResultObservation#validateResultObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Observation Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class FunctionalStatusResultObservationTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateFunctionalStatusResultObservationTextReference() { + OperationsTestCase validateFunctionalStatusResultObservationTextReferenceTestCase = new OperationsTestCase( + "validateFunctionalStatusResultObservationTextReference", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_RESULT_OBSERVATION_TEXT_REFERENCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusResultObservation target) { + target.init(); + ED txt = DatatypesFactory.eINSTANCE.createED(); + target.setText(txt); + } + + @Override + protected void updateToPass(FunctionalStatusResultObservation target) { + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL("test")); + target.setText(txt); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusResultObservationOperations.validateFunctionalStatusResultObservationTextReference( + (FunctionalStatusResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusResultObservationTextReferenceTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFunctionalStatusResultObservationTextReferenceValue() { + OperationsTestCase validateFunctionalStatusResultObservationTextReferenceValueTestCase = new NarrativeReferenceTestCase( + "validateFunctionalStatusResultObservationTextReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_RESULT_OBSERVATION_TEXT_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusResultObservation target) { + target.init(); + + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), "", + "No particular health status observed."); + + // add a reference to the section text + target.setText(createEDWithReference("Some sample text", "#1.2.3.4")); + } + + @Override + protected void updateToPass(FunctionalStatusResultObservation target) { + + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), + "1.2.3.4", "No particular health status observed."); + + // add a reference to the section text + target.setText(createEDWithReference("Some sample text", "#1.2.3.4")); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusResultObservationOperations.validateFunctionalStatusResultObservationTextReferenceValue( + (FunctionalStatusResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusResultObservationTextReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFunctionalStatusResultObservationValueDatatype() { + OperationsTestCase validateFunctionalStatusResultObservationValueDatatypeTestCase = new OperationsTestCase( + "validateFunctionalStatusResultObservationValueDatatype", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_RESULT_OBSERVATION_VALUE_DATATYPE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusResultObservation target) { + target.init(); + target.getValues().add(DatatypesFactory.eINSTANCE.createCD()); + } + + @Override + protected void updateToPass(FunctionalStatusResultObservation target) { + target.getValues().clear(); + target.getValues().add(DatatypesFactory.eINSTANCE.createCD("", "2.16.840.1.113883.6.96", "", "")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusResultObservationOperations.validateFunctionalStatusResultObservationValueDatatype( + (FunctionalStatusResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusResultObservationValueDatatypeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFunctionalStatusResultObservationClassCode() { + OperationsTestCase validateFunctionalStatusResultObservationClassCodeTestCase = new OperationsTestCase( + "validateFunctionalStatusResultObservationClassCode", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_RESULT_OBSERVATION_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusResultObservation target) { + + } + + @Override + protected void updateToPass(FunctionalStatusResultObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusResultObservationOperations.validateFunctionalStatusResultObservationClassCode( + (FunctionalStatusResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusResultObservationClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFunctionalStatusResultObservationMoodCode() { + OperationsTestCase validateFunctionalStatusResultObservationMoodCodeTestCase = new OperationsTestCase( + "validateFunctionalStatusResultObservationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_RESULT_OBSERVATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusResultObservation target) { + + } + + @Override + protected void updateToPass(FunctionalStatusResultObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusResultObservationOperations.validateFunctionalStatusResultObservationMoodCode( + (FunctionalStatusResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusResultObservationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFunctionalStatusResultObservationId() { + OperationsTestCase validateFunctionalStatusResultObservationIdTestCase = new OperationsTestCase( + "validateFunctionalStatusResultObservationId", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_RESULT_OBSERVATION_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusResultObservation target) { + + } + + @Override + protected void updateToPass(FunctionalStatusResultObservation target) { + target.init(); + + II ii = DatatypesFactory.eINSTANCE.createII(); + target.getIds().add(ii); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusResultObservationOperations.validateFunctionalStatusResultObservationId( + (FunctionalStatusResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusResultObservationIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFunctionalStatusResultObservationCodeP() { + OperationsTestCase validateFunctionalStatusResultObservationCodePTestCase = new OperationsTestCase( + "validateFunctionalStatusResultObservationCodeP", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_RESULT_OBSERVATION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusResultObservation target) { + + } + + @Override + protected void updateToPass(FunctionalStatusResultObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusResultObservationOperations.validateFunctionalStatusResultObservationCodeP( + (FunctionalStatusResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusResultObservationCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFunctionalStatusResultObservationCode() { + OperationsTestCase validateFunctionalStatusResultObservationCodeTestCase = new OperationsTestCase( + "validateFunctionalStatusResultObservationCode", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_RESULT_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusResultObservation target) { + + } + + @Override + protected void updateToPass(FunctionalStatusResultObservation target) { + target.init(); + + CE cd = DatatypesFactory.eINSTANCE.createCE("", "2.16.840.1.113883.6.1", "", ""); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusResultObservationOperations.validateFunctionalStatusResultObservationCode( + (FunctionalStatusResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusResultObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFunctionalStatusResultObservationText() { + OperationsTestCase validateFunctionalStatusResultObservationTextTestCase = new OperationsTestCase( + "validateFunctionalStatusResultObservationText", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_RESULT_OBSERVATION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusResultObservation target) { + + } + + @Override + protected void updateToPass(FunctionalStatusResultObservation target) { + target.init(); + + ED text = DatatypesFactory.eINSTANCE.createED(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusResultObservationOperations.validateFunctionalStatusResultObservationText( + (FunctionalStatusResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusResultObservationTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFunctionalStatusResultObservationStatusCodeP() { + OperationsTestCase validateFunctionalStatusResultObservationStatusCodePTestCase = new OperationsTestCase( + "validateFunctionalStatusResultObservationStatusCodeP", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_RESULT_OBSERVATION_STATUS_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusResultObservation target) { + + } + + @Override + protected void updateToPass(FunctionalStatusResultObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusResultObservationOperations.validateFunctionalStatusResultObservationStatusCodeP( + (FunctionalStatusResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusResultObservationStatusCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFunctionalStatusResultObservationStatusCode() { + OperationsTestCase validateFunctionalStatusResultObservationStatusCodeTestCase = new OperationsTestCase( + "validateFunctionalStatusResultObservationStatusCode", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_RESULT_OBSERVATION_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusResultObservation target) { + + } + + @Override + protected void updateToPass(FunctionalStatusResultObservation target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusResultObservationOperations.validateFunctionalStatusResultObservationStatusCode( + (FunctionalStatusResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusResultObservationStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFunctionalStatusResultObservationEffectiveTime() { + OperationsTestCase validateFunctionalStatusResultObservationEffectiveTimeTestCase = new OperationsTestCase( + "validateFunctionalStatusResultObservationEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_RESULT_OBSERVATION_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusResultObservation target) { + + } + + @Override + protected void updateToPass(FunctionalStatusResultObservation target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusResultObservationOperations.validateFunctionalStatusResultObservationEffectiveTime( + (FunctionalStatusResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusResultObservationEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFunctionalStatusResultObservationValue() { + OperationsTestCase validateFunctionalStatusResultObservationValueTestCase = new OperationsTestCase( + "validateFunctionalStatusResultObservationValue", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_RESULT_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusResultObservation target) { + + } + + @Override + protected void updateToPass(FunctionalStatusResultObservation target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD(); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusResultObservationOperations.validateFunctionalStatusResultObservationValue( + (FunctionalStatusResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusResultObservationValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFunctionalStatusResultObservationInterpretationCode() { + OperationsTestCase validateFunctionalStatusResultObservationInterpretationCodeTestCase = new OperationsTestCase( + "validateFunctionalStatusResultObservationInterpretationCode", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_RESULT_OBSERVATION_INTERPRETATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusResultObservation target) { + + } + + @Override + protected void updateToPass(FunctionalStatusResultObservation target) { + target.init(); + target.getInterpretationCodes().add(DatatypesFactory.eINSTANCE.createCE()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusResultObservationOperations.validateFunctionalStatusResultObservationInterpretationCode( + (FunctionalStatusResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusResultObservationInterpretationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFunctionalStatusResultObservationMethodCode() { + OperationsTestCase validateFunctionalStatusResultObservationMethodCodeTestCase = new OperationsTestCase( + "validateFunctionalStatusResultObservationMethodCode", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_RESULT_OBSERVATION_METHOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusResultObservation target) { + + } + + @Override + protected void updateToPass(FunctionalStatusResultObservation target) { + target.init(); + target.getMethodCodes().add(DatatypesFactory.eINSTANCE.createCE()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusResultObservationOperations.validateFunctionalStatusResultObservationMethodCode( + (FunctionalStatusResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusResultObservationMethodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFunctionalStatusResultObservationTargetSiteCode() { + OperationsTestCase validateFunctionalStatusResultObservationTargetSiteCodeTestCase = new OperationsTestCase( + "validateFunctionalStatusResultObservationTargetSiteCode", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_RESULT_OBSERVATION_TARGET_SITE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusResultObservation target) { + + } + + @Override + protected void updateToPass(FunctionalStatusResultObservation target) { + target.init(); + target.getTargetSiteCodes().add(DatatypesFactory.eINSTANCE.createCD()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusResultObservationOperations.validateFunctionalStatusResultObservationTargetSiteCode( + (FunctionalStatusResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusResultObservationTargetSiteCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFunctionalStatusResultObservationAuthor() { + OperationsTestCase validateFunctionalStatusResultObservationAuthorTestCase = new OperationsTestCase( + "validateFunctionalStatusResultObservationAuthor", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_RESULT_OBSERVATION_AUTHOR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusResultObservation target) { + + } + + @Override + protected void updateToPass(FunctionalStatusResultObservation target) { + target.init(); + target.getAuthors().add(CDAFactory.eINSTANCE.createAuthor()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusResultObservationOperations.validateFunctionalStatusResultObservationAuthor( + (FunctionalStatusResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusResultObservationAuthorTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFunctionalStatusResultObservationNonMedicinalSupplyActivity() { + OperationsTestCase validateFunctionalStatusResultObservationNonMedicinalSupplyActivityTestCase = new OperationsTestCase( + "validateFunctionalStatusResultObservationNonMedicinalSupplyActivity", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_RESULT_OBSERVATION_NON_MEDICINAL_SUPPLY_ACTIVITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusResultObservation target) { + + } + + @Override + protected void updateToPass(FunctionalStatusResultObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.REFR); + er.setSupply(ConsolFactory.eINSTANCE.createNonMedicinalSupplyActivity()); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusResultObservationOperations.validateFunctionalStatusResultObservationNonMedicinalSupplyActivity( + (FunctionalStatusResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusResultObservationNonMedicinalSupplyActivityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFunctionalStatusResultObservationCaregiverCharacteristics() { + OperationsTestCase validateFunctionalStatusResultObservationCaregiverCharacteristicsTestCase = new OperationsTestCase( + "validateFunctionalStatusResultObservationCaregiverCharacteristics", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_RESULT_OBSERVATION_CAREGIVER_CHARACTERISTICS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusResultObservation target) { + + } + + @Override + protected void updateToPass(FunctionalStatusResultObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.REFR); + er.setObservation(ConsolFactory.eINSTANCE.createCaregiverCharacteristics()); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusResultObservationOperations.validateFunctionalStatusResultObservationCaregiverCharacteristics( + (FunctionalStatusResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusResultObservationCaregiverCharacteristicsTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFunctionalStatusResultObservationAssessmentScaleObservation() { + OperationsTestCase validateFunctionalStatusResultObservationAssessmentScaleObservationTestCase = new OperationsTestCase( + "validateFunctionalStatusResultObservationAssessmentScaleObservation", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_RESULT_OBSERVATION_ASSESSMENT_SCALE_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusResultObservation target) { + + } + + @Override + protected void updateToPass(FunctionalStatusResultObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + er.setObservation(ConsolFactory.eINSTANCE.createAssessmentScaleObservation()); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusResultObservationOperations.validateFunctionalStatusResultObservationAssessmentScaleObservation( + (FunctionalStatusResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusResultObservationAssessmentScaleObservationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFunctionalStatusResultObservationReferenceRange() { + OperationsTestCase validateFunctionalStatusResultObservationReferenceRangeTestCase = new OperationsTestCase( + "validateFunctionalStatusResultObservationReferenceRange", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_RESULT_OBSERVATION_REFERENCE_RANGE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusResultObservation target) { + + } + + @Override + protected void updateToPass(FunctionalStatusResultObservation target) { + target.init(); + target.getReferenceRanges().add(CDAFactory.eINSTANCE.createReferenceRange()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusResultObservationOperations.validateFunctionalStatusResultObservationReferenceRange( + (FunctionalStatusResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusResultObservationReferenceRangeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFunctionalStatusResultObservationReferenceRangeObservationRangeNoCode() { + OperationsTestCase validateFunctionalStatusResultObservationReferenceRangeObservationRangeNoCodeTestCase = new OperationsTestCase( + "validateFunctionalStatusResultObservationReferenceRangeObservationRangeNoCode", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_RESULT_OBSERVATION_REFERENCE_RANGE_OBSERVATION_RANGE_NO_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusResultObservation target) { + target.init(); + ReferenceRange rr = CDAFactory.eINSTANCE.createReferenceRange(); + ObservationRange or = CDAFactory.eINSTANCE.createObservationRange(); + or.setCode(DatatypesFactory.eINSTANCE.createCD()); + rr.setObservationRange(or); + target.getReferenceRanges().add(rr); + } + + @Override + protected void updateToPass(FunctionalStatusResultObservation target) { + target.getReferenceRanges().clear(); + ReferenceRange rr = CDAFactory.eINSTANCE.createReferenceRange(); + rr.setObservationRange(CDAFactory.eINSTANCE.createObservationRange()); + target.getReferenceRanges().add(rr); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusResultObservationOperations.validateFunctionalStatusResultObservationReferenceRangeObservationRangeNoCode( + (FunctionalStatusResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusResultObservationReferenceRangeObservationRangeNoCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFunctionalStatusResultObservationReferenceRangeObservationRange() { + OperationsTestCase validateFunctionalStatusResultObservationReferenceRangeObservationRangeTestCase = new OperationsTestCase( + "validateFunctionalStatusResultObservationReferenceRangeObservationRange", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_RESULT_OBSERVATION_REFERENCE_RANGE_OBSERVATION_RANGE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusResultObservation target) { + target.init(); + target.getReferenceRanges().add(CDAFactory.eINSTANCE.createReferenceRange()); + } + + @Override + protected void updateToPass(FunctionalStatusResultObservation target) { + target.getReferenceRanges().clear(); + ReferenceRange rr = CDAFactory.eINSTANCE.createReferenceRange(); + rr.setObservationRange(CDAFactory.eINSTANCE.createObservationRange()); + target.getReferenceRanges().add(rr); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusResultObservationOperations.validateFunctionalStatusResultObservationReferenceRangeObservationRange( + (FunctionalStatusResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusResultObservationReferenceRangeObservationRangeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetNonMedicinalSupplyActivity() { + + FunctionalStatusResultObservation target = objectFactory.create(); + target.getNonMedicinalSupplyActivity(); + + } + + /** + * + * @generated + */ + @Test + public void testGetCaregiverCharacteristics() { + + FunctionalStatusResultObservation target = objectFactory.create(); + target.getCaregiverCharacteristics(); + + } + + /** + * + * @generated + */ + @Test + public void testGetAssessmentScaleObservation() { + + FunctionalStatusResultObservation target = objectFactory.create(); + target.getAssessmentScaleObservation(); + + } + + /** + * + * @generated + */ + @Test + public void testValidateResultObservationTemplateId() { + OperationsTestCase validateResultObservationTemplateIdTestCase = new OperationsTestCase( + "validateResultObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_RESULT_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusResultObservation target) { + + } + + @Override + protected void updateToPass(FunctionalStatusResultObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusResultObservationOperations.validateResultObservationTemplateId( + (FunctionalStatusResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateResultObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends FunctionalStatusResultObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public FunctionalStatusResultObservation create() { + return ConsolFactory.eINSTANCE.createFunctionalStatusResultObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends FunctionalStatusResultObservationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // FunctionalStatusResultObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/FunctionalStatusResultOrganizerTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/FunctionalStatusResultOrganizerTest.java new file mode 100644 index 000000000..9a45c4d6b --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/FunctionalStatusResultOrganizerTest.java @@ -0,0 +1,434 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusResultOrganizer; +import org.openhealthtools.mdht.uml.cda.consol.operations.FunctionalStatusResultOrganizerOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; + +/** + * + * A static utility class that provides operations related to 'Functional Status Result Organizer' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusResultOrganizer#validateFunctionalStatusResultOrganizerCodeCodeSystem(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Result Organizer Code Code System}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusResultOrganizer#validateFunctionalStatusResultOrganizerClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Result Organizer Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusResultOrganizer#validateFunctionalStatusResultOrganizerMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Result Organizer Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusResultOrganizer#validateFunctionalStatusResultOrganizerId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Result Organizer Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusResultOrganizer#validateFunctionalStatusResultOrganizerCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Result Organizer Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusResultOrganizer#validateFunctionalStatusResultOrganizerStatusCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Result Organizer Status Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusResultOrganizer#validateFunctionalStatusResultOrganizerStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Result Organizer Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusResultOrganizer#validateFunctionalStatusResultOrganizerFunctionalStatusResultObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Result Organizer Functional Status Result Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusResultOrganizer#getFunctionalStatusResultObservations() Get Functional Status Result Observations}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusResultOrganizer#validateResultOrganizerTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Organizer Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class FunctionalStatusResultOrganizerTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateFunctionalStatusResultOrganizerCodeCodeSystem() { + OperationsTestCase validateFunctionalStatusResultOrganizerCodeCodeSystemTestCase = new OperationsTestCase( + "validateFunctionalStatusResultOrganizerCodeCodeSystem", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_RESULT_ORGANIZER_CODE_CODE_SYSTEM__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusResultOrganizer target) { + + } + + @Override + protected void updateToPass(FunctionalStatusResultOrganizer target) { + target.init(); + target.setCode(DatatypesFactory.eINSTANCE.createCE("", "2.16.840.1.113883.6.96")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusResultOrganizerOperations.validateFunctionalStatusResultOrganizerCodeCodeSystem( + (FunctionalStatusResultOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusResultOrganizerCodeCodeSystemTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFunctionalStatusResultOrganizerClassCode() { + OperationsTestCase validateFunctionalStatusResultOrganizerClassCodeTestCase = new OperationsTestCase( + "validateFunctionalStatusResultOrganizerClassCode", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_RESULT_ORGANIZER_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusResultOrganizer target) { + + } + + @Override + protected void updateToPass(FunctionalStatusResultOrganizer target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusResultOrganizerOperations.validateFunctionalStatusResultOrganizerClassCode( + (FunctionalStatusResultOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusResultOrganizerClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFunctionalStatusResultOrganizerMoodCode() { + OperationsTestCase validateFunctionalStatusResultOrganizerMoodCodeTestCase = new OperationsTestCase( + "validateFunctionalStatusResultOrganizerMoodCode", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_RESULT_ORGANIZER_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusResultOrganizer target) { + + } + + @Override + protected void updateToPass(FunctionalStatusResultOrganizer target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusResultOrganizerOperations.validateFunctionalStatusResultOrganizerMoodCode( + (FunctionalStatusResultOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusResultOrganizerMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFunctionalStatusResultOrganizerId() { + OperationsTestCase validateFunctionalStatusResultOrganizerIdTestCase = new OperationsTestCase( + "validateFunctionalStatusResultOrganizerId", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_RESULT_ORGANIZER_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusResultOrganizer target) { + + } + + @Override + protected void updateToPass(FunctionalStatusResultOrganizer target) { + target.init(); + target.getIds().add(DatatypesFactory.eINSTANCE.createII()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusResultOrganizerOperations.validateFunctionalStatusResultOrganizerId( + (FunctionalStatusResultOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusResultOrganizerIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFunctionalStatusResultOrganizerCode() { + OperationsTestCase validateFunctionalStatusResultOrganizerCodeTestCase = new OperationsTestCase( + "validateFunctionalStatusResultOrganizerCode", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_RESULT_ORGANIZER_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusResultOrganizer target) { + + } + + @Override + protected void updateToPass(FunctionalStatusResultOrganizer target) { + target.init(); + target.setCode(DatatypesFactory.eINSTANCE.createCE("", "2.16.840.1.113883.6.96")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusResultOrganizerOperations.validateFunctionalStatusResultOrganizerCode( + (FunctionalStatusResultOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusResultOrganizerCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFunctionalStatusResultOrganizerStatusCodeP() { + OperationsTestCase validateFunctionalStatusResultOrganizerStatusCodePTestCase = new OperationsTestCase( + "validateFunctionalStatusResultOrganizerStatusCodeP", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_RESULT_ORGANIZER_STATUS_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusResultOrganizer target) { + + } + + @Override + protected void updateToPass(FunctionalStatusResultOrganizer target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusResultOrganizerOperations.validateFunctionalStatusResultOrganizerStatusCodeP( + (FunctionalStatusResultOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusResultOrganizerStatusCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFunctionalStatusResultOrganizerStatusCode() { + OperationsTestCase validateFunctionalStatusResultOrganizerStatusCodeTestCase = new OperationsTestCase( + "validateFunctionalStatusResultOrganizerStatusCode", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_RESULT_ORGANIZER_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusResultOrganizer target) { + + } + + @Override + protected void updateToPass(FunctionalStatusResultOrganizer target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusResultOrganizerOperations.validateFunctionalStatusResultOrganizerStatusCode( + (FunctionalStatusResultOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusResultOrganizerStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFunctionalStatusResultOrganizerFunctionalStatusResultObservation() { + OperationsTestCase validateFunctionalStatusResultOrganizerFunctionalStatusResultObservationTestCase = new OperationsTestCase( + "validateFunctionalStatusResultOrganizerFunctionalStatusResultObservation", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_RESULT_ORGANIZER_FUNCTIONAL_STATUS_RESULT_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusResultOrganizer target) { + + } + + @Override + protected void updateToPass(FunctionalStatusResultOrganizer target) { + target.init(); + target.addObservation(ConsolFactory.eINSTANCE.createFunctionalStatusResultObservation()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusResultOrganizerOperations.validateFunctionalStatusResultOrganizerFunctionalStatusResultObservation( + (FunctionalStatusResultOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusResultOrganizerFunctionalStatusResultObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetFunctionalStatusResultObservations() { + + FunctionalStatusResultOrganizer target = objectFactory.create(); + target.getFunctionalStatusResultObservations(); + + } + + /** + * + * @generated + */ + @Test + public void testValidateResultOrganizerTemplateId() { + OperationsTestCase validateResultOrganizerTemplateIdTestCase = new OperationsTestCase( + "validateResultOrganizerTemplateId", + operationsForOCL.getOCLValue("VALIDATE_RESULT_ORGANIZER_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusResultOrganizer target) { + + } + + @Override + protected void updateToPass(FunctionalStatusResultOrganizer target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusResultOrganizerOperations.validateResultOrganizerTemplateId( + (FunctionalStatusResultOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateResultOrganizerTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends FunctionalStatusResultOrganizerOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public FunctionalStatusResultOrganizer create() { + return ConsolFactory.eINSTANCE.createFunctionalStatusResultOrganizer(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends FunctionalStatusResultOrganizerOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // FunctionalStatusResultOrganizerOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/FunctionalStatusSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/FunctionalStatusSectionTest.java new file mode 100644 index 000000000..47d45881e --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/FunctionalStatusSectionTest.java @@ -0,0 +1,831 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.FunctionalStatusSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Functional Status Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusSection#validateFunctionalStatusSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusSection#validateFunctionalStatusSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusSection#validateFunctionalStatusSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusSection#validateFunctionalStatusSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusSection#validateFunctionalStatusSectionFunctionalStatusResultOrganizer(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Section Functional Status Result Organizer}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusSection#validateFunctionalStatusSectionCognitiveStatusResultOrganizer(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Section Cognitive Status Result Organizer}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusSection#validateFunctionalStatusSectionFunctionalStatusResultObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Section Functional Status Result Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusSection#validateFunctionalStatusSectionCognitiveStatusResultObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Section Cognitive Status Result Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusSection#validateFunctionalStatusSectionFunctionalStatusProblemObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Section Functional Status Problem Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusSection#validateFunctionalStatusSectionCognitiveStatusProblemObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Section Cognitive Status Problem Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusSection#validateFunctionalStatusSectionCaregiverCharacteristics(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Section Caregiver Characteristics}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusSection#validateFunctionalStatusSectionAssessmentScaleObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Section Assessment Scale Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusSection#validateFunctionalStatusSectionNonMedicinalSupplyActivity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Section Non Medicinal Supply Activity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusSection#validateFunctionalStatusSectionPressureUlcerObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Section Pressure Ulcer Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusSection#validateFunctionalStatusSectionNumberOfPressureUlcersObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Section Number Of Pressure Ulcers Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusSection#validateFunctionalStatusSectionHighestPressureUlcerStage(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Section Highest Pressure Ulcer Stage}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusSection#getFunctionalStatusResultOrganizers() Get Functional Status Result Organizers}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusSection#getCognitiveStatusResultOrganizers() Get Cognitive Status Result Organizers}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusSection#getFunctionalStatusResultObservations() Get Functional Status Result Observations}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusSection#getCognitiveStatusResultObservations() Get Cognitive Status Result Observations}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusSection#getFunctionalStatusProblemObservations() Get Functional Status Problem Observations}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusSection#getCognitiveStatusProblemObservations() Get Cognitive Status Problem Observations}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusSection#getCaregiverCharacteristicss() Get Caregiver Characteristicss}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusSection#getAssessmentScaleObservations() Get Assessment Scale Observations}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusSection#getNonMedicinalSupplyActivities() Get Non Medicinal Supply Activities}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusSection#getPressureUlcerObservations() Get Pressure Ulcer Observations}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusSection#getNumberOfPressureUlcersObservations() Get Number Of Pressure Ulcers Observations}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusSection#getHighestPressureUlcerStages() Get Highest Pressure Ulcer Stages}
  • + *
+ *

+ * + * @generated + */ + +public class FunctionalStatusSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateFunctionalStatusSectionTemplateId() { + OperationsTestCase validateFunctionalStatusSectionTemplateIdTestCase = new OperationsTestCase( + "validateFunctionalStatusSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusSection target) { + + } + + @Override + protected void updateToPass(FunctionalStatusSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusSectionOperations.validateFunctionalStatusSectionTemplateId( + (FunctionalStatusSection) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFunctionalStatusSectionCode() { + OperationsTestCase validateFunctionalStatusSectionCodeTestCase = new OperationsTestCase( + "validateFunctionalStatusSectionCode", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusSection target) { + + } + + @Override + protected void updateToPass(FunctionalStatusSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusSectionOperations.validateFunctionalStatusSectionCode( + (FunctionalStatusSection) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFunctionalStatusSectionTitle() { + OperationsTestCase validateFunctionalStatusSectionTitleTestCase = new OperationsTestCase( + "validateFunctionalStatusSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusSection target) { + + } + + @Override + protected void updateToPass(FunctionalStatusSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusSectionOperations.validateFunctionalStatusSectionTitle( + (FunctionalStatusSection) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFunctionalStatusSectionText() { + OperationsTestCase validateFunctionalStatusSectionTextTestCase = new OperationsTestCase( + "validateFunctionalStatusSectionText", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusSection target) { + + } + + @Override + protected void updateToPass(FunctionalStatusSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusSectionOperations.validateFunctionalStatusSectionText( + (FunctionalStatusSection) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFunctionalStatusSectionFunctionalStatusResultOrganizer() { + OperationsTestCase validateFunctionalStatusSectionFunctionalStatusResultOrganizerTestCase = new OperationsTestCase( + "validateFunctionalStatusSectionFunctionalStatusResultOrganizer", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_SECTION_FUNCTIONAL_STATUS_RESULT_ORGANIZER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusSection target) { + + } + + @Override + protected void updateToPass(FunctionalStatusSection target) { + target.init(); + target.addOrganizer(ConsolFactory.eINSTANCE.createFunctionalStatusResultOrganizer()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusSectionOperations.validateFunctionalStatusSectionFunctionalStatusResultOrganizer( + (FunctionalStatusSection) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusSectionFunctionalStatusResultOrganizerTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFunctionalStatusSectionCognitiveStatusResultOrganizer() { + OperationsTestCase validateFunctionalStatusSectionCognitiveStatusResultOrganizerTestCase = new OperationsTestCase( + "validateFunctionalStatusSectionCognitiveStatusResultOrganizer", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_SECTION_COGNITIVE_STATUS_RESULT_ORGANIZER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusSection target) { + + } + + @Override + protected void updateToPass(FunctionalStatusSection target) { + target.init(); + target.addOrganizer(ConsolFactory.eINSTANCE.createCognitiveStatusResultOrganizer()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusSectionOperations.validateFunctionalStatusSectionCognitiveStatusResultOrganizer( + (FunctionalStatusSection) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusSectionCognitiveStatusResultOrganizerTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFunctionalStatusSectionFunctionalStatusResultObservation() { + OperationsTestCase validateFunctionalStatusSectionFunctionalStatusResultObservationTestCase = new OperationsTestCase( + "validateFunctionalStatusSectionFunctionalStatusResultObservation", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_SECTION_FUNCTIONAL_STATUS_RESULT_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusSection target) { + + } + + @Override + protected void updateToPass(FunctionalStatusSection target) { + target.init(); + target.addObservation(ConsolFactory.eINSTANCE.createFunctionalStatusResultObservation()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusSectionOperations.validateFunctionalStatusSectionFunctionalStatusResultObservation( + (FunctionalStatusSection) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusSectionFunctionalStatusResultObservationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFunctionalStatusSectionCognitiveStatusResultObservation() { + OperationsTestCase validateFunctionalStatusSectionCognitiveStatusResultObservationTestCase = new OperationsTestCase( + "validateFunctionalStatusSectionCognitiveStatusResultObservation", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_SECTION_COGNITIVE_STATUS_RESULT_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusSection target) { + + } + + @Override + protected void updateToPass(FunctionalStatusSection target) { + target.init(); + target.addObservation(ConsolFactory.eINSTANCE.createCognitiveStatusResultObservation()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusSectionOperations.validateFunctionalStatusSectionCognitiveStatusResultObservation( + (FunctionalStatusSection) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusSectionCognitiveStatusResultObservationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFunctionalStatusSectionFunctionalStatusProblemObservation() { + OperationsTestCase validateFunctionalStatusSectionFunctionalStatusProblemObservationTestCase = new OperationsTestCase( + "validateFunctionalStatusSectionFunctionalStatusProblemObservation", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_SECTION_FUNCTIONAL_STATUS_PROBLEM_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusSection target) { + + } + + @Override + protected void updateToPass(FunctionalStatusSection target) { + target.init(); + target.addObservation(ConsolFactory.eINSTANCE.createFunctionalStatusProblemObservation()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusSectionOperations.validateFunctionalStatusSectionFunctionalStatusProblemObservation( + (FunctionalStatusSection) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusSectionFunctionalStatusProblemObservationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFunctionalStatusSectionCognitiveStatusProblemObservation() { + OperationsTestCase validateFunctionalStatusSectionCognitiveStatusProblemObservationTestCase = new OperationsTestCase( + "validateFunctionalStatusSectionCognitiveStatusProblemObservation", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_SECTION_COGNITIVE_STATUS_PROBLEM_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusSection target) { + + } + + @Override + protected void updateToPass(FunctionalStatusSection target) { + target.init(); + target.addObservation(ConsolFactory.eINSTANCE.createCognitiveStatusProblemObservation()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusSectionOperations.validateFunctionalStatusSectionCognitiveStatusProblemObservation( + (FunctionalStatusSection) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusSectionCognitiveStatusProblemObservationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFunctionalStatusSectionCaregiverCharacteristics() { + OperationsTestCase validateFunctionalStatusSectionCaregiverCharacteristicsTestCase = new OperationsTestCase( + "validateFunctionalStatusSectionCaregiverCharacteristics", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_SECTION_CAREGIVER_CHARACTERISTICS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusSection target) { + + } + + @Override + protected void updateToPass(FunctionalStatusSection target) { + target.init(); + target.addObservation(ConsolFactory.eINSTANCE.createCaregiverCharacteristics()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusSectionOperations.validateFunctionalStatusSectionCaregiverCharacteristics( + (FunctionalStatusSection) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusSectionCaregiverCharacteristicsTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFunctionalStatusSectionAssessmentScaleObservation() { + OperationsTestCase validateFunctionalStatusSectionAssessmentScaleObservationTestCase = new OperationsTestCase( + "validateFunctionalStatusSectionAssessmentScaleObservation", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_SECTION_ASSESSMENT_SCALE_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusSection target) { + + } + + @Override + protected void updateToPass(FunctionalStatusSection target) { + target.init(); + target.addObservation(ConsolFactory.eINSTANCE.createAssessmentScaleObservation()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusSectionOperations.validateFunctionalStatusSectionAssessmentScaleObservation( + (FunctionalStatusSection) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusSectionAssessmentScaleObservationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFunctionalStatusSectionNonMedicinalSupplyActivity() { + OperationsTestCase validateFunctionalStatusSectionNonMedicinalSupplyActivityTestCase = new OperationsTestCase( + "validateFunctionalStatusSectionNonMedicinalSupplyActivity", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_SECTION_NON_MEDICINAL_SUPPLY_ACTIVITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusSection target) { + + } + + @Override + protected void updateToPass(FunctionalStatusSection target) { + target.init(); + target.addSupply(ConsolFactory.eINSTANCE.createNonMedicinalSupplyActivity()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusSectionOperations.validateFunctionalStatusSectionNonMedicinalSupplyActivity( + (FunctionalStatusSection) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusSectionNonMedicinalSupplyActivityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFunctionalStatusSectionPressureUlcerObservation() { + OperationsTestCase validateFunctionalStatusSectionPressureUlcerObservationTestCase = new OperationsTestCase( + "validateFunctionalStatusSectionPressureUlcerObservation", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_SECTION_PRESSURE_ULCER_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusSection target) { + + } + + @Override + protected void updateToPass(FunctionalStatusSection target) { + target.init(); + target.addObservation(ConsolFactory.eINSTANCE.createPressureUlcerObservation()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusSectionOperations.validateFunctionalStatusSectionPressureUlcerObservation( + (FunctionalStatusSection) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusSectionPressureUlcerObservationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFunctionalStatusSectionNumberOfPressureUlcersObservation() { + OperationsTestCase validateFunctionalStatusSectionNumberOfPressureUlcersObservationTestCase = new OperationsTestCase( + "validateFunctionalStatusSectionNumberOfPressureUlcersObservation", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_SECTION_NUMBER_OF_PRESSURE_ULCERS_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusSection target) { + + } + + @Override + protected void updateToPass(FunctionalStatusSection target) { + target.init(); + target.addObservation(ConsolFactory.eINSTANCE.createNumberOfPressureUlcersObservation()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusSectionOperations.validateFunctionalStatusSectionNumberOfPressureUlcersObservation( + (FunctionalStatusSection) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusSectionNumberOfPressureUlcersObservationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFunctionalStatusSectionHighestPressureUlcerStage() { + OperationsTestCase validateFunctionalStatusSectionHighestPressureUlcerStageTestCase = new OperationsTestCase( + "validateFunctionalStatusSectionHighestPressureUlcerStage", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_SECTION_HIGHEST_PRESSURE_ULCER_STAGE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusSection target) { + + } + + @Override + protected void updateToPass(FunctionalStatusSection target) { + target.init(); + target.addObservation(ConsolFactory.eINSTANCE.createHighestPressureUlcerStage()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusSectionOperations.validateFunctionalStatusSectionHighestPressureUlcerStage( + (FunctionalStatusSection) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusSectionHighestPressureUlcerStageTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetFunctionalStatusResultOrganizers() { + + FunctionalStatusSection target = objectFactory.create(); + target.getFunctionalStatusResultOrganizers(); + + } + + /** + * + * @generated + */ + @Test + public void testGetCognitiveStatusResultOrganizers() { + + FunctionalStatusSection target = objectFactory.create(); + target.getCognitiveStatusResultOrganizers(); + + } + + /** + * + * @generated + */ + @Test + public void testGetFunctionalStatusResultObservations() { + + FunctionalStatusSection target = objectFactory.create(); + target.getFunctionalStatusResultObservations(); + + } + + /** + * + * @generated + */ + @Test + public void testGetCognitiveStatusResultObservations() { + + FunctionalStatusSection target = objectFactory.create(); + target.getCognitiveStatusResultObservations(); + + } + + /** + * + * @generated + */ + @Test + public void testGetFunctionalStatusProblemObservations() { + + FunctionalStatusSection target = objectFactory.create(); + target.getFunctionalStatusProblemObservations(); + + } + + /** + * + * @generated + */ + @Test + public void testGetCognitiveStatusProblemObservations() { + + FunctionalStatusSection target = objectFactory.create(); + target.getCognitiveStatusProblemObservations(); + + } + + /** + * + * @generated + */ + @Test + public void testGetCaregiverCharacteristicss() { + + FunctionalStatusSection target = objectFactory.create(); + target.getCaregiverCharacteristicss(); + + } + + /** + * + * @generated + */ + @Test + public void testGetAssessmentScaleObservations() { + + FunctionalStatusSection target = objectFactory.create(); + target.getAssessmentScaleObservations(); + + } + + /** + * + * @generated + */ + @Test + public void testGetNonMedicinalSupplyActivities() { + + FunctionalStatusSection target = objectFactory.create(); + target.getNonMedicinalSupplyActivities(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPressureUlcerObservations() { + + FunctionalStatusSection target = objectFactory.create(); + target.getPressureUlcerObservations(); + + } + + /** + * + * @generated + */ + @Test + public void testGetNumberOfPressureUlcersObservations() { + + FunctionalStatusSection target = objectFactory.create(); + target.getNumberOfPressureUlcersObservations(); + + } + + /** + * + * @generated + */ + @Test + public void testGetHighestPressureUlcerStages() { + + FunctionalStatusSection target = objectFactory.create(); + target.getHighestPressureUlcerStages(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends FunctionalStatusSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public FunctionalStatusSection create() { + return ConsolFactory.eINSTANCE.createFunctionalStatusSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends FunctionalStatusSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // FunctionalStatusSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/GeneralHeaderConstraintsTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/GeneralHeaderConstraintsTest.java new file mode 100644 index 000000000..533e113ca --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/GeneralHeaderConstraintsTest.java @@ -0,0 +1,12852 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.AssignedAuthor; +import org.openhealthtools.mdht.uml.cda.AssignedCustodian; +import org.openhealthtools.mdht.uml.cda.AssignedEntity; +import org.openhealthtools.mdht.uml.cda.AssociatedEntity; +import org.openhealthtools.mdht.uml.cda.Authenticator; +import org.openhealthtools.mdht.uml.cda.Author; +import org.openhealthtools.mdht.uml.cda.AuthoringDevice; +import org.openhealthtools.mdht.uml.cda.Authorization; +import org.openhealthtools.mdht.uml.cda.Birthplace; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Component1; +import org.openhealthtools.mdht.uml.cda.Consent; +import org.openhealthtools.mdht.uml.cda.Custodian; +import org.openhealthtools.mdht.uml.cda.CustodianOrganization; +import org.openhealthtools.mdht.uml.cda.DataEnterer; +import org.openhealthtools.mdht.uml.cda.DocumentationOf; +import org.openhealthtools.mdht.uml.cda.EncompassingEncounter; +import org.openhealthtools.mdht.uml.cda.Guardian; +import org.openhealthtools.mdht.uml.cda.InFulfillmentOf; +import org.openhealthtools.mdht.uml.cda.Informant12; +import org.openhealthtools.mdht.uml.cda.InformationRecipient; +import org.openhealthtools.mdht.uml.cda.InfrastructureRootTypeId; +import org.openhealthtools.mdht.uml.cda.IntendedRecipient; +import org.openhealthtools.mdht.uml.cda.LanguageCommunication; +import org.openhealthtools.mdht.uml.cda.LegalAuthenticator; +import org.openhealthtools.mdht.uml.cda.Order; +import org.openhealthtools.mdht.uml.cda.Organization; +import org.openhealthtools.mdht.uml.cda.Participant1; +import org.openhealthtools.mdht.uml.cda.Patient; +import org.openhealthtools.mdht.uml.cda.PatientRole; +import org.openhealthtools.mdht.uml.cda.Performer1; +import org.openhealthtools.mdht.uml.cda.Person; +import org.openhealthtools.mdht.uml.cda.Place; +import org.openhealthtools.mdht.uml.cda.RecordTarget; +import org.openhealthtools.mdht.uml.cda.RelatedEntity; +import org.openhealthtools.mdht.uml.cda.ServiceEvent; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints; +import org.openhealthtools.mdht.uml.cda.consol.operations.GeneralHeaderConstraintsOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.AD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.datatypes.PN; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; +import org.openhealthtools.mdht.uml.hl7.datatypes.TEL; +import org.openhealthtools.mdht.uml.hl7.vocab.EntityNameUse; +import org.openhealthtools.mdht.uml.hl7.vocab.PostalAddressUse; +import org.openhealthtools.mdht.uml.hl7.vocab.TelecommunicationAddressUse; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ServiceEventPerformer; + +/** + * + * A static utility class that provides operations related to 'General Header Constraints' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsTypeIdRoot(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Type Id Root}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsTypeIdExtension(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Type Id Extension}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsSetIdVersionNumber(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Set Id Version Number}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsVersionNumberSetId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Version Number Set Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRealmCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Realm Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsTypeId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Type Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsConfidentialityCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Confidentiality Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsLanguageCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Language Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsSetId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Set Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsVersionNumber(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Version Number}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthor(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Author}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsDataEnterer(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Data Enterer}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsCustodian(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Custodian}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsInformationRecipient(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Information Recipient}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsLegalAuthenticator(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Legal Authenticator}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthenticator(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Authenticator}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTarget(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsComponentOf(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Component Of}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsInformant(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Informant}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsSupportParticipant(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Support Participant}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsInFulfillmentOf(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints In Fulfillment Of}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsDocumentationOf(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Documentation Of}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthorization(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Authorization}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressStreet(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role US Realm Address Street}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressCity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role US Realm Address City}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressCountry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role US Realm Address Country}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressPostalCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role US Realm Address Postal Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressState(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role US Realm Address State}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressStreetAddressLine(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role US Realm Address Street Address Line}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressUseP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role US Realm Address Use P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressUse(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role US Realm Address Use}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRoleTELUse(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role TEL Use}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientUSRealmPatientNameMixedContent(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient US Realm Patient Name Mixed Content}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientUSRealmPatientNameFamily(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient US Realm Patient Name Family}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientUSRealmPatientNameGiven(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient US Realm Patient Name Given}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientUSRealmPatientNamePrefix(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient US Realm Patient Name Prefix}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientUSRealmPatientNameSuffix(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient US Realm Patient Name Suffix}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientUSRealmPatientNameUseP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient US Realm Patient Name Use P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientUSRealmPatientNameUse(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient US Realm Patient Name Use}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressStreet(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient Guardian US Realm Address Street}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressCity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient Guardian US Realm Address City}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressCountry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient Guardian US Realm Address Country}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressPostalCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient Guardian US Realm Address Postal Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressState(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient Guardian US Realm Address State}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressStreetAddressLine(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient Guardian US Realm Address Street Address Line}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressUseP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient Guardian US Realm Address Use P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressUse(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient Guardian US Realm Address Use}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianTELUse(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient Guardian TEL Use}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianPersonName(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient Guardian Person Name}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianAddr(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient Guardian Addr}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient Guardian Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient Guardian Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianTelecom(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient Guardian Telecom}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianGuardianPerson(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient Guardian Guardian Person}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientBirthplacePlaceAddr(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient Birthplace Place Addr}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientBirthplacePlace(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient Birthplace Place}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationPreferenceInd(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient Language Communication Preference Ind}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationProficiencyLevelCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient Language Communication Proficiency Level Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationProficiencyLevelCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient Language Communication Proficiency Level Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationModeCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient Language Communication Mode Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationModeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient Language Communication Mode Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationLanguageCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient Language Communication Language Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationLanguageCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient Language Communication Language Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientBirthTimePreciseToYear(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient Birth Time Precise To Year}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientBirthTimePreciseToDay(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient Birth Time Precise To Day}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientAdministrativeGenderCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient Administrative Gender Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientBirthTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient Birth Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientEthnicGroupCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient Ethnic Group Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientEthnicGroupCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient Ethnic Group Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientMaritalStatusCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient Marital Status Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientMaritalStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient Marital Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientName(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient Name}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientRaceCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient Race Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientRaceCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient Race Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientReligiousAffiliationCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient Religious Affiliation Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientReligiousAffiliationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient Religious Affiliation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientSDTCRaceCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient SDTC Race Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientSDTCRaceCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient SDTC Race Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardian(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient Guardian}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientBirthplace(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient Birthplace}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunication(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient Language Communication}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressStreet(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Provider Organization US Realm Address Street}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressCity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Provider Organization US Realm Address City}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressCountry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Provider Organization US Realm Address Country}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressPostalCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Provider Organization US Realm Address Postal Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressState(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Provider Organization US Realm Address State}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressStreetAddressLine(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Provider Organization US Realm Address Street Address Line}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressUseP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Provider Organization US Realm Address Use P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressUse(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Provider Organization US Realm Address Use}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationTELUse(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Provider Organization TEL Use}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationHasNationalProviderIdentifier(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Provider Organization Has National Provider Identifier}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationAddr(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Provider Organization Addr}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Provider Organization Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationName(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Provider Organization Name}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationTelecom(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Provider Organization Telecom}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRoleAddr(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Addr}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRoleId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRoleTelecom(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Telecom}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatient(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganization(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Provider Organization}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRole(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsComponentOfEncompassingEncounterEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Component Of Encompassing Encounter Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsComponentOfEncompassingEncounterId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Component Of Encompassing Encounter Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsComponentOfEncompassingEncounter(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Component Of Encompassing Encounter}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressStreet(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Author Assigned Author US Realm Address Street}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressCity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Author Assigned Author US Realm Address City}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressCountry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Author Assigned Author US Realm Address Country}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressPostalCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Author Assigned Author US Realm Address Postal Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressState(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Author Assigned Author US Realm Address State}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressStreetAddressLine(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Author Assigned Author US Realm Address Street Address Line}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressUseP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Author Assigned Author US Realm Address Use P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressUse(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Author Assigned Author US Realm Address Use}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthorAssignedAuthorTELUse(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Author Assigned Author TEL Use}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthorAssignedAuthorAuthoringDeviceManufacturerModelName(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Author Assigned Author Authoring Device Manufacturer Model Name}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthorAssignedAuthorAuthoringDeviceSoftwareName(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Author Assigned Author Authoring Device Software Name}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthorAssignedAuthorPersonName(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Author Assigned Author Person Name}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthorAssignedAuthorHasAssignedPersonOrAssignedAuthoringDevice(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Author Assigned Author Has Assigned Person Or Assigned Authoring Device}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthorAssignedAuthorHasNationalProviderIdentifier(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Author Assigned Author Has National Provider Identifier}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthorAssignedAuthorAddr(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Author Assigned Author Addr}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthorAssignedAuthorCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Author Assigned Author Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthorAssignedAuthorCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Author Assigned Author Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthorAssignedAuthorId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Author Assigned Author Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthorAssignedAuthorTelecom(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Author Assigned Author Telecom}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthorAssignedAuthorAssignedAuthoringDevice(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Author Assigned Author Assigned Authoring Device}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthorAssignedAuthorAssignedPerson(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Author Assigned Author Assigned Person}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthorTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Author Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthorAssignedAuthor(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Author Assigned Author}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressStreet(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Data Enterer Assigned Entity US Realm Address Street}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressCity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Data Enterer Assigned Entity US Realm Address City}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressCountry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Data Enterer Assigned Entity US Realm Address Country}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressPostalCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Data Enterer Assigned Entity US Realm Address Postal Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressState(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Data Enterer Assigned Entity US Realm Address State}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressStreetAddressLine(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Data Enterer Assigned Entity US Realm Address Street Address Line}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressUseP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Data Enterer Assigned Entity US Realm Address Use P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressUse(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Data Enterer Assigned Entity US Realm Address Use}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsDataEntererAssignedEntityTELUse(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Data Enterer Assigned Entity TEL Use}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsDataEntererAssignedEntityPersonName(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Data Enterer Assigned Entity Person Name}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsDataEntererAssignedEntityHasNationalProviderIdentifier(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Data Enterer Assigned Entity Has National Provider Identifier}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsDataEntererAssignedEntityAddr(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Data Enterer Assigned Entity Addr}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsDataEntererAssignedEntityCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Data Enterer Assigned Entity Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsDataEntererAssignedEntityCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Data Enterer Assigned Entity Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsDataEntererAssignedEntityId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Data Enterer Assigned Entity Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsDataEntererAssignedEntityTelecom(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Data Enterer Assigned Entity Telecom}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsDataEntererAssignedEntityAssignedPerson(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Data Enterer Assigned Entity Assigned Person}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsDataEntererAssignedEntity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Data Enterer Assigned Entity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressStreet(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Custodian Assigned Custodian Custodian Organization US Realm Address Street}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressCity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Custodian Assigned Custodian Custodian Organization US Realm Address City}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressCountry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Custodian Assigned Custodian Custodian Organization US Realm Address Country}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressPostalCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Custodian Assigned Custodian Custodian Organization US Realm Address Postal Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressState(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Custodian Assigned Custodian Custodian Organization US Realm Address State}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressStreetAddressLine(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Custodian Assigned Custodian Custodian Organization US Realm Address Street Address Line}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressUseP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Custodian Assigned Custodian Custodian Organization US Realm Address Use P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressUse(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Custodian Assigned Custodian Custodian Organization US Realm Address Use}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationTELUse(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Custodian Assigned Custodian Custodian Organization TEL Use}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationHasNationalProviderIdentifier(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Custodian Assigned Custodian Custodian Organization Has National Provider Identifier}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationAddr(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Custodian Assigned Custodian Custodian Organization Addr}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Custodian Assigned Custodian Custodian Organization Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationName(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Custodian Assigned Custodian Custodian Organization Name}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationTelecom(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Custodian Assigned Custodian Custodian Organization Telecom}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsCustodianAssignedCustodianRepresentedCustodianOrganization(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Custodian Assigned Custodian Represented Custodian Organization}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsCustodianAssignedCustodian(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Custodian Assigned Custodian}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsInformationRecipientIntendedRecipientPersonName(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Information Recipient Intended Recipient Person Name}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsInformationRecipientIntendedRecipientOrganizationName(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Information Recipient Intended Recipient Organization Name}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsInformationRecipientIntendedRecipientInformationRecipient(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Information Recipient Intended Recipient Information Recipient}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsInformationRecipientIntendedRecipientRecievedOrganization(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Information Recipient Intended Recipient Recieved Organization}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsInformationRecipientIntendedRecipient(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Information Recipient Intended Recipient}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressStreet(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Legal Authenticator Assigned Entity US Realm Address Street}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressCity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Legal Authenticator Assigned Entity US Realm Address City}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressCountry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Legal Authenticator Assigned Entity US Realm Address Country}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressPostalCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Legal Authenticator Assigned Entity US Realm Address Postal Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressState(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Legal Authenticator Assigned Entity US Realm Address State}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressStreetAddressLine(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Legal Authenticator Assigned Entity US Realm Address Street Address Line}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressUseP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Legal Authenticator Assigned Entity US Realm Address Use P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressUse(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Legal Authenticator Assigned Entity US Realm Address Use}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityTELUse(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Legal Authenticator Assigned Entity TEL Use}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityPersonName(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Legal Authenticator Assigned Entity Person Name}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityHasNationalProviderIdentifier(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Legal Authenticator Assigned Entity Has National Provider Identifier}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityAddr(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Legal Authenticator Assigned Entity Addr}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Legal Authenticator Assigned Entity Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Legal Authenticator Assigned Entity Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Legal Authenticator Assigned Entity Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityTelecom(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Legal Authenticator Assigned Entity Telecom}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityAssignedPerson(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Legal Authenticator Assigned Entity Assigned Person}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsLegalAuthenticatorTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Legal Authenticator Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsLegalAuthenticatorSignatureCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Legal Authenticator Signature Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsLegalAuthenticatorSignatureCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Legal Authenticator Signature Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressStreet(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Authenticator Assigned Entity US Realm Address Street}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressCity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Authenticator Assigned Entity US Realm Address City}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressCountry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Authenticator Assigned Entity US Realm Address Country}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressPostalCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Authenticator Assigned Entity US Realm Address Postal Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressState(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Authenticator Assigned Entity US Realm Address State}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressStreetAddressLine(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Authenticator Assigned Entity US Realm Address Street Address Line}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressUseP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Authenticator Assigned Entity US Realm Address Use P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressUse(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Authenticator Assigned Entity US Realm Address Use}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthenticatorAssignedEntityTELUse(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Authenticator Assigned Entity TEL Use}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthenticatorAssignedEntityPersonName(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Authenticator Assigned Entity Person Name}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthenticatorAssignedEntityHasNationalProviderIdentifier(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Authenticator Assigned Entity Has National Provider Identifier}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthenticatorAssignedEntityAddr(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Authenticator Assigned Entity Addr}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthenticatorAssignedEntityCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Authenticator Assigned Entity Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthenticatorAssignedEntityCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Authenticator Assigned Entity Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthenticatorAssignedEntityId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Authenticator Assigned Entity Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthenticatorAssignedEntityTelecom(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Authenticator Assigned Entity Telecom}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthenticatorAssignedEntityAssignedPerson(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Authenticator Assigned Entity Assigned Person}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthenticatorTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Authenticator Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthenticatorSignatureCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Authenticator Signature Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthenticatorAssignedEntity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Authenticator Assigned Entity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressStreet(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Informant Assigned Entity US Realm Address Street}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressCity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Informant Assigned Entity US Realm Address City}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressCountry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Informant Assigned Entity US Realm Address Country}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressPostalCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Informant Assigned Entity US Realm Address Postal Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressState(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Informant Assigned Entity US Realm Address State}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressStreetAddressLine(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Informant Assigned Entity US Realm Address Street Address Line}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressUseP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Informant Assigned Entity US Realm Address Use P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressUse(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Informant Assigned Entity US Realm Address Use}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsInformantAssignedEntityPersonName(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Informant Assigned Entity Person Name}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsInformantAssignedEntityHasNationalProviderIdentifier(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Informant Assigned Entity Has National Provider Identifier}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsInformantAssignedEntityAddr(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Informant Assigned Entity Addr}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsInformantAssignedEntityCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Informant Assigned Entity Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsInformantAssignedEntityCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Informant Assigned Entity Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsInformantAssignedEntityId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Informant Assigned Entity Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsInformantAssignedEntityAssignedPerson(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Informant Assigned Entity Assigned Person}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressStreet(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Informant Related Entity US Realm Address Street}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressCity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Informant Related Entity US Realm Address City}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressCountry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Informant Related Entity US Realm Address Country}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressPostalCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Informant Related Entity US Realm Address Postal Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressState(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Informant Related Entity US Realm Address State}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressStreetAddressLine(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Informant Related Entity US Realm Address Street Address Line}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressUseP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Informant Related Entity US Realm Address Use P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressUse(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Informant Related Entity US Realm Address Use}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsInformantRelatedEntityPersonName(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Informant Related Entity Person Name}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsInformantRelatedEntityAddr(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Informant Related Entity Addr}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsInformantRelatedEntityPerson(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Informant Related Entity Person}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsInformantHasAssignedEntityOrRelatedEntity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Informant Has Assigned Entity Or Related Entity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsInformantAssignedEntity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Informant Assigned Entity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsInformantRelatedEntity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Informant Related Entity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsParticipantSupportAssociatedEntityHasAssociatedPersonOrScopingOrganization(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Participant Support Associated Entity Has Associated Person Or Scoping Organization}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsParticipantSupportTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Participant Support Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsInFulfillmentOfOrderId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints In Fulfillment Of Order Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsInFulfillmentOfOrder(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints In Fulfillment Of Order}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1AssignedEntityHasNationalProviderIdentifier(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Documentation Of Service Event Performer1 Assigned Entity Has National Provider Identifier}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1AssignedEntityCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Documentation Of Service Event Performer1 Assigned Entity Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1AssignedEntityCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Documentation Of Service Event Performer1 Assigned Entity Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1AssignedEntityId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Documentation Of Service Event Performer1 Assigned Entity Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1FunctionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Documentation Of Service Event Performer1 Function Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1FunctionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Documentation Of Service Event Performer1 Function Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1TypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Documentation Of Service Event Performer1 Type Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1AssignedEntity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Documentation Of Service Event Performer1 Assigned Entity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsDocumentationOfServiceEventEffectiveTimeLow(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Documentation Of Service Event Effective Time Low}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsDocumentationOfServiceEventEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Documentation Of Service Event Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Documentation Of Service Event Performer}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsDocumentationOfServiceEvent(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Documentation Of Service Event}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthorizationConsentCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Authorization Consent Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthorizationConsentId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Authorization Consent Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthorizationConsentStatusCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Authorization Consent Status Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthorizationConsentStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Authorization Consent Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsAuthorizationConsent(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Authorization Consent}
  • + *
+ *

+ * + * @generated + */ + +public class GeneralHeaderConstraintsTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsTypeIdRoot() { + OperationsTestCase validateGeneralHeaderConstraintsTypeIdRootTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsTypeIdRoot", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_TYPE_ID_ROOT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + InfrastructureRootTypeId typeid = CDAFactory.eINSTANCE.createInfrastructureRootTypeId(); + typeid.setRoot("2.16.840.1.113883.1.3"); + typeid.setExtension("POCD_HD000040"); + target.setTypeId(typeid); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsTypeIdRoot( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsTypeIdRootTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsTypeIdExtension() { + OperationsTestCase validateGeneralHeaderConstraintsTypeIdExtensionTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsTypeIdExtension", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_TYPE_ID_EXTENSION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + InfrastructureRootTypeId typeid = CDAFactory.eINSTANCE.createInfrastructureRootTypeId(); + typeid.setRoot("2.16.840.1.113883.1.3"); + typeid.setExtension("POCD_HD000040"); + target.setTypeId(typeid); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsTypeIdExtension( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsTypeIdExtensionTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsSetIdVersionNumber() { + OperationsTestCase validateGeneralHeaderConstraintsSetIdVersionNumberTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsSetIdVersionNumber", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_SET_ID_VERSION_NUMBER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + target.setSetId(DatatypesFactory.eINSTANCE.createII()); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.setVersionNumber(DatatypesFactory.eINSTANCE.createINT()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsSetIdVersionNumber( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsSetIdVersionNumberTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsVersionNumberSetId() { + OperationsTestCase validateGeneralHeaderConstraintsVersionNumberSetIdTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsVersionNumberSetId", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_VERSION_NUMBER_SET_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + target.setVersionNumber(DatatypesFactory.eINSTANCE.createINT()); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.setSetId(DatatypesFactory.eINSTANCE.createII()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsVersionNumberSetId( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsVersionNumberSetIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateGeneralHeaderConstraintsTemplateId() { + OperationsTestCase validateGeneralHeaderConstraintsTemplateIdTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsTemplateId", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsTemplateId( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateGeneralHeaderConstraintsRealmCode() { + OperationsTestCase validateGeneralHeaderConstraintsRealmCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRealmCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_REALM_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRealmCode( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRealmCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsTypeId() { + OperationsTestCase validateGeneralHeaderConstraintsTypeIdTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsTypeId", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_TYPE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + + target.setTypeId(CDAFactory.eINSTANCE.createInfrastructureRootTypeId()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsTypeId( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsTypeIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsId() { + OperationsTestCase validateGeneralHeaderConstraintsIdTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsId", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + target.setId(DatatypesFactory.eINSTANCE.createII()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsId( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsCode() { + OperationsTestCase validateGeneralHeaderConstraintsCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + target.setCode(DatatypesFactory.eINSTANCE.createCE()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsCode( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateGeneralHeaderConstraintsTitle() { + OperationsTestCase validateGeneralHeaderConstraintsTitleTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsTitle", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsTitle( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateGeneralHeaderConstraintsEffectiveTime() { + OperationsTestCase validateGeneralHeaderConstraintsEffectiveTimeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsEffectiveTime( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsConfidentialityCode() { + OperationsTestCase validateGeneralHeaderConstraintsConfidentialityCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsConfidentialityCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_CONFIDENTIALITY_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + + target.setConfidentialityCode(DatatypesFactory.eINSTANCE.createCE("V", "2.16.840.1.113883.5.25")); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsConfidentialityCode( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsConfidentialityCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsLanguageCode() { + OperationsTestCase validateGeneralHeaderConstraintsLanguageCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsLanguageCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_LANGUAGE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + + target.setLanguageCode(DatatypesFactory.eINSTANCE.createCS("value")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsLanguageCode( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsLanguageCodeTestCase.doValidationTest(); + } + + // /** + // * + // * @generated not + // */ + // @Test + // public void testValidateGeneralHeaderConstraintsLanguageCode() { + // OperationsTestCase validateGeneralHeaderConstraintsLanguageCodeTestCase = new + // OperationsTestCase( + // "validateGeneralHeaderConstraintsLanguageCode", + // operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_LANGUAGE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + // objectFactory) { + // + // @Override + // protected void updateToFail(GeneralHeaderConstraints target) { + // + // } + // + // @Override + // protected void updateToPass(GeneralHeaderConstraints target) { + // target.init(); + // target.setLanguageCode(DatatypesFactory.eINSTANCE.createCS()); + // + // } + // + // @Override + // protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + // + // return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsLanguageCode( + // (GeneralHeaderConstraints) objectToTest, diagnostician, map); + // } + // + // }; + // + // validateGeneralHeaderConstraintsLanguageCodeTestCase.doValidationTest(); + // } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsSetId() { + OperationsTestCase validateGeneralHeaderConstraintsSetIdTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsSetId", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_SET_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + target.setSetId(DatatypesFactory.eINSTANCE.createII()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsSetId( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsSetIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsVersionNumber() { + OperationsTestCase validateGeneralHeaderConstraintsVersionNumberTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsVersionNumber", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_VERSION_NUMBER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + target.setVersionNumber(DatatypesFactory.eINSTANCE.createINT()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsVersionNumber( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsVersionNumberTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthor() { + OperationsTestCase validateGeneralHeaderConstraintsAuthorTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthor", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHOR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + target.getAuthors().add(author); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthor( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthorTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsDataEnterer() { + OperationsTestCase validateGeneralHeaderConstraintsDataEntererTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsDataEnterer", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_DATA_ENTERER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + target.setDataEnterer(CDAFactory.eINSTANCE.createDataEnterer()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsDataEnterer( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsDataEntererTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsCustodian() { + OperationsTestCase validateGeneralHeaderConstraintsCustodianTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsCustodian", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_CUSTODIAN__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + target.setCustodian(CDAFactory.eINSTANCE.createCustodian()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsCustodian( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsCustodianTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsInformationRecipient() { + OperationsTestCase validateGeneralHeaderConstraintsInformationRecipientTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsInformationRecipient", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_INFORMATION_RECIPIENT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + target.getInformationRecipients().add(CDAFactory.eINSTANCE.createInformationRecipient()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsInformationRecipient( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsInformationRecipientTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsLegalAuthenticator() { + OperationsTestCase validateGeneralHeaderConstraintsLegalAuthenticatorTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsLegalAuthenticator", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_LEGAL_AUTHENTICATOR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + target.setLegalAuthenticator(CDAFactory.eINSTANCE.createLegalAuthenticator()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsLegalAuthenticator( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsLegalAuthenticatorTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthenticator() { + OperationsTestCase validateGeneralHeaderConstraintsAuthenticatorTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthenticator", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHENTICATOR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + target.getAuthenticators().add(CDAFactory.eINSTANCE.createAuthenticator()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthenticator( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthenticatorTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTarget() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTarget", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + target.getRecordTargets().add(CDAFactory.eINSTANCE.createRecordTarget()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTarget( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsComponentOf() { + OperationsTestCase validateGeneralHeaderConstraintsComponentOfTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsComponentOf", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_COMPONENT_OF__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + target.setComponentOf(CDAFactory.eINSTANCE.createComponent1()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsComponentOf( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsComponentOfTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsInformant() { + OperationsTestCase validateGeneralHeaderConstraintsInformantTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsInformant", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_INFORMANT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + target.getInformants().add(CDAFactory.eINSTANCE.createInformant12()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsInformant( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsInformantTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsSupportParticipant() { + OperationsTestCase validateGeneralHeaderConstraintsSupportParticipantTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsSupportParticipant", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_SUPPORT_PARTICIPANT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + target.getParticipants().add(CDAFactory.eINSTANCE.createParticipant1()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsSupportParticipant( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsSupportParticipantTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsInFulfillmentOf() { + OperationsTestCase validateGeneralHeaderConstraintsInFulfillmentOfTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsInFulfillmentOf", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_IN_FULFILLMENT_OF__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + InFulfillmentOf iff = CDAFactory.eINSTANCE.createInFulfillmentOf(); + target.getInFulfillmentOfs().add(iff); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsInFulfillmentOf( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsInFulfillmentOfTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsDocumentationOf() { + OperationsTestCase validateGeneralHeaderConstraintsDocumentationOfTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsDocumentationOf", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_DOCUMENTATION_OF__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + target.getDocumentationOfs().add(CDAFactory.eINSTANCE.createDocumentationOf()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsDocumentationOf( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsDocumentationOfTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthorization() { + OperationsTestCase validateGeneralHeaderConstraintsAuthorizationTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthorization", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHORIZATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + target.getAuthorizations().add(CDAFactory.eINSTANCE.createAuthorization()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthorization( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthorizationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressStreet() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressStreetTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressStreet", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_US_REALM_ADDRESS_STREET__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + public void addFailTests() { + + addFailTest(new FailTest() { + + @Override + public void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + pr.getAddrs().add(ad); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + pr.getAddrs().add(ad); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + }); + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + pr.getAddrs().add(createUSRealmAddress()); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressStreet( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressStreetTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressCity() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressCityTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressCity", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_US_REALM_ADDRESS_CITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + pr.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + pr.getAddrs().add(createUSRealmAddress()); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressCity( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressCityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressCountry() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressCountryTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressCountry", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_US_REALM_ADDRESS_COUNTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + pr.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + pr.getAddrs().add(createUSRealmAddress()); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressCountry( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressCountryTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressPostalCode() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressPostalCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressPostalCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_US_REALM_ADDRESS_POSTAL_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + pr.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + pr.getAddrs().add(createUSRealmAddress()); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressPostalCode( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressPostalCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressState() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressStateTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressState", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_US_REALM_ADDRESS_STATE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + pr.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + pr.getAddrs().add(createUSRealmAddress()); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressState( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressStateTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressStreetAddressLine() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressStreetAddressLineTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressStreetAddressLine", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_US_REALM_ADDRESS_STREET_ADDRESS_LINE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + pr.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + pr.getAddrs().add(createUSRealmAddress()); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressStreetAddressLine( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressStreetAddressLineTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressUseP() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressUsePTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressUseP", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_US_REALM_ADDRESS_USE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + pr.getAddrs().add(ad); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + ad.getUses().add(PostalAddressUse.HP); + pr.getAddrs().add(ad); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressUseP( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressUsePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressUse() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressUseTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressUse", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_US_REALM_ADDRESS_USE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + ad.getUses().add(null); + pr.getAddrs().add(ad); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + ad.getUses().add(PostalAddressUse.HP); + pr.getAddrs().add(ad); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressUse( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRoleUSRealmAddressUseTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRoleTELUse() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRoleTELUseTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRoleTELUse", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_TEL_USE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + pr.getTelecoms().add(DatatypesFactory.eINSTANCE.createTEL()); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + TEL tel = DatatypesFactory.eINSTANCE.createTEL(); + tel.getUses().add(TelecommunicationAddressUse.HP); + pr.getTelecoms().add(tel); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRoleTELUse( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRoleTELUseTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientUSRealmPatientNameMixedContent() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientUSRealmPatientNameMixedContentTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientUSRealmPatientNameMixedContent", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_US_REALM_PATIENT_NAME_MIXED_CONTENT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient pat = CDAFactory.eINSTANCE.createPatient(); + pr.setPatient(pat); + PN name = DatatypesFactory.eINSTANCE.createPN(); + name.addText("12"); + pat.getNames().add(name); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient pat = CDAFactory.eINSTANCE.createPatient(); + pr.setPatient(pat); + pat.getNames().add(createUSRealmPatientName()); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientUSRealmPatientNameMixedContent( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientUSRealmPatientNameMixedContentTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientUSRealmPatientNameFamily() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientUSRealmPatientNameFamilyTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientUSRealmPatientNameFamily", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_US_REALM_PATIENT_NAME_FAMILY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient pat = CDAFactory.eINSTANCE.createPatient(); + pr.setPatient(pat); + PN name = DatatypesFactory.eINSTANCE.createPN(); + pat.getNames().add(name); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient pat = CDAFactory.eINSTANCE.createPatient(); + pr.setPatient(pat); + pat.getNames().add(createUSRealmPatientName()); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientUSRealmPatientNameFamily( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientUSRealmPatientNameFamilyTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientUSRealmPatientNameGiven() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientUSRealmPatientNameGivenTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientUSRealmPatientNameGiven", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_US_REALM_PATIENT_NAME_GIVEN__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient pat = CDAFactory.eINSTANCE.createPatient(); + pr.setPatient(pat); + PN name = DatatypesFactory.eINSTANCE.createPN(); + pat.getNames().add(name); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient pat = CDAFactory.eINSTANCE.createPatient(); + pr.setPatient(pat); + pat.getNames().add(createUSRealmPatientName()); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientUSRealmPatientNameGiven( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientUSRealmPatientNameGivenTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientUSRealmPatientNamePrefix() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientUSRealmPatientNamePrefixTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientUSRealmPatientNamePrefix", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_US_REALM_PATIENT_NAME_PREFIX__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient pat = CDAFactory.eINSTANCE.createPatient(); + pr.setPatient(pat); + PN name = DatatypesFactory.eINSTANCE.createPN(); + pat.getNames().add(name); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient pat = CDAFactory.eINSTANCE.createPatient(); + pr.setPatient(pat); + pat.getNames().add(createUSRealmPatientName()); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientUSRealmPatientNamePrefix( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientUSRealmPatientNamePrefixTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientUSRealmPatientNameSuffix() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientUSRealmPatientNameSuffixTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientUSRealmPatientNameSuffix", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_US_REALM_PATIENT_NAME_SUFFIX__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient pat = CDAFactory.eINSTANCE.createPatient(); + pr.setPatient(pat); + PN name = DatatypesFactory.eINSTANCE.createPN(); + pat.getNames().add(name); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient pat = CDAFactory.eINSTANCE.createPatient(); + pr.setPatient(pat); + pat.getNames().add(createUSRealmPatientName()); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientUSRealmPatientNameSuffix( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientUSRealmPatientNameSuffixTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientUSRealmPatientNameUseP() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientUSRealmPatientNameUsePTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientUSRealmPatientNameUseP", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_US_REALM_PATIENT_NAME_USE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient pat = CDAFactory.eINSTANCE.createPatient(); + pr.setPatient(pat); + PN name = DatatypesFactory.eINSTANCE.createPN(); + pat.getNames().add(name); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient pat = CDAFactory.eINSTANCE.createPatient(); + pr.setPatient(pat); + pat.getNames().add(createUSRealmPatientName()); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientUSRealmPatientNameUseP( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientUSRealmPatientNameUsePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientUSRealmPatientNameUse() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientUSRealmPatientNameUseTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientUSRealmPatientNameUse", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_US_REALM_PATIENT_NAME_USE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient pat = CDAFactory.eINSTANCE.createPatient(); + pr.setPatient(pat); + PN name = DatatypesFactory.eINSTANCE.createPN(); + name.getUses().add(null); + pat.getNames().add(name); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient pat = CDAFactory.eINSTANCE.createPatient(); + pr.setPatient(pat); + pat.getNames().add(createUSRealmPatientName()); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientUSRealmPatientNameUse( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientUSRealmPatientNameUseTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressStreet() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressStreetTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressStreet", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_GUARDIAN_US_REALM_ADDRESS_STREET__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + public void addFailTests() { + + addFailTest(new FailTest() { + + @Override + public void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient pat = CDAFactory.eINSTANCE.createPatient(); + Guardian guar = CDAFactory.eINSTANCE.createGuardian(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + guar.getAddrs().add(ad); + pat.getGuardians().add(guar); + pr.setPatient(pat); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient pat = CDAFactory.eINSTANCE.createPatient(); + Guardian guar = CDAFactory.eINSTANCE.createGuardian(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + guar.getAddrs().add(ad); + pat.getGuardians().add(guar); + pr.setPatient(pat); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + }); + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient pat = CDAFactory.eINSTANCE.createPatient(); + Guardian guar = CDAFactory.eINSTANCE.createGuardian(); + guar.getAddrs().add(createUSRealmAddress()); + pat.getGuardians().add(guar); + + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressStreet( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressStreetTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressCity() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressCityTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressCity", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_GUARDIAN_US_REALM_ADDRESS_CITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient pat = CDAFactory.eINSTANCE.createPatient(); + Guardian guar = CDAFactory.eINSTANCE.createGuardian(); + guar.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + pat.getGuardians().add(guar); + pr.setPatient(pat); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient pat = CDAFactory.eINSTANCE.createPatient(); + Guardian guar = CDAFactory.eINSTANCE.createGuardian(); + guar.getAddrs().add(createUSRealmAddress()); + pat.getGuardians().add(guar); + + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressCity( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressCityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressCountry() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressCountryTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressCountry", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_GUARDIAN_US_REALM_ADDRESS_COUNTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient pat = CDAFactory.eINSTANCE.createPatient(); + Guardian guar = CDAFactory.eINSTANCE.createGuardian(); + guar.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + pat.getGuardians().add(guar); + pr.setPatient(pat); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient pat = CDAFactory.eINSTANCE.createPatient(); + Guardian guar = CDAFactory.eINSTANCE.createGuardian(); + guar.getAddrs().add(createUSRealmAddress()); + pat.getGuardians().add(guar); + + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressCountry( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressCountryTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressPostalCode() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressPostalCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressPostalCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_GUARDIAN_US_REALM_ADDRESS_POSTAL_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient pat = CDAFactory.eINSTANCE.createPatient(); + Guardian guar = CDAFactory.eINSTANCE.createGuardian(); + guar.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + pat.getGuardians().add(guar); + pr.setPatient(pat); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient pat = CDAFactory.eINSTANCE.createPatient(); + Guardian guar = CDAFactory.eINSTANCE.createGuardian(); + guar.getAddrs().add(createUSRealmAddress()); + pat.getGuardians().add(guar); + + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressPostalCode( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressPostalCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressState() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressStateTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressState", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_GUARDIAN_US_REALM_ADDRESS_STATE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient pat = CDAFactory.eINSTANCE.createPatient(); + Guardian guar = CDAFactory.eINSTANCE.createGuardian(); + guar.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + pat.getGuardians().add(guar); + pr.setPatient(pat); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient pat = CDAFactory.eINSTANCE.createPatient(); + Guardian guar = CDAFactory.eINSTANCE.createGuardian(); + guar.getAddrs().add(createUSRealmAddress()); + pat.getGuardians().add(guar); + + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressState( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressStateTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressStreetAddressLine() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressStreetAddressLineTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressStreetAddressLine", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_GUARDIAN_US_REALM_ADDRESS_STREET_ADDRESS_LINE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient pat = CDAFactory.eINSTANCE.createPatient(); + Guardian guar = CDAFactory.eINSTANCE.createGuardian(); + guar.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + pat.getGuardians().add(guar); + pr.setPatient(pat); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient pat = CDAFactory.eINSTANCE.createPatient(); + Guardian guar = CDAFactory.eINSTANCE.createGuardian(); + guar.getAddrs().add(createUSRealmAddress()); + pat.getGuardians().add(guar); + + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressStreetAddressLine( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressStreetAddressLineTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressUseP() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressUsePTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressUseP", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_GUARDIAN_US_REALM_ADDRESS_USE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient pat = CDAFactory.eINSTANCE.createPatient(); + Guardian guar = CDAFactory.eINSTANCE.createGuardian(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + guar.getAddrs().add(ad); + pat.getGuardians().add(guar); + pr.setPatient(pat); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient pat = CDAFactory.eINSTANCE.createPatient(); + Guardian guar = CDAFactory.eINSTANCE.createGuardian(); + guar.getAddrs().add(createUSRealmAddress()); + pat.getGuardians().add(guar); + + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressUseP( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressUsePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressUse() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressUseTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressUse", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_GUARDIAN_US_REALM_ADDRESS_USE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient pat = CDAFactory.eINSTANCE.createPatient(); + Guardian guar = CDAFactory.eINSTANCE.createGuardian(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + ad.getUses().add(null); + guar.getAddrs().add(ad); + pat.getGuardians().add(guar); + pr.setPatient(pat); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient pat = CDAFactory.eINSTANCE.createPatient(); + Guardian guar = CDAFactory.eINSTANCE.createGuardian(); + guar.getAddrs().add(createUSRealmAddress()); + pat.getGuardians().add(guar); + + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressUse( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianUSRealmAddressUseTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianTELUse() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianTELUseTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianTELUse", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_GUARDIAN_TEL_USE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient pat = CDAFactory.eINSTANCE.createPatient(); + Guardian guar = CDAFactory.eINSTANCE.createGuardian(); + guar.getTelecoms().add(DatatypesFactory.eINSTANCE.createTEL()); + pat.getGuardians().add(guar); + pr.setPatient(pat); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient pat = CDAFactory.eINSTANCE.createPatient(); + Guardian guar = CDAFactory.eINSTANCE.createGuardian(); + TEL tel = DatatypesFactory.eINSTANCE.createTEL(); + tel.getUses().add(TelecommunicationAddressUse.HP); + guar.getTelecoms().add(tel); + pat.getGuardians().add(guar); + + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianTELUse( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianTELUseTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthorAssignedAuthorAuthoringDeviceManufacturerModelName() { + OperationsTestCase validateGeneralHeaderConstraintsAuthorAssignedAuthorAuthoringDeviceManufacturerModelNameTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthorAssignedAuthorAuthoringDeviceManufacturerModelName", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHOR_ASSIGNED_AUTHOR_AUTHORING_DEVICE_MANUFACTURER_MODEL_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + + AuthoringDevice device = CDAFactory.eINSTANCE.createAuthoringDevice(); + + aa.setAssignedAuthoringDevice(device); + + author.setAssignedAuthor(aa); + + target.getAuthors().add(author); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getAuthors().clear(); + + Author author = CDAFactory.eINSTANCE.createAuthor(); + + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + + AuthoringDevice device = CDAFactory.eINSTANCE.createAuthoringDevice(); + + device.setManufacturerModelName(DatatypesFactory.eINSTANCE.createSC()); + aa.setAssignedAuthoringDevice(device); + + author.setAssignedAuthor(aa); + + target.getAuthors().add(author); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthorAssignedAuthorAuthoringDeviceManufacturerModelName( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthorAssignedAuthorAuthoringDeviceManufacturerModelNameTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthorAssignedAuthorAuthoringDeviceSoftwareName() { + OperationsTestCase validateGeneralHeaderConstraintsAuthorAssignedAuthorAuthoringDeviceSoftwareNameTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthorAssignedAuthorAuthoringDeviceSoftwareName", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHOR_ASSIGNED_AUTHOR_AUTHORING_DEVICE_SOFTWARE_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + + AuthoringDevice device = CDAFactory.eINSTANCE.createAuthoringDevice(); + + aa.setAssignedAuthoringDevice(device); + + author.setAssignedAuthor(aa); + + target.getAuthors().add(author); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getAuthors().clear(); + + Author author = CDAFactory.eINSTANCE.createAuthor(); + + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + + AuthoringDevice device = CDAFactory.eINSTANCE.createAuthoringDevice(); + + device.setSoftwareName(DatatypesFactory.eINSTANCE.createSC()); + aa.setAssignedAuthoringDevice(device); + + author.setAssignedAuthor(aa); + + target.getAuthors().add(author); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthorAssignedAuthorAuthoringDeviceSoftwareName( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthorAssignedAuthorAuthoringDeviceSoftwareNameTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthorAssignedAuthorPersonName() { + OperationsTestCase validateGeneralHeaderConstraintsAuthorAssignedAuthorPersonNameTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthorAssignedAuthorPersonName", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHOR_ASSIGNED_AUTHOR_PERSON_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + + Person person = CDAFactory.eINSTANCE.createPerson(); + aa.setAssignedPerson(person); + + author.setAssignedAuthor(aa); + + target.getAuthors().add(author); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + + target.getAuthors().clear(); + + Author author = CDAFactory.eINSTANCE.createAuthor(); + + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + + Person person = CDAFactory.eINSTANCE.createPerson(); + person.getNames().add(DatatypesFactory.eINSTANCE.createPN()); + aa.setAssignedPerson(person); + + author.setAssignedAuthor(aa); + + target.getAuthors().add(author); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthorAssignedAuthorPersonName( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthorAssignedAuthorPersonNameTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthorAssignedAuthorHasAssignedPersonOrAssignedAuthoringDevice() { + OperationsTestCase validateGeneralHeaderConstraintsAuthorAssignedAuthorHasAssignedPersonOrAssignedAuthoringDeviceTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthorAssignedAuthorHasAssignedPersonOrAssignedAuthoringDevice", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHOR_ASSIGNED_AUTHOR_HAS_ASSIGNED_PERSON_OR_ASSIGNED_AUTHORING_DEVICE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + /* + * (non-Javadoc) + * + * @see org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest.OperationsTestCase#addFailTests() + */ + @Override + public void addFailTests() { + + addFailTest(new FailTest() { + + @Override + public void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + author.setAssignedAuthor(aa); + target.getAuthors().add(author); + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + author.setAssignedAuthor(aa); + aa.setAssignedAuthoringDevice(CDAFactory.eINSTANCE.createAuthoringDevice()); + aa.setAssignedPerson(CDAFactory.eINSTANCE.createPerson()); + target.getAuthors().add(author); + } + }); + + } + + /* + * (non-Javadoc) + * + * @see org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest.OperationsTestCase#addPassTests() + */ + @Override + public void addPassTests() { + + addPassTest(new PassTest() { + + @Override + public void updateToPass(GeneralHeaderConstraints target) { + target.init(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + author.setAssignedAuthor(aa); + aa.setAssignedPerson(CDAFactory.eINSTANCE.createPerson()); + target.getAuthors().add(author); + } + } + + ); + + addPassTest(new PassTest() { + + @Override + public void updateToPass(GeneralHeaderConstraints target) { + target.init(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + author.setAssignedAuthor(aa); + aa.setAssignedAuthoringDevice(CDAFactory.eINSTANCE.createAuthoringDevice()); + target.getAuthors().add(author); + } + } + + ); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthorAssignedAuthorHasAssignedPersonOrAssignedAuthoringDevice( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthorAssignedAuthorHasAssignedPersonOrAssignedAuthoringDeviceTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthorAssignedAuthorHasNationalProviderIdentifier() { + OperationsTestCase validateGeneralHeaderConstraintsAuthorAssignedAuthorHasNationalProviderIdentifierTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthorAssignedAuthorHasNationalProviderIdentifier", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHOR_ASSIGNED_AUTHOR_HAS_NATIONAL_PROVIDER_IDENTIFIER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + target.init(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + aa.getIds().add(DatatypesFactory.eINSTANCE.createII("111111")); + + author.setAssignedAuthor(aa); + aa.setAssignedPerson(CDAFactory.eINSTANCE.createPerson()); + target.getAuthors().add(author); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + + target.getAuthors().clear(); + + Author author = CDAFactory.eINSTANCE.createAuthor(); + + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + + aa.getIds().add(DatatypesFactory.eINSTANCE.createII("2.16.840.1.113883.4.6")); + + author.setAssignedAuthor(aa); + + target.getAuthors().add(author); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthorAssignedAuthorHasNationalProviderIdentifier( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthorAssignedAuthorHasNationalProviderIdentifierTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthorAssignedAuthorAddr() { + OperationsTestCase validateGeneralHeaderConstraintsAuthorAssignedAuthorAddrTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthorAssignedAuthorAddr", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHOR_ASSIGNED_AUTHOR_ADDR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + + author.setAssignedAuthor(aa); + + target.getAuthors().add(author); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getAuthors().clear(); + + Author author = CDAFactory.eINSTANCE.createAuthor(); + + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + + aa.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + author.setAssignedAuthor(aa); + + target.getAuthors().add(author); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthorAssignedAuthorAddr( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthorAssignedAuthorAddrTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthorAssignedAuthorCode() { + OperationsTestCase validateGeneralHeaderConstraintsAuthorAssignedAuthorCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthorAssignedAuthorCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHOR_ASSIGNED_AUTHOR_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + + author.setAssignedAuthor(aa); + + target.getAuthors().add(author); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getAuthors().clear(); + + Author author = CDAFactory.eINSTANCE.createAuthor(); + + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + CE ce = DatatypesFactory.eINSTANCE.createCE("test", "2.16.840.1.113883.6.101"); + + aa.setCode(ce); + author.setAssignedAuthor(aa); + + target.getAuthors().add(author); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthorAssignedAuthorCode( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthorAssignedAuthorCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthorAssignedAuthorCodeP() { + OperationsTestCase validateGeneralHeaderConstraintsAuthorAssignedAuthorCodePTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthorAssignedAuthorCodeP", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHOR_ASSIGNED_AUTHOR_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + + author.setAssignedAuthor(aa); + + target.getAuthors().add(author); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getAuthors().clear(); + + Author author = CDAFactory.eINSTANCE.createAuthor(); + + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + CE ce = DatatypesFactory.eINSTANCE.createCE(); + ce.setCodeSystem("2.16.840.1.113883.6.101"); + + aa.setCode(ce); + author.setAssignedAuthor(aa); + + target.getAuthors().add(author); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthorAssignedAuthorCodeP( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthorAssignedAuthorCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthorAssignedAuthorId() { + OperationsTestCase validateGeneralHeaderConstraintsAuthorAssignedAuthorIdTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthorAssignedAuthorId", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHOR_ASSIGNED_AUTHOR_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + + author.setAssignedAuthor(aa); + + target.getAuthors().add(author); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getAuthors().clear(); + + Author author = CDAFactory.eINSTANCE.createAuthor(); + + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + + aa.getIds().add(DatatypesFactory.eINSTANCE.createII()); + + author.setAssignedAuthor(aa); + + target.getAuthors().add(author); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthorAssignedAuthorId( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthorAssignedAuthorIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthorAssignedAuthorTelecom() { + OperationsTestCase validateGeneralHeaderConstraintsAuthorAssignedAuthorTelecomTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthorAssignedAuthorTelecom", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHOR_ASSIGNED_AUTHOR_TELECOM__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + target.init(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + + author.setAssignedAuthor(aa); + + target.getAuthors().add(author); + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + + target.getAuthors().clear(); + + Author author = CDAFactory.eINSTANCE.createAuthor(); + + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + + aa.getTelecoms().add(DatatypesFactory.eINSTANCE.createTEL()); + author.setAssignedAuthor(aa); + + target.getAuthors().add(author); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthorAssignedAuthorTelecom( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthorAssignedAuthorTelecomTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthorAssignedAuthorAssignedAuthoringDevice() { + OperationsTestCase validateGeneralHeaderConstraintsAuthorAssignedAuthorAssignedAuthoringDeviceTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthorAssignedAuthorAssignedAuthoringDevice", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHOR_ASSIGNED_AUTHOR_ASSIGNED_AUTHORING_DEVICE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + target.init(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + + author.setAssignedAuthor(aa); + + target.getAuthors().add(author); + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + + target.getAuthors().clear(); + + Author author = CDAFactory.eINSTANCE.createAuthor(); + + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + + aa.setAssignedAuthoringDevice(CDAFactory.eINSTANCE.createAuthoringDevice()); + author.setAssignedAuthor(aa); + + target.getAuthors().add(author); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthorAssignedAuthorAssignedAuthoringDevice( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthorAssignedAuthorAssignedAuthoringDeviceTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthorAssignedAuthorAssignedPerson() { + OperationsTestCase validateGeneralHeaderConstraintsAuthorAssignedAuthorAssignedPersonTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthorAssignedAuthorAssignedPerson", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHOR_ASSIGNED_AUTHOR_ASSIGNED_PERSON__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Author a = CDAFactory.eINSTANCE.createAuthor(); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + + a.setAssignedAuthor(aa); + target.getAuthors().add(a); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getAuthors().clear(); + Author a = CDAFactory.eINSTANCE.createAuthor(); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + Person ap = CDAFactory.eINSTANCE.createPerson(); + aa.setAssignedPerson(ap); + a.setAssignedAuthor(aa); + target.getAuthors().add(a); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthorAssignedAuthorAssignedPerson( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthorAssignedAuthorAssignedPersonTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthorTime() { + OperationsTestCase validateGeneralHeaderConstraintsAuthorTimeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthorTime", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHOR_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + target.getAuthors().add(CDAFactory.eINSTANCE.createAuthor()); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getAuthors().clear(); + Author a = CDAFactory.eINSTANCE.createAuthor(); + a.setTime(DatatypesFactory.eINSTANCE.createTS()); + target.getAuthors().add(a); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthorTime( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthorTimeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthorAssignedAuthor() { + OperationsTestCase validateGeneralHeaderConstraintsAuthorAssignedAuthorTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthorAssignedAuthor", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHOR_ASSIGNED_AUTHOR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + + Author author = CDAFactory.eINSTANCE.createAuthor(); + + target.getAuthors().add(author); + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + + target.getAuthors().clear(); + + Author author = CDAFactory.eINSTANCE.createAuthor(); + + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + + author.setAssignedAuthor(aa); + + target.getAuthors().add(author); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthorAssignedAuthor( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthorAssignedAuthorTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressStreet() { + OperationsTestCase validateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressStreetTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressStreet", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_DATA_ENTERER_ASSIGNED_ENTITY_US_REALM_ADDRESS_STREET__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + public void addFailTests() { + + addFailTest(new FailTest() { + + @Override + public void updateToFail(GeneralHeaderConstraints target) { + target.init(); + DataEnterer de = CDAFactory.eINSTANCE.createDataEnterer(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ae.getAddrs().add(ad); + de.setAssignedEntity(ae); + target.setDataEnterer(de); + + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(GeneralHeaderConstraints target) { + target.init(); + DataEnterer de = CDAFactory.eINSTANCE.createDataEnterer(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + + ae.getAddrs().add(ad); + de.setAssignedEntity(ae); + target.setDataEnterer(de); + } + }); + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + DataEnterer de = CDAFactory.eINSTANCE.createDataEnterer(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(createUSRealmAddress()); + de.setAssignedEntity(ae); + target.setDataEnterer(de); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressStreet( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressStreetTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressCity() { + OperationsTestCase validateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressCityTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressCity", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_DATA_ENTERER_ASSIGNED_ENTITY_US_REALM_ADDRESS_CITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + DataEnterer de = CDAFactory.eINSTANCE.createDataEnterer(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + de.setAssignedEntity(ae); + target.setDataEnterer(de); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + DataEnterer de = CDAFactory.eINSTANCE.createDataEnterer(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(createUSRealmAddress()); + de.setAssignedEntity(ae); + target.setDataEnterer(de); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressCity( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressCityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressCountry() { + OperationsTestCase validateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressCountryTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressCountry", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_DATA_ENTERER_ASSIGNED_ENTITY_US_REALM_ADDRESS_COUNTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + DataEnterer de = CDAFactory.eINSTANCE.createDataEnterer(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + de.setAssignedEntity(ae); + target.setDataEnterer(de); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + DataEnterer de = CDAFactory.eINSTANCE.createDataEnterer(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(createUSRealmAddress()); + de.setAssignedEntity(ae); + target.setDataEnterer(de); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressCountry( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressCountryTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressPostalCode() { + OperationsTestCase validateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressPostalCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressPostalCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_DATA_ENTERER_ASSIGNED_ENTITY_US_REALM_ADDRESS_POSTAL_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + DataEnterer de = CDAFactory.eINSTANCE.createDataEnterer(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + de.setAssignedEntity(ae); + target.setDataEnterer(de); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + DataEnterer de = CDAFactory.eINSTANCE.createDataEnterer(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(createUSRealmAddress()); + de.setAssignedEntity(ae); + target.setDataEnterer(de); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressPostalCode( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressPostalCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressState() { + OperationsTestCase validateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressStateTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressState", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_DATA_ENTERER_ASSIGNED_ENTITY_US_REALM_ADDRESS_STATE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + DataEnterer de = CDAFactory.eINSTANCE.createDataEnterer(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + de.setAssignedEntity(ae); + target.setDataEnterer(de); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + DataEnterer de = CDAFactory.eINSTANCE.createDataEnterer(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(createUSRealmAddress()); + de.setAssignedEntity(ae); + target.setDataEnterer(de); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressState( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressStateTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressStreetAddressLine() { + OperationsTestCase validateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressStreetAddressLineTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressStreetAddressLine", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_DATA_ENTERER_ASSIGNED_ENTITY_US_REALM_ADDRESS_STREET_ADDRESS_LINE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + DataEnterer de = CDAFactory.eINSTANCE.createDataEnterer(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + de.setAssignedEntity(ae); + target.setDataEnterer(de); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + DataEnterer de = CDAFactory.eINSTANCE.createDataEnterer(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(createUSRealmAddress()); + de.setAssignedEntity(ae); + target.setDataEnterer(de); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressStreetAddressLine( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressStreetAddressLineTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressUseP() { + OperationsTestCase validateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressUsePTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressUseP", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_DATA_ENTERER_ASSIGNED_ENTITY_US_REALM_ADDRESS_USE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + DataEnterer de = CDAFactory.eINSTANCE.createDataEnterer(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + + ae.getAddrs().add(ad); + de.setAssignedEntity(ae); + target.setDataEnterer(de); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + DataEnterer de = CDAFactory.eINSTANCE.createDataEnterer(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(createUSRealmAddress()); + de.setAssignedEntity(ae); + target.setDataEnterer(de); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressUseP( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressUsePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressUse() { + OperationsTestCase validateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressUseTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressUse", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_DATA_ENTERER_ASSIGNED_ENTITY_US_REALM_ADDRESS_USE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + DataEnterer de = CDAFactory.eINSTANCE.createDataEnterer(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + ad.getUses().add(null); + ae.getAddrs().add(ad); + de.setAssignedEntity(ae); + target.setDataEnterer(de); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + DataEnterer de = CDAFactory.eINSTANCE.createDataEnterer(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(createUSRealmAddress()); + de.setAssignedEntity(ae); + target.setDataEnterer(de); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressUse( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsDataEntererAssignedEntityUSRealmAddressUseTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsDataEntererAssignedEntityTELUse() { + OperationsTestCase validateGeneralHeaderConstraintsDataEntererAssignedEntityTELUseTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsDataEntererAssignedEntityTELUse", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_DATA_ENTERER_ASSIGNED_ENTITY_TEL_USE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + DataEnterer de = CDAFactory.eINSTANCE.createDataEnterer(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getTelecoms().add(DatatypesFactory.eINSTANCE.createTEL()); + de.setAssignedEntity(ae); + target.setDataEnterer(de); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + DataEnterer de = CDAFactory.eINSTANCE.createDataEnterer(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + TEL tel = DatatypesFactory.eINSTANCE.createTEL(); + tel.getUses().add(TelecommunicationAddressUse.HP); + ae.getTelecoms().add(tel); + de.setAssignedEntity(ae); + target.setDataEnterer(de); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsDataEntererAssignedEntityTELUse( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsDataEntererAssignedEntityTELUseTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsDataEntererAssignedEntityPersonName() { + OperationsTestCase validateGeneralHeaderConstraintsDataEntererAssignedEntityPersonNameTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsDataEntererAssignedEntityPersonName", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_DATA_ENTERER_ASSIGNED_ENTITY_PERSON_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + DataEnterer de = CDAFactory.eINSTANCE.createDataEnterer(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + Person person = CDAFactory.eINSTANCE.createPerson(); + ae.setAssignedPerson(person); + de.setAssignedEntity(ae); + target.setDataEnterer(de); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + DataEnterer de = CDAFactory.eINSTANCE.createDataEnterer(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + Person person = CDAFactory.eINSTANCE.createPerson(); + person.getNames().add(DatatypesFactory.eINSTANCE.createPN()); + ae.setAssignedPerson(person); + de.setAssignedEntity(ae); + target.setDataEnterer(de); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsDataEntererAssignedEntityPersonName( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsDataEntererAssignedEntityPersonNameTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsDataEntererAssignedEntityHasNationalProviderIdentifier() { + OperationsTestCase validateGeneralHeaderConstraintsDataEntererAssignedEntityHasNationalProviderIdentifierTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsDataEntererAssignedEntityHasNationalProviderIdentifier", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_DATA_ENTERER_ASSIGNED_ENTITY_HAS_NATIONAL_PROVIDER_IDENTIFIER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + DataEnterer de = CDAFactory.eINSTANCE.createDataEnterer(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + de.setAssignedEntity(ae); + + target.setDataEnterer(de); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getDataEnterer().getAssignedEntity().getIds().add( + DatatypesFactory.eINSTANCE.createII("2.16.840.1.113883.4.6")); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsDataEntererAssignedEntityHasNationalProviderIdentifier( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsDataEntererAssignedEntityHasNationalProviderIdentifierTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsDataEntererAssignedEntityAddr() { + OperationsTestCase validateGeneralHeaderConstraintsDataEntererAssignedEntityAddrTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsDataEntererAssignedEntityAddr", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_DATA_ENTERER_ASSIGNED_ENTITY_ADDR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + DataEnterer de = CDAFactory.eINSTANCE.createDataEnterer(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + de.setAssignedEntity(ae); + target.setDataEnterer(de); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getDataEnterer().getAssignedEntity().getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsDataEntererAssignedEntityAddr( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsDataEntererAssignedEntityAddrTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsDataEntererAssignedEntityCode() { + OperationsTestCase validateGeneralHeaderConstraintsDataEntererAssignedEntityCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsDataEntererAssignedEntityCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_DATA_ENTERER_ASSIGNED_ENTITY_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + DataEnterer de = CDAFactory.eINSTANCE.createDataEnterer(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + de.setAssignedEntity(ae); + + target.setDataEnterer(de); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getDataEnterer().getAssignedEntity().setCode( + DatatypesFactory.eINSTANCE.createCE("", "2.16.840.1.113883.6.101")); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsDataEntererAssignedEntityCode( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsDataEntererAssignedEntityCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsDataEntererAssignedEntityCodeP() { + OperationsTestCase validateGeneralHeaderConstraintsDataEntererAssignedEntityCodePTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsDataEntererAssignedEntityCodeP", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_DATA_ENTERER_ASSIGNED_ENTITY_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + DataEnterer de = CDAFactory.eINSTANCE.createDataEnterer(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + de.setAssignedEntity(ae); + + target.setDataEnterer(de); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getDataEnterer().getAssignedEntity().setCode( + DatatypesFactory.eINSTANCE.createCE("", "2.16.840.1.113883.6.101")); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsDataEntererAssignedEntityCodeP( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsDataEntererAssignedEntityCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsDataEntererAssignedEntityId() { + OperationsTestCase validateGeneralHeaderConstraintsDataEntererAssignedEntityIdTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsDataEntererAssignedEntityId", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_DATA_ENTERER_ASSIGNED_ENTITY_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + DataEnterer de = CDAFactory.eINSTANCE.createDataEnterer(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + de.setAssignedEntity(ae); + target.setDataEnterer(de); + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getDataEnterer().getAssignedEntity().getIds().add(DatatypesFactory.eINSTANCE.createII()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsDataEntererAssignedEntityId( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsDataEntererAssignedEntityIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsDataEntererAssignedEntityTelecom() { + OperationsTestCase validateGeneralHeaderConstraintsDataEntererAssignedEntityTelecomTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsDataEntererAssignedEntityTelecom", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_DATA_ENTERER_ASSIGNED_ENTITY_TELECOM__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + DataEnterer de = CDAFactory.eINSTANCE.createDataEnterer(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + de.setAssignedEntity(ae); + + target.setDataEnterer(de); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getDataEnterer().getAssignedEntity().getTelecoms().add(DatatypesFactory.eINSTANCE.createTEL()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsDataEntererAssignedEntityTelecom( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsDataEntererAssignedEntityTelecomTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsDataEntererAssignedEntityAssignedPerson() { + OperationsTestCase validateGeneralHeaderConstraintsDataEntererAssignedEntityAssignedPersonTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsDataEntererAssignedEntityAssignedPerson", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_DATA_ENTERER_ASSIGNED_ENTITY_ASSIGNED_PERSON__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + DataEnterer de = CDAFactory.eINSTANCE.createDataEnterer(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + de.setAssignedEntity(ae); + + target.setDataEnterer(de); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + DataEnterer de = CDAFactory.eINSTANCE.createDataEnterer(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.setAssignedPerson(CDAFactory.eINSTANCE.createPerson()); + de.setAssignedEntity(ae); + + target.setDataEnterer(de); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsDataEntererAssignedEntityAssignedPerson( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsDataEntererAssignedEntityAssignedPersonTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + // @Test + // public void testValidateGeneralHeaderConstraintsDataEntererAssignedEntityAssignedPerson() { + // OperationsTestCase validateGeneralHeaderConstraintsDataEntererAssignedEntityAssignedPersonTestCase = new + // OperationsTestCase( + // "validateGeneralHeaderConstraintsDataEntererAssignedEntityAssignedPerson", + // operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_DATA_ENTERER_ASSIGNED_ENTITY_ASSIGNED_PERSON__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + // objectFactory) { + // + // @Override + // protected void updateToFail(GeneralHeaderConstraints target) { + // + // target.init(); + // DataEnterer de = CDAFactory.eINSTANCE.createDataEnterer(); + // AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + // de.setAssignedEntity(ae); + // + // target.setDataEnterer(de); + // + // } + // + // @Override + // protected void updateToPass(GeneralHeaderConstraints target) { + // Person person = CDAFactory.eINSTANCE.createPerson(); + // target.getDataEnterer().getAssignedEntity().setAssignedPerson(person); + // + // } + // + // @Override + // protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + // + // return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsDataEntererAssignedEntityAssignedPerson( + // (GeneralHeaderConstraints) objectToTest, diagnostician, map); + // } + // + // }; + // + // validateGeneralHeaderConstraintsDataEntererAssignedEntityAssignedPersonTestCase.doValidationTest(); + // } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsDataEntererAssignedEntity() { + OperationsTestCase validateGeneralHeaderConstraintsDataEntererAssignedEntityTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsDataEntererAssignedEntity", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_DATA_ENTERER_ASSIGNED_ENTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + DataEnterer de = CDAFactory.eINSTANCE.createDataEnterer(); + + target.setDataEnterer(de); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + DataEnterer de = CDAFactory.eINSTANCE.createDataEnterer(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + de.setAssignedEntity(ae); + + target.setDataEnterer(de); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsDataEntererAssignedEntity( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsDataEntererAssignedEntityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressStreet() { + OperationsTestCase validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressStreetTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressStreet", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_CUSTODIAN_ASSIGNED_CUSTODIAN_CUSTODIAN_ORGANIZATION_US_REALM_ADDRESS_STREET__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + public void addFailTests() { + + addFailTest(new FailTest() { + + @Override + public void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Custodian cust = CDAFactory.eINSTANCE.createCustodian(); + AssignedCustodian ac = CDAFactory.eINSTANCE.createAssignedCustodian(); + CustodianOrganization org = CDAFactory.eINSTANCE.createCustodianOrganization(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + org.setAddr(ad); + ac.setRepresentedCustodianOrganization(org); + cust.setAssignedCustodian(ac); + target.setCustodian(cust); + + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Custodian cust = CDAFactory.eINSTANCE.createCustodian(); + AssignedCustodian ac = CDAFactory.eINSTANCE.createAssignedCustodian(); + CustodianOrganization org = CDAFactory.eINSTANCE.createCustodianOrganization(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + + org.setAddr(ad); + ac.setRepresentedCustodianOrganization(org); + cust.setAssignedCustodian(ac); + target.setCustodian(cust); + } + }); + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + Custodian cust = CDAFactory.eINSTANCE.createCustodian(); + AssignedCustodian ac = CDAFactory.eINSTANCE.createAssignedCustodian(); + CustodianOrganization org = CDAFactory.eINSTANCE.createCustodianOrganization(); + org.setAddr(createUSRealmAddress()); + ac.setRepresentedCustodianOrganization(org); + cust.setAssignedCustodian(ac); + target.setCustodian(cust); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressStreet( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressStreetTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressCity() { + OperationsTestCase validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressCityTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressCity", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_CUSTODIAN_ASSIGNED_CUSTODIAN_CUSTODIAN_ORGANIZATION_US_REALM_ADDRESS_CITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Custodian cust = CDAFactory.eINSTANCE.createCustodian(); + AssignedCustodian ac = CDAFactory.eINSTANCE.createAssignedCustodian(); + CustodianOrganization org = CDAFactory.eINSTANCE.createCustodianOrganization(); + org.setAddr(DatatypesFactory.eINSTANCE.createAD()); + ac.setRepresentedCustodianOrganization(org); + cust.setAssignedCustodian(ac); + target.setCustodian(cust); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + Custodian cust = CDAFactory.eINSTANCE.createCustodian(); + AssignedCustodian ac = CDAFactory.eINSTANCE.createAssignedCustodian(); + CustodianOrganization org = CDAFactory.eINSTANCE.createCustodianOrganization(); + org.setAddr(createUSRealmAddress()); + ac.setRepresentedCustodianOrganization(org); + cust.setAssignedCustodian(ac); + target.setCustodian(cust); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressCity( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressCityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressCountry() { + OperationsTestCase validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressCountryTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressCountry", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_CUSTODIAN_ASSIGNED_CUSTODIAN_CUSTODIAN_ORGANIZATION_US_REALM_ADDRESS_COUNTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Custodian cust = CDAFactory.eINSTANCE.createCustodian(); + AssignedCustodian ac = CDAFactory.eINSTANCE.createAssignedCustodian(); + CustodianOrganization org = CDAFactory.eINSTANCE.createCustodianOrganization(); + org.setAddr(DatatypesFactory.eINSTANCE.createAD()); + ac.setRepresentedCustodianOrganization(org); + cust.setAssignedCustodian(ac); + target.setCustodian(cust); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + Custodian cust = CDAFactory.eINSTANCE.createCustodian(); + AssignedCustodian ac = CDAFactory.eINSTANCE.createAssignedCustodian(); + CustodianOrganization org = CDAFactory.eINSTANCE.createCustodianOrganization(); + org.setAddr(createUSRealmAddress()); + ac.setRepresentedCustodianOrganization(org); + cust.setAssignedCustodian(ac); + target.setCustodian(cust); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressCountry( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressCountryTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressPostalCode() { + OperationsTestCase validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressPostalCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressPostalCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_CUSTODIAN_ASSIGNED_CUSTODIAN_CUSTODIAN_ORGANIZATION_US_REALM_ADDRESS_POSTAL_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Custodian cust = CDAFactory.eINSTANCE.createCustodian(); + AssignedCustodian ac = CDAFactory.eINSTANCE.createAssignedCustodian(); + CustodianOrganization org = CDAFactory.eINSTANCE.createCustodianOrganization(); + org.setAddr(DatatypesFactory.eINSTANCE.createAD()); + ac.setRepresentedCustodianOrganization(org); + cust.setAssignedCustodian(ac); + target.setCustodian(cust); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + Custodian cust = CDAFactory.eINSTANCE.createCustodian(); + AssignedCustodian ac = CDAFactory.eINSTANCE.createAssignedCustodian(); + CustodianOrganization org = CDAFactory.eINSTANCE.createCustodianOrganization(); + org.setAddr(createUSRealmAddress()); + ac.setRepresentedCustodianOrganization(org); + cust.setAssignedCustodian(ac); + target.setCustodian(cust); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressPostalCode( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressPostalCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressState() { + OperationsTestCase validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressStateTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressState", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_CUSTODIAN_ASSIGNED_CUSTODIAN_CUSTODIAN_ORGANIZATION_US_REALM_ADDRESS_STATE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Custodian cust = CDAFactory.eINSTANCE.createCustodian(); + AssignedCustodian ac = CDAFactory.eINSTANCE.createAssignedCustodian(); + CustodianOrganization org = CDAFactory.eINSTANCE.createCustodianOrganization(); + org.setAddr(DatatypesFactory.eINSTANCE.createAD()); + ac.setRepresentedCustodianOrganization(org); + cust.setAssignedCustodian(ac); + target.setCustodian(cust); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + Custodian cust = CDAFactory.eINSTANCE.createCustodian(); + AssignedCustodian ac = CDAFactory.eINSTANCE.createAssignedCustodian(); + CustodianOrganization org = CDAFactory.eINSTANCE.createCustodianOrganization(); + org.setAddr(createUSRealmAddress()); + ac.setRepresentedCustodianOrganization(org); + cust.setAssignedCustodian(ac); + target.setCustodian(cust); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressState( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressStateTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressStreetAddressLine() { + OperationsTestCase validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressStreetAddressLineTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressStreetAddressLine", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_CUSTODIAN_ASSIGNED_CUSTODIAN_CUSTODIAN_ORGANIZATION_US_REALM_ADDRESS_STREET_ADDRESS_LINE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Custodian cust = CDAFactory.eINSTANCE.createCustodian(); + AssignedCustodian ac = CDAFactory.eINSTANCE.createAssignedCustodian(); + CustodianOrganization org = CDAFactory.eINSTANCE.createCustodianOrganization(); + org.setAddr(DatatypesFactory.eINSTANCE.createAD()); + ac.setRepresentedCustodianOrganization(org); + cust.setAssignedCustodian(ac); + target.setCustodian(cust); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + Custodian cust = CDAFactory.eINSTANCE.createCustodian(); + AssignedCustodian ac = CDAFactory.eINSTANCE.createAssignedCustodian(); + CustodianOrganization org = CDAFactory.eINSTANCE.createCustodianOrganization(); + org.setAddr(createUSRealmAddress()); + ac.setRepresentedCustodianOrganization(org); + cust.setAssignedCustodian(ac); + target.setCustodian(cust); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressStreetAddressLine( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressStreetAddressLineTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressUseP() { + OperationsTestCase validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressUsePTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressUseP", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_CUSTODIAN_ASSIGNED_CUSTODIAN_CUSTODIAN_ORGANIZATION_US_REALM_ADDRESS_USE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Custodian cust = CDAFactory.eINSTANCE.createCustodian(); + AssignedCustodian ac = CDAFactory.eINSTANCE.createAssignedCustodian(); + CustodianOrganization org = CDAFactory.eINSTANCE.createCustodianOrganization(); + org.setAddr(DatatypesFactory.eINSTANCE.createAD()); + ac.setRepresentedCustodianOrganization(org); + cust.setAssignedCustodian(ac); + target.setCustodian(cust); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + Custodian cust = CDAFactory.eINSTANCE.createCustodian(); + AssignedCustodian ac = CDAFactory.eINSTANCE.createAssignedCustodian(); + CustodianOrganization org = CDAFactory.eINSTANCE.createCustodianOrganization(); + org.setAddr(createUSRealmAddress()); + ac.setRepresentedCustodianOrganization(org); + cust.setAssignedCustodian(ac); + target.setCustodian(cust); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressUseP( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressUsePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressUse() { + OperationsTestCase validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressUseTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressUse", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_CUSTODIAN_ASSIGNED_CUSTODIAN_CUSTODIAN_ORGANIZATION_US_REALM_ADDRESS_USE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Custodian cust = CDAFactory.eINSTANCE.createCustodian(); + AssignedCustodian ac = CDAFactory.eINSTANCE.createAssignedCustodian(); + CustodianOrganization org = CDAFactory.eINSTANCE.createCustodianOrganization(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + ad.getUses().add(null); + org.setAddr(ad); + ac.setRepresentedCustodianOrganization(org); + cust.setAssignedCustodian(ac); + target.setCustodian(cust); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + Custodian cust = CDAFactory.eINSTANCE.createCustodian(); + AssignedCustodian ac = CDAFactory.eINSTANCE.createAssignedCustodian(); + CustodianOrganization org = CDAFactory.eINSTANCE.createCustodianOrganization(); + org.setAddr(createUSRealmAddress()); + ac.setRepresentedCustodianOrganization(org); + cust.setAssignedCustodian(ac); + target.setCustodian(cust); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressUse( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationUSRealmAddressUseTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationTELUse() { + OperationsTestCase validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationTELUseTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationTELUse", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_CUSTODIAN_ASSIGNED_CUSTODIAN_CUSTODIAN_ORGANIZATION_TEL_USE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Custodian cust = CDAFactory.eINSTANCE.createCustodian(); + AssignedCustodian ac = CDAFactory.eINSTANCE.createAssignedCustodian(); + CustodianOrganization org = CDAFactory.eINSTANCE.createCustodianOrganization(); + org.setTelecom(DatatypesFactory.eINSTANCE.createTEL()); + ac.setRepresentedCustodianOrganization(org); + cust.setAssignedCustodian(ac); + target.setCustodian(cust); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + Custodian cust = CDAFactory.eINSTANCE.createCustodian(); + AssignedCustodian ac = CDAFactory.eINSTANCE.createAssignedCustodian(); + CustodianOrganization org = CDAFactory.eINSTANCE.createCustodianOrganization(); + TEL tel = DatatypesFactory.eINSTANCE.createTEL(); + tel.getUses().add(TelecommunicationAddressUse.HP); + org.setTelecom(tel); + ac.setRepresentedCustodianOrganization(org); + cust.setAssignedCustodian(ac); + target.setCustodian(cust); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationTELUse( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationTELUseTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationHasNationalProviderIdentifier() { + OperationsTestCase validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationHasNationalProviderIdentifierTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationHasNationalProviderIdentifier", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_CUSTODIAN_ASSIGNED_CUSTODIAN_CUSTODIAN_ORGANIZATION_HAS_NATIONAL_PROVIDER_IDENTIFIER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Custodian custodian = CDAFactory.eINSTANCE.createCustodian(); + AssignedCustodian ac = CDAFactory.eINSTANCE.createAssignedCustodian(); + CustodianOrganization organization = CDAFactory.eINSTANCE.createCustodianOrganization(); + ac.setRepresentedCustodianOrganization(organization); + custodian.setAssignedCustodian(ac); + target.setCustodian(custodian); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getCustodian().getAssignedCustodian().getRepresentedCustodianOrganization().getIds().add( + DatatypesFactory.eINSTANCE.createII("2.16.840.1.113883.4.6")); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationHasNationalProviderIdentifier( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationHasNationalProviderIdentifierTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationAddr() { + OperationsTestCase validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationAddrTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationAddr", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_CUSTODIAN_ASSIGNED_CUSTODIAN_CUSTODIAN_ORGANIZATION_ADDR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Custodian custodian = CDAFactory.eINSTANCE.createCustodian(); + AssignedCustodian ac = CDAFactory.eINSTANCE.createAssignedCustodian(); + CustodianOrganization organization = CDAFactory.eINSTANCE.createCustodianOrganization(); + ac.setRepresentedCustodianOrganization(organization); + custodian.setAssignedCustodian(ac); + target.setCustodian(custodian); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getCustodian().getAssignedCustodian().getRepresentedCustodianOrganization().setAddr( + DatatypesFactory.eINSTANCE.createAD()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationAddr( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationAddrTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationId() { + OperationsTestCase validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationIdTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationId", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_CUSTODIAN_ASSIGNED_CUSTODIAN_CUSTODIAN_ORGANIZATION_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Custodian custodian = CDAFactory.eINSTANCE.createCustodian(); + AssignedCustodian ac = CDAFactory.eINSTANCE.createAssignedCustodian(); + CustodianOrganization organization = CDAFactory.eINSTANCE.createCustodianOrganization(); + ac.setRepresentedCustodianOrganization(organization); + custodian.setAssignedCustodian(ac); + target.setCustodian(custodian); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getCustodian().getAssignedCustodian().getRepresentedCustodianOrganization().getIds().add( + DatatypesFactory.eINSTANCE.createII()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationId( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationName() { + OperationsTestCase validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationNameTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationName", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_CUSTODIAN_ASSIGNED_CUSTODIAN_CUSTODIAN_ORGANIZATION_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Custodian custodian = CDAFactory.eINSTANCE.createCustodian(); + AssignedCustodian ac = CDAFactory.eINSTANCE.createAssignedCustodian(); + CustodianOrganization organization = CDAFactory.eINSTANCE.createCustodianOrganization(); + ac.setRepresentedCustodianOrganization(organization); + custodian.setAssignedCustodian(ac); + target.setCustodian(custodian); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getCustodian().getAssignedCustodian().getRepresentedCustodianOrganization().setName( + DatatypesFactory.eINSTANCE.createON()); + ; + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationName( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationNameTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationTelecom() { + OperationsTestCase validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationTelecomTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationTelecom", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_CUSTODIAN_ASSIGNED_CUSTODIAN_CUSTODIAN_ORGANIZATION_TELECOM__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + Custodian custodian = CDAFactory.eINSTANCE.createCustodian(); + AssignedCustodian ac = CDAFactory.eINSTANCE.createAssignedCustodian(); + CustodianOrganization organization = CDAFactory.eINSTANCE.createCustodianOrganization(); + ac.setRepresentedCustodianOrganization(organization); + custodian.setAssignedCustodian(ac); + target.setCustodian(custodian); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getCustodian().getAssignedCustodian().getRepresentedCustodianOrganization().setTelecom( + DatatypesFactory.eINSTANCE.createTEL()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationTelecom( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsCustodianAssignedCustodianCustodianOrganizationTelecomTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsCustodianAssignedCustodianRepresentedCustodianOrganization() { + OperationsTestCase validateGeneralHeaderConstraintsCustodianAssignedCustodianRepresentedCustodianOrganizationTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsCustodianAssignedCustodianRepresentedCustodianOrganization", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_CUSTODIAN_ASSIGNED_CUSTODIAN_REPRESENTED_CUSTODIAN_ORGANIZATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + Custodian custodian = CDAFactory.eINSTANCE.createCustodian(); + AssignedCustodian ac = CDAFactory.eINSTANCE.createAssignedCustodian(); + + custodian.setAssignedCustodian(ac); + target.setCustodian(custodian); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + CustodianOrganization organization = CDAFactory.eINSTANCE.createCustodianOrganization(); + target.getCustodian().getAssignedCustodian().setRepresentedCustodianOrganization(organization); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsCustodianAssignedCustodianRepresentedCustodianOrganization( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsCustodianAssignedCustodianRepresentedCustodianOrganizationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsCustodianAssignedCustodian() { + OperationsTestCase validateGeneralHeaderConstraintsCustodianAssignedCustodianTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsCustodianAssignedCustodian", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_CUSTODIAN_ASSIGNED_CUSTODIAN__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Custodian custodian = CDAFactory.eINSTANCE.createCustodian(); + + target.setCustodian(custodian); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + AssignedCustodian ac = CDAFactory.eINSTANCE.createAssignedCustodian(); + target.getCustodian().setAssignedCustodian(ac); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsCustodianAssignedCustodian( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsCustodianAssignedCustodianTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsInformationRecipientIntendedRecipientOrganizationName() { + OperationsTestCase validateGeneralHeaderConstraintsInformationRecipientIntendedRecipientOrganizationNameTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsInformationRecipientIntendedRecipientOrganizationName", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_INFORMATION_RECIPIENT_INTENDED_RECIPIENT_ORGANIZATION_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + InformationRecipient ir = CDAFactory.eINSTANCE.createInformationRecipient(); + IntendedRecipient intended = CDAFactory.eINSTANCE.createIntendedRecipient(); + Organization organization = CDAFactory.eINSTANCE.createOrganization(); + intended.setReceivedOrganization(organization); + ir.setIntendedRecipient(intended); + + target.getInformationRecipients().add(ir); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getInformationRecipients().clear(); + InformationRecipient ir = CDAFactory.eINSTANCE.createInformationRecipient(); + IntendedRecipient intended = CDAFactory.eINSTANCE.createIntendedRecipient(); + Organization organization = CDAFactory.eINSTANCE.createOrganization(); + organization.getNames().add(DatatypesFactory.eINSTANCE.createON()); + intended.setReceivedOrganization(organization); + ir.setIntendedRecipient(intended); + + target.getInformationRecipients().add(ir); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsInformationRecipientIntendedRecipientOrganizationName( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsInformationRecipientIntendedRecipientOrganizationNameTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsInformationRecipientIntendedRecipientPersonName() { + OperationsTestCase validateGeneralHeaderConstraintsInformationRecipientIntendedRecipientPersonNameTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsInformationRecipientIntendedRecipientPersonName", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_INFORMATION_RECIPIENT_INTENDED_RECIPIENT_PERSON_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + InformationRecipient ir = CDAFactory.eINSTANCE.createInformationRecipient(); + IntendedRecipient intended = CDAFactory.eINSTANCE.createIntendedRecipient(); + Organization organization = CDAFactory.eINSTANCE.createOrganization(); + intended.setReceivedOrganization(organization); + Person person = CDAFactory.eINSTANCE.createPerson(); + intended.setInformationRecipient(person); + ir.setIntendedRecipient(intended); + + target.getInformationRecipients().add(ir); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + + target.getInformationRecipients().clear(); + + InformationRecipient ir = CDAFactory.eINSTANCE.createInformationRecipient(); + IntendedRecipient intended = CDAFactory.eINSTANCE.createIntendedRecipient(); + Organization organization = CDAFactory.eINSTANCE.createOrganization(); + intended.setReceivedOrganization(organization); + Person person = CDAFactory.eINSTANCE.createPerson(); + person.getNames().add(DatatypesFactory.eINSTANCE.createPN()); + intended.setInformationRecipient(person); + ir.setIntendedRecipient(intended); + + target.getInformationRecipients().add(ir); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsInformationRecipientIntendedRecipientPersonName( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsInformationRecipientIntendedRecipientPersonNameTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsInformationRecipientIntendedRecipientInformationRecipient() { + OperationsTestCase validateGeneralHeaderConstraintsInformationRecipientIntendedRecipientInformationRecipientTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsInformationRecipientIntendedRecipientInformationRecipient", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_INFORMATION_RECIPIENT_INTENDED_RECIPIENT_INFORMATION_RECIPIENT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + InformationRecipient ir = CDAFactory.eINSTANCE.createInformationRecipient(); + IntendedRecipient intended = CDAFactory.eINSTANCE.createIntendedRecipient(); + + ir.setIntendedRecipient(intended); + + target.getInformationRecipients().add(ir); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getInformationRecipients().clear(); + InformationRecipient ir = CDAFactory.eINSTANCE.createInformationRecipient(); + IntendedRecipient intended = CDAFactory.eINSTANCE.createIntendedRecipient(); + Person person = CDAFactory.eINSTANCE.createPerson(); + intended.setInformationRecipient(person); + ir.setIntendedRecipient(intended); + + target.getInformationRecipients().add(ir); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsInformationRecipientIntendedRecipientInformationRecipient( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsInformationRecipientIntendedRecipientInformationRecipientTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsInformationRecipientIntendedRecipientRecievedOrganization() { + OperationsTestCase validateGeneralHeaderConstraintsInformationRecipientIntendedRecipientRecievedOrganizationTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsInformationRecipientIntendedRecipientRecievedOrganization", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_INFORMATION_RECIPIENT_INTENDED_RECIPIENT_RECIEVED_ORGANIZATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + target.init(); + InformationRecipient ir = CDAFactory.eINSTANCE.createInformationRecipient(); + IntendedRecipient intended = CDAFactory.eINSTANCE.createIntendedRecipient(); + + ir.setIntendedRecipient(intended); + + target.getInformationRecipients().add(ir); + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + + target.getInformationRecipients().clear(); + InformationRecipient ir = CDAFactory.eINSTANCE.createInformationRecipient(); + IntendedRecipient intended = CDAFactory.eINSTANCE.createIntendedRecipient(); + Organization organization = CDAFactory.eINSTANCE.createOrganization(); + intended.setReceivedOrganization(organization); + ir.setIntendedRecipient(intended); + + target.getInformationRecipients().add(ir); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsInformationRecipientIntendedRecipientRecievedOrganization( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsInformationRecipientIntendedRecipientRecievedOrganizationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsInformationRecipientIntendedRecipient() { + OperationsTestCase validateGeneralHeaderConstraintsInformationRecipientIntendedRecipientTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsInformationRecipientIntendedRecipient", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_INFORMATION_RECIPIENT_INTENDED_RECIPIENT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + InformationRecipient ir = CDAFactory.eINSTANCE.createInformationRecipient(); + target.getInformationRecipients().add(ir); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getInformationRecipients().clear(); + InformationRecipient ir = CDAFactory.eINSTANCE.createInformationRecipient(); + IntendedRecipient intended = CDAFactory.eINSTANCE.createIntendedRecipient(); + Organization organization = CDAFactory.eINSTANCE.createOrganization(); + intended.setReceivedOrganization(organization); + ir.setIntendedRecipient(intended); + + target.getInformationRecipients().add(ir); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsInformationRecipientIntendedRecipient( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsInformationRecipientIntendedRecipientTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressStreet() { + OperationsTestCase validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressStreetTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressStreet", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_LEGAL_AUTHENTICATOR_ASSIGNED_ENTITY_US_REALM_ADDRESS_STREET__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + public void addFailTests() { + + addFailTest(new FailTest() { + + @Override + public void updateToFail(GeneralHeaderConstraints target) { + target.init(); + LegalAuthenticator la = CDAFactory.eINSTANCE.createLegalAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ae.getAddrs().add(ad); + la.setAssignedEntity(ae); + target.setLegalAuthenticator(la); + + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(GeneralHeaderConstraints target) { + target.init(); + LegalAuthenticator la = CDAFactory.eINSTANCE.createLegalAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + + ae.getAddrs().add(ad); + la.setAssignedEntity(ae); + target.setLegalAuthenticator(la); + } + }); + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + LegalAuthenticator la = CDAFactory.eINSTANCE.createLegalAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(createUSRealmAddress()); + la.setAssignedEntity(ae); + target.setLegalAuthenticator(la); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressStreet( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressStreetTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressCity() { + OperationsTestCase validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressCityTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressCity", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_LEGAL_AUTHENTICATOR_ASSIGNED_ENTITY_US_REALM_ADDRESS_CITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + LegalAuthenticator la = CDAFactory.eINSTANCE.createLegalAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + la.setAssignedEntity(ae); + target.setLegalAuthenticator(la); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + LegalAuthenticator la = CDAFactory.eINSTANCE.createLegalAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(createUSRealmAddress()); + la.setAssignedEntity(ae); + target.setLegalAuthenticator(la); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressCity( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressCityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressCountry() { + OperationsTestCase validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressCountryTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressCountry", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_LEGAL_AUTHENTICATOR_ASSIGNED_ENTITY_US_REALM_ADDRESS_COUNTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + LegalAuthenticator la = CDAFactory.eINSTANCE.createLegalAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + la.setAssignedEntity(ae); + target.setLegalAuthenticator(la); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + LegalAuthenticator la = CDAFactory.eINSTANCE.createLegalAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(createUSRealmAddress()); + la.setAssignedEntity(ae); + target.setLegalAuthenticator(la); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressCountry( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressCountryTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressPostalCode() { + OperationsTestCase validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressPostalCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressPostalCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_LEGAL_AUTHENTICATOR_ASSIGNED_ENTITY_US_REALM_ADDRESS_POSTAL_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + LegalAuthenticator la = CDAFactory.eINSTANCE.createLegalAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + la.setAssignedEntity(ae); + target.setLegalAuthenticator(la); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + LegalAuthenticator la = CDAFactory.eINSTANCE.createLegalAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(createUSRealmAddress()); + la.setAssignedEntity(ae); + target.setLegalAuthenticator(la); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressPostalCode( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressPostalCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressState() { + OperationsTestCase validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressStateTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressState", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_LEGAL_AUTHENTICATOR_ASSIGNED_ENTITY_US_REALM_ADDRESS_STATE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + LegalAuthenticator la = CDAFactory.eINSTANCE.createLegalAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + la.setAssignedEntity(ae); + target.setLegalAuthenticator(la); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + LegalAuthenticator la = CDAFactory.eINSTANCE.createLegalAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(createUSRealmAddress()); + la.setAssignedEntity(ae); + target.setLegalAuthenticator(la); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressState( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressStateTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressStreetAddressLine() { + OperationsTestCase validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressStreetAddressLineTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressStreetAddressLine", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_LEGAL_AUTHENTICATOR_ASSIGNED_ENTITY_US_REALM_ADDRESS_STREET_ADDRESS_LINE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + LegalAuthenticator la = CDAFactory.eINSTANCE.createLegalAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + la.setAssignedEntity(ae); + target.setLegalAuthenticator(la); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + LegalAuthenticator la = CDAFactory.eINSTANCE.createLegalAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(createUSRealmAddress()); + la.setAssignedEntity(ae); + target.setLegalAuthenticator(la); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressStreetAddressLine( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressStreetAddressLineTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressUseP() { + OperationsTestCase validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressUsePTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressUseP", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_LEGAL_AUTHENTICATOR_ASSIGNED_ENTITY_US_REALM_ADDRESS_USE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + LegalAuthenticator la = CDAFactory.eINSTANCE.createLegalAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + la.setAssignedEntity(ae); + target.setLegalAuthenticator(la); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + LegalAuthenticator la = CDAFactory.eINSTANCE.createLegalAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(createUSRealmAddress()); + la.setAssignedEntity(ae); + target.setLegalAuthenticator(la); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressUseP( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressUsePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressUse() { + OperationsTestCase validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressUseTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressUse", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_LEGAL_AUTHENTICATOR_ASSIGNED_ENTITY_US_REALM_ADDRESS_USE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + LegalAuthenticator la = CDAFactory.eINSTANCE.createLegalAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + ad.getUses().add(null); + + ae.getAddrs().add(ad); + la.setAssignedEntity(ae); + target.setLegalAuthenticator(la); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + LegalAuthenticator la = CDAFactory.eINSTANCE.createLegalAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(createUSRealmAddress()); + la.setAssignedEntity(ae); + target.setLegalAuthenticator(la); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressUse( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityUSRealmAddressUseTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityTELUse() { + OperationsTestCase validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityTELUseTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityTELUse", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_LEGAL_AUTHENTICATOR_ASSIGNED_ENTITY_TEL_USE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + LegalAuthenticator la = CDAFactory.eINSTANCE.createLegalAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getTelecoms().add(DatatypesFactory.eINSTANCE.createTEL()); + la.setAssignedEntity(ae); + target.setLegalAuthenticator(la); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + LegalAuthenticator la = CDAFactory.eINSTANCE.createLegalAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + TEL tel = DatatypesFactory.eINSTANCE.createTEL(); + tel.getUses().add(TelecommunicationAddressUse.HP); + ae.getTelecoms().add(tel); + la.setAssignedEntity(ae); + target.setLegalAuthenticator(la); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityTELUse( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityTELUseTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityPersonName() { + OperationsTestCase validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityPersonNameTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityPersonName", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_LEGAL_AUTHENTICATOR_ASSIGNED_ENTITY_PERSON_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + LegalAuthenticator authenticator = CDAFactory.eINSTANCE.createLegalAuthenticator(); + + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + Person ap = CDAFactory.eINSTANCE.createPerson(); + + ae.setAssignedPerson(ap); + authenticator.setAssignedEntity(ae); + target.setLegalAuthenticator(authenticator); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + + LegalAuthenticator authenticator = CDAFactory.eINSTANCE.createLegalAuthenticator(); + + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + Person ap = CDAFactory.eINSTANCE.createPerson(); + ap.getNames().add(DatatypesFactory.eINSTANCE.createPN()); + ae.setAssignedPerson(ap); + authenticator.setAssignedEntity(ae); + target.setLegalAuthenticator(authenticator); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityPersonName( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityPersonNameTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + // @Test + // public void testValidateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityPersonName() { + // OperationsTestCase validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityPersonNameTestCase = new + // OperationsTestCase( + // "validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityPersonName", + // operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_LEGAL_AUTHENTICATOR_ASSIGNED_ENTITY_PERSON_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + // objectFactory) { + // + // @Override + // protected void updateToFail(GeneralHeaderConstraints target) { + // target.init(); + // LegalAuthenticator la = CDAFactory.eINSTANCE.createLegalAuthenticator(); + // target.setLegalAuthenticator(la); + // AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + // Person person = CDAFactory.eINSTANCE.createPerson(); + // + // ae.setAssignedPerson(person); + // la.setAssignedEntity(ae); + // } + // + // @Override + // protected void updateToPass(GeneralHeaderConstraints target) { + // LegalAuthenticator la = CDAFactory.eINSTANCE.createLegalAuthenticator(); + // target.setLegalAuthenticator(la); + // AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + // Person person = CDAFactory.eINSTANCE.createPerson(); + // person.getNames().add(DatatypesFactory.eINSTANCE.createPN()); + // ae.setAssignedPerson(person); + // la.setAssignedEntity(ae); + // } + // + // @Override + // protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + // + // return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityPersonName( + // (GeneralHeaderConstraints) objectToTest, diagnostician, map); + // } + // + // }; + // + // validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityPersonNameTestCase.doValidationTest(); + // } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityHasNationalProviderIdentifier() { + OperationsTestCase validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityHasNationalProviderIdentifierTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityHasNationalProviderIdentifier", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_LEGAL_AUTHENTICATOR_ASSIGNED_ENTITY_HAS_NATIONAL_PROVIDER_IDENTIFIER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + LegalAuthenticator la = CDAFactory.eINSTANCE.createLegalAuthenticator(); + target.setLegalAuthenticator(la); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + la.setAssignedEntity(ae); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getLegalAuthenticator().getAssignedEntity().getIds().add( + DatatypesFactory.eINSTANCE.createII("2.16.840.1.113883.4.6")); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityHasNationalProviderIdentifier( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityHasNationalProviderIdentifierTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityAddr() { + OperationsTestCase validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityAddrTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityAddr", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_LEGAL_AUTHENTICATOR_ASSIGNED_ENTITY_ADDR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + LegalAuthenticator la = CDAFactory.eINSTANCE.createLegalAuthenticator(); + target.setLegalAuthenticator(la); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + la.setAssignedEntity(ae); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getLegalAuthenticator().getAssignedEntity().getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityAddr( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityAddrTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityCode() { + OperationsTestCase validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_LEGAL_AUTHENTICATOR_ASSIGNED_ENTITY_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + LegalAuthenticator la = CDAFactory.eINSTANCE.createLegalAuthenticator(); + target.setLegalAuthenticator(la); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + la.setAssignedEntity(ae); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getLegalAuthenticator().getAssignedEntity().setCode( + DatatypesFactory.eINSTANCE.createCE("207X00000X", "2.16.840.1.113883.6.101")); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityCode( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityCodeP() { + OperationsTestCase validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityCodePTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityCodeP", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_LEGAL_AUTHENTICATOR_ASSIGNED_ENTITY_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + LegalAuthenticator la = CDAFactory.eINSTANCE.createLegalAuthenticator(); + target.setLegalAuthenticator(la); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + la.setAssignedEntity(ae); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getLegalAuthenticator().getAssignedEntity().setCode( + DatatypesFactory.eINSTANCE.createCE("207X00000X", "2.16.840.1.113883.6.101")); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityCodeP( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityId() { + OperationsTestCase validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityIdTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityId", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_LEGAL_AUTHENTICATOR_ASSIGNED_ENTITY_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + LegalAuthenticator la = CDAFactory.eINSTANCE.createLegalAuthenticator(); + target.setLegalAuthenticator(la); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + la.setAssignedEntity(ae); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getLegalAuthenticator().getAssignedEntity().getIds().add(DatatypesFactory.eINSTANCE.createII()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityId( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityTelecom() { + OperationsTestCase validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityTelecomTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityTelecom", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_LEGAL_AUTHENTICATOR_ASSIGNED_ENTITY_TELECOM__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + LegalAuthenticator la = CDAFactory.eINSTANCE.createLegalAuthenticator(); + target.setLegalAuthenticator(la); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + la.setAssignedEntity(ae); + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getLegalAuthenticator().getAssignedEntity().getTelecoms().add( + DatatypesFactory.eINSTANCE.createTEL()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityTelecom( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityTelecomTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityAssignedPerson() { + OperationsTestCase validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityAssignedPersonTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityAssignedPerson", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_LEGAL_AUTHENTICATOR_ASSIGNED_ENTITY_ASSIGNED_PERSON__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + LegalAuthenticator la = CDAFactory.eINSTANCE.createLegalAuthenticator(); + target.setLegalAuthenticator(la); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + la.setAssignedEntity(ae); + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + LegalAuthenticator la = CDAFactory.eINSTANCE.createLegalAuthenticator(); + target.setLegalAuthenticator(la); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.setAssignedPerson(CDAFactory.eINSTANCE.createPerson()); + la.setAssignedEntity(ae); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityAssignedPerson( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityAssignedPersonTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + // @Test + // public void testValidateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityAssignedPerson() { + // OperationsTestCase validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityAssignedPersonTestCase = new + // OperationsTestCase( + // "validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityAssignedPerson", + // operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_LEGAL_AUTHENTICATOR_ASSIGNED_ENTITY_ASSIGNED_PERSON__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + // objectFactory) { + // + // @Override + // protected void updateToFail(GeneralHeaderConstraints target) { + // + // target.init(); + // LegalAuthenticator la = CDAFactory.eINSTANCE.createLegalAuthenticator(); + // target.setLegalAuthenticator(la); + // AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + // la.setAssignedEntity(ae); + // + // } + // + // @Override + // protected void updateToPass(GeneralHeaderConstraints target) { + // Person person = CDAFactory.eINSTANCE.createPerson(); + // + // target.getLegalAuthenticator().getAssignedEntity().setAssignedPerson(person); + // + // } + // + // @Override + // protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + // + // return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityAssignedPerson( + // (GeneralHeaderConstraints) objectToTest, diagnostician, map); + // } + // + // }; + // + // validateGeneralHeaderConstraintsLegalAuthenticatorAssignedEntityAssignedPersonTestCase.doValidationTest(); + // } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsLegalAuthenticatorTime() { + OperationsTestCase validateGeneralHeaderConstraintsLegalAuthenticatorTimeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsLegalAuthenticatorTime", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_LEGAL_AUTHENTICATOR_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + target.init(); + LegalAuthenticator la = CDAFactory.eINSTANCE.createLegalAuthenticator(); + target.setLegalAuthenticator(la); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getLegalAuthenticator().setTime(DatatypesFactory.eINSTANCE.createTS()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsLegalAuthenticatorTime( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsLegalAuthenticatorTimeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsLegalAuthenticatorSignatureCodeP() { + OperationsTestCase validateGeneralHeaderConstraintsLegalAuthenticatorSignatureCodePTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsLegalAuthenticatorSignatureCodeP", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_LEGAL_AUTHENTICATOR_SIGNATURE_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + LegalAuthenticator la = CDAFactory.eINSTANCE.createLegalAuthenticator(); + target.setLegalAuthenticator(la); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getLegalAuthenticator().setSignatureCode(DatatypesFactory.eINSTANCE.createCS("S")); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsLegalAuthenticatorSignatureCodeP( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsLegalAuthenticatorSignatureCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsLegalAuthenticatorSignatureCode() { + OperationsTestCase validateGeneralHeaderConstraintsLegalAuthenticatorSignatureCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsLegalAuthenticatorSignatureCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_LEGAL_AUTHENTICATOR_SIGNATURE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + LegalAuthenticator la = CDAFactory.eINSTANCE.createLegalAuthenticator(); + target.setLegalAuthenticator(la); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getLegalAuthenticator().setSignatureCode(DatatypesFactory.eINSTANCE.createCS("S")); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsLegalAuthenticatorSignatureCode( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsLegalAuthenticatorSignatureCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressStreet() { + OperationsTestCase validateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressStreetTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressStreet", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHENTICATOR_ASSIGNED_ENTITY_US_REALM_ADDRESS_STREET__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + public void addFailTests() { + + addFailTest(new FailTest() { + + @Override + public void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Authenticator auth = CDAFactory.eINSTANCE.createAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ae.getAddrs().add(ad); + auth.setAssignedEntity(ae); + target.getAuthenticators().add(auth); + + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Authenticator auth = CDAFactory.eINSTANCE.createAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + + ae.getAddrs().add(ad); + auth.setAssignedEntity(ae); + target.getAuthenticators().add(auth); + } + }); + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getAuthenticators().clear(); + Authenticator auth = CDAFactory.eINSTANCE.createAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(createUSRealmAddress()); + auth.setAssignedEntity(ae); + target.getAuthenticators().add(auth); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressStreet( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressStreetTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressCity() { + OperationsTestCase validateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressCityTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressCity", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHENTICATOR_ASSIGNED_ENTITY_US_REALM_ADDRESS_CITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Authenticator auth = CDAFactory.eINSTANCE.createAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + auth.setAssignedEntity(ae); + target.getAuthenticators().add(auth); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getAuthenticators().clear(); + Authenticator auth = CDAFactory.eINSTANCE.createAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(createUSRealmAddress()); + auth.setAssignedEntity(ae); + target.getAuthenticators().add(auth); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressCity( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressCityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressCountry() { + OperationsTestCase validateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressCountryTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressCountry", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHENTICATOR_ASSIGNED_ENTITY_US_REALM_ADDRESS_COUNTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Authenticator auth = CDAFactory.eINSTANCE.createAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + auth.setAssignedEntity(ae); + target.getAuthenticators().add(auth); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getAuthenticators().clear(); + Authenticator auth = CDAFactory.eINSTANCE.createAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(createUSRealmAddress()); + auth.setAssignedEntity(ae); + target.getAuthenticators().add(auth); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressCountry( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressCountryTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressPostalCode() { + OperationsTestCase validateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressPostalCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressPostalCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHENTICATOR_ASSIGNED_ENTITY_US_REALM_ADDRESS_POSTAL_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Authenticator auth = CDAFactory.eINSTANCE.createAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + auth.setAssignedEntity(ae); + target.getAuthenticators().add(auth); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getAuthenticators().clear(); + Authenticator auth = CDAFactory.eINSTANCE.createAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(createUSRealmAddress()); + auth.setAssignedEntity(ae); + target.getAuthenticators().add(auth); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressPostalCode( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressPostalCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressState() { + OperationsTestCase validateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressStateTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressState", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHENTICATOR_ASSIGNED_ENTITY_US_REALM_ADDRESS_STATE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Authenticator auth = CDAFactory.eINSTANCE.createAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + auth.setAssignedEntity(ae); + target.getAuthenticators().add(auth); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getAuthenticators().clear(); + Authenticator auth = CDAFactory.eINSTANCE.createAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(createUSRealmAddress()); + auth.setAssignedEntity(ae); + target.getAuthenticators().add(auth); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressState( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressStateTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressStreetAddressLine() { + OperationsTestCase validateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressStreetAddressLineTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressStreetAddressLine", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHENTICATOR_ASSIGNED_ENTITY_US_REALM_ADDRESS_STREET_ADDRESS_LINE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Authenticator auth = CDAFactory.eINSTANCE.createAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + auth.setAssignedEntity(ae); + target.getAuthenticators().add(auth); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getAuthenticators().clear(); + Authenticator auth = CDAFactory.eINSTANCE.createAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(createUSRealmAddress()); + auth.setAssignedEntity(ae); + target.getAuthenticators().add(auth); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressStreetAddressLine( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressStreetAddressLineTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressUseP() { + OperationsTestCase validateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressUsePTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressUseP", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHENTICATOR_ASSIGNED_ENTITY_US_REALM_ADDRESS_USE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Authenticator auth = CDAFactory.eINSTANCE.createAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + auth.setAssignedEntity(ae); + target.getAuthenticators().add(auth); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getAuthenticators().clear(); + Authenticator auth = CDAFactory.eINSTANCE.createAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(createUSRealmAddress()); + auth.setAssignedEntity(ae); + target.getAuthenticators().add(auth); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressUseP( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressUsePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressUse() { + OperationsTestCase validateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressUseTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressUse", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHENTICATOR_ASSIGNED_ENTITY_US_REALM_ADDRESS_USE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Authenticator auth = CDAFactory.eINSTANCE.createAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + ad.getUses().add(null); + + ae.getAddrs().add(ad); + auth.setAssignedEntity(ae); + target.getAuthenticators().add(auth); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getAuthenticators().clear(); + Authenticator auth = CDAFactory.eINSTANCE.createAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(createUSRealmAddress()); + auth.setAssignedEntity(ae); + target.getAuthenticators().add(auth); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressUse( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthenticatorAssignedEntityUSRealmAddressUseTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthenticatorAssignedEntityTELUse() { + OperationsTestCase validateGeneralHeaderConstraintsAuthenticatorAssignedEntityTELUseTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthenticatorAssignedEntityTELUse", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHENTICATOR_ASSIGNED_ENTITY_TEL_USE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Authenticator auth = CDAFactory.eINSTANCE.createAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getTelecoms().add(DatatypesFactory.eINSTANCE.createTEL()); + auth.setAssignedEntity(ae); + target.getAuthenticators().add(auth); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getAuthenticators().clear(); + Authenticator auth = CDAFactory.eINSTANCE.createAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + TEL tel = DatatypesFactory.eINSTANCE.createTEL(); + tel.getUses().add(TelecommunicationAddressUse.HP); + ae.getTelecoms().add(tel); + auth.setAssignedEntity(ae); + target.getAuthenticators().add(auth); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthenticatorAssignedEntityTELUse( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthenticatorAssignedEntityTELUseTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthenticatorAssignedEntityPersonName() { + OperationsTestCase validateGeneralHeaderConstraintsAuthenticatorAssignedEntityPersonNameTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthenticatorAssignedEntityPersonName", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHENTICATOR_ASSIGNED_ENTITY_PERSON_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + target.init(); + Authenticator authenticator = CDAFactory.eINSTANCE.createAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + Person person = CDAFactory.eINSTANCE.createPerson(); + + ae.setAssignedPerson(person); + + authenticator.setAssignedEntity(ae); + target.getAuthenticators().add(authenticator); + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getAuthenticators().clear(); + Authenticator authenticator = CDAFactory.eINSTANCE.createAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + Person person = CDAFactory.eINSTANCE.createPerson(); + person.getNames().add(DatatypesFactory.eINSTANCE.createPN()); + authenticator.setAssignedEntity(ae); + target.getAuthenticators().add(authenticator); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthenticatorAssignedEntityPersonName( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthenticatorAssignedEntityPersonNameTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthenticatorAssignedEntityHasNationalProviderIdentifier() { + OperationsTestCase validateGeneralHeaderConstraintsAuthenticatorAssignedEntityHasNationalProviderIdentifierTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthenticatorAssignedEntityHasNationalProviderIdentifier", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHENTICATOR_ASSIGNED_ENTITY_HAS_NATIONAL_PROVIDER_IDENTIFIER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Authenticator authenticator = CDAFactory.eINSTANCE.createAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + authenticator.setAssignedEntity(ae); + target.getAuthenticators().add(authenticator); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getAuthenticators().clear(); + Authenticator authenticator = CDAFactory.eINSTANCE.createAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getIds().add(DatatypesFactory.eINSTANCE.createII("2.16.840.1.113883.4.6")); + authenticator.setAssignedEntity(ae); + target.getAuthenticators().add(authenticator); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthenticatorAssignedEntityHasNationalProviderIdentifier( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthenticatorAssignedEntityHasNationalProviderIdentifierTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthenticatorAssignedEntityAddr() { + OperationsTestCase validateGeneralHeaderConstraintsAuthenticatorAssignedEntityAddrTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthenticatorAssignedEntityAddr", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHENTICATOR_ASSIGNED_ENTITY_ADDR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Authenticator authenticator = CDAFactory.eINSTANCE.createAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + authenticator.setAssignedEntity(ae); + target.getAuthenticators().add(authenticator); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getAuthenticators().clear(); + Authenticator authenticator = CDAFactory.eINSTANCE.createAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + authenticator.setAssignedEntity(ae); + target.getAuthenticators().add(authenticator); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthenticatorAssignedEntityAddr( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthenticatorAssignedEntityAddrTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthenticatorAssignedEntityCode() { + OperationsTestCase validateGeneralHeaderConstraintsAuthenticatorAssignedEntityCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthenticatorAssignedEntityCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHENTICATOR_ASSIGNED_ENTITY_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Authenticator authenticator = CDAFactory.eINSTANCE.createAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + authenticator.setAssignedEntity(ae); + target.getAuthenticators().add(authenticator); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getAuthenticators().clear(); + Authenticator authenticator = CDAFactory.eINSTANCE.createAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.setCode(DatatypesFactory.eINSTANCE.createCE("", "2.16.840.1.113883.6.101")); + authenticator.setAssignedEntity(ae); + target.getAuthenticators().add(authenticator); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthenticatorAssignedEntityCode( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthenticatorAssignedEntityCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthenticatorAssignedEntityCodeP() { + OperationsTestCase validateGeneralHeaderConstraintsAuthenticatorAssignedEntityCodePTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthenticatorAssignedEntityCodeP", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHENTICATOR_ASSIGNED_ENTITY_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Authenticator authenticator = CDAFactory.eINSTANCE.createAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + authenticator.setAssignedEntity(ae); + target.getAuthenticators().add(authenticator); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getAuthenticators().clear(); + Authenticator authenticator = CDAFactory.eINSTANCE.createAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.setCode(DatatypesFactory.eINSTANCE.createCE("", "2.16.840.1.113883.6.101")); + authenticator.setAssignedEntity(ae); + target.getAuthenticators().add(authenticator); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthenticatorAssignedEntityCodeP( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthenticatorAssignedEntityCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthenticatorAssignedEntityId() { + OperationsTestCase validateGeneralHeaderConstraintsAuthenticatorAssignedEntityIdTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthenticatorAssignedEntityId", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHENTICATOR_ASSIGNED_ENTITY_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Authenticator authenticator = CDAFactory.eINSTANCE.createAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + authenticator.setAssignedEntity(ae); + target.getAuthenticators().add(authenticator); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getAuthenticators().clear(); + Authenticator authenticator = CDAFactory.eINSTANCE.createAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getIds().add(DatatypesFactory.eINSTANCE.createII()); + authenticator.setAssignedEntity(ae); + target.getAuthenticators().add(authenticator); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthenticatorAssignedEntityId( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthenticatorAssignedEntityIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthenticatorAssignedEntityTelecom() { + OperationsTestCase validateGeneralHeaderConstraintsAuthenticatorAssignedEntityTelecomTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthenticatorAssignedEntityTelecom", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHENTICATOR_ASSIGNED_ENTITY_TELECOM__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Authenticator authenticator = CDAFactory.eINSTANCE.createAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + authenticator.setAssignedEntity(ae); + target.getAuthenticators().add(authenticator); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getAuthenticators().clear(); + Authenticator authenticator = CDAFactory.eINSTANCE.createAuthenticator(); + + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getTelecoms().add(DatatypesFactory.eINSTANCE.createTEL()); + authenticator.setAssignedEntity(ae); + target.getAuthenticators().add(authenticator); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthenticatorAssignedEntityTelecom( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthenticatorAssignedEntityTelecomTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthenticatorAssignedEntityAssignedPerson() { + OperationsTestCase validateGeneralHeaderConstraintsAuthenticatorAssignedEntityAssignedPersonTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthenticatorAssignedEntityAssignedPerson", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHENTICATOR_ASSIGNED_ENTITY_ASSIGNED_PERSON__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Authenticator authenticator = CDAFactory.eINSTANCE.createAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + authenticator.setAssignedEntity(ae); + target.getAuthenticators().add(authenticator); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getAuthenticators().clear(); + Authenticator authenticator = CDAFactory.eINSTANCE.createAuthenticator(); + + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + Person ap = CDAFactory.eINSTANCE.createPerson(); + ae.setAssignedPerson(ap); + authenticator.setAssignedEntity(ae); + target.getAuthenticators().add(authenticator); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthenticatorAssignedEntityAssignedPerson( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthenticatorAssignedEntityAssignedPersonTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthenticatorTime() { + OperationsTestCase validateGeneralHeaderConstraintsAuthenticatorTimeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthenticatorTime", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHENTICATOR_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Authenticator authenticator = CDAFactory.eINSTANCE.createAuthenticator(); + target.getAuthenticators().add(authenticator); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getAuthenticators().clear(); + Authenticator authenticator = CDAFactory.eINSTANCE.createAuthenticator(); + authenticator.setTime(DatatypesFactory.eINSTANCE.createTS()); + target.getAuthenticators().add(authenticator); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthenticatorTime( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthenticatorTimeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthenticatorSignatureCode() { + OperationsTestCase validateGeneralHeaderConstraintsAuthenticatorSignatureCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthenticatorSignatureCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHENTICATOR_SIGNATURE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + target.init(); + Authenticator authenticator = CDAFactory.eINSTANCE.createAuthenticator(); + target.getAuthenticators().add(authenticator); + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + + target.getAuthenticators().clear(); + Authenticator authenticator = CDAFactory.eINSTANCE.createAuthenticator(); + authenticator.setSignatureCode(DatatypesFactory.eINSTANCE.createCS("S")); + target.getAuthenticators().add(authenticator); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthenticatorSignatureCode( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthenticatorSignatureCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthenticatorAssignedEntity() { + OperationsTestCase validateGeneralHeaderConstraintsAuthenticatorAssignedEntityTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthenticatorAssignedEntity", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHENTICATOR_ASSIGNED_ENTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + target.init(); + Authenticator authenticator = CDAFactory.eINSTANCE.createAuthenticator(); + authenticator.setSignatureCode(DatatypesFactory.eINSTANCE.createCS("s")); + target.getAuthenticators().add(authenticator); + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + + target.getAuthenticators().clear(); + Authenticator authenticator = CDAFactory.eINSTANCE.createAuthenticator(); + authenticator.setSignatureCode(DatatypesFactory.eINSTANCE.createCS("s")); + target.getAuthenticators().add(authenticator); + + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getTelecoms().add(DatatypesFactory.eINSTANCE.createTEL()); + authenticator.setAssignedEntity(ae); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthenticatorAssignedEntity( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthenticatorAssignedEntityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressStreet() { + OperationsTestCase validateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressStreetTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressStreet", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_INFORMANT_ASSIGNED_ENTITY_US_REALM_ADDRESS_STREET__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + public void addFailTests() { + + addFailTest(new FailTest() { + + @Override + public void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Informant12 inf = CDAFactory.eINSTANCE.createInformant12(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ae.getAddrs().add(ad); + inf.setAssignedEntity(ae); + target.getInformants().add(inf); + + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Informant12 inf = CDAFactory.eINSTANCE.createInformant12(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + + ae.getAddrs().add(ad); + inf.setAssignedEntity(ae); + target.getInformants().add(inf); + } + }); + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getInformants().clear(); + Informant12 inf = CDAFactory.eINSTANCE.createInformant12(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(createUSRealmAddress()); + inf.setAssignedEntity(ae); + target.getInformants().add(inf); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressStreet( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressStreetTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressCity() { + OperationsTestCase validateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressCityTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressCity", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_INFORMANT_ASSIGNED_ENTITY_US_REALM_ADDRESS_CITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Informant12 inf = CDAFactory.eINSTANCE.createInformant12(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + inf.setAssignedEntity(ae); + target.getInformants().add(inf); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getInformants().clear(); + Informant12 inf = CDAFactory.eINSTANCE.createInformant12(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(createUSRealmAddress()); + inf.setAssignedEntity(ae); + target.getInformants().add(inf); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressCity( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressCityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressCountry() { + OperationsTestCase validateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressCountryTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressCountry", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_INFORMANT_ASSIGNED_ENTITY_US_REALM_ADDRESS_COUNTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Informant12 inf = CDAFactory.eINSTANCE.createInformant12(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + inf.setAssignedEntity(ae); + target.getInformants().add(inf); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getInformants().clear(); + Informant12 inf = CDAFactory.eINSTANCE.createInformant12(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(createUSRealmAddress()); + inf.setAssignedEntity(ae); + target.getInformants().add(inf); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressCountry( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressCountryTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressPostalCode() { + OperationsTestCase validateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressPostalCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressPostalCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_INFORMANT_ASSIGNED_ENTITY_US_REALM_ADDRESS_POSTAL_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Informant12 inf = CDAFactory.eINSTANCE.createInformant12(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + inf.setAssignedEntity(ae); + target.getInformants().add(inf); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getInformants().clear(); + Informant12 inf = CDAFactory.eINSTANCE.createInformant12(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(createUSRealmAddress()); + inf.setAssignedEntity(ae); + target.getInformants().add(inf); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressPostalCode( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressPostalCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressState() { + OperationsTestCase validateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressStateTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressState", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_INFORMANT_ASSIGNED_ENTITY_US_REALM_ADDRESS_STATE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Informant12 inf = CDAFactory.eINSTANCE.createInformant12(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + inf.setAssignedEntity(ae); + target.getInformants().add(inf); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getInformants().clear(); + Informant12 inf = CDAFactory.eINSTANCE.createInformant12(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(createUSRealmAddress()); + inf.setAssignedEntity(ae); + target.getInformants().add(inf); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressState( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressStateTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressStreetAddressLine() { + OperationsTestCase validateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressStreetAddressLineTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressStreetAddressLine", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_INFORMANT_ASSIGNED_ENTITY_US_REALM_ADDRESS_STREET_ADDRESS_LINE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Informant12 inf = CDAFactory.eINSTANCE.createInformant12(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + inf.setAssignedEntity(ae); + target.getInformants().add(inf); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getInformants().clear(); + Informant12 inf = CDAFactory.eINSTANCE.createInformant12(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(createUSRealmAddress()); + inf.setAssignedEntity(ae); + target.getInformants().add(inf); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressStreetAddressLine( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressStreetAddressLineTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressUseP() { + OperationsTestCase validateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressUsePTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressUseP", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_INFORMANT_ASSIGNED_ENTITY_US_REALM_ADDRESS_USE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Informant12 inf = CDAFactory.eINSTANCE.createInformant12(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + inf.setAssignedEntity(ae); + target.getInformants().add(inf); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getInformants().clear(); + Informant12 inf = CDAFactory.eINSTANCE.createInformant12(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(createUSRealmAddress()); + inf.setAssignedEntity(ae); + target.getInformants().add(inf); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressUseP( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressUsePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressUse() { + OperationsTestCase validateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressUseTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressUse", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_INFORMANT_ASSIGNED_ENTITY_US_REALM_ADDRESS_USE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Informant12 inf = CDAFactory.eINSTANCE.createInformant12(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + ad.getUses().add(null); + + ae.getAddrs().add(ad); + inf.setAssignedEntity(ae); + target.getInformants().add(inf); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getInformants().clear(); + Informant12 inf = CDAFactory.eINSTANCE.createInformant12(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(createUSRealmAddress()); + inf.setAssignedEntity(ae); + target.getInformants().add(inf); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressUse( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsInformantAssignedEntityUSRealmAddressUseTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationHasNationalProviderIdentifier() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationHasNationalProviderIdentifierTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationHasNationalProviderIdentifier", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PROVIDER_ORGANIZATION_HAS_NATIONAL_PROVIDER_IDENTIFIER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Organization organization = CDAFactory.eINSTANCE.createOrganization(); + pr.setProviderOrganization(organization); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Organization organization = CDAFactory.eINSTANCE.createOrganization(); + organization.getIds().add(DatatypesFactory.eINSTANCE.createII("2.16.840.1.113883.4.6")); + pr.setProviderOrganization(organization); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationHasNationalProviderIdentifier( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationHasNationalProviderIdentifierTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianAddr() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianAddrTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianAddr", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_GUARDIAN_ADDR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + Guardian guardian = CDAFactory.eINSTANCE.createGuardian(); + patient.getGuardians().add(guardian); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + Guardian guardian = CDAFactory.eINSTANCE.createGuardian(); + guardian.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + patient.getGuardians().add(guardian); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianAddr( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianAddrTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianCode() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_GUARDIAN_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + Guardian guardian = CDAFactory.eINSTANCE.createGuardian(); + patient.getGuardians().add(guardian); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + Guardian guardian = CDAFactory.eINSTANCE.createGuardian(); + guardian.setCode(DatatypesFactory.eINSTANCE.createCE("SPS", "2.16.840.1.113883.5.111")); + + guardian.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + patient.getGuardians().add(guardian); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianCode( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianCodeP() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianCodePTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianCodeP", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_GUARDIAN_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + Guardian guardian = CDAFactory.eINSTANCE.createGuardian(); + patient.getGuardians().add(guardian); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + Guardian guardian = CDAFactory.eINSTANCE.createGuardian(); + guardian.setCode(DatatypesFactory.eINSTANCE.createCE("HUSB", "2.16.840.1.113883.5.111")); + + guardian.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + patient.getGuardians().add(guardian); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianCodeP( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianTelecom() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianTelecomTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianTelecom", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_GUARDIAN_TELECOM__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + Guardian guardian = CDAFactory.eINSTANCE.createGuardian(); + patient.getGuardians().add(guardian); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + Guardian guardian = CDAFactory.eINSTANCE.createGuardian(); + guardian.getTelecoms().add(DatatypesFactory.eINSTANCE.createTEL()); + patient.getGuardians().add(guardian); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianTelecom( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianTelecomTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianGuardianPerson() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianGuardianPersonTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianGuardianPerson", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_GUARDIAN_GUARDIAN_PERSON__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + Guardian guardian = CDAFactory.eINSTANCE.createGuardian(); + patient.getGuardians().add(guardian); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + Guardian guardian = CDAFactory.eINSTANCE.createGuardian(); + guardian.setGuardianPerson(CDAFactory.eINSTANCE.createPerson()); + patient.getGuardians().add(guardian); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianGuardianPerson( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianGuardianPersonTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientBirthTimePreciseToYear() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientBirthTimePreciseToYearTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientBirthTimePreciseToYear", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_BIRTH_TIME_PRECISE_TO_YEAR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + patient.setBirthTime(DatatypesFactory.eINSTANCE.createTS("10")); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + patient.setBirthTime(DatatypesFactory.eINSTANCE.createTS("1980")); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientBirthTimePreciseToYear( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientBirthTimePreciseToYearTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientBirthTimePreciseToDay() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientBirthTimePreciseToDayTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientBirthTimePreciseToDay", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_BIRTH_TIME_PRECISE_TO_DAY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + patient.setBirthTime(DatatypesFactory.eINSTANCE.createTS()); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + patient.setBirthTime(DatatypesFactory.eINSTANCE.createTS("19800101")); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientBirthTimePreciseToDay( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientBirthTimePreciseToDayTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientAdministrativeGenderCode() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientAdministrativeGenderCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientAdministrativeGenderCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_ADMINISTRATIVE_GENDER_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + Birthplace birthplace = CDAFactory.eINSTANCE.createBirthplace(); + Place place = CDAFactory.eINSTANCE.createPlace(); + birthplace.setPlace(place); + patient.setBirthplace(birthplace); + + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + patient.setAdministrativeGenderCode(DatatypesFactory.eINSTANCE.createCE("F", "2.16.840.1.113883.5.1")); + Birthplace birthplace = CDAFactory.eINSTANCE.createBirthplace(); + Place place = CDAFactory.eINSTANCE.createPlace(); + birthplace.setPlace(place); + patient.setBirthplace(birthplace); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientAdministrativeGenderCode( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientAdministrativeGenderCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientBirthplacePlaceAddr() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientBirthplacePlaceAddrTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientBirthplacePlaceAddr", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_BIRTHPLACE_PLACE_ADDR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + Birthplace birthplace = CDAFactory.eINSTANCE.createBirthplace(); + Place place = CDAFactory.eINSTANCE.createPlace(); + birthplace.setPlace(place); + patient.setBirthplace(birthplace); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + Birthplace birthplace = CDAFactory.eINSTANCE.createBirthplace(); + Place place = CDAFactory.eINSTANCE.createPlace(); + place.setAddr(DatatypesFactory.eINSTANCE.createAD()); + birthplace.setPlace(place); + patient.setBirthplace(birthplace); + pr.setPatient(patient); + re.setPatientRole(pr); + + target.getRecordTargets().add(re); + + // patientRole->one(patientRole : cda::PatientRole | not patientRole.oclIsUndefined() and patientRole.oclIsKindOf(cda::PatientRole)) + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientBirthplacePlaceAddr( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientBirthplacePlaceAddrTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientBirthplacePlace() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientBirthplacePlaceTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientBirthplacePlace", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_BIRTHPLACE_PLACE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + Birthplace birthplace = CDAFactory.eINSTANCE.createBirthplace(); + CDAFactory.eINSTANCE.createPlace(); + patient.setBirthplace(birthplace); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + Birthplace birthplace = CDAFactory.eINSTANCE.createBirthplace(); + Place place = CDAFactory.eINSTANCE.createPlace(); + birthplace.setPlace(place); + patient.setBirthplace(birthplace); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientBirthplacePlace( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientBirthplacePlaceTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianPersonName() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianPersonNameTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianPersonName", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_GUARDIAN_PERSON_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + CDAFactory.eINSTANCE.createBirthplace(); + Guardian guardian = CDAFactory.eINSTANCE.createGuardian(); + Person person = CDAFactory.eINSTANCE.createPerson(); + guardian.setGuardianPerson(person); + + patient.getGuardians().add(guardian); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + CDAFactory.eINSTANCE.createBirthplace(); + Guardian guardian = CDAFactory.eINSTANCE.createGuardian(); + Person person = CDAFactory.eINSTANCE.createPerson(); + person.getNames().add(DatatypesFactory.eINSTANCE.createPN()); + guardian.setGuardianPerson(person); + + patient.getGuardians().add(guardian); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianPersonName( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianPersonNameTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationPreferenceInd() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationPreferenceIndTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationPreferenceInd", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_LANGUAGE_COMMUNICATION_PREFERENCE_IND__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + LanguageCommunication languageCommunication = CDAFactory.eINSTANCE.createLanguageCommunication(); + + patient.getLanguageCommunications().add(languageCommunication); + + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + LanguageCommunication languageCommunication = CDAFactory.eINSTANCE.createLanguageCommunication(); + languageCommunication.setPreferenceInd(DatatypesFactory.eINSTANCE.createBL(true)); + + patient.getLanguageCommunications().add(languageCommunication); + + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationPreferenceInd( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationPreferenceIndTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationProficiencyLevelCode() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationProficiencyLevelCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationProficiencyLevelCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_LANGUAGE_COMMUNICATION_PROFICIENCY_LEVEL_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + LanguageCommunication languageCommunication = CDAFactory.eINSTANCE.createLanguageCommunication(); + + patient.getLanguageCommunications().add(languageCommunication); + + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + LanguageCommunication languageCommunication = CDAFactory.eINSTANCE.createLanguageCommunication(); + languageCommunication.setProficiencyLevelCode(DatatypesFactory.eINSTANCE.createCE( + "E", "2.16.840.1.113883.5.61", "", "")); + + patient.getLanguageCommunications().add(languageCommunication); + + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationProficiencyLevelCode( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationProficiencyLevelCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationProficiencyLevelCodeP() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationProficiencyLevelCodePTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationProficiencyLevelCodeP", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_LANGUAGE_COMMUNICATION_PROFICIENCY_LEVEL_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + LanguageCommunication languageCommunication = CDAFactory.eINSTANCE.createLanguageCommunication(); + + patient.getLanguageCommunications().add(languageCommunication); + + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + LanguageCommunication languageCommunication = CDAFactory.eINSTANCE.createLanguageCommunication(); + languageCommunication.setProficiencyLevelCode(DatatypesFactory.eINSTANCE.createCE( + "E", "2.16.840.1.113883.5.61", "", "")); + + patient.getLanguageCommunications().add(languageCommunication); + + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationProficiencyLevelCodeP( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationProficiencyLevelCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationModeCode() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationModeCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationModeCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_LANGUAGE_COMMUNICATION_MODE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + LanguageCommunication languageCommunication = CDAFactory.eINSTANCE.createLanguageCommunication(); + patient.getLanguageCommunications().add(languageCommunication); + + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + LanguageCommunication languageCommunication = CDAFactory.eINSTANCE.createLanguageCommunication(); + + // 2.16.840.1.113883.5.60' and (value.code = 'ESGN' + languageCommunication.setModeCode(DatatypesFactory.eINSTANCE.createCE( + "ESGN", "2.16.840.1.113883.5.60", "", "")); + patient.getLanguageCommunications().add(languageCommunication); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationModeCode( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationModeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationModeCodeP() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationModeCodePTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationModeCodeP", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_LANGUAGE_COMMUNICATION_MODE_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + LanguageCommunication languageCommunication = CDAFactory.eINSTANCE.createLanguageCommunication(); + patient.getLanguageCommunications().add(languageCommunication); + + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + LanguageCommunication languageCommunication = CDAFactory.eINSTANCE.createLanguageCommunication(); + + // 2.16.840.1.113883.5.60' and (value.code = 'ESGN' + languageCommunication.setModeCode(DatatypesFactory.eINSTANCE.createCE( + "ESGN", "2.16.840.1.113883.5.60", "", "")); + patient.getLanguageCommunications().add(languageCommunication); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationModeCodeP( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationModeCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientBirthTime() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientBirthTimeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientBirthTime", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_BIRTH_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + patient.setBirthTime(DatatypesFactory.eINSTANCE.createTS()); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientBirthTime( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientBirthTimeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientEthnicGroupCode() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientEthnicGroupCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientEthnicGroupCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_ETHNIC_GROUP_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + patient.setEthnicGroupCode(DatatypesFactory.eINSTANCE.createCE("2135-2", "2.16.840.1.113883.6.238")); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientEthnicGroupCode( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientEthnicGroupCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientMaritalStatusCodeP() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientMaritalStatusCodePTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientMaritalStatusCodeP", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_MARITAL_STATUS_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + patient.setMaritalStatusCode(DatatypesFactory.eINSTANCE.createCE("A", "2.16.840.1.113883.5.2")); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientMaritalStatusCodeP( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientMaritalStatusCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientEthnicGroupCodeP() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientEthnicGroupCodePTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientEthnicGroupCodeP", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_ETHNIC_GROUP_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + patient.setEthnicGroupCode(DatatypesFactory.eINSTANCE.createCE("", "2.16.840.1.113883.6.238")); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientEthnicGroupCodeP( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientEthnicGroupCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientMaritalStatusCode() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientMaritalStatusCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientMaritalStatusCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_MARITAL_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + patient.setMaritalStatusCode(DatatypesFactory.eINSTANCE.createCE("A", "2.16.840.1.113883.5.2")); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + + } + + // Test for 0 ( lower bound) Marital Status + @Override + public void addPassTests() { + addPassTest(new PassTest() { + + @Override + public void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + patient.setMaritalStatusCode(DatatypesFactory.eINSTANCE.createCE("A", "2.16.840.1.113883.5.2")); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + } + } + + ); + + } + + // ======= + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientMaritalStatusCode( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientMaritalStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientName() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientNameTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientName", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + patient.getNames().add(DatatypesFactory.eINSTANCE.createPN()); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientName( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientNameTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientRaceCodeP() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientRaceCodePTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientRaceCodeP", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_RACE_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + patient.setRaceCode(DatatypesFactory.eINSTANCE.createCE("2058-6", "2.16.840.1.113883.6.238")); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientRaceCodeP( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientRaceCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientRaceCode() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientRaceCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientRaceCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_RACE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + patient.setRaceCode(DatatypesFactory.eINSTANCE.createCE("2058-6", "2.16.840.1.113883.6.238")); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientRaceCode( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientRaceCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientReligiousAffiliationCodeP() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientReligiousAffiliationCodePTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientReligiousAffiliationCodeP", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_RELIGIOUS_AFFILIATION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + patient.setReligiousAffiliationCode(DatatypesFactory.eINSTANCE.createCE( + "1026", "2.16.840.1.113883.5.1076")); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientReligiousAffiliationCodeP( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientReligiousAffiliationCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientReligiousAffiliationCode() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientReligiousAffiliationCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientReligiousAffiliationCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_RELIGIOUS_AFFILIATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + patient.setReligiousAffiliationCode(DatatypesFactory.eINSTANCE.createCE( + "1026", "2.16.840.1.113883.5.1076")); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientReligiousAffiliationCode( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientReligiousAffiliationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientSDTCRaceCodeP() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientSDTCRaceCodePTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientSDTCRaceCodeP", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_SDTC_RACE_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + patient.getSDTCRaceCodes().add( + (DatatypesFactory.eINSTANCE.createCE("2058-6", "2.16.840.1.113883.6.238"))); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientSDTCRaceCodeP( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientSDTCRaceCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientSDTCRaceCode() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientSDTCRaceCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientSDTCRaceCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_SDTC_RACE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + patient.getSDTCRaceCodes().add((DatatypesFactory.eINSTANCE.createCE())); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + patient.getSDTCRaceCodes().add( + (DatatypesFactory.eINSTANCE.createCE("2058-6", "2.16.840.1.113883.6.238"))); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientSDTCRaceCode( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientSDTCRaceCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardian() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardian", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_GUARDIAN__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + Guardian guardian = CDAFactory.eINSTANCE.createGuardian(); + patient.getGuardians().add(guardian); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardian( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientGuardianTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientBirthplace() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientBirthplaceTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientBirthplace", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_BIRTHPLACE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + Birthplace birthplace = CDAFactory.eINSTANCE.createBirthplace(); + patient.setBirthplace(birthplace); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientBirthplace( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientBirthplaceTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunication() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunication", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_LANGUAGE_COMMUNICATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + patient.getLanguageCommunications().add(CDAFactory.eINSTANCE.createLanguageCommunication()); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunication( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressStreet() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressStreetTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressStreet", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PROVIDER_ORGANIZATION_US_REALM_ADDRESS_STREET__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + public void addFailTests() { + + addFailTest(new FailTest() { + + @Override + public void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Organization org = CDAFactory.eINSTANCE.createOrganization(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + org.getAddrs().add(ad); + pr.setProviderOrganization(org); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Organization org = CDAFactory.eINSTANCE.createOrganization(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + + org.getAddrs().add(ad); + pr.setProviderOrganization(org); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + }); + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Organization org = CDAFactory.eINSTANCE.createOrganization(); + org.getAddrs().add(createUSRealmAddress()); + pr.setProviderOrganization(org); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressStreet( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressStreetTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressCity() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressCityTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressCity", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PROVIDER_ORGANIZATION_US_REALM_ADDRESS_CITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Organization org = CDAFactory.eINSTANCE.createOrganization(); + org.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + pr.setProviderOrganization(org); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Organization org = CDAFactory.eINSTANCE.createOrganization(); + org.getAddrs().add(createUSRealmAddress()); + pr.setProviderOrganization(org); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressCity( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressCityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressCountry() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressCountryTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressCountry", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PROVIDER_ORGANIZATION_US_REALM_ADDRESS_COUNTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Organization org = CDAFactory.eINSTANCE.createOrganization(); + org.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + pr.setProviderOrganization(org); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Organization org = CDAFactory.eINSTANCE.createOrganization(); + org.getAddrs().add(createUSRealmAddress()); + pr.setProviderOrganization(org); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressCountry( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressCountryTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressPostalCode() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressPostalCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressPostalCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PROVIDER_ORGANIZATION_US_REALM_ADDRESS_POSTAL_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Organization org = CDAFactory.eINSTANCE.createOrganization(); + org.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + pr.setProviderOrganization(org); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Organization org = CDAFactory.eINSTANCE.createOrganization(); + org.getAddrs().add(createUSRealmAddress()); + pr.setProviderOrganization(org); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressPostalCode( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressPostalCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressState() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressStateTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressState", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PROVIDER_ORGANIZATION_US_REALM_ADDRESS_STATE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Organization org = CDAFactory.eINSTANCE.createOrganization(); + org.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + pr.setProviderOrganization(org); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Organization org = CDAFactory.eINSTANCE.createOrganization(); + org.getAddrs().add(createUSRealmAddress()); + pr.setProviderOrganization(org); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressState( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressStateTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressStreetAddressLine() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressStreetAddressLineTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressStreetAddressLine", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PROVIDER_ORGANIZATION_US_REALM_ADDRESS_STREET_ADDRESS_LINE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Organization org = CDAFactory.eINSTANCE.createOrganization(); + org.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + pr.setProviderOrganization(org); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Organization org = CDAFactory.eINSTANCE.createOrganization(); + org.getAddrs().add(createUSRealmAddress()); + pr.setProviderOrganization(org); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressStreetAddressLine( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressStreetAddressLineTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressUseP() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressUsePTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressUseP", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PROVIDER_ORGANIZATION_US_REALM_ADDRESS_USE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Organization org = CDAFactory.eINSTANCE.createOrganization(); + org.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + pr.setProviderOrganization(org); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Organization org = CDAFactory.eINSTANCE.createOrganization(); + org.getAddrs().add(createUSRealmAddress()); + pr.setProviderOrganization(org); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressUseP( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressUsePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressUse() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressUseTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressUse", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PROVIDER_ORGANIZATION_US_REALM_ADDRESS_USE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Organization org = CDAFactory.eINSTANCE.createOrganization(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + ad.getUses().add(null); + + org.getAddrs().add(ad); + pr.setProviderOrganization(org); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Organization org = CDAFactory.eINSTANCE.createOrganization(); + org.getAddrs().add(createUSRealmAddress()); + pr.setProviderOrganization(org); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressUse( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationUSRealmAddressUseTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationTELUse() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationTELUseTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationTELUse", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PROVIDER_ORGANIZATION_TEL_USE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Organization org = CDAFactory.eINSTANCE.createOrganization(); + org.getTelecoms().add(DatatypesFactory.eINSTANCE.createTEL()); + pr.setProviderOrganization(org); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Organization org = CDAFactory.eINSTANCE.createOrganization(); + TEL tel = DatatypesFactory.eINSTANCE.createTEL(); + tel.getUses().add(TelecommunicationAddressUse.HP); + org.getTelecoms().add(tel); + pr.setProviderOrganization(org); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationTELUse( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationTELUseTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationAddr() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationAddrTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationAddr", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PROVIDER_ORGANIZATION_ADDR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Organization organization = CDAFactory.eINSTANCE.createOrganization(); + pr.setProviderOrganization(organization); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Organization organization = CDAFactory.eINSTANCE.createOrganization(); + organization.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + pr.setProviderOrganization(organization); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationAddr( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationAddrTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationId() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationIdTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationId", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PROVIDER_ORGANIZATION_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Organization organization = CDAFactory.eINSTANCE.createOrganization(); + pr.setProviderOrganization(organization); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Organization organization = CDAFactory.eINSTANCE.createOrganization(); + organization.getIds().add(DatatypesFactory.eINSTANCE.createII()); + pr.setProviderOrganization(organization); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationId( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationName() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationNameTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationName", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PROVIDER_ORGANIZATION_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Organization organization = CDAFactory.eINSTANCE.createOrganization(); + pr.setProviderOrganization(organization); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + + Organization organization = CDAFactory.eINSTANCE.createOrganization(); + organization.getNames().add(DatatypesFactory.eINSTANCE.createON()); + pr.setProviderOrganization(organization); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationName( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationNameTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationTelecom() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationTelecomTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationTelecom", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PROVIDER_ORGANIZATION_TELECOM__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + re.setPatientRole(pr); + Organization organization = CDAFactory.eINSTANCE.createOrganization(); + pr.setProviderOrganization(organization); + target.getRecordTargets().add(re); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Organization organization = CDAFactory.eINSTANCE.createOrganization(); + organization.getTelecoms().add(DatatypesFactory.eINSTANCE.createTEL()); + pr.setProviderOrganization(organization); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationTelecom( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationTelecomTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationLanguageCode() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationLanguageCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationLanguageCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_LANGUAGE_COMMUNICATION_LANGUAGE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + Guardian guardian = CDAFactory.eINSTANCE.createGuardian(); + patient.getLanguageCommunications().add(CDAFactory.eINSTANCE.createLanguageCommunication()); + patient.getGuardians().add(guardian); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + LanguageCommunication languageCommunication = CDAFactory.eINSTANCE.createLanguageCommunication(); + languageCommunication.setLanguageCode(DatatypesFactory.eINSTANCE.createCS("code")); + patient.getLanguageCommunications().add(languageCommunication); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationLanguageCode( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationLanguageCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationLanguageCodeP() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationLanguageCodePTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationLanguageCodeP", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_LANGUAGE_COMMUNICATION_LANGUAGE_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + Guardian guardian = CDAFactory.eINSTANCE.createGuardian(); + patient.getLanguageCommunications().add(CDAFactory.eINSTANCE.createLanguageCommunication()); + patient.getGuardians().add(guardian); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + LanguageCommunication languageCommunication = CDAFactory.eINSTANCE.createLanguageCommunication(); + languageCommunication.setLanguageCode(DatatypesFactory.eINSTANCE.createCS("code")); + patient.getLanguageCommunications().add(languageCommunication); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationLanguageCodeP( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationLanguageCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRoleAddr() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRoleAddrTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRoleAddr", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_ADDR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + pr.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRoleAddr( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRoleAddrTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRoleId() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRoleIdTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRoleId", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + pr.getIds().add(DatatypesFactory.eINSTANCE.createII()); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRoleId( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRoleIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRoleTelecom() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRoleTelecomTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRoleTelecom", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_TELECOM__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + pr.getTelecoms().add(DatatypesFactory.eINSTANCE.createTEL()); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRoleTelecom( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRoleTelecomTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatient() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatient", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + pr.setPatient(patient); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatient( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganization() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganization", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PROVIDER_ORGANIZATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getRecordTargets().clear(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Organization org = CDAFactory.eINSTANCE.createOrganization(); + pr.setProviderOrganization(org); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganization( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRoleProviderOrganizationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRole() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRoleTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRole", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + target.init(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + + target.getRecordTargets().add(re); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + + target.getRecordTargets().clear(); + RecordTarget re = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + re.setPatientRole(pr); + target.getRecordTargets().add(re); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRole( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRoleTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsComponentOfEncompassingEncounterEffectiveTime() { + OperationsTestCase validateGeneralHeaderConstraintsComponentOfEncompassingEncounterEffectiveTimeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsComponentOfEncompassingEncounterEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_COMPONENT_OF_ENCOMPASSING_ENCOUNTER_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + + Component1 value = CDAFactory.eINSTANCE.createComponent1(); + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + value.setEncompassingEncounter(ee); + target.setComponentOf(value); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + + target.getComponentOf().getEncompassingEncounter().setEffectiveTime( + DatatypesFactory.eINSTANCE.createIVL_TS()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsComponentOfEncompassingEncounterEffectiveTime( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsComponentOfEncompassingEncounterEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsComponentOfEncompassingEncounterId() { + OperationsTestCase validateGeneralHeaderConstraintsComponentOfEncompassingEncounterIdTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsComponentOfEncompassingEncounterId", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_COMPONENT_OF_ENCOMPASSING_ENCOUNTER_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + + Component1 value = CDAFactory.eINSTANCE.createComponent1(); + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + value.setEncompassingEncounter(ee); + target.setComponentOf(value); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getComponentOf().getEncompassingEncounter().getIds().add(DatatypesFactory.eINSTANCE.createII()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsComponentOfEncompassingEncounterId( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsComponentOfEncompassingEncounterIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsComponentOfEncompassingEncounter() { + OperationsTestCase validateGeneralHeaderConstraintsComponentOfEncompassingEncounterTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsComponentOfEncompassingEncounter", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_COMPONENT_OF_ENCOMPASSING_ENCOUNTER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + target.init(); + + Component1 value = CDAFactory.eINSTANCE.createComponent1(); + + target.setComponentOf(value); + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + target.getComponentOf().setEncompassingEncounter(ee); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsComponentOfEncompassingEncounter( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsComponentOfEncompassingEncounterTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressStreet() { + OperationsTestCase validateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressStreetTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressStreet", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHOR_ASSIGNED_AUTHOR_US_REALM_ADDRESS_STREET__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + public void addFailTests() { + + addFailTest(new FailTest() { + + @Override + public void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Author auth = CDAFactory.eINSTANCE.createAuthor(); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + aa.getAddrs().add(ad); + auth.setAssignedAuthor(aa); + target.getAuthors().add(auth); + + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Author auth = CDAFactory.eINSTANCE.createAuthor(); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + + aa.getAddrs().add(ad); + auth.setAssignedAuthor(aa); + target.getAuthors().add(auth); + } + }); + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getAuthors().clear(); + Author auth = CDAFactory.eINSTANCE.createAuthor(); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + aa.getAddrs().add(createUSRealmAddress()); + auth.setAssignedAuthor(aa); + target.getAuthors().add(auth); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressStreet( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressStreetTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressCity() { + OperationsTestCase validateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressCityTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressCity", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHOR_ASSIGNED_AUTHOR_US_REALM_ADDRESS_CITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Author auth = CDAFactory.eINSTANCE.createAuthor(); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + aa.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + auth.setAssignedAuthor(aa); + target.getAuthors().add(auth); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getAuthors().clear(); + Author auth = CDAFactory.eINSTANCE.createAuthor(); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + aa.getAddrs().add(createUSRealmAddress()); + auth.setAssignedAuthor(aa); + target.getAuthors().add(auth); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressCity( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressCityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressCountry() { + OperationsTestCase validateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressCountryTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressCountry", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHOR_ASSIGNED_AUTHOR_US_REALM_ADDRESS_COUNTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Author auth = CDAFactory.eINSTANCE.createAuthor(); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + aa.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + auth.setAssignedAuthor(aa); + target.getAuthors().add(auth); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getAuthors().clear(); + Author auth = CDAFactory.eINSTANCE.createAuthor(); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + aa.getAddrs().add(createUSRealmAddress()); + auth.setAssignedAuthor(aa); + target.getAuthors().add(auth); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressCountry( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressCountryTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressPostalCode() { + OperationsTestCase validateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressPostalCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressPostalCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHOR_ASSIGNED_AUTHOR_US_REALM_ADDRESS_POSTAL_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Author auth = CDAFactory.eINSTANCE.createAuthor(); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + aa.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + auth.setAssignedAuthor(aa); + target.getAuthors().add(auth); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getAuthors().clear(); + Author auth = CDAFactory.eINSTANCE.createAuthor(); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + aa.getAddrs().add(createUSRealmAddress()); + auth.setAssignedAuthor(aa); + target.getAuthors().add(auth); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressPostalCode( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressPostalCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressState() { + OperationsTestCase validateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressStateTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressState", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHOR_ASSIGNED_AUTHOR_US_REALM_ADDRESS_STATE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Author auth = CDAFactory.eINSTANCE.createAuthor(); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + aa.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + auth.setAssignedAuthor(aa); + target.getAuthors().add(auth); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getAuthors().clear(); + Author auth = CDAFactory.eINSTANCE.createAuthor(); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + aa.getAddrs().add(createUSRealmAddress()); + auth.setAssignedAuthor(aa); + target.getAuthors().add(auth); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressState( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressStateTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressStreetAddressLine() { + OperationsTestCase validateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressStreetAddressLineTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressStreetAddressLine", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHOR_ASSIGNED_AUTHOR_US_REALM_ADDRESS_STREET_ADDRESS_LINE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Author auth = CDAFactory.eINSTANCE.createAuthor(); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + aa.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + auth.setAssignedAuthor(aa); + target.getAuthors().add(auth); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getAuthors().clear(); + Author auth = CDAFactory.eINSTANCE.createAuthor(); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + aa.getAddrs().add(createUSRealmAddress()); + auth.setAssignedAuthor(aa); + target.getAuthors().add(auth); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressStreetAddressLine( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressStreetAddressLineTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressUseP() { + OperationsTestCase validateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressUsePTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressUseP", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHOR_ASSIGNED_AUTHOR_US_REALM_ADDRESS_USE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Author auth = CDAFactory.eINSTANCE.createAuthor(); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + aa.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + auth.setAssignedAuthor(aa); + target.getAuthors().add(auth); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getAuthors().clear(); + Author auth = CDAFactory.eINSTANCE.createAuthor(); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + aa.getAddrs().add(createUSRealmAddress()); + auth.setAssignedAuthor(aa); + target.getAuthors().add(auth); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressUseP( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressUsePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressUse() { + OperationsTestCase validateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressUseTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressUse", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHOR_ASSIGNED_AUTHOR_US_REALM_ADDRESS_USE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Author auth = CDAFactory.eINSTANCE.createAuthor(); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + ad.getUses().add(null); + + aa.getAddrs().add(ad); + auth.setAssignedAuthor(aa); + target.getAuthors().add(auth); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getAuthors().clear(); + Author auth = CDAFactory.eINSTANCE.createAuthor(); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + aa.getAddrs().add(createUSRealmAddress()); + auth.setAssignedAuthor(aa); + target.getAuthors().add(auth); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressUse( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthorAssignedAuthorUSRealmAddressUseTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthorAssignedAuthorTELUse() { + OperationsTestCase validateGeneralHeaderConstraintsAuthorAssignedAuthorTELUseTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthorAssignedAuthorTELUse", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHOR_ASSIGNED_AUTHOR_TEL_USE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Author auth = CDAFactory.eINSTANCE.createAuthor(); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + aa.getTelecoms().add(DatatypesFactory.eINSTANCE.createTEL()); + auth.setAssignedAuthor(aa); + target.getAuthors().add(auth); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getAuthors().clear(); + Author auth = CDAFactory.eINSTANCE.createAuthor(); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + TEL tel = DatatypesFactory.eINSTANCE.createTEL(); + tel.getUses().add(TelecommunicationAddressUse.HP); + aa.getTelecoms().add(tel); + auth.setAssignedAuthor(aa); + target.getAuthors().add(auth); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthorAssignedAuthorTELUse( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthorAssignedAuthorTELUseTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsInformantRelatedEntityPersonName() { + OperationsTestCase validateGeneralHeaderConstraintsInformantRelatedEntityPersonNameTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsInformantRelatedEntityPersonName", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_INFORMANT_RELATED_ENTITY_PERSON_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + + Informant12 informant = CDAFactory.eINSTANCE.createInformant12(); + CDAFactory.eINSTANCE.createAssignedEntity(); + + RelatedEntity re = CDAFactory.eINSTANCE.createRelatedEntity(); + Person person = CDAFactory.eINSTANCE.createPerson(); + re.setRelatedPerson(person); + + informant.setRelatedEntity(re); + target.getInformants().add(informant); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getInformants().clear(); + + Informant12 informant = CDAFactory.eINSTANCE.createInformant12(); + CDAFactory.eINSTANCE.createAssignedEntity(); + + RelatedEntity re = CDAFactory.eINSTANCE.createRelatedEntity(); + Person person = CDAFactory.eINSTANCE.createPerson(); + person.getNames().add(DatatypesFactory.eINSTANCE.createPN()); + re.setRelatedPerson(person); + + informant.setRelatedEntity(re); + target.getInformants().add(informant); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsInformantRelatedEntityPersonName( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsInformantRelatedEntityPersonNameTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsInformantAssignedEntityAddr() { + OperationsTestCase validateGeneralHeaderConstraintsInformantAssignedEntityAddrTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsInformantAssignedEntityAddr", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_INFORMANT_ASSIGNED_ENTITY_ADDR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + + Informant12 informant = CDAFactory.eINSTANCE.createInformant12(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + + informant.setAssignedEntity(ae); + target.getInformants().add(informant); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getInformants().clear(); + + Informant12 informant = CDAFactory.eINSTANCE.createInformant12(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + + informant.setAssignedEntity(ae); + target.getInformants().add(informant); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsInformantAssignedEntityAddr( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsInformantAssignedEntityAddrTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsInformantAssignedEntityCode() { + OperationsTestCase validateGeneralHeaderConstraintsInformantAssignedEntityCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsInformantAssignedEntityCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_INFORMANT_ASSIGNED_ENTITY_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + + Informant12 informant = CDAFactory.eINSTANCE.createInformant12(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + + informant.setAssignedEntity(ae); + target.getInformants().add(informant); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getInformants().clear(); + + Informant12 informant = CDAFactory.eINSTANCE.createInformant12(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + + ae.setCode(DatatypesFactory.eINSTANCE.createCE("207L00000X", "2.16.840.1.113883.6.101")); + informant.setAssignedEntity(ae); + target.getInformants().add(informant); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsInformantAssignedEntityCode( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsInformantAssignedEntityCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsInformantAssignedEntityCodeP() { + OperationsTestCase validateGeneralHeaderConstraintsInformantAssignedEntityCodePTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsInformantAssignedEntityCodeP", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_INFORMANT_ASSIGNED_ENTITY_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + + Informant12 informant = CDAFactory.eINSTANCE.createInformant12(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + + informant.setAssignedEntity(ae); + target.getInformants().add(informant); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getInformants().clear(); + + Informant12 informant = CDAFactory.eINSTANCE.createInformant12(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + + ae.setCode(DatatypesFactory.eINSTANCE.createCE("207L00000X", "2.16.840.1.113883.6.101")); + informant.setAssignedEntity(ae); + target.getInformants().add(informant); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsInformantAssignedEntityCodeP( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsInformantAssignedEntityCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsInformantAssignedEntityId() { + OperationsTestCase validateGeneralHeaderConstraintsInformantAssignedEntityIdTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsInformantAssignedEntityId", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_INFORMANT_ASSIGNED_ENTITY_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Informant12 informant = CDAFactory.eINSTANCE.createInformant12(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + informant.setAssignedEntity(ae); + target.getInformants().add(informant); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getInformants().clear(); + Informant12 informant = CDAFactory.eINSTANCE.createInformant12(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getIds().add(DatatypesFactory.eINSTANCE.createII()); + informant.setAssignedEntity(ae); + target.getInformants().add(informant); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsInformantAssignedEntityId( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsInformantAssignedEntityIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsInformantAssignedEntityAssignedPerson() { + OperationsTestCase validateGeneralHeaderConstraintsInformantAssignedEntityAssignedPersonTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsInformantAssignedEntityAssignedPerson", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_INFORMANT_ASSIGNED_ENTITY_ASSIGNED_PERSON__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Informant12 informant = CDAFactory.eINSTANCE.createInformant12(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + informant.setAssignedEntity(ae); + target.getInformants().add(informant); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getInformants().clear(); + Informant12 informant = CDAFactory.eINSTANCE.createInformant12(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.setAssignedPerson(CDAFactory.eINSTANCE.createPerson()); + informant.setAssignedEntity(ae); + target.getInformants().add(informant); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsInformantAssignedEntityAssignedPerson( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsInformantAssignedEntityAssignedPersonTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressStreet() { + OperationsTestCase validateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressStreetTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressStreet", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_INFORMANT_RELATED_ENTITY_US_REALM_ADDRESS_STREET__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + public void addFailTests() { + + addFailTest(new FailTest() { + + @Override + public void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Informant12 inf = CDAFactory.eINSTANCE.createInformant12(); + RelatedEntity re = CDAFactory.eINSTANCE.createRelatedEntity(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + re.getAddrs().add(ad); + inf.setRelatedEntity(re); + target.getInformants().add(inf); + + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Informant12 inf = CDAFactory.eINSTANCE.createInformant12(); + RelatedEntity re = CDAFactory.eINSTANCE.createRelatedEntity(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + + re.getAddrs().add(ad); + inf.setRelatedEntity(re); + target.getInformants().add(inf); + + } + }); + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getInformants().clear(); + Informant12 inf = CDAFactory.eINSTANCE.createInformant12(); + RelatedEntity re = CDAFactory.eINSTANCE.createRelatedEntity(); + re.getAddrs().add(createUSRealmAddress()); + inf.setRelatedEntity(re); + target.getInformants().add(inf); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressStreet( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressStreetTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressCity() { + OperationsTestCase validateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressCityTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressCity", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_INFORMANT_RELATED_ENTITY_US_REALM_ADDRESS_CITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Informant12 inf = CDAFactory.eINSTANCE.createInformant12(); + RelatedEntity re = CDAFactory.eINSTANCE.createRelatedEntity(); + re.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + inf.setRelatedEntity(re); + target.getInformants().add(inf); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getInformants().clear(); + Informant12 inf = CDAFactory.eINSTANCE.createInformant12(); + RelatedEntity re = CDAFactory.eINSTANCE.createRelatedEntity(); + re.getAddrs().add(createUSRealmAddress()); + inf.setRelatedEntity(re); + target.getInformants().add(inf); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressCity( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressCityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressCountry() { + OperationsTestCase validateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressCountryTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressCountry", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_INFORMANT_RELATED_ENTITY_US_REALM_ADDRESS_COUNTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Informant12 inf = CDAFactory.eINSTANCE.createInformant12(); + RelatedEntity re = CDAFactory.eINSTANCE.createRelatedEntity(); + re.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + inf.setRelatedEntity(re); + target.getInformants().add(inf); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getInformants().clear(); + Informant12 inf = CDAFactory.eINSTANCE.createInformant12(); + RelatedEntity re = CDAFactory.eINSTANCE.createRelatedEntity(); + re.getAddrs().add(createUSRealmAddress()); + inf.setRelatedEntity(re); + target.getInformants().add(inf); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressCountry( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressCountryTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressPostalCode() { + OperationsTestCase validateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressPostalCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressPostalCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_INFORMANT_RELATED_ENTITY_US_REALM_ADDRESS_POSTAL_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Informant12 inf = CDAFactory.eINSTANCE.createInformant12(); + RelatedEntity re = CDAFactory.eINSTANCE.createRelatedEntity(); + re.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + inf.setRelatedEntity(re); + target.getInformants().add(inf); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getInformants().clear(); + Informant12 inf = CDAFactory.eINSTANCE.createInformant12(); + RelatedEntity re = CDAFactory.eINSTANCE.createRelatedEntity(); + re.getAddrs().add(createUSRealmAddress()); + inf.setRelatedEntity(re); + target.getInformants().add(inf); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressPostalCode( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressPostalCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressState() { + OperationsTestCase validateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressStateTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressState", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_INFORMANT_RELATED_ENTITY_US_REALM_ADDRESS_STATE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Informant12 inf = CDAFactory.eINSTANCE.createInformant12(); + RelatedEntity re = CDAFactory.eINSTANCE.createRelatedEntity(); + re.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + inf.setRelatedEntity(re); + target.getInformants().add(inf); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getInformants().clear(); + Informant12 inf = CDAFactory.eINSTANCE.createInformant12(); + RelatedEntity re = CDAFactory.eINSTANCE.createRelatedEntity(); + re.getAddrs().add(createUSRealmAddress()); + inf.setRelatedEntity(re); + target.getInformants().add(inf); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressState( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressStateTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressStreetAddressLine() { + OperationsTestCase validateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressStreetAddressLineTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressStreetAddressLine", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_INFORMANT_RELATED_ENTITY_US_REALM_ADDRESS_STREET_ADDRESS_LINE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Informant12 inf = CDAFactory.eINSTANCE.createInformant12(); + RelatedEntity re = CDAFactory.eINSTANCE.createRelatedEntity(); + re.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + inf.setRelatedEntity(re); + target.getInformants().add(inf); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getInformants().clear(); + Informant12 inf = CDAFactory.eINSTANCE.createInformant12(); + RelatedEntity re = CDAFactory.eINSTANCE.createRelatedEntity(); + re.getAddrs().add(createUSRealmAddress()); + inf.setRelatedEntity(re); + target.getInformants().add(inf); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressStreetAddressLine( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressStreetAddressLineTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressUseP() { + OperationsTestCase validateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressUsePTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressUseP", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_INFORMANT_RELATED_ENTITY_US_REALM_ADDRESS_USE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Informant12 inf = CDAFactory.eINSTANCE.createInformant12(); + RelatedEntity re = CDAFactory.eINSTANCE.createRelatedEntity(); + re.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + inf.setRelatedEntity(re); + target.getInformants().add(inf); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getInformants().clear(); + Informant12 inf = CDAFactory.eINSTANCE.createInformant12(); + RelatedEntity re = CDAFactory.eINSTANCE.createRelatedEntity(); + re.getAddrs().add(createUSRealmAddress()); + inf.setRelatedEntity(re); + target.getInformants().add(inf); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressUseP( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressUsePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressUse() { + OperationsTestCase validateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressUseTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressUse", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_INFORMANT_RELATED_ENTITY_US_REALM_ADDRESS_USE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Informant12 inf = CDAFactory.eINSTANCE.createInformant12(); + RelatedEntity re = CDAFactory.eINSTANCE.createRelatedEntity(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + ad.getUses().add(null); + + re.getAddrs().add(ad); + inf.setRelatedEntity(re); + target.getInformants().add(inf); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getInformants().clear(); + Informant12 inf = CDAFactory.eINSTANCE.createInformant12(); + RelatedEntity re = CDAFactory.eINSTANCE.createRelatedEntity(); + re.getAddrs().add(createUSRealmAddress()); + inf.setRelatedEntity(re); + target.getInformants().add(inf); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressUse( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsInformantRelatedEntityUSRealmAddressUseTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + // @Test + // public void testValidateGeneralHeaderConstraintsInformantAssignedEntityPerson() { + // OperationsTestCase validateGeneralHeaderConstraintsInformantAssignedEntityPersonTestCase = new + // OperationsTestCase( + // "validateGeneralHeaderConstraintsInformantAssignedEntityPerson", + // operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_INFORMANT_ASSIGNED_ENTITY_PERSON__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + // objectFactory) { + // + // @Override + // protected void updateToFail(GeneralHeaderConstraints target) { + // target.init(); + // Informant12 informant = CDAFactory.eINSTANCE.createInformant12(); + // AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + // informant.setAssignedEntity(ae); + // target.getInformants().add(informant); + // } + // + // @Override + // protected void updateToPass(GeneralHeaderConstraints target) { + // target.getInformants().clear(); + // Informant12 informant = CDAFactory.eINSTANCE.createInformant12(); + // AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + // ae.getIds().add(DatatypesFactory.eINSTANCE.createII()); + // ae.setAssignedPerson(CDAFactory.eINSTANCE.createPerson()); + // informant.setAssignedEntity(ae); + // target.getInformants().add(informant); + // } + // + // @Override + // protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + // + // return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsInformantAssignedEntityPerson( + // (GeneralHeaderConstraints) objectToTest, diagnostician, map); + // } + // + // }; + // + // validateGeneralHeaderConstraintsInformantAssignedEntityPersonTestCase.doValidationTest(); + // } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsInformantHasAssignedEntityOrRelatedEntity() { + OperationsTestCase validateGeneralHeaderConstraintsInformantHasAssignedEntityOrRelatedEntityTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsInformantHasAssignedEntityOrRelatedEntity", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_INFORMANT_HAS_ASSIGNED_ENTITY_OR_RELATED_ENTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + /* + * (non-Javadoc) + * + * @see org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest.OperationsTestCase#addFailTests() + */ + @Override + public void addFailTests() { + + addFailTest(new FailTest() { + + @Override + public void updateToFail(GeneralHeaderConstraints target) { + target.init(); + + Informant12 informant = CDAFactory.eINSTANCE.createInformant12(); + + target.getInformants().add(informant); + + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(GeneralHeaderConstraints target) { + target.init(); + + Informant12 informant = CDAFactory.eINSTANCE.createInformant12(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + informant.setAssignedEntity(ae); + RelatedEntity re = CDAFactory.eINSTANCE.createRelatedEntity(); + + informant.setRelatedEntity(re); + + target.getInformants().add(informant); + + } + }); + + } + + /* + * (non-Javadoc) + * + * @see org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest.OperationsTestCase#addPassTests() + */ + @Override + public void addPassTests() { + addPassTest(new PassTest() { + + @Override + public void updateToPass(GeneralHeaderConstraints target) { + target.init(); + + Informant12 informant = CDAFactory.eINSTANCE.createInformant12(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + informant.setAssignedEntity(ae); + + target.getInformants().add(informant); + + } + + }); + + addPassTest(new PassTest() { + + @Override + public void updateToPass(GeneralHeaderConstraints target) { + target.init(); + + Informant12 informant = CDAFactory.eINSTANCE.createInformant12(); + + RelatedEntity re = CDAFactory.eINSTANCE.createRelatedEntity(); + + informant.setRelatedEntity(re); + + target.getInformants().add(informant); + + } + + }); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsInformantHasAssignedEntityOrRelatedEntity( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsInformantHasAssignedEntityOrRelatedEntityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsInformantAssignedEntity() { + OperationsTestCase validateGeneralHeaderConstraintsInformantAssignedEntityTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsInformantAssignedEntity", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_INFORMANT_ASSIGNED_ENTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + + Informant12 informant = CDAFactory.eINSTANCE.createInformant12(); + + target.getInformants().add(informant); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getInformants().clear(); + + Informant12 informant = CDAFactory.eINSTANCE.createInformant12(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + + informant.setAssignedEntity(ae); + + target.getInformants().add(informant); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsInformantAssignedEntity( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsInformantAssignedEntityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsInformantRelatedEntity() { + OperationsTestCase validateGeneralHeaderConstraintsInformantRelatedEntityTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsInformantRelatedEntity", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_INFORMANT_RELATED_ENTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + + Informant12 informant = CDAFactory.eINSTANCE.createInformant12(); + + target.getInformants().add(informant); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getInformants().clear(); + + Informant12 informant = CDAFactory.eINSTANCE.createInformant12(); + RelatedEntity re = CDAFactory.eINSTANCE.createRelatedEntity(); + + informant.setRelatedEntity(re); + + target.getInformants().add(informant); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsInformantRelatedEntity( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsInformantRelatedEntityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsParticipantSupportAssociatedEntityHasAssociatedPersonOrScopingOrganization() { + OperationsTestCase validateGeneralHeaderConstraintsParticipantSupportAssociatedEntityHasAssociatedPersonOrScopingOrganizationTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsParticipantSupportAssociatedEntityHasAssociatedPersonOrScopingOrganization", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_PARTICIPANT_SUPPORT_ASSOCIATED_ENTITY_HAS_ASSOCIATED_PERSON_OR_SCOPING_ORGANIZATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + /* + * (non-Javadoc) + * + * @see org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest.OperationsTestCase#addFailTests() + */ + @Override + public void addFailTests() { + + addFailTest(new FailTest() { + + @Override + public void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Participant1 participant = CDAFactory.eINSTANCE.createParticipant1(); + AssociatedEntity ae = CDAFactory.eINSTANCE.createAssociatedEntity(); + ae.setAssociatedPerson(CDAFactory.eINSTANCE.createPerson()); + ae.setScopingOrganization(CDAFactory.eINSTANCE.createOrganization()); + participant.setAssociatedEntity(ae); + target.getParticipants().add(participant); + } + }); + + } + + /* + * (non-Javadoc) + * + * @see org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest.OperationsTestCase#addPassTests() + */ + @Override + public void addPassTests() { + + addPassTest(new PassTest() { + + @Override + public void updateToPass(GeneralHeaderConstraints target) { + target.init(); + Participant1 participant = CDAFactory.eINSTANCE.createParticipant1(); + AssociatedEntity ae = CDAFactory.eINSTANCE.createAssociatedEntity(); + ae.setScopingOrganization(CDAFactory.eINSTANCE.createOrganization()); + participant.setAssociatedEntity(ae); + target.getParticipants().add(participant); + + } + }); + + addPassTest(new PassTest() { + + @Override + public void updateToPass(GeneralHeaderConstraints target) { + target.init(); + Participant1 participant = CDAFactory.eINSTANCE.createParticipant1(); + AssociatedEntity ae = CDAFactory.eINSTANCE.createAssociatedEntity(); + ae.setAssociatedPerson(CDAFactory.eINSTANCE.createPerson()); + participant.setAssociatedEntity(ae); + target.getParticipants().add(participant); + + } + }); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsParticipantSupportAssociatedEntityHasAssociatedPersonOrScopingOrganization( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsParticipantSupportAssociatedEntityHasAssociatedPersonOrScopingOrganizationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsInformantRelatedEntityAddr() { + OperationsTestCase validateGeneralHeaderConstraintsInformantRelatedEntityAddrTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsInformantRelatedEntityAddr", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_INFORMANT_RELATED_ENTITY_ADDR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + + Informant12 informant = CDAFactory.eINSTANCE.createInformant12(); + RelatedEntity re = CDAFactory.eINSTANCE.createRelatedEntity(); + + informant.setRelatedEntity(re); + + target.getInformants().add(informant); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getInformants().clear(); + + Informant12 informant = CDAFactory.eINSTANCE.createInformant12(); + RelatedEntity re = CDAFactory.eINSTANCE.createRelatedEntity(); + re.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + + informant.setRelatedEntity(re); + + target.getInformants().add(informant); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsInformantRelatedEntityAddr( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsInformantRelatedEntityAddrTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsInformantRelatedEntityPerson() { + OperationsTestCase validateGeneralHeaderConstraintsInformantRelatedEntityPersonTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsInformantRelatedEntityPerson", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_INFORMANT_RELATED_ENTITY_PERSON__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + + Informant12 informant = CDAFactory.eINSTANCE.createInformant12(); + RelatedEntity re = CDAFactory.eINSTANCE.createRelatedEntity(); + + informant.setRelatedEntity(re); + + target.getInformants().add(informant); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getInformants().clear(); + Informant12 informant = CDAFactory.eINSTANCE.createInformant12(); + RelatedEntity re = CDAFactory.eINSTANCE.createRelatedEntity(); + re.setRelatedPerson(CDAFactory.eINSTANCE.createPerson()); + + informant.setRelatedEntity(re); + + target.getInformants().add(informant); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsInformantRelatedEntityPerson( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsInformantRelatedEntityPersonTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsInformantAssignedEntityPersonName() { + OperationsTestCase validateGeneralHeaderConstraintsInformantAssignedEntityPersonNameTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsInformantAssignedEntityPersonName", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_INFORMANT_ASSIGNED_ENTITY_PERSON_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Informant12 informant = CDAFactory.eINSTANCE.createInformant12(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getIds().add(DatatypesFactory.eINSTANCE.createII()); + ae.setAssignedPerson(CDAFactory.eINSTANCE.createPerson()); + informant.setAssignedEntity(ae); + target.getInformants().add(informant); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getInformants().clear(); + Informant12 informant = CDAFactory.eINSTANCE.createInformant12(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getIds().add(DatatypesFactory.eINSTANCE.createII()); + Person person = CDAFactory.eINSTANCE.createPerson(); + person.getNames().add(DatatypesFactory.eINSTANCE.createPN()); + ae.setAssignedPerson(person); + informant.setAssignedEntity(ae); + target.getInformants().add(informant); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsInformantAssignedEntityPersonName( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsInformantAssignedEntityPersonNameTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsInformantAssignedEntityHasNationalProviderIdentifier() { + OperationsTestCase validateGeneralHeaderConstraintsInformantAssignedEntityHasNationalProviderIdentifierTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsInformantAssignedEntityHasNationalProviderIdentifier", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_INFORMANT_ASSIGNED_ENTITY_HAS_NATIONAL_PROVIDER_IDENTIFIER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + + Informant12 informant = CDAFactory.eINSTANCE.createInformant12(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + + informant.setAssignedEntity(ae); + target.getInformants().add(informant); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getInformants().clear(); + + Informant12 informant = CDAFactory.eINSTANCE.createInformant12(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getIds().add(DatatypesFactory.eINSTANCE.createII("2.16.840.1.113883.4.6")); + + informant.setAssignedEntity(ae); + target.getInformants().add(informant); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsInformantAssignedEntityHasNationalProviderIdentifier( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsInformantAssignedEntityHasNationalProviderIdentifierTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsParticipantSupportTime() { + OperationsTestCase validateGeneralHeaderConstraintsParticipantSupportTimeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsParticipantSupportTime", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_PARTICIPANT_SUPPORT_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + target.init(); + Participant1 participant = CDAFactory.eINSTANCE.createParticipant1(); + target.getParticipants().add(participant); + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + + target.getParticipants().clear(); + Participant1 participant = CDAFactory.eINSTANCE.createParticipant1(); + participant.setTime(DatatypesFactory.eINSTANCE.createIVL_TS()); + target.getParticipants().add(participant); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsParticipantSupportTime( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsParticipantSupportTimeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsInFulfillmentOfOrderId() { + OperationsTestCase validateGeneralHeaderConstraintsInFulfillmentOfOrderIdTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsInFulfillmentOfOrderId", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_IN_FULFILLMENT_OF_ORDER_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + InFulfillmentOf iff = CDAFactory.eINSTANCE.createInFulfillmentOf(); + Order order = CDAFactory.eINSTANCE.createOrder(); + + iff.setOrder(order); + target.getInFulfillmentOfs().add(iff); + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + + target.getInFulfillmentOfs().clear(); + InFulfillmentOf iff = CDAFactory.eINSTANCE.createInFulfillmentOf(); + Order order = CDAFactory.eINSTANCE.createOrder(); + order.getIds().add(DatatypesFactory.eINSTANCE.createII()); + + iff.setOrder(order); + target.getInFulfillmentOfs().add(iff); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsInFulfillmentOfOrderId( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsInFulfillmentOfOrderIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsInFulfillmentOfOrder() { + OperationsTestCase validateGeneralHeaderConstraintsInFulfillmentOfOrderTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsInFulfillmentOfOrder", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_IN_FULFILLMENT_OF_ORDER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + InFulfillmentOf iff = CDAFactory.eINSTANCE.createInFulfillmentOf(); + + target.getInFulfillmentOfs().add(iff); + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + + target.getInFulfillmentOfs().clear(); + InFulfillmentOf iff = CDAFactory.eINSTANCE.createInFulfillmentOf(); + Order order = CDAFactory.eINSTANCE.createOrder(); + order.getIds().add(DatatypesFactory.eINSTANCE.createII()); + + iff.setOrder(order); + target.getInFulfillmentOfs().add(iff); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsInFulfillmentOfOrder( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsInFulfillmentOfOrderTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1AssignedEntityHasNationalProviderIdentifier() { + OperationsTestCase validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1AssignedEntityHasNationalProviderIdentifierTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1AssignedEntityHasNationalProviderIdentifier", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_DOCUMENTATION_OF_SERVICE_EVENT_PERFORMER1_ASSIGNED_ENTITY_HAS_NATIONAL_PROVIDER_IDENTIFIER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + Performer1 perf = CDAFactory.eINSTANCE.createPerformer1(); + perf.setTypeCode(x_ServiceEventPerformer.PPRF); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getIds().add(DatatypesFactory.eINSTANCE.createII()); + perf.setAssignedEntity(ae); + se.getPerformers().add(perf); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + Performer1 perf = CDAFactory.eINSTANCE.createPerformer1(); + perf.setTypeCode(x_ServiceEventPerformer.PPRF); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getIds().add(DatatypesFactory.eINSTANCE.createII("2.16.840.1.113883.4.6")); + perf.setAssignedEntity(ae); + se.getPerformers().add(perf); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1AssignedEntityHasNationalProviderIdentifier( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1AssignedEntityHasNationalProviderIdentifierTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1AssignedEntityCodeP() { + OperationsTestCase validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1AssignedEntityCodePTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1AssignedEntityCodeP", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_DOCUMENTATION_OF_SERVICE_EVENT_PERFORMER1_ASSIGNED_ENTITY_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + Performer1 perf = CDAFactory.eINSTANCE.createPerformer1(); + perf.setTypeCode(x_ServiceEventPerformer.PPRF); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + perf.setAssignedEntity(ae); + se.getPerformers().add(perf); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + Performer1 perf = CDAFactory.eINSTANCE.createPerformer1(); + perf.setTypeCode(x_ServiceEventPerformer.PPRF); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.setCode(DatatypesFactory.eINSTANCE.createCE("test", "2.16.840.1.113883.6.101")); + perf.setAssignedEntity(ae); + se.getPerformers().add(perf); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1AssignedEntityCodeP( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1AssignedEntityCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1AssignedEntityCode() { + OperationsTestCase validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1AssignedEntityCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1AssignedEntityCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_DOCUMENTATION_OF_SERVICE_EVENT_PERFORMER1_ASSIGNED_ENTITY_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + Performer1 perf = CDAFactory.eINSTANCE.createPerformer1(); + perf.setTypeCode(x_ServiceEventPerformer.PPRF); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + perf.setAssignedEntity(ae); + se.getPerformers().add(perf); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + Performer1 perf = CDAFactory.eINSTANCE.createPerformer1(); + perf.setTypeCode(x_ServiceEventPerformer.PPRF); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.setCode(DatatypesFactory.eINSTANCE.createCE("test", "2.16.840.1.113883.6.101")); + perf.setAssignedEntity(ae); + se.getPerformers().add(perf); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1AssignedEntityCode( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1AssignedEntityCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1AssignedEntityId() { + OperationsTestCase validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1AssignedEntityIdTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1AssignedEntityId", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_DOCUMENTATION_OF_SERVICE_EVENT_PERFORMER1_ASSIGNED_ENTITY_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + Performer1 perf = CDAFactory.eINSTANCE.createPerformer1(); + perf.setTypeCode(x_ServiceEventPerformer.PPRF); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + perf.setAssignedEntity(ae); + se.getPerformers().add(perf); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + Performer1 perf = CDAFactory.eINSTANCE.createPerformer1(); + perf.setTypeCode(x_ServiceEventPerformer.PPRF); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getIds().add(DatatypesFactory.eINSTANCE.createII()); + perf.setAssignedEntity(ae); + se.getPerformers().add(perf); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1AssignedEntityId( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1AssignedEntityIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1FunctionCodeP() { + OperationsTestCase validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1FunctionCodePTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1FunctionCodeP", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_DOCUMENTATION_OF_SERVICE_EVENT_PERFORMER1_FUNCTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + Performer1 perf = CDAFactory.eINSTANCE.createPerformer1(); + perf.setTypeCode(x_ServiceEventPerformer.PPRF); + + se.getPerformers().add(perf); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + Performer1 perf = CDAFactory.eINSTANCE.createPerformer1(); + perf.setTypeCode(x_ServiceEventPerformer.PPRF); + + perf.setFunctionCode(DatatypesFactory.eINSTANCE.createCE("PRF", "2.16.840.1.113883.5.88")); + + se.getPerformers().add(perf); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1FunctionCodeP( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1FunctionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1FunctionCode() { + OperationsTestCase validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1FunctionCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1FunctionCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_DOCUMENTATION_OF_SERVICE_EVENT_PERFORMER1_FUNCTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + Performer1 perf = CDAFactory.eINSTANCE.createPerformer1(); + perf.setTypeCode(x_ServiceEventPerformer.PPRF); + + se.getPerformers().add(perf); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + Performer1 perf = CDAFactory.eINSTANCE.createPerformer1(); + perf.setTypeCode(x_ServiceEventPerformer.PPRF); + + perf.setFunctionCode(DatatypesFactory.eINSTANCE.createCE("PRF", "2.16.840.1.113883.5.88")); + + se.getPerformers().add(perf); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1FunctionCode( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1FunctionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1TypeCode() { + OperationsTestCase validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1TypeCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1TypeCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_DOCUMENTATION_OF_SERVICE_EVENT_PERFORMER1_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + Performer1 perf = CDAFactory.eINSTANCE.createPerformer1(); + + se.getPerformers().add(perf); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + Performer1 perf = CDAFactory.eINSTANCE.createPerformer1(); + perf.setTypeCode(x_ServiceEventPerformer.PRF); + se.getPerformers().add(perf); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1TypeCode( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1TypeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1AssignedEntity() { + OperationsTestCase validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1AssignedEntityTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1AssignedEntity", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_DOCUMENTATION_OF_SERVICE_EVENT_PERFORMER1_ASSIGNED_ENTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + Performer1 perf = CDAFactory.eINSTANCE.createPerformer1(); + perf.setTypeCode(x_ServiceEventPerformer.PPRF); + se.getPerformers().add(perf); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + Performer1 perf = CDAFactory.eINSTANCE.createPerformer1(); + perf.setTypeCode(x_ServiceEventPerformer.PPRF); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + perf.setAssignedEntity(ae); + se.getPerformers().add(perf); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1AssignedEntity( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1AssignedEntityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsDocumentationOfServiceEventEffectiveTimeLow() { + OperationsTestCase validateGeneralHeaderConstraintsDocumentationOfServiceEventEffectiveTimeLowTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsDocumentationOfServiceEventEffectiveTimeLow", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_DOCUMENTATION_OF_SERVICE_EVENT_EFFECTIVE_TIME_LOW__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + dof.setServiceEvent(se); + se.setEffectiveTime(DatatypesFactory.eINSTANCE.createIVL_TS()); + target.getDocumentationOfs().add(dof); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + se.setEffectiveTime(DatatypesFactory.eINSTANCE.createIVL_TS("1", "2")); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsDocumentationOfServiceEventEffectiveTimeLow( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsDocumentationOfServiceEventEffectiveTimeLowTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsDocumentationOfServiceEventEffectiveTime() { + OperationsTestCase validateGeneralHeaderConstraintsDocumentationOfServiceEventEffectiveTimeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsDocumentationOfServiceEventEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_DOCUMENTATION_OF_SERVICE_EVENT_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + dof.setServiceEvent(CDAFactory.eINSTANCE.createServiceEvent()); + target.getDocumentationOfs().add(dof); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + se.setEffectiveTime(DatatypesFactory.eINSTANCE.createIVL_TS()); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsDocumentationOfServiceEventEffectiveTime( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsDocumentationOfServiceEventEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer() { + OperationsTestCase validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformerTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_DOCUMENTATION_OF_SERVICE_EVENT_PERFORMER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + dof.setServiceEvent(CDAFactory.eINSTANCE.createServiceEvent()); + target.getDocumentationOfs().add(dof); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + se.getPerformers().add(CDAFactory.eINSTANCE.createPerformer1()); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformerTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsDocumentationOfServiceEvent() { + OperationsTestCase validateGeneralHeaderConstraintsDocumentationOfServiceEventTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsDocumentationOfServiceEvent", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_DOCUMENTATION_OF_SERVICE_EVENT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + target.getDocumentationOfs().add(CDAFactory.eINSTANCE.createDocumentationOf()); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + dof.setServiceEvent(CDAFactory.eINSTANCE.createServiceEvent()); + target.getDocumentationOfs().add(dof); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsDocumentationOfServiceEvent( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsDocumentationOfServiceEventTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthorizationConsentCode() { + OperationsTestCase validateGeneralHeaderConstraintsAuthorizationConsentCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthorizationConsentCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHORIZATION_CONSENT_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Consent con = CDAFactory.eINSTANCE.createConsent(); + Authorization auth = CDAFactory.eINSTANCE.createAuthorization(); + auth.setConsent(con); + target.getAuthorizations().add(auth); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getAuthorizations().clear(); + Consent con = CDAFactory.eINSTANCE.createConsent(); + Authorization auth = CDAFactory.eINSTANCE.createAuthorization(); + con.setCode(DatatypesFactory.eINSTANCE.createCE()); + auth.setConsent(con); + target.getAuthorizations().add(auth); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthorizationConsentCode( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthorizationConsentCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthorizationConsentId() { + OperationsTestCase validateGeneralHeaderConstraintsAuthorizationConsentIdTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthorizationConsentId", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHORIZATION_CONSENT_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Consent con = CDAFactory.eINSTANCE.createConsent(); + Authorization auth = CDAFactory.eINSTANCE.createAuthorization(); + auth.setConsent(con); + target.getAuthorizations().add(auth); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getAuthorizations().clear(); + Consent con = CDAFactory.eINSTANCE.createConsent(); + Authorization auth = CDAFactory.eINSTANCE.createAuthorization(); + con.getIds().add(DatatypesFactory.eINSTANCE.createII()); + auth.setConsent(con); + target.getAuthorizations().add(auth); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthorizationConsentId( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthorizationConsentIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthorizationConsentStatusCodeP() { + OperationsTestCase validateGeneralHeaderConstraintsAuthorizationConsentStatusCodePTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthorizationConsentStatusCodeP", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHORIZATION_CONSENT_STATUS_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Consent con = CDAFactory.eINSTANCE.createConsent(); + Authorization auth = CDAFactory.eINSTANCE.createAuthorization(); + auth.setConsent(con); + target.getAuthorizations().add(auth); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getAuthorizations().clear(); + Consent con = CDAFactory.eINSTANCE.createConsent(); + Authorization auth = CDAFactory.eINSTANCE.createAuthorization(); + con.setStatusCode(DatatypesFactory.eINSTANCE.createCS("completed")); + auth.setConsent(con); + target.getAuthorizations().add(auth); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthorizationConsentStatusCodeP( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthorizationConsentStatusCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthorizationConsentStatusCode() { + OperationsTestCase validateGeneralHeaderConstraintsAuthorizationConsentStatusCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthorizationConsentStatusCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHORIZATION_CONSENT_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Consent con = CDAFactory.eINSTANCE.createConsent(); + Authorization auth = CDAFactory.eINSTANCE.createAuthorization(); + auth.setConsent(con); + target.getAuthorizations().add(auth); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getAuthorizations().clear(); + Consent con = CDAFactory.eINSTANCE.createConsent(); + Authorization auth = CDAFactory.eINSTANCE.createAuthorization(); + con.setStatusCode(DatatypesFactory.eINSTANCE.createCS("completed")); + auth.setConsent(con); + target.getAuthorizations().add(auth); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthorizationConsentStatusCode( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthorizationConsentStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsAuthorizationConsent() { + OperationsTestCase validateGeneralHeaderConstraintsAuthorizationConsentTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsAuthorizationConsent", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_AUTHORIZATION_CONSENT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + target.getAuthorizations().add(CDAFactory.eINSTANCE.createAuthorization()); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.getAuthorizations().clear(); + Consent con = CDAFactory.eINSTANCE.createConsent(); + Authorization auth = CDAFactory.eINSTANCE.createAuthorization(); + auth.setConsent(con); + target.getAuthorizations().add(auth); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsAuthorizationConsent( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsAuthorizationConsentTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends GeneralHeaderConstraintsOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public GeneralHeaderConstraints create() { + return ConsolFactory.eINSTANCE.createGeneralHeaderConstraints(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends GeneralHeaderConstraintsOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + + private AD createUSRealmAddress() { + AD addr = DatatypesFactory.eINSTANCE.createAD(); + addr.getUses().add(PostalAddressUse.HP); + addr.addStreetAddressLine("123 Main Street"); + addr.addCity("Boston"); + addr.addState("MA"); + addr.addCountry("US"); + addr.addPostalCode("01001"); + + return addr; + + } + + private PN createUSRealmPatientName() { + PN name = DatatypesFactory.eINSTANCE.createPN(); + name.addGiven("Aaron"); + name.addFamily("Rodgers"); + name.addPrefix("Mr."); + name.addSuffix("QB"); + name.getUses().add(EntityNameUse.C); + + return name; + } + +} // GeneralHeaderConstraintsOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/GeneralStatusSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/GeneralStatusSectionTest.java new file mode 100644 index 000000000..794d627af --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/GeneralStatusSectionTest.java @@ -0,0 +1,290 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.GeneralStatusSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.GeneralStatusSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'General Status Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralStatusSection#validateGeneralStatusSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Status Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralStatusSection#validateGeneralStatusSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Status Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralStatusSection#validateGeneralStatusSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Status Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralStatusSection#validateGeneralStatusSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Status Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.GeneralStatusSection#validateGeneralStatusSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Status Section Text}
  • + *
+ *

+ * + * @generated + */ + +public class GeneralStatusSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateGeneralStatusSectionTemplateId() { + OperationsTestCase validateGeneralStatusSectionTemplateIdTestCase = new OperationsTestCase( + "validateGeneralStatusSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_STATUS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralStatusSection target) { + + } + + @Override + protected void updateToPass(GeneralStatusSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralStatusSectionOperations.validateGeneralStatusSectionTemplateId( + (GeneralStatusSection) objectToTest, diagnostician, map); + } + + }; + + validateGeneralStatusSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateGeneralStatusSectionCode() { + OperationsTestCase validateGeneralStatusSectionCodeTestCase = new OperationsTestCase( + "validateGeneralStatusSectionCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_STATUS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralStatusSection target) { + + } + + @Override + protected void updateToPass(GeneralStatusSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralStatusSectionOperations.validateGeneralStatusSectionCode( + (GeneralStatusSection) objectToTest, diagnostician, map); + } + + }; + + validateGeneralStatusSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateGeneralStatusSectionCodeP() { + OperationsTestCase validateGeneralStatusSectionCodePTestCase = new OperationsTestCase( + "validateGeneralStatusSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_STATUS_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralStatusSection target) { + + } + + @Override + protected void updateToPass(GeneralStatusSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralStatusSectionOperations.validateGeneralStatusSectionCodeP( + (GeneralStatusSection) objectToTest, diagnostician, map); + } + + }; + + validateGeneralStatusSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateGeneralStatusSectionTitle() { + OperationsTestCase validateGeneralStatusSectionTitleTestCase = new OperationsTestCase( + "validateGeneralStatusSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_STATUS_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralStatusSection target) { + + } + + @Override + protected void updateToPass(GeneralStatusSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralStatusSectionOperations.validateGeneralStatusSectionTitle( + (GeneralStatusSection) objectToTest, diagnostician, map); + } + + }; + + validateGeneralStatusSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateGeneralStatusSectionText() { + OperationsTestCase validateGeneralStatusSectionTextTestCase = new OperationsTestCase( + "validateGeneralStatusSectionText", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_STATUS_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralStatusSection target) { + + } + + @Override + protected void updateToPass(GeneralStatusSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralStatusSectionOperations.validateGeneralStatusSectionText( + (GeneralStatusSection) objectToTest, diagnostician, map); + } + + }; + + validateGeneralStatusSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends GeneralStatusSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public GeneralStatusSection create() { + return ConsolFactory.eINSTANCE.createGeneralStatusSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends GeneralStatusSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // GeneralStatusSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HealthStatusObservationTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HealthStatusObservationTest.java new file mode 100644 index 000000000..78accc540 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HealthStatusObservationTest.java @@ -0,0 +1,541 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ConsolPackage; +import org.openhealthtools.mdht.uml.cda.consol.GeneralStatusSection; +import org.openhealthtools.mdht.uml.cda.consol.HealthStatusObservation; +import org.openhealthtools.mdht.uml.cda.consol.operations.HealthStatusObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; + +/** + * + * A static utility class that provides operations related to 'Health Status Observation' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HealthStatusObservation#validateHealthStatusObservationHasTextReference(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Health Status Observation Has Text Reference}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HealthStatusObservation#validateHealthStatusObservationTextReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Health Status Observation Text Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HealthStatusObservation#validateHealthStatusObservationHasTextReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Health Status Observation Has Text Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HealthStatusObservation#validateHealthStatusObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Health Status Observation Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HealthStatusObservation#validateHealthStatusObservationClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Health Status Observation Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HealthStatusObservation#validateHealthStatusObservationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Health Status Observation Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HealthStatusObservation#validateHealthStatusObservationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Health Status Observation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HealthStatusObservation#validateHealthStatusObservationText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Health Status Observation Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HealthStatusObservation#validateHealthStatusObservationStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Health Status Observation Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HealthStatusObservation#validateHealthStatusObservationValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Health Status Observation Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HealthStatusObservation#validateHealthStatusObservationValueP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Health Status Observation Value P}
  • + *
+ *

+ * + * @generated + */ + +public class HealthStatusObservationTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateHealthStatusObservationHasTextReference() { + OperationsTestCase validateHealthStatusObservationHasTextReferenceTestCase = new OperationsTestCase( + "validateHealthStatusObservationHasTextReference", + operationsForOCL.getOCLValue("VALIDATE_HEALTH_STATUS_OBSERVATION_HAS_TEXT_REFERENCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HealthStatusObservation target) { + target.init(); + ED txt = DatatypesFactory.eINSTANCE.createED(); + target.setText(txt); + } + + @Override + protected void updateToPass(HealthStatusObservation target) { + target.init(); + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL("test")); + target.setText(txt); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HealthStatusObservationOperations.validateHealthStatusObservationHasTextReference( + (HealthStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateHealthStatusObservationHasTextReferenceTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateHealthStatusObservationTextReferenceValue() { + OperationsTestCase validateHealthStatusObservationTextReferenceValueTestCase = new OperationsTestCase( + "validateHealthStatusObservationTextReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_HEALTH_STATUS_OBSERVATION_TEXT_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HealthStatusObservation target) { + target.init(); + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL()); + target.setText(txt); + } + + @Override + protected void updateToPass(HealthStatusObservation target) { + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL("test")); + target.setText(txt); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HealthStatusObservationOperations.validateHealthStatusObservationTextReferenceValue( + (HealthStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateHealthStatusObservationTextReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateHealthStatusObservationHasTextReferenceValue() { + OperationsTestCase validateHealthStatusObservationHasTextReferenceValueTestCase = new NarrativeReferenceTestCase( + "validateHealthStatusObservationHasTextReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_HEALTH_STATUS_OBSERVATION_HAS_TEXT_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HealthStatusObservation target) { + target.init(); + + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), "", + "No particular health status observed."); + + // add a reference to the section text + target.setText(createEDWithReference("Some sample text", "#1.2.3.4")); + + } + + @Override + protected void updateToPass(HealthStatusObservation target) { + + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), + "1.2.3.4", "No particular health status observed."); + + // add a reference to the section text + target.setText(createEDWithReference("Some sample text", "#1.2.3.4")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HealthStatusObservationOperations.validateHealthStatusObservationHasTextReferenceValue( + (HealthStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateHealthStatusObservationHasTextReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHealthStatusObservationTemplateId() { + OperationsTestCase validateHealthStatusObservationTemplateIdTestCase = new OperationsTestCase( + "validateHealthStatusObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HEALTH_STATUS_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HealthStatusObservation target) { + + } + + @Override + protected void updateToPass(HealthStatusObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HealthStatusObservationOperations.validateHealthStatusObservationTemplateId( + (HealthStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateHealthStatusObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHealthStatusObservationClassCode() { + OperationsTestCase validateHealthStatusObservationClassCodeTestCase = new OperationsTestCase( + "validateHealthStatusObservationClassCode", + operationsForOCL.getOCLValue("VALIDATE_HEALTH_STATUS_OBSERVATION_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HealthStatusObservation target) { + + } + + @Override + protected void updateToPass(HealthStatusObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HealthStatusObservationOperations.validateHealthStatusObservationClassCode( + (HealthStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateHealthStatusObservationClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHealthStatusObservationMoodCode() { + OperationsTestCase validateHealthStatusObservationMoodCodeTestCase = new OperationsTestCase( + "validateHealthStatusObservationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_HEALTH_STATUS_OBSERVATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HealthStatusObservation target) { + + } + + @Override + protected void updateToPass(HealthStatusObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HealthStatusObservationOperations.validateHealthStatusObservationMoodCode( + (HealthStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateHealthStatusObservationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHealthStatusObservationCode() { + OperationsTestCase validateHealthStatusObservationCodeTestCase = new OperationsTestCase( + "validateHealthStatusObservationCode", + operationsForOCL.getOCLValue("VALIDATE_HEALTH_STATUS_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HealthStatusObservation target) { + + } + + @Override + protected void updateToPass(HealthStatusObservation target) { + target.init(); + + CE cd = DatatypesFactory.eINSTANCE.createCE(); + cd.setCodeSystem("2.16.840.1.113883.6.1"); + cd.setCode("11323-3"); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HealthStatusObservationOperations.validateHealthStatusObservationCode( + (HealthStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateHealthStatusObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHealthStatusObservationText() { + OperationsTestCase validateHealthStatusObservationTextTestCase = new OperationsTestCase( + "validateHealthStatusObservationText", + operationsForOCL.getOCLValue("VALIDATE_HEALTH_STATUS_OBSERVATION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HealthStatusObservation target) { + + } + + @Override + protected void updateToPass(HealthStatusObservation target) { + target.init(); + + ED text = DatatypesFactory.eINSTANCE.createED(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HealthStatusObservationOperations.validateHealthStatusObservationText( + (HealthStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateHealthStatusObservationTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHealthStatusObservationStatusCode() { + OperationsTestCase validateHealthStatusObservationStatusCodeTestCase = new OperationsTestCase( + "validateHealthStatusObservationStatusCode", + operationsForOCL.getOCLValue("VALIDATE_HEALTH_STATUS_OBSERVATION_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HealthStatusObservation target) { + + } + + @Override + protected void updateToPass(HealthStatusObservation target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HealthStatusObservationOperations.validateHealthStatusObservationStatusCode( + (HealthStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateHealthStatusObservationStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHealthStatusObservationValue() { + OperationsTestCase validateHealthStatusObservationValueTestCase = new OperationsTestCase( + "validateHealthStatusObservationValue", + operationsForOCL.getOCLValue("VALIDATE_HEALTH_STATUS_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HealthStatusObservation target) { + + } + + @Override + protected void updateToPass(HealthStatusObservation target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD(); + value.setCodeSystem("2.16.840.1.113883.6.96"); + value.setCode("81323004"); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HealthStatusObservationOperations.validateHealthStatusObservationValue( + (HealthStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateHealthStatusObservationValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateHealthStatusObservationValueP() { + OperationsTestCase validateHealthStatusObservationValuePTestCase = new OperationsTestCase( + "validateHealthStatusObservationValueP", + operationsForOCL.getOCLValue("VALIDATE_HEALTH_STATUS_OBSERVATION_VALUE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HealthStatusObservation target) { + + } + + @Override + protected void updateToPass(HealthStatusObservation target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD(); + value.setCodeSystem("2.16.840.1.113883.6.96"); + value.setCode("81323004"); + target.getValues().add(value); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HealthStatusObservationOperations.validateHealthStatusObservationValueP( + (HealthStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateHealthStatusObservationValuePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends HealthStatusObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public HealthStatusObservation create() { + return ConsolFactory.eINSTANCE.createHealthStatusObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends HealthStatusObservationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // HealthStatusObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HealthcareProviderTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HealthcareProviderTest.java new file mode 100644 index 000000000..c0f0fa139 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HealthcareProviderTest.java @@ -0,0 +1,45 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Healthcare Provider' model objects. + * + * + * + * @generated + */ + +public class HealthcareProviderTest extends CDAValidationTest { + + /** + * No Operations Test + * @generated + */ + @Test + public void testNoOperations() { + } + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // HealthcareProviderOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HighestPressureUlcerStageTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HighestPressureUlcerStageTest.java new file mode 100644 index 000000000..7cce3afe8 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HighestPressureUlcerStageTest.java @@ -0,0 +1,351 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.HighestPressureUlcerStage; +import org.openhealthtools.mdht.uml.cda.consol.operations.HighestPressureUlcerStageOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; + +/** + * + * A static utility class that provides operations related to 'Highest Pressure Ulcer Stage' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HighestPressureUlcerStage#validateHighestPressureUlcerStageTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Highest Pressure Ulcer Stage Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HighestPressureUlcerStage#validateHighestPressureUlcerStageClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Highest Pressure Ulcer Stage Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HighestPressureUlcerStage#validateHighestPressureUlcerStageMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Highest Pressure Ulcer Stage Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HighestPressureUlcerStage#validateHighestPressureUlcerStageId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Highest Pressure Ulcer Stage Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HighestPressureUlcerStage#validateHighestPressureUlcerStageCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Highest Pressure Ulcer Stage Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HighestPressureUlcerStage#validateHighestPressureUlcerStageCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Highest Pressure Ulcer Stage Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HighestPressureUlcerStage#validateHighestPressureUlcerStageValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Highest Pressure Ulcer Stage Value}
  • + *
+ *

+ * + * @generated + */ + +public class HighestPressureUlcerStageTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHighestPressureUlcerStageTemplateId() { + OperationsTestCase validateHighestPressureUlcerStageTemplateIdTestCase = new OperationsTestCase( + "validateHighestPressureUlcerStageTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HIGHEST_PRESSURE_ULCER_STAGE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HighestPressureUlcerStage target) { + + } + + @Override + protected void updateToPass(HighestPressureUlcerStage target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HighestPressureUlcerStageOperations.validateHighestPressureUlcerStageTemplateId( + (HighestPressureUlcerStage) objectToTest, diagnostician, map); + } + + }; + + validateHighestPressureUlcerStageTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHighestPressureUlcerStageClassCode() { + OperationsTestCase validateHighestPressureUlcerStageClassCodeTestCase = new OperationsTestCase( + "validateHighestPressureUlcerStageClassCode", + operationsForOCL.getOCLValue("VALIDATE_HIGHEST_PRESSURE_ULCER_STAGE_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HighestPressureUlcerStage target) { + + } + + @Override + protected void updateToPass(HighestPressureUlcerStage target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HighestPressureUlcerStageOperations.validateHighestPressureUlcerStageClassCode( + (HighestPressureUlcerStage) objectToTest, diagnostician, map); + } + + }; + + validateHighestPressureUlcerStageClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHighestPressureUlcerStageMoodCode() { + OperationsTestCase validateHighestPressureUlcerStageMoodCodeTestCase = new OperationsTestCase( + "validateHighestPressureUlcerStageMoodCode", + operationsForOCL.getOCLValue("VALIDATE_HIGHEST_PRESSURE_ULCER_STAGE_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HighestPressureUlcerStage target) { + + } + + @Override + protected void updateToPass(HighestPressureUlcerStage target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HighestPressureUlcerStageOperations.validateHighestPressureUlcerStageMoodCode( + (HighestPressureUlcerStage) objectToTest, diagnostician, map); + } + + }; + + validateHighestPressureUlcerStageMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateHighestPressureUlcerStageId() { + OperationsTestCase validateHighestPressureUlcerStageIdTestCase = new OperationsTestCase( + "validateHighestPressureUlcerStageId", + operationsForOCL.getOCLValue("VALIDATE_HIGHEST_PRESSURE_ULCER_STAGE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HighestPressureUlcerStage target) { + + } + + @Override + protected void updateToPass(HighestPressureUlcerStage target) { + target.init(); + target.getIds().add(DatatypesFactory.eINSTANCE.createII()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HighestPressureUlcerStageOperations.validateHighestPressureUlcerStageId( + (HighestPressureUlcerStage) objectToTest, diagnostician, map); + } + + }; + + validateHighestPressureUlcerStageIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHighestPressureUlcerStageCodeP() { + OperationsTestCase validateHighestPressureUlcerStageCodePTestCase = new OperationsTestCase( + "validateHighestPressureUlcerStageCodeP", + operationsForOCL.getOCLValue("VALIDATE_HIGHEST_PRESSURE_ULCER_STAGE_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HighestPressureUlcerStage target) { + + } + + @Override + protected void updateToPass(HighestPressureUlcerStage target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HighestPressureUlcerStageOperations.validateHighestPressureUlcerStageCodeP( + (HighestPressureUlcerStage) objectToTest, diagnostician, map); + } + + }; + + validateHighestPressureUlcerStageCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHighestPressureUlcerStageCode() { + OperationsTestCase validateHighestPressureUlcerStageCodeTestCase = new OperationsTestCase( + "validateHighestPressureUlcerStageCode", + operationsForOCL.getOCLValue("VALIDATE_HIGHEST_PRESSURE_ULCER_STAGE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HighestPressureUlcerStage target) { + + } + + @Override + protected void updateToPass(HighestPressureUlcerStage target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HighestPressureUlcerStageOperations.validateHighestPressureUlcerStageCode( + (HighestPressureUlcerStage) objectToTest, diagnostician, map); + } + + }; + + validateHighestPressureUlcerStageCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHighestPressureUlcerStageValue() { + OperationsTestCase validateHighestPressureUlcerStageValueTestCase = new OperationsTestCase( + "validateHighestPressureUlcerStageValue", + operationsForOCL.getOCLValue("VALIDATE_HIGHEST_PRESSURE_ULCER_STAGE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HighestPressureUlcerStage target) { + + } + + @Override + protected void updateToPass(HighestPressureUlcerStage target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD(); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HighestPressureUlcerStageOperations.validateHighestPressureUlcerStageValue( + (HighestPressureUlcerStage) objectToTest, diagnostician, map); + } + + }; + + validateHighestPressureUlcerStageValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends HighestPressureUlcerStageOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public HighestPressureUlcerStage create() { + return ConsolFactory.eINSTANCE.createHighestPressureUlcerStage(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends HighestPressureUlcerStageOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // HighestPressureUlcerStageOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HistoryAndPhysicalNoteTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HistoryAndPhysicalNoteTest.java new file mode 100644 index 000000000..2a986db75 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HistoryAndPhysicalNoteTest.java @@ -0,0 +1,2305 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.AssignedEntity; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Component1; +import org.openhealthtools.mdht.uml.cda.EncompassingEncounter; +import org.openhealthtools.mdht.uml.cda.EncounterParticipant; +import org.openhealthtools.mdht.uml.cda.Person; +import org.openhealthtools.mdht.uml.cda.ResponsibleParty; +import org.openhealthtools.mdht.uml.cda.consol.AllergiesSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.AssessmentAndPlanSection; +import org.openhealthtools.mdht.uml.cda.consol.AssessmentSection; +import org.openhealthtools.mdht.uml.cda.consol.ChiefComplaintAndReasonForVisitSection; +import org.openhealthtools.mdht.uml.cda.consol.ChiefComplaintSection; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.FamilyHistorySection; +import org.openhealthtools.mdht.uml.cda.consol.GeneralStatusSection; +import org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote; +import org.openhealthtools.mdht.uml.cda.consol.HistoryOfPastIllnessSection; +import org.openhealthtools.mdht.uml.cda.consol.HistoryOfPresentIllnessSection; +import org.openhealthtools.mdht.uml.cda.consol.ImmunizationsSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.InstructionsSection; +import org.openhealthtools.mdht.uml.cda.consol.MedicationsSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.PhysicalExamSection; +import org.openhealthtools.mdht.uml.cda.consol.PlanOfCareSection; +import org.openhealthtools.mdht.uml.cda.consol.ProblemSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.ProceduresSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.ReasonForVisitSection; +import org.openhealthtools.mdht.uml.cda.consol.ResultsSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.ReviewOfSystemsSection; +import org.openhealthtools.mdht.uml.cda.consol.SocialHistorySection; +import org.openhealthtools.mdht.uml.cda.consol.VitalSignsSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.operations.GeneralHeaderConstraintsOperations; +import org.openhealthtools.mdht.uml.cda.consol.operations.HistoryAndPhysicalNoteOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; + +/** + * + * A static utility class that provides operations related to 'History And Physical Note' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#validateHistoryAndPhysicalNoteHasAnAssementAndPlanSectionOrIndividualAssementAndPlanSections(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Note Has An Assement And Plan Section Or Individual Assement And Plan Sections}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#validateHistoryAndPhysicalNoteDoesNotHaveIndividualAssementAndPlanSectionsWhenAssementAndPlanSectionPresent(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Note Does Not Have Individual Assement And Plan Sections When Assement And Plan Section Present}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#validateHistoryAndPhysicalNoteHasChiefComplaintAndReasonForVisitChiefComplaintOrReasonForVisit(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Note Has Chief Complaint And Reason For Visit Chief Complaint Or Reason For Visit}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#validateHistoryAndPhysicalNoteDoesNotHaveChiefComplaintAndReasonForVisitWithChiefComplaintSectionOrReasonSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Note Does Not Have Chief Complaint And Reason For Visit With Chief Complaint Section Or Reason Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#validateHistoryAndPhysicalNoteTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Note Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#validateHistoryAndPhysicalNoteCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Note Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#validateHistoryAndPhysicalNoteCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Note Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#validateHistoryAndPhysicalNoteInFulfillmentOf(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Note In Fulfillment Of}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#validateHistoryAndPhysicalNoteComponentOf(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Note Component Of}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#validateHistoryAndPhysicalNoteAllergiesSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Note Allergies Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#validateHistoryAndPhysicalNoteAssessmentSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Note Assessment Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#validateHistoryAndPhysicalNotePlanOfCareSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Note Plan Of Care Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#validateHistoryAndPhysicalNoteAssessmentAndPlanSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Note Assessment And Plan Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#validateHistoryAndPhysicalNoteChiefComplaintSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Note Chief Complaint Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#validateHistoryAndPhysicalNoteChiefComplaintAndReasonForVisitSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Note Chief Complaint And Reason For Visit Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#validateHistoryAndPhysicalNoteFamilyHistorySection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Note Family History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#validateHistoryAndPhysicalNoteGeneralStatusSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Note General Status Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#validateHistoryAndPhysicalNoteHistoryOfPastIllnessSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Note History Of Past Illness Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#validateHistoryAndPhysicalNoteMedicationsSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Note Medications Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#validateHistoryAndPhysicalNotePhysicalExamSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Note Physical Exam Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#validateHistoryAndPhysicalNoteReasonForVisitSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Note Reason For Visit Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#validateHistoryAndPhysicalNoteResultsSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Note Results Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#validateHistoryAndPhysicalNoteReviewOfSystemsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Note Review Of Systems Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#validateHistoryAndPhysicalNoteSocialHistorySection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Note Social History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#validateHistoryAndPhysicalNoteHistoryOfPresentIllnessSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Note History Of Present Illness Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#validateHistoryAndPhysicalNoteImmunizationsSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Note Immunizations Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#validateHistoryAndPhysicalNoteProblemSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Note Problem Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#validateHistoryAndPhysicalNoteProceduresSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Note Procedures Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#validateHistoryAndPhysicalNoteVitalSignsSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Note Vital Signs Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#validateHistoryAndPhysicalNoteInstructionsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Note Instructions Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#validateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4ResponsiblePartyAssignedEntityHasPersonOrOrganization(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Note Component Of Encompassing Encounter4 Responsible Party Assigned Entity Has Person Or Organization}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#validateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4ResponsiblePartyAssignedEntity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Note Component Of Encompassing Encounter4 Responsible Party Assigned Entity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#validateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4EncounterParticipantAssignedEntityHasPersonOrOrganization(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Note Component Of Encompassing Encounter4 Encounter Participant Assigned Entity Has Person Or Organization}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#validateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4EncounterParticipantAssignedEntity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Note Component Of Encompassing Encounter4 Encounter Participant Assigned Entity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#validateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4EffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Note Component Of Encompassing Encounter4 Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#validateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4Id(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Note Component Of Encompassing Encounter4 Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#validateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4Location(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Note Component Of Encompassing Encounter4 Location}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#validateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4ResponsibleParty(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Note Component Of Encompassing Encounter4 Responsible Party}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#validateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4EncounterParticipant(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Note Component Of Encompassing Encounter4 Encounter Participant}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#validateHistoryAndPhysicalNoteComponentOfEncompassingEncounter(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History And Physical Note Component Of Encompassing Encounter}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#getAllergiesSectionEntriesOptional() Get Allergies Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#getAssessmentSection() Get Assessment Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#getPlanOfCareSection() Get Plan Of Care Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#getAssessmentAndPlanSection() Get Assessment And Plan Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#getChiefComplaintSection() Get Chief Complaint Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#getChiefComplaintAndReasonForVisitSection() Get Chief Complaint And Reason For Visit Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#getFamilyHistorySection() Get Family History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#getGeneralStatusSection() Get General Status Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#getHistoryOfPastIllnessSection() Get History Of Past Illness Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#getMedicationsSectionEntriesOptional() Get Medications Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#getPhysicalExamSection() Get Physical Exam Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#getReasonForVisitSection() Get Reason For Visit Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#getResultsSectionEntriesOptional() Get Results Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#getReviewOfSystemsSection() Get Review Of Systems Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#getSocialHistorySection() Get Social History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#getHistoryOfPresentIllnessSection() Get History Of Present Illness Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#getImmunizationsSectionEntriesOptional() Get Immunizations Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#getProblemSectionEntriesOptional() Get Problem Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#getProceduresSectionEntriesOptional() Get Procedures Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#getVitalSignsSectionEntriesOptional() Get Vital Signs Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryAndPhysicalNote#getInstructionsSection() Get Instructions Section}
  • + *
+ *

+ * + * @generated + */ + +public class HistoryAndPhysicalNoteTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateHistoryAndPhysicalNoteHasAnAssementAndPlanSectionOrIndividualAssementAndPlanSections() { + OperationsTestCase validateHistoryAndPhysicalNoteHasAnAssementAndPlanSectionOrIndividualAssementAndPlanSectionsTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalNoteHasAnAssementAndPlanSectionOrIndividualAssementAndPlanSections", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_NOTE_HAS_AN_ASSEMENT_AND_PLAN_SECTION_OR_INDIVIDUAL_ASSEMENT_AND_PLAN_SECTIONS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + public void addFailTests() { + + addFailTest(new FailTest() { + @Override + public void updateToFail(HistoryAndPhysicalNote target) { + target.init(); + } + + }); + + addFailTest(new FailTest() { + @Override + public void updateToFail(HistoryAndPhysicalNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createAssessmentSection().init()); + } + + }); + + addFailTest(new FailTest() { + @Override + public void updateToFail(HistoryAndPhysicalNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createPlanOfCareSection().init()); + } + + }); + + } + + /* + * (non-Javadoc) + * + * @see org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest.OperationsTestCase#addPassTests() + */ + @Override + public void addPassTests() { + addPassTest(new PassTest() { + @Override + public void updateToPass(HistoryAndPhysicalNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createAssessmentAndPlanSection().init()); + + } + }); + + addPassTest(new PassTest() { + @Override + public void updateToPass(HistoryAndPhysicalNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createAssessmentSection().init()); + target.addSection(ConsolFactory.eINSTANCE.createPlanOfCareSection().init()); + } + }); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalNoteOperations.validateHistoryAndPhysicalNoteHasAnAssementAndPlanSectionOrIndividualAssementAndPlanSections( + (HistoryAndPhysicalNote) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalNoteHasAnAssementAndPlanSectionOrIndividualAssementAndPlanSectionsTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateHistoryAndPhysicalNoteDoesNotHaveIndividualAssementAndPlanSectionsWhenAssementAndPlanSectionPresent() { + OperationsTestCase validateHistoryAndPhysicalNoteDoesNotHaveIndividualAssementAndPlanSectionsWhenAssementAndPlanSectionPresentTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalNoteDoesNotHaveIndividualAssementAndPlanSectionsWhenAssementAndPlanSectionPresent", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_NOTE_DOES_NOT_HAVE_INDIVIDUAL_ASSEMENT_AND_PLAN_SECTIONS_WHEN_ASSEMENT_AND_PLAN_SECTION_PRESENT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + /* + * (non-Javadoc) + * + * @see org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest.OperationsTestCase#addFailTests() + */ + @Override + public void addFailTests() { + + addFailTest(new FailTest() { + @Override + public void updateToFail(HistoryAndPhysicalNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createAssessmentAndPlanSection().init()); + target.addSection(ConsolFactory.eINSTANCE.createPlanOfCareSection().init()); + } + + }); + + addFailTest(new FailTest() { + @Override + public void updateToFail(HistoryAndPhysicalNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createAssessmentAndPlanSection().init()); + target.addSection(ConsolFactory.eINSTANCE.createAssessmentSection().init()); + } + + }); + + addFailTest(new FailTest() { + @Override + public void updateToFail(HistoryAndPhysicalNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createAssessmentAndPlanSection().init()); + target.addSection(ConsolFactory.eINSTANCE.createAssessmentSection().init()); + target.addSection(ConsolFactory.eINSTANCE.createPlanOfCareSection().init()); + } + + }); + + } + + @Override + public void addPassTests() { + addPassTest(new PassTest() { + @Override + public void updateToPass(HistoryAndPhysicalNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createAssessmentAndPlanSection().init()); + + } + }); + + addPassTest(new PassTest() { + @Override + public void updateToPass(HistoryAndPhysicalNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createAssessmentSection().init()); + target.addSection(ConsolFactory.eINSTANCE.createPlanOfCareSection().init()); + } + }); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalNoteOperations.validateHistoryAndPhysicalNoteDoesNotHaveIndividualAssementAndPlanSectionsWhenAssementAndPlanSectionPresent( + (HistoryAndPhysicalNote) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalNoteDoesNotHaveIndividualAssementAndPlanSectionsWhenAssementAndPlanSectionPresentTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateHistoryAndPhysicalNoteHasChiefComplaintAndReasonForVisitChiefComplaintOrReasonForVisit() { + OperationsTestCase validateHistoryAndPhysicalNoteHasChiefComplaintAndReasonForVisitChiefComplaintOrReasonForVisitTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalNoteHasChiefComplaintAndReasonForVisitChiefComplaintOrReasonForVisit", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_NOTE_HAS_CHIEF_COMPLAINT_AND_REASON_FOR_VISIT_CHIEF_COMPLAINT_OR_REASON_FOR_VISIT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + public void addFailTests() { + + addFailTest(new FailTest() { + @Override + public void updateToFail(HistoryAndPhysicalNote target) { + target.init(); + } + + }); + + addFailTest(new FailTest() { + @Override + public void updateToFail(HistoryAndPhysicalNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createChiefComplaintSection().init()); + } + + }); + + addFailTest(new FailTest() { + @Override + public void updateToFail(HistoryAndPhysicalNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createReasonForVisitSection().init()); + } + + }); + + } + + /* + * (non-Javadoc) + * + * @see org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest.OperationsTestCase#addPassTests() + */ + @Override + public void addPassTests() { + addPassTest(new PassTest() { + @Override + public void updateToPass(HistoryAndPhysicalNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createChiefComplaintAndReasonForVisitSection().init()); + + } + }); + + addPassTest(new PassTest() { + @Override + public void updateToPass(HistoryAndPhysicalNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createChiefComplaintSection().init()); + target.addSection(ConsolFactory.eINSTANCE.createReasonForVisitSection().init()); + } + }); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalNoteOperations.validateHistoryAndPhysicalNoteHasChiefComplaintAndReasonForVisitChiefComplaintOrReasonForVisit( + (HistoryAndPhysicalNote) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalNoteHasChiefComplaintAndReasonForVisitChiefComplaintOrReasonForVisitTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateHistoryAndPhysicalNoteDoesNotHaveChiefComplaintAndReasonForVisitWithChiefComplaintSectionOrReasonSection() { + OperationsTestCase validateHistoryAndPhysicalNoteDoesNotHaveChiefComplaintAndReasonForVisitWithChiefComplaintSectionOrReasonSectionTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalNoteDoesNotHaveChiefComplaintAndReasonForVisitWithChiefComplaintSectionOrReasonSection", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_NOTE_DOES_NOT_HAVE_CHIEF_COMPLAINT_AND_REASON_FOR_VISIT_WITH_CHIEF_COMPLAINT_SECTION_OR_REASON_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + /* + * (non-Javadoc) + * + * @see org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest.OperationsTestCase#addFailTests() + */ + @Override + public void addFailTests() { + + addFailTest(new FailTest() { + @Override + public void updateToFail(HistoryAndPhysicalNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createChiefComplaintAndReasonForVisitSection().init()); + target.addSection(ConsolFactory.eINSTANCE.createChiefComplaintSection().init()); + } + + }); + + addFailTest(new FailTest() { + @Override + public void updateToFail(HistoryAndPhysicalNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createChiefComplaintAndReasonForVisitSection().init()); + target.addSection(ConsolFactory.eINSTANCE.createReasonForVisitSection().init()); + } + + }); + + addFailTest(new FailTest() { + @Override + public void updateToFail(HistoryAndPhysicalNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createChiefComplaintAndReasonForVisitSection().init()); + target.addSection(ConsolFactory.eINSTANCE.createChiefComplaintSection().init()); + target.addSection(ConsolFactory.eINSTANCE.createReasonForVisitSection().init()); + } + + }); + + } + + @Override + public void addPassTests() { + addPassTest(new PassTest() { + @Override + public void updateToPass(HistoryAndPhysicalNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createChiefComplaintAndReasonForVisitSection().init()); + + } + }); + + addPassTest(new PassTest() { + @Override + public void updateToPass(HistoryAndPhysicalNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createChiefComplaintSection().init()); + target.addSection(ConsolFactory.eINSTANCE.createReasonForVisitSection().init()); + } + }); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalNoteOperations.validateHistoryAndPhysicalNoteDoesNotHaveChiefComplaintAndReasonForVisitWithChiefComplaintSectionOrReasonSection( + (HistoryAndPhysicalNote) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalNoteDoesNotHaveChiefComplaintAndReasonForVisitWithChiefComplaintSectionOrReasonSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHistoryAndPhysicalNoteTemplateId() { + OperationsTestCase validateHistoryAndPhysicalNoteTemplateIdTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalNoteTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_NOTE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysicalNote target) { + + } + + @Override + protected void updateToPass(HistoryAndPhysicalNote target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalNoteOperations.validateHistoryAndPhysicalNoteTemplateId( + (HistoryAndPhysicalNote) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalNoteTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHistoryAndPhysicalNoteCodeP() { + OperationsTestCase validateHistoryAndPhysicalNoteCodePTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalNoteCodeP", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_NOTE_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysicalNote target) { + + } + + @Override + protected void updateToPass(HistoryAndPhysicalNote target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalNoteOperations.validateHistoryAndPhysicalNoteCodeP( + (HistoryAndPhysicalNote) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalNoteCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateHistoryAndPhysicalNoteCode() { + OperationsTestCase validateHistoryAndPhysicalNoteCodeTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalNoteCode", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_NOTE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysicalNote target) { + + } + + @Override + protected void updateToPass(HistoryAndPhysicalNote target) { + target.init(); + target.setCode(DatatypesFactory.eINSTANCE.createCE("34117-2", "2.16.840.1.113883.6.1")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalNoteOperations.validateHistoryAndPhysicalNoteCode( + (HistoryAndPhysicalNote) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalNoteCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateHistoryAndPhysicalNoteInFulfillmentOf() { + OperationsTestCase validateHistoryAndPhysicalNoteInFulfillmentOfTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalNoteInFulfillmentOf", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_NOTE_IN_FULFILLMENT_OF__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysicalNote target) { + target.init(); + } + + @Override + protected void updateToPass(HistoryAndPhysicalNote target) { + target.getInFulfillmentOfs().add(CDAFactory.eINSTANCE.createInFulfillmentOf()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalNoteOperations.validateHistoryAndPhysicalNoteInFulfillmentOf( + (HistoryAndPhysicalNote) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalNoteInFulfillmentOfTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateHistoryAndPhysicalNoteComponentOf() { + OperationsTestCase validateHistoryAndPhysicalNoteComponentOfTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalNoteComponentOf", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_NOTE_COMPONENT_OF__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysicalNote target) { + target.init(); + } + + @Override + protected void updateToPass(HistoryAndPhysicalNote target) { + target.setComponentOf(CDAFactory.eINSTANCE.createComponent1()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalNoteOperations.validateHistoryAndPhysicalNoteComponentOf( + (HistoryAndPhysicalNote) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalNoteComponentOfTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHistoryAndPhysicalNoteAllergiesSectionEntriesOptional() { + OperationsTestCase validateHistoryAndPhysicalNoteAllergiesSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalNoteAllergiesSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_NOTE_ALLERGIES_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysicalNote target) { + + } + + @Override + protected void updateToPass(HistoryAndPhysicalNote target) { + target.init(); + + /* AllergiesSectionEntriesOptional */ + AllergiesSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createAllergiesSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalNoteOperations.validateHistoryAndPhysicalNoteAllergiesSectionEntriesOptional( + (HistoryAndPhysicalNote) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalNoteAllergiesSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHistoryAndPhysicalNoteAssessmentSection() { + OperationsTestCase validateHistoryAndPhysicalNoteAssessmentSectionTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalNoteAssessmentSection", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_NOTE_ASSESSMENT_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysicalNote target) { + + } + + @Override + protected void updateToPass(HistoryAndPhysicalNote target) { + target.init(); + + /* AssessmentSection */ + AssessmentSection section = + + ConsolFactory.eINSTANCE.createAssessmentSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalNoteOperations.validateHistoryAndPhysicalNoteAssessmentSection( + (HistoryAndPhysicalNote) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalNoteAssessmentSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHistoryAndPhysicalNotePlanOfCareSection() { + OperationsTestCase validateHistoryAndPhysicalNotePlanOfCareSectionTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalNotePlanOfCareSection", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_NOTE_PLAN_OF_CARE_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysicalNote target) { + + } + + @Override + protected void updateToPass(HistoryAndPhysicalNote target) { + target.init(); + + /* PlanOfCareSection */ + PlanOfCareSection section = + + ConsolFactory.eINSTANCE.createPlanOfCareSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalNoteOperations.validateHistoryAndPhysicalNotePlanOfCareSection( + (HistoryAndPhysicalNote) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalNotePlanOfCareSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHistoryAndPhysicalNoteAssessmentAndPlanSection() { + OperationsTestCase validateHistoryAndPhysicalNoteAssessmentAndPlanSectionTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalNoteAssessmentAndPlanSection", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_NOTE_ASSESSMENT_AND_PLAN_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysicalNote target) { + + } + + @Override + protected void updateToPass(HistoryAndPhysicalNote target) { + target.init(); + + /* AssessmentAndPlanSection */ + AssessmentAndPlanSection section = + + ConsolFactory.eINSTANCE.createAssessmentAndPlanSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalNoteOperations.validateHistoryAndPhysicalNoteAssessmentAndPlanSection( + (HistoryAndPhysicalNote) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalNoteAssessmentAndPlanSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHistoryAndPhysicalNoteChiefComplaintSection() { + OperationsTestCase validateHistoryAndPhysicalNoteChiefComplaintSectionTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalNoteChiefComplaintSection", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_NOTE_CHIEF_COMPLAINT_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysicalNote target) { + + } + + @Override + protected void updateToPass(HistoryAndPhysicalNote target) { + target.init(); + + /* ChiefComplaintSection */ + ChiefComplaintSection section = + + ConsolFactory.eINSTANCE.createChiefComplaintSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalNoteOperations.validateHistoryAndPhysicalNoteChiefComplaintSection( + (HistoryAndPhysicalNote) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalNoteChiefComplaintSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHistoryAndPhysicalNoteChiefComplaintAndReasonForVisitSection() { + OperationsTestCase validateHistoryAndPhysicalNoteChiefComplaintAndReasonForVisitSectionTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalNoteChiefComplaintAndReasonForVisitSection", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_NOTE_CHIEF_COMPLAINT_AND_REASON_FOR_VISIT_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysicalNote target) { + + } + + @Override + protected void updateToPass(HistoryAndPhysicalNote target) { + target.init(); + + /* ChiefComplaintAndReasonForVisitSection */ + ChiefComplaintAndReasonForVisitSection section = + + ConsolFactory.eINSTANCE.createChiefComplaintAndReasonForVisitSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalNoteOperations.validateHistoryAndPhysicalNoteChiefComplaintAndReasonForVisitSection( + (HistoryAndPhysicalNote) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalNoteChiefComplaintAndReasonForVisitSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHistoryAndPhysicalNoteFamilyHistorySection() { + OperationsTestCase validateHistoryAndPhysicalNoteFamilyHistorySectionTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalNoteFamilyHistorySection", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_NOTE_FAMILY_HISTORY_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysicalNote target) { + + } + + @Override + protected void updateToPass(HistoryAndPhysicalNote target) { + target.init(); + + /* FamilyHistorySection */ + FamilyHistorySection section = + + ConsolFactory.eINSTANCE.createFamilyHistorySection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalNoteOperations.validateHistoryAndPhysicalNoteFamilyHistorySection( + (HistoryAndPhysicalNote) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalNoteFamilyHistorySectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHistoryAndPhysicalNoteGeneralStatusSection() { + OperationsTestCase validateHistoryAndPhysicalNoteGeneralStatusSectionTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalNoteGeneralStatusSection", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_NOTE_GENERAL_STATUS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysicalNote target) { + + } + + @Override + protected void updateToPass(HistoryAndPhysicalNote target) { + target.init(); + + /* GeneralStatusSection */ + GeneralStatusSection section = + + ConsolFactory.eINSTANCE.createGeneralStatusSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalNoteOperations.validateHistoryAndPhysicalNoteGeneralStatusSection( + (HistoryAndPhysicalNote) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalNoteGeneralStatusSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHistoryAndPhysicalNoteHistoryOfPastIllnessSection() { + OperationsTestCase validateHistoryAndPhysicalNoteHistoryOfPastIllnessSectionTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalNoteHistoryOfPastIllnessSection", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_NOTE_HISTORY_OF_PAST_ILLNESS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysicalNote target) { + + } + + @Override + protected void updateToPass(HistoryAndPhysicalNote target) { + target.init(); + + /* HistoryOfPastIllnessSection */ + HistoryOfPastIllnessSection section = + + ConsolFactory.eINSTANCE.createHistoryOfPastIllnessSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalNoteOperations.validateHistoryAndPhysicalNoteHistoryOfPastIllnessSection( + (HistoryAndPhysicalNote) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalNoteHistoryOfPastIllnessSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHistoryAndPhysicalNoteMedicationsSectionEntriesOptional() { + OperationsTestCase validateHistoryAndPhysicalNoteMedicationsSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalNoteMedicationsSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_NOTE_MEDICATIONS_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysicalNote target) { + + } + + @Override + protected void updateToPass(HistoryAndPhysicalNote target) { + target.init(); + + /* MedicationsSectionEntriesOptional */ + MedicationsSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createMedicationsSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalNoteOperations.validateHistoryAndPhysicalNoteMedicationsSectionEntriesOptional( + (HistoryAndPhysicalNote) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalNoteMedicationsSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHistoryAndPhysicalNotePhysicalExamSection() { + OperationsTestCase validateHistoryAndPhysicalNotePhysicalExamSectionTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalNotePhysicalExamSection", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_NOTE_PHYSICAL_EXAM_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysicalNote target) { + + } + + @Override + protected void updateToPass(HistoryAndPhysicalNote target) { + target.init(); + + /* PhysicalExamSection */ + PhysicalExamSection section = + + ConsolFactory.eINSTANCE.createPhysicalExamSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalNoteOperations.validateHistoryAndPhysicalNotePhysicalExamSection( + (HistoryAndPhysicalNote) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalNotePhysicalExamSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHistoryAndPhysicalNoteReasonForVisitSection() { + OperationsTestCase validateHistoryAndPhysicalNoteReasonForVisitSectionTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalNoteReasonForVisitSection", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_NOTE_REASON_FOR_VISIT_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysicalNote target) { + + } + + @Override + protected void updateToPass(HistoryAndPhysicalNote target) { + target.init(); + + /* ReasonForVisitSection */ + ReasonForVisitSection section = + + ConsolFactory.eINSTANCE.createReasonForVisitSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalNoteOperations.validateHistoryAndPhysicalNoteReasonForVisitSection( + (HistoryAndPhysicalNote) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalNoteReasonForVisitSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHistoryAndPhysicalNoteResultsSectionEntriesOptional() { + OperationsTestCase validateHistoryAndPhysicalNoteResultsSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalNoteResultsSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_NOTE_RESULTS_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysicalNote target) { + + } + + @Override + protected void updateToPass(HistoryAndPhysicalNote target) { + target.init(); + + /* ResultsSectionEntriesOptional */ + ResultsSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createResultsSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalNoteOperations.validateHistoryAndPhysicalNoteResultsSectionEntriesOptional( + (HistoryAndPhysicalNote) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalNoteResultsSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHistoryAndPhysicalNoteReviewOfSystemsSection() { + OperationsTestCase validateHistoryAndPhysicalNoteReviewOfSystemsSectionTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalNoteReviewOfSystemsSection", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_NOTE_REVIEW_OF_SYSTEMS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysicalNote target) { + + } + + @Override + protected void updateToPass(HistoryAndPhysicalNote target) { + target.init(); + + /* ReviewOfSystemsSection */ + ReviewOfSystemsSection section = + + ConsolFactory.eINSTANCE.createReviewOfSystemsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalNoteOperations.validateHistoryAndPhysicalNoteReviewOfSystemsSection( + (HistoryAndPhysicalNote) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalNoteReviewOfSystemsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHistoryAndPhysicalNoteSocialHistorySection() { + OperationsTestCase validateHistoryAndPhysicalNoteSocialHistorySectionTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalNoteSocialHistorySection", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_NOTE_SOCIAL_HISTORY_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysicalNote target) { + + } + + @Override + protected void updateToPass(HistoryAndPhysicalNote target) { + target.init(); + + /* SocialHistorySection */ + SocialHistorySection section = + + ConsolFactory.eINSTANCE.createSocialHistorySection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalNoteOperations.validateHistoryAndPhysicalNoteSocialHistorySection( + (HistoryAndPhysicalNote) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalNoteSocialHistorySectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHistoryAndPhysicalNoteHistoryOfPresentIllnessSection() { + OperationsTestCase validateHistoryAndPhysicalNoteHistoryOfPresentIllnessSectionTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalNoteHistoryOfPresentIllnessSection", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_NOTE_HISTORY_OF_PRESENT_ILLNESS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysicalNote target) { + + } + + @Override + protected void updateToPass(HistoryAndPhysicalNote target) { + target.init(); + + /* HistoryOfPresentIllnessSection */ + HistoryOfPresentIllnessSection section = + + ConsolFactory.eINSTANCE.createHistoryOfPresentIllnessSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalNoteOperations.validateHistoryAndPhysicalNoteHistoryOfPresentIllnessSection( + (HistoryAndPhysicalNote) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalNoteHistoryOfPresentIllnessSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHistoryAndPhysicalNoteImmunizationsSectionEntriesOptional() { + OperationsTestCase validateHistoryAndPhysicalNoteImmunizationsSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalNoteImmunizationsSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_NOTE_IMMUNIZATIONS_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysicalNote target) { + + } + + @Override + protected void updateToPass(HistoryAndPhysicalNote target) { + target.init(); + + /* ImmunizationsSectionEntriesOptional */ + ImmunizationsSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createImmunizationsSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalNoteOperations.validateHistoryAndPhysicalNoteImmunizationsSectionEntriesOptional( + (HistoryAndPhysicalNote) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalNoteImmunizationsSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHistoryAndPhysicalNoteProblemSectionEntriesOptional() { + OperationsTestCase validateHistoryAndPhysicalNoteProblemSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalNoteProblemSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_NOTE_PROBLEM_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysicalNote target) { + + } + + @Override + protected void updateToPass(HistoryAndPhysicalNote target) { + target.init(); + + /* ProblemSectionEntriesOptional */ + ProblemSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createProblemSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalNoteOperations.validateHistoryAndPhysicalNoteProblemSectionEntriesOptional( + (HistoryAndPhysicalNote) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalNoteProblemSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHistoryAndPhysicalNoteProceduresSectionEntriesOptional() { + OperationsTestCase validateHistoryAndPhysicalNoteProceduresSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalNoteProceduresSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_NOTE_PROCEDURES_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysicalNote target) { + + } + + @Override + protected void updateToPass(HistoryAndPhysicalNote target) { + target.init(); + + /* ProceduresSectionEntriesOptional */ + ProceduresSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createProceduresSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalNoteOperations.validateHistoryAndPhysicalNoteProceduresSectionEntriesOptional( + (HistoryAndPhysicalNote) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalNoteProceduresSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHistoryAndPhysicalNoteVitalSignsSectionEntriesOptional() { + OperationsTestCase validateHistoryAndPhysicalNoteVitalSignsSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalNoteVitalSignsSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_NOTE_VITAL_SIGNS_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysicalNote target) { + + } + + @Override + protected void updateToPass(HistoryAndPhysicalNote target) { + target.init(); + + /* VitalSignsSectionEntriesOptional */ + VitalSignsSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createVitalSignsSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalNoteOperations.validateHistoryAndPhysicalNoteVitalSignsSectionEntriesOptional( + (HistoryAndPhysicalNote) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalNoteVitalSignsSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateHistoryAndPhysicalNoteInstructionsSection() { + OperationsTestCase validateHistoryAndPhysicalNoteInstructionsSectionTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalNoteInstructionsSection", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_NOTE_INSTRUCTIONS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysicalNote target) { + + } + + @Override + protected void updateToPass(HistoryAndPhysicalNote target) { + target.init(); + + /* InstructionsSection */ + InstructionsSection section = ConsolFactory.eINSTANCE.createInstructionsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalNoteOperations.validateHistoryAndPhysicalNoteInstructionsSection( + (HistoryAndPhysicalNote) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalNoteInstructionsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4ResponsiblePartyAssignedEntityHasPersonOrOrganization() { + OperationsTestCase validateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4ResponsiblePartyAssignedEntityHasPersonOrOrganizationTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4ResponsiblePartyAssignedEntityHasPersonOrOrganization", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_NOTE_COMPONENT_OF_ENCOMPASSING_ENCOUNTER4_RESPONSIBLE_PARTY_ASSIGNED_ENTITY_HAS_PERSON_OR_ORGANIZATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysicalNote target) { + target.init(); + Component1 cof = CDAFactory.eINSTANCE.createComponent1(); + + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + + ResponsibleParty rp = CDAFactory.eINSTANCE.createResponsibleParty(); + + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + + rp.setAssignedEntity(ae); + ee.setResponsibleParty(rp); + + cof.setEncompassingEncounter(ee); + target.setComponentOf(cof); + + } + + @Override + protected void updateToPass(HistoryAndPhysicalNote target) { + + Person person = CDAFactory.eINSTANCE.createPerson(); + + target.getComponentOf().getEncompassingEncounter().getResponsibleParty().getAssignedEntity().setAssignedPerson( + person); + ; + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalNoteOperations.validateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4ResponsiblePartyAssignedEntityHasPersonOrOrganization( + (HistoryAndPhysicalNote) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4ResponsiblePartyAssignedEntityHasPersonOrOrganizationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4ResponsiblePartyAssignedEntity() { + OperationsTestCase validateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4ResponsiblePartyAssignedEntityTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4ResponsiblePartyAssignedEntity", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_NOTE_COMPONENT_OF_ENCOMPASSING_ENCOUNTER4_RESPONSIBLE_PARTY_ASSIGNED_ENTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysicalNote target) { + + target.init(); + Component1 cof = CDAFactory.eINSTANCE.createComponent1(); + + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + + ResponsibleParty rp = CDAFactory.eINSTANCE.createResponsibleParty(); + + ee.setResponsibleParty(rp); + + cof.setEncompassingEncounter(ee); + target.setComponentOf(cof); + } + + @Override + protected void updateToPass(HistoryAndPhysicalNote target) { + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + + target.getComponentOf().getEncompassingEncounter().getResponsibleParty().setAssignedEntity(ae); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalNoteOperations.validateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4ResponsiblePartyAssignedEntity( + (HistoryAndPhysicalNote) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4ResponsiblePartyAssignedEntityTestCase.doValidationTest(); + } + + /** + * + * @generated not not + */ + @Test + public void testValidateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4EncounterParticipantAssignedEntityHasPersonOrOrganization() { + OperationsTestCase validateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4EncounterParticipantAssignedEntityHasPersonOrOrganizationTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4EncounterParticipantAssignedEntityHasPersonOrOrganization", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_NOTE_COMPONENT_OF_ENCOMPASSING_ENCOUNTER4_ENCOUNTER_PARTICIPANT_ASSIGNED_ENTITY_HAS_PERSON_OR_ORGANIZATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysicalNote target) { + target.init(); + Component1 cof = CDAFactory.eINSTANCE.createComponent1(); + + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + + EncounterParticipant ep = CDAFactory.eINSTANCE.createEncounterParticipant(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + + ep.setAssignedEntity(ae); + ee.getEncounterParticipants().add(ep); + + cof.setEncompassingEncounter(ee); + target.setComponentOf(cof); + } + + @Override + protected void updateToPass(HistoryAndPhysicalNote target) { + target.getComponentOf().getEncompassingEncounter().getEncounterParticipants().clear(); + + EncounterParticipant ep = CDAFactory.eINSTANCE.createEncounterParticipant(); + + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + + Person person = CDAFactory.eINSTANCE.createPerson(); + + ae.setAssignedPerson(person); + + ep.setAssignedEntity(ae); + + target.getComponentOf().getEncompassingEncounter().getEncounterParticipants().add(ep); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalNoteOperations.validateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4EncounterParticipantAssignedEntityHasPersonOrOrganization( + (HistoryAndPhysicalNote) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4EncounterParticipantAssignedEntityHasPersonOrOrganizationTestCase.doValidationTest(); + } + + /** + * + * @generated not not + */ + @Test + public void testValidateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4EncounterParticipantAssignedEntity() { + OperationsTestCase validateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4EncounterParticipantAssignedEntityTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4EncounterParticipantAssignedEntity", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_NOTE_COMPONENT_OF_ENCOMPASSING_ENCOUNTER4_ENCOUNTER_PARTICIPANT_ASSIGNED_ENTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysicalNote target) { + target.init(); + Component1 cof = CDAFactory.eINSTANCE.createComponent1(); + + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + + EncounterParticipant ep = CDAFactory.eINSTANCE.createEncounterParticipant(); + + ee.getEncounterParticipants().add(ep); + + cof.setEncompassingEncounter(ee); + target.setComponentOf(cof); + } + + @Override + protected void updateToPass(HistoryAndPhysicalNote target) { + target.getComponentOf().getEncompassingEncounter().getEncounterParticipants().clear(); + + EncounterParticipant ep = CDAFactory.eINSTANCE.createEncounterParticipant(); + + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + + ep.setAssignedEntity(ae); + + target.getComponentOf().getEncompassingEncounter().getEncounterParticipants().add(ep); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalNoteOperations.validateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4EncounterParticipantAssignedEntity( + (HistoryAndPhysicalNote) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4EncounterParticipantAssignedEntityTestCase.doValidationTest(); + } + + /** + * + * @generated not not + */ + @Test + public void testValidateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4EffectiveTime() { + OperationsTestCase validateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4EffectiveTimeTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4EffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_NOTE_COMPONENT_OF_ENCOMPASSING_ENCOUNTER4_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysicalNote target) { + Component1 cof = CDAFactory.eINSTANCE.createComponent1(); + + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + + cof.setEncompassingEncounter(ee); + target.setComponentOf(cof); + + } + + @Override + protected void updateToPass(HistoryAndPhysicalNote target) { + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + target.getComponentOf().getEncompassingEncounter().setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalNoteOperations.validateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4EffectiveTime( + (HistoryAndPhysicalNote) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4EffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4Id() { + OperationsTestCase validateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4IdTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4Id", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_NOTE_COMPONENT_OF_ENCOMPASSING_ENCOUNTER4_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysicalNote target) { + target.init(); + Component1 cof = CDAFactory.eINSTANCE.createComponent1(); + + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + + cof.setEncompassingEncounter(ee); + + target.setComponentOf(cof); + } + + @Override + protected void updateToPass(HistoryAndPhysicalNote target) { + target.getComponentOf().getEncompassingEncounter().getIds().add(DatatypesFactory.eINSTANCE.createII()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalNoteOperations.validateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4Id( + (HistoryAndPhysicalNote) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4IdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4Location() { + OperationsTestCase validateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4LocationTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4Location", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_NOTE_COMPONENT_OF_ENCOMPASSING_ENCOUNTER4_LOCATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysicalNote target) { + target.init(); + Component1 cof = CDAFactory.eINSTANCE.createComponent1(); + + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + + cof.setEncompassingEncounter(ee); + + target.setComponentOf(cof); + } + + @Override + protected void updateToPass(HistoryAndPhysicalNote target) { + target.getComponentOf().getEncompassingEncounter().setLocation(CDAFactory.eINSTANCE.createLocation()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalNoteOperations.validateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4Location( + (HistoryAndPhysicalNote) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4LocationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4ResponsibleParty() { + OperationsTestCase validateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4ResponsiblePartyTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4ResponsibleParty", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_NOTE_COMPONENT_OF_ENCOMPASSING_ENCOUNTER4_RESPONSIBLE_PARTY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysicalNote target) { + target.init(); + Component1 cof = CDAFactory.eINSTANCE.createComponent1(); + + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + + cof.setEncompassingEncounter(ee); + target.setComponentOf(cof); + } + + @Override + protected void updateToPass(HistoryAndPhysicalNote target) { + ResponsibleParty rp = CDAFactory.eINSTANCE.createResponsibleParty(); + + target.getComponentOf().getEncompassingEncounter().setResponsibleParty(rp); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalNoteOperations.validateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4ResponsibleParty( + (HistoryAndPhysicalNote) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4ResponsiblePartyTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4EncounterParticipant() { + OperationsTestCase validateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4EncounterParticipantTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4EncounterParticipant", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_NOTE_COMPONENT_OF_ENCOMPASSING_ENCOUNTER4_ENCOUNTER_PARTICIPANT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysicalNote target) { + target.init(); + Component1 cof = CDAFactory.eINSTANCE.createComponent1(); + + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + + cof.setEncompassingEncounter(ee); + target.setComponentOf(cof); + + } + + @Override + protected void updateToPass(HistoryAndPhysicalNote target) { + EncounterParticipant ep = CDAFactory.eINSTANCE.createEncounterParticipant(); + + target.getComponentOf().getEncompassingEncounter().getEncounterParticipants().add(ep); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalNoteOperations.validateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4EncounterParticipant( + (HistoryAndPhysicalNote) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalNoteComponentOfEncompassingEncounter4EncounterParticipantTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateHistoryAndPhysicalNoteComponentOfEncompassingEncounter() { + OperationsTestCase validateHistoryAndPhysicalNoteComponentOfEncompassingEncounterTestCase = new OperationsTestCase( + "validateHistoryAndPhysicalNoteComponentOfEncompassingEncounter", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_AND_PHYSICAL_NOTE_COMPONENT_OF_ENCOMPASSING_ENCOUNTER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysicalNote target) { + target.init(); + Component1 cof = CDAFactory.eINSTANCE.createComponent1(); + + target.setComponentOf(cof); + + } + + @Override + protected void updateToPass(HistoryAndPhysicalNote target) { + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + + target.getComponentOf().setEncompassingEncounter(ee); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryAndPhysicalNoteOperations.validateHistoryAndPhysicalNoteComponentOfEncompassingEncounter( + (HistoryAndPhysicalNote) objectToTest, diagnostician, map); + } + + }; + + validateHistoryAndPhysicalNoteComponentOfEncompassingEncounterTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetAllergiesSectionEntriesOptional() { + + HistoryAndPhysicalNote target = objectFactory.create(); + target.getAllergiesSectionEntriesOptional(); + + } + + /** + * + * @generated + */ + @Test + public void testGetAssessmentSection() { + + HistoryAndPhysicalNote target = objectFactory.create(); + target.getAssessmentSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPlanOfCareSection() { + + HistoryAndPhysicalNote target = objectFactory.create(); + target.getPlanOfCareSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetAssessmentAndPlanSection() { + + HistoryAndPhysicalNote target = objectFactory.create(); + target.getAssessmentAndPlanSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetChiefComplaintSection() { + + HistoryAndPhysicalNote target = objectFactory.create(); + target.getChiefComplaintSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetChiefComplaintAndReasonForVisitSection() { + + HistoryAndPhysicalNote target = objectFactory.create(); + target.getChiefComplaintAndReasonForVisitSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetFamilyHistorySection() { + + HistoryAndPhysicalNote target = objectFactory.create(); + target.getFamilyHistorySection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetGeneralStatusSection() { + + HistoryAndPhysicalNote target = objectFactory.create(); + target.getGeneralStatusSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetHistoryOfPastIllnessSection() { + + HistoryAndPhysicalNote target = objectFactory.create(); + target.getHistoryOfPastIllnessSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetMedicationsSectionEntriesOptional() { + + HistoryAndPhysicalNote target = objectFactory.create(); + target.getMedicationsSectionEntriesOptional(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPhysicalExamSection() { + + HistoryAndPhysicalNote target = objectFactory.create(); + target.getPhysicalExamSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetReasonForVisitSection() { + + HistoryAndPhysicalNote target = objectFactory.create(); + target.getReasonForVisitSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetResultsSectionEntriesOptional() { + + HistoryAndPhysicalNote target = objectFactory.create(); + target.getResultsSectionEntriesOptional(); + + } + + /** + * + * @generated + */ + @Test + public void testGetReviewOfSystemsSection() { + + HistoryAndPhysicalNote target = objectFactory.create(); + target.getReviewOfSystemsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetSocialHistorySection() { + + HistoryAndPhysicalNote target = objectFactory.create(); + target.getSocialHistorySection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetHistoryOfPresentIllnessSection() { + + HistoryAndPhysicalNote target = objectFactory.create(); + target.getHistoryOfPresentIllnessSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetImmunizationsSectionEntriesOptional() { + + HistoryAndPhysicalNote target = objectFactory.create(); + target.getImmunizationsSectionEntriesOptional(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProblemSectionEntriesOptional() { + + HistoryAndPhysicalNote target = objectFactory.create(); + target.getProblemSectionEntriesOptional(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProceduresSectionEntriesOptional() { + + HistoryAndPhysicalNote target = objectFactory.create(); + target.getProceduresSectionEntriesOptional(); + + } + + /** + * + * @generated + */ + @Test + public void testGetVitalSignsSectionEntriesOptional() { + + HistoryAndPhysicalNote target = objectFactory.create(); + target.getVitalSignsSectionEntriesOptional(); + + } + + /** + * + * @generated + */ + @Test + public void testGetInstructionsSection() { + + HistoryAndPhysicalNote target = objectFactory.create(); + target.getInstructionsSection(); + + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsCode() { + OperationsTestCase validateGeneralHeaderConstraintsCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryAndPhysicalNote target) { + + } + + @Override + protected void updateToPass(HistoryAndPhysicalNote target) { + target.init(); + target.setCode(DatatypesFactory.eINSTANCE.createCE("12345", "2.16.840.1.113883.6.1")); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsCode( + (HistoryAndPhysicalNote) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends HistoryAndPhysicalNoteOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public HistoryAndPhysicalNote create() { + return ConsolFactory.eINSTANCE.createHistoryAndPhysicalNote(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends HistoryAndPhysicalNoteOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // HistoryAndPhysicalNoteOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HistoryOfPastIllnessSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HistoryOfPastIllnessSectionTest.java new file mode 100644 index 000000000..2c43d09e7 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HistoryOfPastIllnessSectionTest.java @@ -0,0 +1,338 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.HistoryOfPastIllnessSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.HistoryOfPastIllnessSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'History Of Past Illness Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryOfPastIllnessSection#validateHistoryOfPastIllnessSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History Of Past Illness Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryOfPastIllnessSection#validateHistoryOfPastIllnessSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History Of Past Illness Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryOfPastIllnessSection#validateHistoryOfPastIllnessSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History Of Past Illness Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryOfPastIllnessSection#validateHistoryOfPastIllnessSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History Of Past Illness Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryOfPastIllnessSection#validateHistoryOfPastIllnessSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History Of Past Illness Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryOfPastIllnessSection#validateHistoryOfPastIllnessSectionProblemObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History Of Past Illness Section Problem Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryOfPastIllnessSection#getProblemObservations() Get Problem Observations}
  • + *
+ *

+ * + * @generated + */ + +public class HistoryOfPastIllnessSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHistoryOfPastIllnessSectionTemplateId() { + OperationsTestCase validateHistoryOfPastIllnessSectionTemplateIdTestCase = new OperationsTestCase( + "validateHistoryOfPastIllnessSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_OF_PAST_ILLNESS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryOfPastIllnessSection target) { + + } + + @Override + protected void updateToPass(HistoryOfPastIllnessSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryOfPastIllnessSectionOperations.validateHistoryOfPastIllnessSectionTemplateId( + (HistoryOfPastIllnessSection) objectToTest, diagnostician, map); + } + + }; + + validateHistoryOfPastIllnessSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHistoryOfPastIllnessSectionCode() { + OperationsTestCase validateHistoryOfPastIllnessSectionCodeTestCase = new OperationsTestCase( + "validateHistoryOfPastIllnessSectionCode", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_OF_PAST_ILLNESS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryOfPastIllnessSection target) { + + } + + @Override + protected void updateToPass(HistoryOfPastIllnessSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryOfPastIllnessSectionOperations.validateHistoryOfPastIllnessSectionCode( + (HistoryOfPastIllnessSection) objectToTest, diagnostician, map); + } + + }; + + validateHistoryOfPastIllnessSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHistoryOfPastIllnessSectionCodeP() { + OperationsTestCase validateHistoryOfPastIllnessSectionCodePTestCase = new OperationsTestCase( + "validateHistoryOfPastIllnessSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_OF_PAST_ILLNESS_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryOfPastIllnessSection target) { + + } + + @Override + protected void updateToPass(HistoryOfPastIllnessSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryOfPastIllnessSectionOperations.validateHistoryOfPastIllnessSectionCodeP( + (HistoryOfPastIllnessSection) objectToTest, diagnostician, map); + } + + }; + + validateHistoryOfPastIllnessSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHistoryOfPastIllnessSectionTitle() { + OperationsTestCase validateHistoryOfPastIllnessSectionTitleTestCase = new OperationsTestCase( + "validateHistoryOfPastIllnessSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_OF_PAST_ILLNESS_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryOfPastIllnessSection target) { + + } + + @Override + protected void updateToPass(HistoryOfPastIllnessSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryOfPastIllnessSectionOperations.validateHistoryOfPastIllnessSectionTitle( + (HistoryOfPastIllnessSection) objectToTest, diagnostician, map); + } + + }; + + validateHistoryOfPastIllnessSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHistoryOfPastIllnessSectionText() { + OperationsTestCase validateHistoryOfPastIllnessSectionTextTestCase = new OperationsTestCase( + "validateHistoryOfPastIllnessSectionText", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_OF_PAST_ILLNESS_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryOfPastIllnessSection target) { + + } + + @Override + protected void updateToPass(HistoryOfPastIllnessSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryOfPastIllnessSectionOperations.validateHistoryOfPastIllnessSectionText( + (HistoryOfPastIllnessSection) objectToTest, diagnostician, map); + } + + }; + + validateHistoryOfPastIllnessSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHistoryOfPastIllnessSectionProblemObservation() { + OperationsTestCase validateHistoryOfPastIllnessSectionProblemObservationTestCase = new OperationsTestCase( + "validateHistoryOfPastIllnessSectionProblemObservation", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_OF_PAST_ILLNESS_SECTION_PROBLEM_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryOfPastIllnessSection target) { + + } + + @Override + protected void updateToPass(HistoryOfPastIllnessSection target) { + target.init(); + target.addObservation(ConsolFactory.eINSTANCE.createProblemObservation()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryOfPastIllnessSectionOperations.validateHistoryOfPastIllnessSectionProblemObservation( + (HistoryOfPastIllnessSection) objectToTest, diagnostician, map); + } + + }; + + validateHistoryOfPastIllnessSectionProblemObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemObservations() { + + HistoryOfPastIllnessSection target = objectFactory.create(); + target.getProblemObservations(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends HistoryOfPastIllnessSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public HistoryOfPastIllnessSection create() { + return ConsolFactory.eINSTANCE.createHistoryOfPastIllnessSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends HistoryOfPastIllnessSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // HistoryOfPastIllnessSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HistoryOfPresentIllnessSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HistoryOfPresentIllnessSectionTest.java new file mode 100644 index 000000000..7c940d7fc --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HistoryOfPresentIllnessSectionTest.java @@ -0,0 +1,290 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.HistoryOfPresentIllnessSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.HistoryOfPresentIllnessSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'History Of Present Illness Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryOfPresentIllnessSection#validateHistoryOfPresentIllnessSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History Of Present Illness Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryOfPresentIllnessSection#validateHistoryOfPresentIllnessSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History Of Present Illness Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryOfPresentIllnessSection#validateHistoryOfPresentIllnessSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History Of Present Illness Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryOfPresentIllnessSection#validateHistoryOfPresentIllnessSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History Of Present Illness Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HistoryOfPresentIllnessSection#validateHistoryOfPresentIllnessSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History Of Present Illness Section Text}
  • + *
+ *

+ * + * @generated + */ + +public class HistoryOfPresentIllnessSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHistoryOfPresentIllnessSectionTemplateId() { + OperationsTestCase validateHistoryOfPresentIllnessSectionTemplateIdTestCase = new OperationsTestCase( + "validateHistoryOfPresentIllnessSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_OF_PRESENT_ILLNESS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryOfPresentIllnessSection target) { + + } + + @Override + protected void updateToPass(HistoryOfPresentIllnessSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryOfPresentIllnessSectionOperations.validateHistoryOfPresentIllnessSectionTemplateId( + (HistoryOfPresentIllnessSection) objectToTest, diagnostician, map); + } + + }; + + validateHistoryOfPresentIllnessSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHistoryOfPresentIllnessSectionCode() { + OperationsTestCase validateHistoryOfPresentIllnessSectionCodeTestCase = new OperationsTestCase( + "validateHistoryOfPresentIllnessSectionCode", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_OF_PRESENT_ILLNESS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryOfPresentIllnessSection target) { + + } + + @Override + protected void updateToPass(HistoryOfPresentIllnessSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryOfPresentIllnessSectionOperations.validateHistoryOfPresentIllnessSectionCode( + (HistoryOfPresentIllnessSection) objectToTest, diagnostician, map); + } + + }; + + validateHistoryOfPresentIllnessSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHistoryOfPresentIllnessSectionCodeP() { + OperationsTestCase validateHistoryOfPresentIllnessSectionCodePTestCase = new OperationsTestCase( + "validateHistoryOfPresentIllnessSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_OF_PRESENT_ILLNESS_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryOfPresentIllnessSection target) { + + } + + @Override + protected void updateToPass(HistoryOfPresentIllnessSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryOfPresentIllnessSectionOperations.validateHistoryOfPresentIllnessSectionCodeP( + (HistoryOfPresentIllnessSection) objectToTest, diagnostician, map); + } + + }; + + validateHistoryOfPresentIllnessSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHistoryOfPresentIllnessSectionTitle() { + OperationsTestCase validateHistoryOfPresentIllnessSectionTitleTestCase = new OperationsTestCase( + "validateHistoryOfPresentIllnessSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_OF_PRESENT_ILLNESS_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryOfPresentIllnessSection target) { + + } + + @Override + protected void updateToPass(HistoryOfPresentIllnessSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryOfPresentIllnessSectionOperations.validateHistoryOfPresentIllnessSectionTitle( + (HistoryOfPresentIllnessSection) objectToTest, diagnostician, map); + } + + }; + + validateHistoryOfPresentIllnessSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHistoryOfPresentIllnessSectionText() { + OperationsTestCase validateHistoryOfPresentIllnessSectionTextTestCase = new OperationsTestCase( + "validateHistoryOfPresentIllnessSectionText", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_OF_PRESENT_ILLNESS_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryOfPresentIllnessSection target) { + + } + + @Override + protected void updateToPass(HistoryOfPresentIllnessSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryOfPresentIllnessSectionOperations.validateHistoryOfPresentIllnessSectionText( + (HistoryOfPresentIllnessSection) objectToTest, diagnostician, map); + } + + }; + + validateHistoryOfPresentIllnessSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends HistoryOfPresentIllnessSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public HistoryOfPresentIllnessSection create() { + return ConsolFactory.eINSTANCE.createHistoryOfPresentIllnessSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends HistoryOfPresentIllnessSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // HistoryOfPresentIllnessSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HospitalAdmissionDiagnosisSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HospitalAdmissionDiagnosisSectionTest.java new file mode 100644 index 000000000..1b5939ebc --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HospitalAdmissionDiagnosisSectionTest.java @@ -0,0 +1,338 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.HospitalAdmissionDiagnosisSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.HospitalAdmissionDiagnosisSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Hospital Admission Diagnosis Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalAdmissionDiagnosisSection#validateHospitalAdmissionDiagnosisSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Admission Diagnosis Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalAdmissionDiagnosisSection#validateHospitalAdmissionDiagnosisSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Admission Diagnosis Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalAdmissionDiagnosisSection#validateHospitalAdmissionDiagnosisSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Admission Diagnosis Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalAdmissionDiagnosisSection#validateHospitalAdmissionDiagnosisSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Admission Diagnosis Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalAdmissionDiagnosisSection#validateHospitalAdmissionDiagnosisSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Admission Diagnosis Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalAdmissionDiagnosisSection#validateHospitalAdmissionDiagnosisSectionHospitalAdmissionDiagnosis(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Admission Diagnosis Section Hospital Admission Diagnosis}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalAdmissionDiagnosisSection#getHospitalAdmissionDiagnosis() Get Hospital Admission Diagnosis}
  • + *
+ *

+ * + * @generated + */ + +public class HospitalAdmissionDiagnosisSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHospitalAdmissionDiagnosisSectionTemplateId() { + OperationsTestCase validateHospitalAdmissionDiagnosisSectionTemplateIdTestCase = new OperationsTestCase( + "validateHospitalAdmissionDiagnosisSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_ADMISSION_DIAGNOSIS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalAdmissionDiagnosisSection target) { + + } + + @Override + protected void updateToPass(HospitalAdmissionDiagnosisSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalAdmissionDiagnosisSectionOperations.validateHospitalAdmissionDiagnosisSectionTemplateId( + (HospitalAdmissionDiagnosisSection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalAdmissionDiagnosisSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalAdmissionDiagnosisSectionCode() { + OperationsTestCase validateHospitalAdmissionDiagnosisSectionCodeTestCase = new OperationsTestCase( + "validateHospitalAdmissionDiagnosisSectionCode", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_ADMISSION_DIAGNOSIS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalAdmissionDiagnosisSection target) { + + } + + @Override + protected void updateToPass(HospitalAdmissionDiagnosisSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalAdmissionDiagnosisSectionOperations.validateHospitalAdmissionDiagnosisSectionCode( + (HospitalAdmissionDiagnosisSection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalAdmissionDiagnosisSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalAdmissionDiagnosisSectionCodeP() { + OperationsTestCase validateHospitalAdmissionDiagnosisSectionCodePTestCase = new OperationsTestCase( + "validateHospitalAdmissionDiagnosisSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_ADMISSION_DIAGNOSIS_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalAdmissionDiagnosisSection target) { + + } + + @Override + protected void updateToPass(HospitalAdmissionDiagnosisSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalAdmissionDiagnosisSectionOperations.validateHospitalAdmissionDiagnosisSectionCodeP( + (HospitalAdmissionDiagnosisSection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalAdmissionDiagnosisSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalAdmissionDiagnosisSectionTitle() { + OperationsTestCase validateHospitalAdmissionDiagnosisSectionTitleTestCase = new OperationsTestCase( + "validateHospitalAdmissionDiagnosisSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_ADMISSION_DIAGNOSIS_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalAdmissionDiagnosisSection target) { + + } + + @Override + protected void updateToPass(HospitalAdmissionDiagnosisSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalAdmissionDiagnosisSectionOperations.validateHospitalAdmissionDiagnosisSectionTitle( + (HospitalAdmissionDiagnosisSection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalAdmissionDiagnosisSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalAdmissionDiagnosisSectionText() { + OperationsTestCase validateHospitalAdmissionDiagnosisSectionTextTestCase = new OperationsTestCase( + "validateHospitalAdmissionDiagnosisSectionText", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_ADMISSION_DIAGNOSIS_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalAdmissionDiagnosisSection target) { + + } + + @Override + protected void updateToPass(HospitalAdmissionDiagnosisSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalAdmissionDiagnosisSectionOperations.validateHospitalAdmissionDiagnosisSectionText( + (HospitalAdmissionDiagnosisSection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalAdmissionDiagnosisSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateHospitalAdmissionDiagnosisSectionHospitalAdmissionDiagnosis() { + OperationsTestCase validateHospitalAdmissionDiagnosisSectionHospitalAdmissionDiagnosisTestCase = new OperationsTestCase( + "validateHospitalAdmissionDiagnosisSectionHospitalAdmissionDiagnosis", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_ADMISSION_DIAGNOSIS_SECTION_HOSPITAL_ADMISSION_DIAGNOSIS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalAdmissionDiagnosisSection target) { + + } + + @Override + protected void updateToPass(HospitalAdmissionDiagnosisSection target) { + target.init(); + target.addAct(ConsolFactory.eINSTANCE.createHospitalAdmissionDiagnosis()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalAdmissionDiagnosisSectionOperations.validateHospitalAdmissionDiagnosisSectionHospitalAdmissionDiagnosis( + (HospitalAdmissionDiagnosisSection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalAdmissionDiagnosisSectionHospitalAdmissionDiagnosisTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetHospitalAdmissionDiagnosis() { + + HospitalAdmissionDiagnosisSection target = objectFactory.create(); + target.getHospitalAdmissionDiagnosis(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends HospitalAdmissionDiagnosisSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public HospitalAdmissionDiagnosisSection create() { + return ConsolFactory.eINSTANCE.createHospitalAdmissionDiagnosisSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends HospitalAdmissionDiagnosisSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // HospitalAdmissionDiagnosisSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HospitalAdmissionDiagnosisTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HospitalAdmissionDiagnosisTest.java new file mode 100644 index 000000000..c403f47a7 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HospitalAdmissionDiagnosisTest.java @@ -0,0 +1,301 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.HospitalAdmissionDiagnosis; +import org.openhealthtools.mdht.uml.cda.consol.operations.HospitalAdmissionDiagnosisOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * + * A static utility class that provides operations related to 'Hospital Admission Diagnosis' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalAdmissionDiagnosis#validateHospitalAdmissionDiagnosisTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Admission Diagnosis Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalAdmissionDiagnosis#validateHospitalAdmissionDiagnosisClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Admission Diagnosis Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalAdmissionDiagnosis#validateHospitalAdmissionDiagnosisCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Admission Diagnosis Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalAdmissionDiagnosis#validateHospitalAdmissionDiagnosisMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Admission Diagnosis Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalAdmissionDiagnosis#validateHospitalAdmissionDiagnosisProblemObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Admission Diagnosis Problem Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalAdmissionDiagnosis#getProblemObservations() Get Problem Observations}
  • + *
+ *

+ * + * @generated + */ + +public class HospitalAdmissionDiagnosisTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHospitalAdmissionDiagnosisTemplateId() { + OperationsTestCase validateHospitalAdmissionDiagnosisTemplateIdTestCase = new OperationsTestCase( + "validateHospitalAdmissionDiagnosisTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_ADMISSION_DIAGNOSIS_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalAdmissionDiagnosis target) { + + } + + @Override + protected void updateToPass(HospitalAdmissionDiagnosis target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalAdmissionDiagnosisOperations.validateHospitalAdmissionDiagnosisTemplateId( + (HospitalAdmissionDiagnosis) objectToTest, diagnostician, map); + } + + }; + + validateHospitalAdmissionDiagnosisTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalAdmissionDiagnosisClassCode() { + OperationsTestCase validateHospitalAdmissionDiagnosisClassCodeTestCase = new OperationsTestCase( + "validateHospitalAdmissionDiagnosisClassCode", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_ADMISSION_DIAGNOSIS_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalAdmissionDiagnosis target) { + + } + + @Override + protected void updateToPass(HospitalAdmissionDiagnosis target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalAdmissionDiagnosisOperations.validateHospitalAdmissionDiagnosisClassCode( + (HospitalAdmissionDiagnosis) objectToTest, diagnostician, map); + } + + }; + + validateHospitalAdmissionDiagnosisClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalAdmissionDiagnosisCode() { + OperationsTestCase validateHospitalAdmissionDiagnosisCodeTestCase = new OperationsTestCase( + "validateHospitalAdmissionDiagnosisCode", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_ADMISSION_DIAGNOSIS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalAdmissionDiagnosis target) { + + } + + @Override + protected void updateToPass(HospitalAdmissionDiagnosis target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalAdmissionDiagnosisOperations.validateHospitalAdmissionDiagnosisCode( + (HospitalAdmissionDiagnosis) objectToTest, diagnostician, map); + } + + }; + + validateHospitalAdmissionDiagnosisCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalAdmissionDiagnosisMoodCode() { + OperationsTestCase validateHospitalAdmissionDiagnosisMoodCodeTestCase = new OperationsTestCase( + "validateHospitalAdmissionDiagnosisMoodCode", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_ADMISSION_DIAGNOSIS_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalAdmissionDiagnosis target) { + + } + + @Override + protected void updateToPass(HospitalAdmissionDiagnosis target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalAdmissionDiagnosisOperations.validateHospitalAdmissionDiagnosisMoodCode( + (HospitalAdmissionDiagnosis) objectToTest, diagnostician, map); + } + + }; + + validateHospitalAdmissionDiagnosisMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateHospitalAdmissionDiagnosisProblemObservation() { + OperationsTestCase validateHospitalAdmissionDiagnosisProblemObservationTestCase = new OperationsTestCase( + "validateHospitalAdmissionDiagnosisProblemObservation", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_ADMISSION_DIAGNOSIS_PROBLEM_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalAdmissionDiagnosis target) { + + target.init(); + target.addObservation(ConsolFactory.eINSTANCE.createProblemObservation().init()); + + } + + @Override + protected void updateToPass(HospitalAdmissionDiagnosis target) { + + for (EntryRelationship er : target.getEntryRelationships()) { + + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + } + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalAdmissionDiagnosisOperations.validateHospitalAdmissionDiagnosisProblemObservation( + (HospitalAdmissionDiagnosis) objectToTest, diagnostician, map); + } + + }; + + validateHospitalAdmissionDiagnosisProblemObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemObservations() { + + HospitalAdmissionDiagnosis target = objectFactory.create(); + target.getProblemObservations(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends HospitalAdmissionDiagnosisOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public HospitalAdmissionDiagnosis create() { + return ConsolFactory.eINSTANCE.createHospitalAdmissionDiagnosis(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends HospitalAdmissionDiagnosisOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // HospitalAdmissionDiagnosisOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HospitalAdmissionMedicationsSectionEntriesOptionalTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HospitalAdmissionMedicationsSectionEntriesOptionalTest.java new file mode 100644 index 000000000..95f4d470f --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HospitalAdmissionMedicationsSectionEntriesOptionalTest.java @@ -0,0 +1,338 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.HospitalAdmissionMedicationsSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.operations.HospitalAdmissionMedicationsSectionEntriesOptionalOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Hospital Admission Medications Section Entries Optional' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalAdmissionMedicationsSectionEntriesOptional#validateHospitalAdmissionMedicationsSectionEntriesOptionalTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Admission Medications Section Entries Optional Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalAdmissionMedicationsSectionEntriesOptional#validateHospitalAdmissionMedicationsSectionEntriesOptionalCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Admission Medications Section Entries Optional Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalAdmissionMedicationsSectionEntriesOptional#validateHospitalAdmissionMedicationsSectionEntriesOptionalCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Admission Medications Section Entries Optional Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalAdmissionMedicationsSectionEntriesOptional#validateHospitalAdmissionMedicationsSectionEntriesOptionalText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Admission Medications Section Entries Optional Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalAdmissionMedicationsSectionEntriesOptional#validateHospitalAdmissionMedicationsSectionEntriesOptionalTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Admission Medications Section Entries Optional Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalAdmissionMedicationsSectionEntriesOptional#validateHospitalAdmissionMedicationsSectionEntriesOptionalAdmissionMedication(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Admission Medications Section Entries Optional Admission Medication}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalAdmissionMedicationsSectionEntriesOptional#getAdmissionMedications() Get Admission Medications}
  • + *
+ *

+ * + * @generated + */ + +public class HospitalAdmissionMedicationsSectionEntriesOptionalTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHospitalAdmissionMedicationsSectionEntriesOptionalTemplateId() { + OperationsTestCase validateHospitalAdmissionMedicationsSectionEntriesOptionalTemplateIdTestCase = new OperationsTestCase( + "validateHospitalAdmissionMedicationsSectionEntriesOptionalTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_ADMISSION_MEDICATIONS_SECTION_ENTRIES_OPTIONAL_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalAdmissionMedicationsSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(HospitalAdmissionMedicationsSectionEntriesOptional target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalAdmissionMedicationsSectionEntriesOptionalOperations.validateHospitalAdmissionMedicationsSectionEntriesOptionalTemplateId( + (HospitalAdmissionMedicationsSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateHospitalAdmissionMedicationsSectionEntriesOptionalTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalAdmissionMedicationsSectionEntriesOptionalCode() { + OperationsTestCase validateHospitalAdmissionMedicationsSectionEntriesOptionalCodeTestCase = new OperationsTestCase( + "validateHospitalAdmissionMedicationsSectionEntriesOptionalCode", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_ADMISSION_MEDICATIONS_SECTION_ENTRIES_OPTIONAL_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalAdmissionMedicationsSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(HospitalAdmissionMedicationsSectionEntriesOptional target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalAdmissionMedicationsSectionEntriesOptionalOperations.validateHospitalAdmissionMedicationsSectionEntriesOptionalCode( + (HospitalAdmissionMedicationsSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateHospitalAdmissionMedicationsSectionEntriesOptionalCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalAdmissionMedicationsSectionEntriesOptionalCodeP() { + OperationsTestCase validateHospitalAdmissionMedicationsSectionEntriesOptionalCodePTestCase = new OperationsTestCase( + "validateHospitalAdmissionMedicationsSectionEntriesOptionalCodeP", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_ADMISSION_MEDICATIONS_SECTION_ENTRIES_OPTIONAL_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalAdmissionMedicationsSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(HospitalAdmissionMedicationsSectionEntriesOptional target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalAdmissionMedicationsSectionEntriesOptionalOperations.validateHospitalAdmissionMedicationsSectionEntriesOptionalCodeP( + (HospitalAdmissionMedicationsSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateHospitalAdmissionMedicationsSectionEntriesOptionalCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalAdmissionMedicationsSectionEntriesOptionalText() { + OperationsTestCase validateHospitalAdmissionMedicationsSectionEntriesOptionalTextTestCase = new OperationsTestCase( + "validateHospitalAdmissionMedicationsSectionEntriesOptionalText", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_ADMISSION_MEDICATIONS_SECTION_ENTRIES_OPTIONAL_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalAdmissionMedicationsSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(HospitalAdmissionMedicationsSectionEntriesOptional target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalAdmissionMedicationsSectionEntriesOptionalOperations.validateHospitalAdmissionMedicationsSectionEntriesOptionalText( + (HospitalAdmissionMedicationsSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateHospitalAdmissionMedicationsSectionEntriesOptionalTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalAdmissionMedicationsSectionEntriesOptionalTitle() { + OperationsTestCase validateHospitalAdmissionMedicationsSectionEntriesOptionalTitleTestCase = new OperationsTestCase( + "validateHospitalAdmissionMedicationsSectionEntriesOptionalTitle", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_ADMISSION_MEDICATIONS_SECTION_ENTRIES_OPTIONAL_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalAdmissionMedicationsSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(HospitalAdmissionMedicationsSectionEntriesOptional target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalAdmissionMedicationsSectionEntriesOptionalOperations.validateHospitalAdmissionMedicationsSectionEntriesOptionalTitle( + (HospitalAdmissionMedicationsSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateHospitalAdmissionMedicationsSectionEntriesOptionalTitleTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateHospitalAdmissionMedicationsSectionEntriesOptionalAdmissionMedication() { + OperationsTestCase validateHospitalAdmissionMedicationsSectionEntriesOptionalAdmissionMedicationTestCase = new OperationsTestCase( + "validateHospitalAdmissionMedicationsSectionEntriesOptionalAdmissionMedication", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_ADMISSION_MEDICATIONS_SECTION_ENTRIES_OPTIONAL_ADMISSION_MEDICATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalAdmissionMedicationsSectionEntriesOptional target) { + target.init(); + } + + @Override + protected void updateToPass(HospitalAdmissionMedicationsSectionEntriesOptional target) { + target.addAct(ConsolFactory.eINSTANCE.createAdmissionMedication().init()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalAdmissionMedicationsSectionEntriesOptionalOperations.validateHospitalAdmissionMedicationsSectionEntriesOptionalAdmissionMedication( + (HospitalAdmissionMedicationsSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateHospitalAdmissionMedicationsSectionEntriesOptionalAdmissionMedicationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetAdmissionMedications() { + + HospitalAdmissionMedicationsSectionEntriesOptional target = objectFactory.create(); + target.getAdmissionMedications(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends HospitalAdmissionMedicationsSectionEntriesOptionalOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public HospitalAdmissionMedicationsSectionEntriesOptional create() { + return ConsolFactory.eINSTANCE.createHospitalAdmissionMedicationsSectionEntriesOptional(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends HospitalAdmissionMedicationsSectionEntriesOptionalOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // HospitalAdmissionMedicationsSectionEntriesOptionalOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HospitalConsultationsSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HospitalConsultationsSectionTest.java new file mode 100644 index 000000000..94151890e --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HospitalConsultationsSectionTest.java @@ -0,0 +1,290 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.HospitalConsultationsSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.HospitalConsultationsSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Hospital Consultations Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalConsultationsSection#validateHospitalConsultationsSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Consultations Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalConsultationsSection#validateHospitalConsultationsSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Consultations Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalConsultationsSection#validateHospitalConsultationsSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Consultations Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalConsultationsSection#validateHospitalConsultationsSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Consultations Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalConsultationsSection#validateHospitalConsultationsSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Consultations Section Title}
  • + *
+ *

+ * + * @generated + */ + +public class HospitalConsultationsSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHospitalConsultationsSectionTemplateId() { + OperationsTestCase validateHospitalConsultationsSectionTemplateIdTestCase = new OperationsTestCase( + "validateHospitalConsultationsSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_CONSULTATIONS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalConsultationsSection target) { + + } + + @Override + protected void updateToPass(HospitalConsultationsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalConsultationsSectionOperations.validateHospitalConsultationsSectionTemplateId( + (HospitalConsultationsSection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalConsultationsSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalConsultationsSectionCode() { + OperationsTestCase validateHospitalConsultationsSectionCodeTestCase = new OperationsTestCase( + "validateHospitalConsultationsSectionCode", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_CONSULTATIONS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalConsultationsSection target) { + + } + + @Override + protected void updateToPass(HospitalConsultationsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalConsultationsSectionOperations.validateHospitalConsultationsSectionCode( + (HospitalConsultationsSection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalConsultationsSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalConsultationsSectionCodeP() { + OperationsTestCase validateHospitalConsultationsSectionCodePTestCase = new OperationsTestCase( + "validateHospitalConsultationsSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_CONSULTATIONS_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalConsultationsSection target) { + + } + + @Override + protected void updateToPass(HospitalConsultationsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalConsultationsSectionOperations.validateHospitalConsultationsSectionCodeP( + (HospitalConsultationsSection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalConsultationsSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalConsultationsSectionText() { + OperationsTestCase validateHospitalConsultationsSectionTextTestCase = new OperationsTestCase( + "validateHospitalConsultationsSectionText", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_CONSULTATIONS_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalConsultationsSection target) { + + } + + @Override + protected void updateToPass(HospitalConsultationsSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalConsultationsSectionOperations.validateHospitalConsultationsSectionText( + (HospitalConsultationsSection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalConsultationsSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalConsultationsSectionTitle() { + OperationsTestCase validateHospitalConsultationsSectionTitleTestCase = new OperationsTestCase( + "validateHospitalConsultationsSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_CONSULTATIONS_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalConsultationsSection target) { + + } + + @Override + protected void updateToPass(HospitalConsultationsSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalConsultationsSectionOperations.validateHospitalConsultationsSectionTitle( + (HospitalConsultationsSection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalConsultationsSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends HospitalConsultationsSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public HospitalConsultationsSection create() { + return ConsolFactory.eINSTANCE.createHospitalConsultationsSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends HospitalConsultationsSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // HospitalConsultationsSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HospitalCourseSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HospitalCourseSectionTest.java new file mode 100644 index 000000000..e31ff18a8 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HospitalCourseSectionTest.java @@ -0,0 +1,290 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.HospitalCourseSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.HospitalCourseSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Hospital Course Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalCourseSection#validateHospitalCourseSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Course Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalCourseSection#validateHospitalCourseSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Course Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalCourseSection#validateHospitalCourseSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Course Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalCourseSection#validateHospitalCourseSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Course Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalCourseSection#validateHospitalCourseSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Course Section Text}
  • + *
+ *

+ * + * @generated + */ + +public class HospitalCourseSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHospitalCourseSectionTemplateId() { + OperationsTestCase validateHospitalCourseSectionTemplateIdTestCase = new OperationsTestCase( + "validateHospitalCourseSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_COURSE_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalCourseSection target) { + + } + + @Override + protected void updateToPass(HospitalCourseSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalCourseSectionOperations.validateHospitalCourseSectionTemplateId( + (HospitalCourseSection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalCourseSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalCourseSectionCode() { + OperationsTestCase validateHospitalCourseSectionCodeTestCase = new OperationsTestCase( + "validateHospitalCourseSectionCode", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_COURSE_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalCourseSection target) { + + } + + @Override + protected void updateToPass(HospitalCourseSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalCourseSectionOperations.validateHospitalCourseSectionCode( + (HospitalCourseSection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalCourseSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalCourseSectionCodeP() { + OperationsTestCase validateHospitalCourseSectionCodePTestCase = new OperationsTestCase( + "validateHospitalCourseSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_COURSE_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalCourseSection target) { + + } + + @Override + protected void updateToPass(HospitalCourseSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalCourseSectionOperations.validateHospitalCourseSectionCodeP( + (HospitalCourseSection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalCourseSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalCourseSectionTitle() { + OperationsTestCase validateHospitalCourseSectionTitleTestCase = new OperationsTestCase( + "validateHospitalCourseSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_COURSE_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalCourseSection target) { + + } + + @Override + protected void updateToPass(HospitalCourseSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalCourseSectionOperations.validateHospitalCourseSectionTitle( + (HospitalCourseSection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalCourseSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalCourseSectionText() { + OperationsTestCase validateHospitalCourseSectionTextTestCase = new OperationsTestCase( + "validateHospitalCourseSectionText", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_COURSE_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalCourseSection target) { + + } + + @Override + protected void updateToPass(HospitalCourseSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalCourseSectionOperations.validateHospitalCourseSectionText( + (HospitalCourseSection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalCourseSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends HospitalCourseSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public HospitalCourseSection create() { + return ConsolFactory.eINSTANCE.createHospitalCourseSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends HospitalCourseSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // HospitalCourseSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HospitalDischargeDiagnosisSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HospitalDischargeDiagnosisSectionTest.java new file mode 100644 index 000000000..eed82626b --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HospitalDischargeDiagnosisSectionTest.java @@ -0,0 +1,338 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeDiagnosisSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.HospitalDischargeDiagnosisSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Hospital Discharge Diagnosis Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeDiagnosisSection#validateHospitalDischargeDiagnosisSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Discharge Diagnosis Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeDiagnosisSection#validateHospitalDischargeDiagnosisSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Discharge Diagnosis Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeDiagnosisSection#validateHospitalDischargeDiagnosisSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Discharge Diagnosis Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeDiagnosisSection#validateHospitalDischargeDiagnosisSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Discharge Diagnosis Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeDiagnosisSection#validateHospitalDischargeDiagnosisSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Discharge Diagnosis Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeDiagnosisSection#validateHospitalDischargeDiagnosisSectionHospitalDischargeDiagnosis(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Discharge Diagnosis Section Hospital Discharge Diagnosis}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeDiagnosisSection#getHospitalDischargeDiagnosis() Get Hospital Discharge Diagnosis}
  • + *
+ *

+ * + * @generated + */ + +public class HospitalDischargeDiagnosisSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHospitalDischargeDiagnosisSectionTemplateId() { + OperationsTestCase validateHospitalDischargeDiagnosisSectionTemplateIdTestCase = new OperationsTestCase( + "validateHospitalDischargeDiagnosisSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_DISCHARGE_DIAGNOSIS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalDischargeDiagnosisSection target) { + + } + + @Override + protected void updateToPass(HospitalDischargeDiagnosisSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalDischargeDiagnosisSectionOperations.validateHospitalDischargeDiagnosisSectionTemplateId( + (HospitalDischargeDiagnosisSection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalDischargeDiagnosisSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalDischargeDiagnosisSectionCode() { + OperationsTestCase validateHospitalDischargeDiagnosisSectionCodeTestCase = new OperationsTestCase( + "validateHospitalDischargeDiagnosisSectionCode", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_DISCHARGE_DIAGNOSIS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalDischargeDiagnosisSection target) { + + } + + @Override + protected void updateToPass(HospitalDischargeDiagnosisSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalDischargeDiagnosisSectionOperations.validateHospitalDischargeDiagnosisSectionCode( + (HospitalDischargeDiagnosisSection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalDischargeDiagnosisSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalDischargeDiagnosisSectionCodeP() { + OperationsTestCase validateHospitalDischargeDiagnosisSectionCodePTestCase = new OperationsTestCase( + "validateHospitalDischargeDiagnosisSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_DISCHARGE_DIAGNOSIS_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalDischargeDiagnosisSection target) { + + } + + @Override + protected void updateToPass(HospitalDischargeDiagnosisSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalDischargeDiagnosisSectionOperations.validateHospitalDischargeDiagnosisSectionCodeP( + (HospitalDischargeDiagnosisSection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalDischargeDiagnosisSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalDischargeDiagnosisSectionTitle() { + OperationsTestCase validateHospitalDischargeDiagnosisSectionTitleTestCase = new OperationsTestCase( + "validateHospitalDischargeDiagnosisSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_DISCHARGE_DIAGNOSIS_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalDischargeDiagnosisSection target) { + + } + + @Override + protected void updateToPass(HospitalDischargeDiagnosisSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalDischargeDiagnosisSectionOperations.validateHospitalDischargeDiagnosisSectionTitle( + (HospitalDischargeDiagnosisSection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalDischargeDiagnosisSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalDischargeDiagnosisSectionText() { + OperationsTestCase validateHospitalDischargeDiagnosisSectionTextTestCase = new OperationsTestCase( + "validateHospitalDischargeDiagnosisSectionText", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_DISCHARGE_DIAGNOSIS_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalDischargeDiagnosisSection target) { + + } + + @Override + protected void updateToPass(HospitalDischargeDiagnosisSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalDischargeDiagnosisSectionOperations.validateHospitalDischargeDiagnosisSectionText( + (HospitalDischargeDiagnosisSection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalDischargeDiagnosisSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHospitalDischargeDiagnosisSectionHospitalDischargeDiagnosis() { + OperationsTestCase validateHospitalDischargeDiagnosisSectionHospitalDischargeDiagnosisTestCase = new OperationsTestCase( + "validateHospitalDischargeDiagnosisSectionHospitalDischargeDiagnosis", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_DISCHARGE_DIAGNOSIS_SECTION_HOSPITAL_DISCHARGE_DIAGNOSIS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalDischargeDiagnosisSection target) { + + } + + @Override + protected void updateToPass(HospitalDischargeDiagnosisSection target) { + target.init(); + target.addAct(ConsolFactory.eINSTANCE.createHospitalDischargeDiagnosis()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalDischargeDiagnosisSectionOperations.validateHospitalDischargeDiagnosisSectionHospitalDischargeDiagnosis( + (HospitalDischargeDiagnosisSection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalDischargeDiagnosisSectionHospitalDischargeDiagnosisTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetHospitalDischargeDiagnosis() { + + HospitalDischargeDiagnosisSection target = objectFactory.create(); + target.getHospitalDischargeDiagnosis(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends HospitalDischargeDiagnosisSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public HospitalDischargeDiagnosisSection create() { + return ConsolFactory.eINSTANCE.createHospitalDischargeDiagnosisSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends HospitalDischargeDiagnosisSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // HospitalDischargeDiagnosisSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HospitalDischargeDiagnosisTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HospitalDischargeDiagnosisTest.java new file mode 100644 index 000000000..f9d57c9b3 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HospitalDischargeDiagnosisTest.java @@ -0,0 +1,299 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeDiagnosis; +import org.openhealthtools.mdht.uml.cda.consol.operations.HospitalDischargeDiagnosisOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * + * A static utility class that provides operations related to 'Hospital Discharge Diagnosis' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeDiagnosis#validateHospitalDischargeDiagnosisProblemObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Discharge Diagnosis Problem Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeDiagnosis#validateHospitalDischargeDiagnosisTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Discharge Diagnosis Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeDiagnosis#validateHospitalDischargeDiagnosisClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Discharge Diagnosis Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeDiagnosis#validateHospitalDischargeDiagnosisMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Discharge Diagnosis Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeDiagnosis#validateHospitalDischargeDiagnosisCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Discharge Diagnosis Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeDiagnosis#getProblemObservations() Get Problem Observations}
  • + *
+ *

+ * + * @generated + */ + +public class HospitalDischargeDiagnosisTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateHospitalDischargeDiagnosisProblemObservation() { + OperationsTestCase validateHospitalDischargeDiagnosisProblemObservationTestCase = new OperationsTestCase( + "validateHospitalDischargeDiagnosisProblemObservation", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_DISCHARGE_DIAGNOSIS_PROBLEM_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalDischargeDiagnosis target) { + + } + + @Override + protected void updateToPass(HospitalDischargeDiagnosis target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + er.setObservation(ConsolFactory.eINSTANCE.createProblemObservation()); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalDischargeDiagnosisOperations.validateHospitalDischargeDiagnosisProblemObservation( + (HospitalDischargeDiagnosis) objectToTest, diagnostician, map); + } + + }; + + validateHospitalDischargeDiagnosisProblemObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalDischargeDiagnosisTemplateId() { + OperationsTestCase validateHospitalDischargeDiagnosisTemplateIdTestCase = new OperationsTestCase( + "validateHospitalDischargeDiagnosisTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_DISCHARGE_DIAGNOSIS_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalDischargeDiagnosis target) { + + } + + @Override + protected void updateToPass(HospitalDischargeDiagnosis target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalDischargeDiagnosisOperations.validateHospitalDischargeDiagnosisTemplateId( + (HospitalDischargeDiagnosis) objectToTest, diagnostician, map); + } + + }; + + validateHospitalDischargeDiagnosisTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalDischargeDiagnosisClassCode() { + OperationsTestCase validateHospitalDischargeDiagnosisClassCodeTestCase = new OperationsTestCase( + "validateHospitalDischargeDiagnosisClassCode", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_DISCHARGE_DIAGNOSIS_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalDischargeDiagnosis target) { + + } + + @Override + protected void updateToPass(HospitalDischargeDiagnosis target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalDischargeDiagnosisOperations.validateHospitalDischargeDiagnosisClassCode( + (HospitalDischargeDiagnosis) objectToTest, diagnostician, map); + } + + }; + + validateHospitalDischargeDiagnosisClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalDischargeDiagnosisMoodCode() { + OperationsTestCase validateHospitalDischargeDiagnosisMoodCodeTestCase = new OperationsTestCase( + "validateHospitalDischargeDiagnosisMoodCode", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_DISCHARGE_DIAGNOSIS_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalDischargeDiagnosis target) { + + } + + @Override + protected void updateToPass(HospitalDischargeDiagnosis target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalDischargeDiagnosisOperations.validateHospitalDischargeDiagnosisMoodCode( + (HospitalDischargeDiagnosis) objectToTest, diagnostician, map); + } + + }; + + validateHospitalDischargeDiagnosisMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalDischargeDiagnosisCode() { + OperationsTestCase validateHospitalDischargeDiagnosisCodeTestCase = new OperationsTestCase( + "validateHospitalDischargeDiagnosisCode", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_DISCHARGE_DIAGNOSIS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalDischargeDiagnosis target) { + + } + + @Override + protected void updateToPass(HospitalDischargeDiagnosis target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalDischargeDiagnosisOperations.validateHospitalDischargeDiagnosisCode( + (HospitalDischargeDiagnosis) objectToTest, diagnostician, map); + } + + }; + + validateHospitalDischargeDiagnosisCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemObservations() { + + HospitalDischargeDiagnosis target = objectFactory.create(); + target.getProblemObservations(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends HospitalDischargeDiagnosisOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public HospitalDischargeDiagnosis create() { + return ConsolFactory.eINSTANCE.createHospitalDischargeDiagnosis(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends HospitalDischargeDiagnosisOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // HospitalDischargeDiagnosisOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HospitalDischargeInstructionsSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HospitalDischargeInstructionsSectionTest.java new file mode 100644 index 000000000..0fccbf57d --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HospitalDischargeInstructionsSectionTest.java @@ -0,0 +1,290 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeInstructionsSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.HospitalDischargeInstructionsSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Hospital Discharge Instructions Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeInstructionsSection#validateHospitalDischargeInstructionsSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Discharge Instructions Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeInstructionsSection#validateHospitalDischargeInstructionsSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Discharge Instructions Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeInstructionsSection#validateHospitalDischargeInstructionsSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Discharge Instructions Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeInstructionsSection#validateHospitalDischargeInstructionsSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Discharge Instructions Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeInstructionsSection#validateHospitalDischargeInstructionsSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Discharge Instructions Section Text}
  • + *
+ *

+ * + * @generated + */ + +public class HospitalDischargeInstructionsSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHospitalDischargeInstructionsSectionTemplateId() { + OperationsTestCase validateHospitalDischargeInstructionsSectionTemplateIdTestCase = new OperationsTestCase( + "validateHospitalDischargeInstructionsSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_DISCHARGE_INSTRUCTIONS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalDischargeInstructionsSection target) { + + } + + @Override + protected void updateToPass(HospitalDischargeInstructionsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalDischargeInstructionsSectionOperations.validateHospitalDischargeInstructionsSectionTemplateId( + (HospitalDischargeInstructionsSection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalDischargeInstructionsSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalDischargeInstructionsSectionCode() { + OperationsTestCase validateHospitalDischargeInstructionsSectionCodeTestCase = new OperationsTestCase( + "validateHospitalDischargeInstructionsSectionCode", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_DISCHARGE_INSTRUCTIONS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalDischargeInstructionsSection target) { + + } + + @Override + protected void updateToPass(HospitalDischargeInstructionsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalDischargeInstructionsSectionOperations.validateHospitalDischargeInstructionsSectionCode( + (HospitalDischargeInstructionsSection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalDischargeInstructionsSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalDischargeInstructionsSectionCodeP() { + OperationsTestCase validateHospitalDischargeInstructionsSectionCodePTestCase = new OperationsTestCase( + "validateHospitalDischargeInstructionsSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_DISCHARGE_INSTRUCTIONS_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalDischargeInstructionsSection target) { + + } + + @Override + protected void updateToPass(HospitalDischargeInstructionsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalDischargeInstructionsSectionOperations.validateHospitalDischargeInstructionsSectionCodeP( + (HospitalDischargeInstructionsSection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalDischargeInstructionsSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalDischargeInstructionsSectionText() { + OperationsTestCase validateHospitalDischargeInstructionsSectionTextTestCase = new OperationsTestCase( + "validateHospitalDischargeInstructionsSectionText", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_DISCHARGE_INSTRUCTIONS_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalDischargeInstructionsSection target) { + + } + + @Override + protected void updateToPass(HospitalDischargeInstructionsSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalDischargeInstructionsSectionOperations.validateHospitalDischargeInstructionsSectionText( + (HospitalDischargeInstructionsSection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalDischargeInstructionsSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalDischargeInstructionsSectionTitle() { + OperationsTestCase validateHospitalDischargeInstructionsSectionTitleTestCase = new OperationsTestCase( + "validateHospitalDischargeInstructionsSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_DISCHARGE_INSTRUCTIONS_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalDischargeInstructionsSection target) { + + } + + @Override + protected void updateToPass(HospitalDischargeInstructionsSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalDischargeInstructionsSectionOperations.validateHospitalDischargeInstructionsSectionTitle( + (HospitalDischargeInstructionsSection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalDischargeInstructionsSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends HospitalDischargeInstructionsSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public HospitalDischargeInstructionsSection create() { + return ConsolFactory.eINSTANCE.createHospitalDischargeInstructionsSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends HospitalDischargeInstructionsSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // HospitalDischargeInstructionsSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HospitalDischargeMedicationsSectionEntriesOptionalTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HospitalDischargeMedicationsSectionEntriesOptionalTest.java new file mode 100644 index 000000000..ef78135b7 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HospitalDischargeMedicationsSectionEntriesOptionalTest.java @@ -0,0 +1,338 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeMedicationsSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.operations.HospitalDischargeMedicationsSectionEntriesOptionalOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Hospital Discharge Medications Section Entries Optional' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeMedicationsSectionEntriesOptional#validateHospitalDischargeMedicationsSectionEntriesOptionalTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Discharge Medications Section Entries Optional Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeMedicationsSectionEntriesOptional#validateHospitalDischargeMedicationsSectionEntriesOptionalCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Discharge Medications Section Entries Optional Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeMedicationsSectionEntriesOptional#validateHospitalDischargeMedicationsSectionEntriesOptionalCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Discharge Medications Section Entries Optional Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeMedicationsSectionEntriesOptional#validateHospitalDischargeMedicationsSectionEntriesOptionalTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Discharge Medications Section Entries Optional Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeMedicationsSectionEntriesOptional#validateHospitalDischargeMedicationsSectionEntriesOptionalText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Discharge Medications Section Entries Optional Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeMedicationsSectionEntriesOptional#validateHospitalDischargeMedicationsSectionEntriesOptionalDischargeMedication(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Discharge Medications Section Entries Optional Discharge Medication}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeMedicationsSectionEntriesOptional#getDischargeMedications() Get Discharge Medications}
  • + *
+ *

+ * + * @generated + */ + +public class HospitalDischargeMedicationsSectionEntriesOptionalTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHospitalDischargeMedicationsSectionEntriesOptionalTemplateId() { + OperationsTestCase validateHospitalDischargeMedicationsSectionEntriesOptionalTemplateIdTestCase = new OperationsTestCase( + "validateHospitalDischargeMedicationsSectionEntriesOptionalTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_DISCHARGE_MEDICATIONS_SECTION_ENTRIES_OPTIONAL_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalDischargeMedicationsSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(HospitalDischargeMedicationsSectionEntriesOptional target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalDischargeMedicationsSectionEntriesOptionalOperations.validateHospitalDischargeMedicationsSectionEntriesOptionalTemplateId( + (HospitalDischargeMedicationsSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateHospitalDischargeMedicationsSectionEntriesOptionalTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalDischargeMedicationsSectionEntriesOptionalCode() { + OperationsTestCase validateHospitalDischargeMedicationsSectionEntriesOptionalCodeTestCase = new OperationsTestCase( + "validateHospitalDischargeMedicationsSectionEntriesOptionalCode", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_DISCHARGE_MEDICATIONS_SECTION_ENTRIES_OPTIONAL_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalDischargeMedicationsSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(HospitalDischargeMedicationsSectionEntriesOptional target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalDischargeMedicationsSectionEntriesOptionalOperations.validateHospitalDischargeMedicationsSectionEntriesOptionalCode( + (HospitalDischargeMedicationsSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateHospitalDischargeMedicationsSectionEntriesOptionalCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalDischargeMedicationsSectionEntriesOptionalCodeP() { + OperationsTestCase validateHospitalDischargeMedicationsSectionEntriesOptionalCodePTestCase = new OperationsTestCase( + "validateHospitalDischargeMedicationsSectionEntriesOptionalCodeP", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_DISCHARGE_MEDICATIONS_SECTION_ENTRIES_OPTIONAL_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalDischargeMedicationsSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(HospitalDischargeMedicationsSectionEntriesOptional target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalDischargeMedicationsSectionEntriesOptionalOperations.validateHospitalDischargeMedicationsSectionEntriesOptionalCodeP( + (HospitalDischargeMedicationsSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateHospitalDischargeMedicationsSectionEntriesOptionalCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalDischargeMedicationsSectionEntriesOptionalTitle() { + OperationsTestCase validateHospitalDischargeMedicationsSectionEntriesOptionalTitleTestCase = new OperationsTestCase( + "validateHospitalDischargeMedicationsSectionEntriesOptionalTitle", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_DISCHARGE_MEDICATIONS_SECTION_ENTRIES_OPTIONAL_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalDischargeMedicationsSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(HospitalDischargeMedicationsSectionEntriesOptional target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalDischargeMedicationsSectionEntriesOptionalOperations.validateHospitalDischargeMedicationsSectionEntriesOptionalTitle( + (HospitalDischargeMedicationsSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateHospitalDischargeMedicationsSectionEntriesOptionalTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalDischargeMedicationsSectionEntriesOptionalText() { + OperationsTestCase validateHospitalDischargeMedicationsSectionEntriesOptionalTextTestCase = new OperationsTestCase( + "validateHospitalDischargeMedicationsSectionEntriesOptionalText", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_DISCHARGE_MEDICATIONS_SECTION_ENTRIES_OPTIONAL_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalDischargeMedicationsSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(HospitalDischargeMedicationsSectionEntriesOptional target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalDischargeMedicationsSectionEntriesOptionalOperations.validateHospitalDischargeMedicationsSectionEntriesOptionalText( + (HospitalDischargeMedicationsSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateHospitalDischargeMedicationsSectionEntriesOptionalTextTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHospitalDischargeMedicationsSectionEntriesOptionalDischargeMedication() { + OperationsTestCase validateHospitalDischargeMedicationsSectionEntriesOptionalDischargeMedicationTestCase = new OperationsTestCase( + "validateHospitalDischargeMedicationsSectionEntriesOptionalDischargeMedication", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_DISCHARGE_MEDICATIONS_SECTION_ENTRIES_OPTIONAL_DISCHARGE_MEDICATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalDischargeMedicationsSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(HospitalDischargeMedicationsSectionEntriesOptional target) { + target.init(); + target.addAct(ConsolFactory.eINSTANCE.createDischargeMedication()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalDischargeMedicationsSectionEntriesOptionalOperations.validateHospitalDischargeMedicationsSectionEntriesOptionalDischargeMedication( + (HospitalDischargeMedicationsSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateHospitalDischargeMedicationsSectionEntriesOptionalDischargeMedicationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetDischargeMedications() { + + HospitalDischargeMedicationsSectionEntriesOptional target = objectFactory.create(); + target.getDischargeMedications(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends HospitalDischargeMedicationsSectionEntriesOptionalOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public HospitalDischargeMedicationsSectionEntriesOptional create() { + return ConsolFactory.eINSTANCE.createHospitalDischargeMedicationsSectionEntriesOptional(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends HospitalDischargeMedicationsSectionEntriesOptionalOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // HospitalDischargeMedicationsSectionEntriesOptionalOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HospitalDischargeMedicationsSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HospitalDischargeMedicationsSectionTest.java new file mode 100644 index 000000000..369546290 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HospitalDischargeMedicationsSectionTest.java @@ -0,0 +1,338 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeMedicationsSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.HospitalDischargeMedicationsSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Hospital Discharge Medications Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeMedicationsSection#validateHospitalDischargeMedicationsSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Discharge Medications Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeMedicationsSection#validateHospitalDischargeMedicationsSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Discharge Medications Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeMedicationsSection#validateHospitalDischargeMedicationsSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Discharge Medications Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeMedicationsSection#validateHospitalDischargeMedicationsSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Discharge Medications Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeMedicationsSection#validateHospitalDischargeMedicationsSectionDischargeMedication(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Discharge Medications Section Discharge Medication}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeMedicationsSection#getConsolDischargeMedications() Get Consol Discharge Medications}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeMedicationsSection#validateHospitalDischargeMedicationsSectionEntriesOptionalTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Discharge Medications Section Entries Optional Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class HospitalDischargeMedicationsSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHospitalDischargeMedicationsSectionCodeP() { + OperationsTestCase validateHospitalDischargeMedicationsSectionCodePTestCase = new OperationsTestCase( + "validateHospitalDischargeMedicationsSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_DISCHARGE_MEDICATIONS_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalDischargeMedicationsSection target) { + + } + + @Override + protected void updateToPass(HospitalDischargeMedicationsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalDischargeMedicationsSectionOperations.validateHospitalDischargeMedicationsSectionCodeP( + (HospitalDischargeMedicationsSection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalDischargeMedicationsSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalDischargeMedicationsSectionCode() { + OperationsTestCase validateHospitalDischargeMedicationsSectionCodeTestCase = new OperationsTestCase( + "validateHospitalDischargeMedicationsSectionCode", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_DISCHARGE_MEDICATIONS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalDischargeMedicationsSection target) { + + } + + @Override + protected void updateToPass(HospitalDischargeMedicationsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalDischargeMedicationsSectionOperations.validateHospitalDischargeMedicationsSectionCode( + (HospitalDischargeMedicationsSection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalDischargeMedicationsSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalDischargeMedicationsSectionText() { + OperationsTestCase validateHospitalDischargeMedicationsSectionTextTestCase = new OperationsTestCase( + "validateHospitalDischargeMedicationsSectionText", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_DISCHARGE_MEDICATIONS_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalDischargeMedicationsSection target) { + + } + + @Override + protected void updateToPass(HospitalDischargeMedicationsSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalDischargeMedicationsSectionOperations.validateHospitalDischargeMedicationsSectionText( + (HospitalDischargeMedicationsSection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalDischargeMedicationsSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalDischargeMedicationsSectionTitle() { + OperationsTestCase validateHospitalDischargeMedicationsSectionTitleTestCase = new OperationsTestCase( + "validateHospitalDischargeMedicationsSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_DISCHARGE_MEDICATIONS_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalDischargeMedicationsSection target) { + + } + + @Override + protected void updateToPass(HospitalDischargeMedicationsSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalDischargeMedicationsSectionOperations.validateHospitalDischargeMedicationsSectionTitle( + (HospitalDischargeMedicationsSection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalDischargeMedicationsSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHospitalDischargeMedicationsSectionDischargeMedication() { + OperationsTestCase validateHospitalDischargeMedicationsSectionDischargeMedicationTestCase = new OperationsTestCase( + "validateHospitalDischargeMedicationsSectionDischargeMedication", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_DISCHARGE_MEDICATIONS_SECTION_DISCHARGE_MEDICATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalDischargeMedicationsSection target) { + + } + + @Override + protected void updateToPass(HospitalDischargeMedicationsSection target) { + target.init(); + target.addAct(ConsolFactory.eINSTANCE.createDischargeMedication()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalDischargeMedicationsSectionOperations.validateHospitalDischargeMedicationsSectionDischargeMedication( + (HospitalDischargeMedicationsSection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalDischargeMedicationsSectionDischargeMedicationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetConsolDischargeMedications() { + + HospitalDischargeMedicationsSection target = objectFactory.create(); + target.getConsolDischargeMedications(); + + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalDischargeMedicationsSectionEntriesOptionalTemplateId() { + OperationsTestCase validateHospitalDischargeMedicationsSectionEntriesOptionalTemplateIdTestCase = new OperationsTestCase( + "validateHospitalDischargeMedicationsSectionEntriesOptionalTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_DISCHARGE_MEDICATIONS_SECTION_ENTRIES_OPTIONAL_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalDischargeMedicationsSection target) { + + } + + @Override + protected void updateToPass(HospitalDischargeMedicationsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalDischargeMedicationsSectionOperations.validateHospitalDischargeMedicationsSectionEntriesOptionalTemplateId( + (HospitalDischargeMedicationsSection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalDischargeMedicationsSectionEntriesOptionalTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends HospitalDischargeMedicationsSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public HospitalDischargeMedicationsSection create() { + return ConsolFactory.eINSTANCE.createHospitalDischargeMedicationsSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends HospitalDischargeMedicationsSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // HospitalDischargeMedicationsSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HospitalDischargePhysicalSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HospitalDischargePhysicalSectionTest.java new file mode 100644 index 000000000..828959989 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HospitalDischargePhysicalSectionTest.java @@ -0,0 +1,290 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.HospitalDischargePhysicalSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.HospitalDischargePhysicalSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Hospital Discharge Physical Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalDischargePhysicalSection#validateHospitalDischargePhysicalSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Discharge Physical Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalDischargePhysicalSection#validateHospitalDischargePhysicalSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Discharge Physical Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalDischargePhysicalSection#validateHospitalDischargePhysicalSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Discharge Physical Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalDischargePhysicalSection#validateHospitalDischargePhysicalSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Discharge Physical Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalDischargePhysicalSection#validateHospitalDischargePhysicalSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Discharge Physical Section Text}
  • + *
+ *

+ * + * @generated + */ + +public class HospitalDischargePhysicalSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHospitalDischargePhysicalSectionTemplateId() { + OperationsTestCase validateHospitalDischargePhysicalSectionTemplateIdTestCase = new OperationsTestCase( + "validateHospitalDischargePhysicalSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_DISCHARGE_PHYSICAL_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalDischargePhysicalSection target) { + + } + + @Override + protected void updateToPass(HospitalDischargePhysicalSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalDischargePhysicalSectionOperations.validateHospitalDischargePhysicalSectionTemplateId( + (HospitalDischargePhysicalSection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalDischargePhysicalSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalDischargePhysicalSectionCode() { + OperationsTestCase validateHospitalDischargePhysicalSectionCodeTestCase = new OperationsTestCase( + "validateHospitalDischargePhysicalSectionCode", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_DISCHARGE_PHYSICAL_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalDischargePhysicalSection target) { + + } + + @Override + protected void updateToPass(HospitalDischargePhysicalSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalDischargePhysicalSectionOperations.validateHospitalDischargePhysicalSectionCode( + (HospitalDischargePhysicalSection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalDischargePhysicalSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalDischargePhysicalSectionCodeP() { + OperationsTestCase validateHospitalDischargePhysicalSectionCodePTestCase = new OperationsTestCase( + "validateHospitalDischargePhysicalSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_DISCHARGE_PHYSICAL_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalDischargePhysicalSection target) { + + } + + @Override + protected void updateToPass(HospitalDischargePhysicalSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalDischargePhysicalSectionOperations.validateHospitalDischargePhysicalSectionCodeP( + (HospitalDischargePhysicalSection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalDischargePhysicalSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalDischargePhysicalSectionTitle() { + OperationsTestCase validateHospitalDischargePhysicalSectionTitleTestCase = new OperationsTestCase( + "validateHospitalDischargePhysicalSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_DISCHARGE_PHYSICAL_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalDischargePhysicalSection target) { + + } + + @Override + protected void updateToPass(HospitalDischargePhysicalSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalDischargePhysicalSectionOperations.validateHospitalDischargePhysicalSectionTitle( + (HospitalDischargePhysicalSection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalDischargePhysicalSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalDischargePhysicalSectionText() { + OperationsTestCase validateHospitalDischargePhysicalSectionTextTestCase = new OperationsTestCase( + "validateHospitalDischargePhysicalSectionText", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_DISCHARGE_PHYSICAL_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalDischargePhysicalSection target) { + + } + + @Override + protected void updateToPass(HospitalDischargePhysicalSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalDischargePhysicalSectionOperations.validateHospitalDischargePhysicalSectionText( + (HospitalDischargePhysicalSection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalDischargePhysicalSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends HospitalDischargePhysicalSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public HospitalDischargePhysicalSection create() { + return ConsolFactory.eINSTANCE.createHospitalDischargePhysicalSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends HospitalDischargePhysicalSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // HospitalDischargePhysicalSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HospitalDischargeStudiesSummarySectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HospitalDischargeStudiesSummarySectionTest.java new file mode 100644 index 000000000..f562581c7 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/HospitalDischargeStudiesSummarySectionTest.java @@ -0,0 +1,290 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeStudiesSummarySection; +import org.openhealthtools.mdht.uml.cda.consol.operations.HospitalDischargeStudiesSummarySectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Hospital Discharge Studies Summary Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeStudiesSummarySection#validateHospitalDischargeStudiesSummarySectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Discharge Studies Summary Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeStudiesSummarySection#validateHospitalDischargeStudiesSummarySectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Discharge Studies Summary Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeStudiesSummarySection#validateHospitalDischargeStudiesSummarySectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Discharge Studies Summary Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeStudiesSummarySection#validateHospitalDischargeStudiesSummarySectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Discharge Studies Summary Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeStudiesSummarySection#validateHospitalDischargeStudiesSummarySectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Discharge Studies Summary Section Text}
  • + *
+ *

+ * + * @generated + */ + +public class HospitalDischargeStudiesSummarySectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHospitalDischargeStudiesSummarySectionTemplateId() { + OperationsTestCase validateHospitalDischargeStudiesSummarySectionTemplateIdTestCase = new OperationsTestCase( + "validateHospitalDischargeStudiesSummarySectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_DISCHARGE_STUDIES_SUMMARY_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalDischargeStudiesSummarySection target) { + + } + + @Override + protected void updateToPass(HospitalDischargeStudiesSummarySection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalDischargeStudiesSummarySectionOperations.validateHospitalDischargeStudiesSummarySectionTemplateId( + (HospitalDischargeStudiesSummarySection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalDischargeStudiesSummarySectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalDischargeStudiesSummarySectionCode() { + OperationsTestCase validateHospitalDischargeStudiesSummarySectionCodeTestCase = new OperationsTestCase( + "validateHospitalDischargeStudiesSummarySectionCode", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_DISCHARGE_STUDIES_SUMMARY_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalDischargeStudiesSummarySection target) { + + } + + @Override + protected void updateToPass(HospitalDischargeStudiesSummarySection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalDischargeStudiesSummarySectionOperations.validateHospitalDischargeStudiesSummarySectionCode( + (HospitalDischargeStudiesSummarySection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalDischargeStudiesSummarySectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalDischargeStudiesSummarySectionCodeP() { + OperationsTestCase validateHospitalDischargeStudiesSummarySectionCodePTestCase = new OperationsTestCase( + "validateHospitalDischargeStudiesSummarySectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_DISCHARGE_STUDIES_SUMMARY_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalDischargeStudiesSummarySection target) { + + } + + @Override + protected void updateToPass(HospitalDischargeStudiesSummarySection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalDischargeStudiesSummarySectionOperations.validateHospitalDischargeStudiesSummarySectionCodeP( + (HospitalDischargeStudiesSummarySection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalDischargeStudiesSummarySectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalDischargeStudiesSummarySectionTitle() { + OperationsTestCase validateHospitalDischargeStudiesSummarySectionTitleTestCase = new OperationsTestCase( + "validateHospitalDischargeStudiesSummarySectionTitle", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_DISCHARGE_STUDIES_SUMMARY_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalDischargeStudiesSummarySection target) { + + } + + @Override + protected void updateToPass(HospitalDischargeStudiesSummarySection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalDischargeStudiesSummarySectionOperations.validateHospitalDischargeStudiesSummarySectionTitle( + (HospitalDischargeStudiesSummarySection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalDischargeStudiesSummarySectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalDischargeStudiesSummarySectionText() { + OperationsTestCase validateHospitalDischargeStudiesSummarySectionTextTestCase = new OperationsTestCase( + "validateHospitalDischargeStudiesSummarySectionText", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_DISCHARGE_STUDIES_SUMMARY_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalDischargeStudiesSummarySection target) { + + } + + @Override + protected void updateToPass(HospitalDischargeStudiesSummarySection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalDischargeStudiesSummarySectionOperations.validateHospitalDischargeStudiesSummarySectionText( + (HospitalDischargeStudiesSummarySection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalDischargeStudiesSummarySectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends HospitalDischargeStudiesSummarySectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public HospitalDischargeStudiesSummarySection create() { + return ConsolFactory.eINSTANCE.createHospitalDischargeStudiesSummarySection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends HospitalDischargeStudiesSummarySectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // HospitalDischargeStudiesSummarySectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ImmunizationActivityTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ImmunizationActivityTest.java new file mode 100644 index 000000000..400a8affa --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ImmunizationActivityTest.java @@ -0,0 +1,1583 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ + +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import static org.openhealthtools.mdht.uml.hl7.vocab.x_DocumentSubstanceMood.EVN; +import static org.openhealthtools.mdht.uml.hl7.vocab.x_DocumentSubstanceMood.INT; + +import java.util.Arrays; +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Consumable; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.Participant2; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ConsolPackage; +import org.openhealthtools.mdht.uml.cda.consol.GeneralStatusSection; +import org.openhealthtools.mdht.uml.cda.consol.ImmunizationActivity; +import org.openhealthtools.mdht.uml.cda.consol.Indication; +import org.openhealthtools.mdht.uml.cda.consol.Instructions; +import org.openhealthtools.mdht.uml.cda.consol.MedicationDispense; +import org.openhealthtools.mdht.uml.cda.consol.PreconditionForSubstanceAdministration; +import org.openhealthtools.mdht.uml.cda.consol.operations.ImmunizationActivityOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_PQ; +import org.openhealthtools.mdht.uml.hl7.vocab.ActClass; +import org.openhealthtools.mdht.uml.hl7.vocab.ActRelationshipType; +import org.openhealthtools.mdht.uml.hl7.vocab.ParticipationType; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; +import org.openhealthtools.mdht.uml.hl7.vocab.x_DocumentSubstanceMood; + +/** + * + * A static utility class that provides operations related to 'Immunization Activity' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationActivity#validateImmunizationActivityTextReference(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Activity Text Reference}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationActivity#validateImmunizationActivityReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Activity Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationActivity#validateImmunizationActivityTextReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Activity Text Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationActivity#validateImmunizationActivityDoseQuantityUnit(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Activity Dose Quantity Unit}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationActivity#validateImmunizationActivityInstructionInversion(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Activity Instruction Inversion}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationActivity#validateImmunizationActivityDrugVehicleTypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Activity Drug Vehicle Type Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationActivity#validateImmunizationActivityPreconditionTypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Activity Precondition Type Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationActivity#validateImmunizationActivityTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Activity Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationActivity#validateImmunizationActivityClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Activity Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationActivity#validateImmunizationActivityMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Activity Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationActivity#validateImmunizationActivityId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Activity Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationActivity#validateImmunizationActivityCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Activity Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationActivity#validateImmunizationActivityStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Activity Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationActivity#validateImmunizationActivityEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Activity Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationActivity#validateImmunizationActivityRouteCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Activity Route Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationActivity#validateImmunizationActivityRouteCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Activity Route Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationActivity#validateImmunizationActivityApproachSiteCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Activity Approach Site Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationActivity#validateImmunizationActivityApproachSiteCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Activity Approach Site Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationActivity#validateImmunizationActivityDoseQuantity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Activity Dose Quantity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationActivity#validateImmunizationActivityNegationInd(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Activity Negation Ind}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationActivity#validateImmunizationActivityText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Activity Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationActivity#validateImmunizationActivityRepeatNumber(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Activity Repeat Number}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationActivity#validateImmunizationActivityAdministrationUnitCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Activity Administration Unit Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationActivity#validateImmunizationActivityAdministrationUnitCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Activity Administration Unit Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationActivity#validateImmunizationActivityDrugVehicle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Activity Drug Vehicle}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationActivity#validateImmunizationActivityIndication(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Activity Indication}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationActivity#validateImmunizationActivityInstructions(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Activity Instructions}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationActivity#validateImmunizationActivityMedicationDispense(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Activity Medication Dispense}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationActivity#validateImmunizationActivityReactionObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Activity Reaction Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationActivity#validateImmunizationActivityPrecondition(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Activity Precondition}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationActivity#validateImmunizationActivityImmunizationRefusalReason(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Activity Immunization Refusal Reason}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationActivity#validateImmunizationActivityConsumable(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Activity Consumable}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationActivity#validateImmunizationActivityPerformer(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Activity Performer}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationActivity#validateImmunizationActivityMedicationSupplyOrder(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Activity Medication Supply Order}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationActivity#validateImmunizationActivityConsumableImmunizationMedicationInformation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Activity Consumable Immunization Medication Information}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationActivity#getDrugVehicle() Get Drug Vehicle}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationActivity#getIndication() Get Indication}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationActivity#getInstructions() Get Instructions}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationActivity#getMedicationDispense() Get Medication Dispense}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationActivity#getReactionObservation() Get Reaction Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationActivity#getImmunizationRefusalReason() Get Immunization Refusal Reason}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationActivity#getMedicationSupplyOrder() Get Medication Supply Order}
  • + *
+ *

+ * + * @generated + */ + +public class ImmunizationActivityTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateImmunizationActivityTextReference() { + OperationsTestCase validateImmunizationActivityTextReferenceTestCase = new OperationsTestCase( + "validateImmunizationActivityTextReference", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_ACTIVITY_TEXT_REFERENCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationActivity target) { + target.init(); + target.setText(DatatypesFactory.eINSTANCE.createED()); + } + + @Override + protected void updateToPass(ImmunizationActivity target) { + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL("test")); + target.setText(txt); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationActivityOperations.validateImmunizationActivityTextReference( + (ImmunizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationActivityTextReferenceTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateImmunizationActivityReferenceValue() { + OperationsTestCase validateImmunizationActivityReferenceValueTestCase = new OperationsTestCase( + "validateImmunizationActivityReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_ACTIVITY_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationActivity target) { + target.init(); + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL()); + target.setText(txt); + } + + @Override + protected void updateToPass(ImmunizationActivity target) { + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL("test")); + target.setText(txt); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationActivityOperations.validateImmunizationActivityReferenceValue( + (ImmunizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationActivityReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateImmunizationActivityTextReferenceValue() { + OperationsTestCase validateImmunizationActivityTextReferenceValueTestCase = new NarrativeReferenceTestCase( + "validateImmunizationActivityTextReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_ACTIVITY_TEXT_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationActivity target) { + target.init(); + + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), "", + "Not a particularly severe reaction."); + + // add a reference to the section text + target.setText(createEDWithReference("Some sample text", "#1.2.3.4")); + + } + + @Override + protected void updateToPass(ImmunizationActivity target) { + + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), + "1.2.3.4", "Not a particularly severe reaction."); + + // add a reference to the section text + target.setText(createEDWithReference("Some sample text", "#1.2.3.4")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationActivityOperations.validateImmunizationActivityTextReferenceValue( + (ImmunizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationActivityTextReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateImmunizationActivityDoseQuantityUnit() { + OperationsTestCase validateImmunizationActivityDoseQuantityUnitTestCase = new OperationsTestCase( + "validateImmunizationActivityDoseQuantityUnit", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_ACTIVITY_DOSE_QUANTITY_UNIT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationActivity target) { + target.init(); + IVL_PQ dq = DatatypesFactory.eINSTANCE.createIVL_PQ(); + dq.setUnit(null); + target.setDoseQuantity(dq); + } + + @Override + protected void updateToPass(ImmunizationActivity target) { + + IVL_PQ dq = DatatypesFactory.eINSTANCE.createIVL_PQ(); + dq.setUnit("test"); + target.setDoseQuantity(dq); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationActivityOperations.validateImmunizationActivityDoseQuantityUnit( + (ImmunizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationActivityDoseQuantityUnitTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateImmunizationActivityInstructionInversion() { + OperationsTestCase validateImmunizationActivityInstructionInversionTestCase = new OperationsTestCase( + "validateImmunizationActivityInstructionInversion", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_ACTIVITY_INSTRUCTION_INVERSION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationActivity target) { + target.init(); + target.addAct(ConsolFactory.eINSTANCE.createInstructions()); + } + + @Override + public void addPassTests() { + + addPassTest(new PassTest() { + + @Override + public void updateToPass(ImmunizationActivity target) { + // Test case with entry Relationship , but no Instruction Act + // Should pass + target.getEntryRelationships().clear(); + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + target.getEntryRelationships().add(er); + } + + }); + } + + @Override + protected void updateToPass(ImmunizationActivity target) { + target.getEntryRelationships().clear(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setAct(ConsolFactory.eINSTANCE.createInstructions()); + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + er.setInversionInd(true); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationActivityOperations.validateImmunizationActivityInstructionInversion( + (ImmunizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationActivityInstructionInversionTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateImmunizationActivityDrugVehicleTypeCode() { + OperationsTestCase validateImmunizationActivityDrugVehicleTypeCodeTestCase = new OperationsTestCase( + "validateImmunizationActivityDrugVehicleTypeCode", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_ACTIVITY_DRUG_VEHICLE_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationActivity target) { + target.init(); + Participant2 p = CDAFactory.eINSTANCE.createParticipant2(); + p.setParticipantRole(ConsolFactory.eINSTANCE.createDrugVehicle()); + target.getParticipants().add(p); + } + + @Override + protected void updateToPass(ImmunizationActivity target) { + target.getParticipants().clear(); + Participant2 p = CDAFactory.eINSTANCE.createParticipant2(); + p.setParticipantRole(ConsolFactory.eINSTANCE.createDrugVehicle()); + p.setTypeCode(ParticipationType.CSM); + target.getParticipants().add(p); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationActivityOperations.validateImmunizationActivityDrugVehicleTypeCode( + (ImmunizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationActivityDrugVehicleTypeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateImmunizationActivityPreconditionTypeCode() { + OperationsTestCase validateImmunizationActivityPreconditionTypeCodeTestCase = new OperationsTestCase( + "validateImmunizationActivityPreconditionTypeCode", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_ACTIVITY_PRECONDITION_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationActivity target) { + target.init(); + PreconditionForSubstanceAdministration pc = ConsolFactory.eINSTANCE.createPreconditionForSubstanceAdministration(); + pc.setTypeCode(ActRelationshipType.CAUS); + target.getPreconditions().add(pc); + } + + @Override + protected void updateToPass(ImmunizationActivity target) { + target.getPreconditions().clear(); + PreconditionForSubstanceAdministration pc = ConsolFactory.eINSTANCE.createPreconditionForSubstanceAdministration(); + pc.setTypeCode(ActRelationshipType.PRCN); + target.getPreconditions().add(pc); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationActivityOperations.validateImmunizationActivityPreconditionTypeCode( + (ImmunizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationActivityPreconditionTypeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateImmunizationActivityTemplateId() { + OperationsTestCase validateImmunizationActivityTemplateIdTestCase = new OperationsTestCase( + "validateImmunizationActivityTemplateId", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_ACTIVITY_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationActivity target) { + + } + + @Override + protected void updateToPass(ImmunizationActivity target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationActivityOperations.validateImmunizationActivityTemplateId( + (ImmunizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationActivityTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + * + */ + @Test + public void testValidateImmunizationActivityClassCode() { + OperationsTestCase validateImmunizationActivityClassCodeTestCase = new OperationsTestCase( + "validateImmunizationActivityClassCode", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_ACTIVITY_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationActivity target) { + target.setClassCode(ActClass.ACCM); + } + + @Override + protected void updateToPass(ImmunizationActivity target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationActivityOperations.validateImmunizationActivityClassCode( + (ImmunizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationActivityClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateImmunizationActivityMoodCode() { + OperationsTestCase validateImmunizationActivityMoodCodeTestCase = new OperationsTestCase( + "validateImmunizationActivityMoodCode", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_ACTIVITY_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationActivity target) { + // the EMF-generated default happens to satisfy the constraint + target.setMoodCode(x_DocumentSubstanceMood.RQO); + } + + @Override + public void addPassTests() { + for (final x_DocumentSubstanceMood mood : Arrays.asList(EVN, INT)) { + addPassTest(new PassTest() { + @Override + public void updateToPass(ImmunizationActivity target) { + target.init(); + target.setMoodCode(mood); + } + }); + } + ; + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationActivityOperations.validateImmunizationActivityMoodCode( + (ImmunizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationActivityMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateImmunizationActivityId() { + OperationsTestCase validateImmunizationActivityIdTestCase = new OperationsTestCase( + "validateImmunizationActivityId", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_ACTIVITY_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationActivity target) { + target.init(); + } + + @Override + protected void updateToPass(ImmunizationActivity target) { + target.getIds().add(DatatypesFactory.eINSTANCE.createII()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationActivityOperations.validateImmunizationActivityId( + (ImmunizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationActivityIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateImmunizationActivityCode() { + OperationsTestCase validateImmunizationActivityCodeTestCase = new OperationsTestCase( + "validateImmunizationActivityCode", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_ACTIVITY_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationActivity target) { + target.init(); + } + + @Override + protected void updateToPass(ImmunizationActivity target) { + target.setCode(DatatypesFactory.eINSTANCE.createCE()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationActivityOperations.validateImmunizationActivityCode( + (ImmunizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationActivityCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateImmunizationActivityStatusCode() { + OperationsTestCase validateImmunizationActivityStatusCodeTestCase = new OperationsTestCase( + "validateImmunizationActivityStatusCode", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_ACTIVITY_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationActivity target) { + + } + + @Override + protected void updateToPass(ImmunizationActivity target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationActivityOperations.validateImmunizationActivityStatusCode( + (ImmunizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationActivityStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateImmunizationActivityEffectiveTime() { + OperationsTestCase validateImmunizationActivityEffectiveTimeTestCase = new OperationsTestCase( + "validateImmunizationActivityEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_ACTIVITY_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationActivity target) { + target.init(); + } + + @Override + protected void updateToPass(ImmunizationActivity target) { + target.getEffectiveTimes().add(DatatypesFactory.eINSTANCE.createSXCM_TS()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationActivityOperations.validateImmunizationActivityEffectiveTime( + (ImmunizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationActivityEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateImmunizationActivityRouteCode() { + OperationsTestCase validateImmunizationActivityRouteCodeTestCase = new OperationsTestCase( + "validateImmunizationActivityRouteCode", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_ACTIVITY_ROUTE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationActivity target) { + target.init(); + } + + @Override + protected void updateToPass(ImmunizationActivity target) { + target.setRouteCode(DatatypesFactory.eINSTANCE.createCE("C38192", "2.16.840.1.113883.3.26.1.1")); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationActivityOperations.validateImmunizationActivityRouteCode( + (ImmunizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationActivityRouteCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateImmunizationActivityRouteCodeP() { + OperationsTestCase validateImmunizationActivityRouteCodePTestCase = new OperationsTestCase( + "validateImmunizationActivityRouteCodeP", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_ACTIVITY_ROUTE_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationActivity target) { + target.init(); + + target.setRouteCode(null); + } + + @Override + protected void updateToPass(ImmunizationActivity target) { + target.setRouteCode(DatatypesFactory.eINSTANCE.createCE("code", "codeSystem")); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationActivityOperations.validateImmunizationActivityRouteCodeP( + (ImmunizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationActivityRouteCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateImmunizationActivityApproachSiteCode() { + OperationsTestCase validateImmunizationActivityApproachSiteCodeTestCase = new OperationsTestCase( + "validateImmunizationActivityApproachSiteCode", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_ACTIVITY_APPROACH_SITE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationActivity target) { + + target.getApproachSiteCodes().add(DatatypesFactory.eINSTANCE.createCD()); + + } + + @Override + protected void updateToPass(ImmunizationActivity target) { + target.init(); + + target.getApproachSiteCodes().clear(); + target.getApproachSiteCodes().add( + DatatypesFactory.eINSTANCE.createCD( + "code", "2.16.840.1.113883.6.96", "codeSystemName", "displayName")); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationActivityOperations.validateImmunizationActivityApproachSiteCode( + (ImmunizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationActivityApproachSiteCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateImmunizationActivityApproachSiteCodeP() { + OperationsTestCase validateImmunizationActivityApproachSiteCodePTestCase = new OperationsTestCase( + "validateImmunizationActivityApproachSiteCodeP", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_ACTIVITY_APPROACH_SITE_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationActivity target) { + target.init(); + target.getApproachSiteCodes().clear(); + } + + @Override + protected void updateToPass(ImmunizationActivity target) { + + target.getApproachSiteCodes().clear(); + target.getApproachSiteCodes().add( + DatatypesFactory.eINSTANCE.createCD( + "code", "2.16.840.1.113883.6.96", "codeSystemName", "displayName")); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationActivityOperations.validateImmunizationActivityApproachSiteCodeP( + (ImmunizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationActivityApproachSiteCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateImmunizationActivityDoseQuantity() { + OperationsTestCase validateImmunizationActivityDoseQuantityTestCase = new OperationsTestCase( + "validateImmunizationActivityDoseQuantity", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_ACTIVITY_DOSE_QUANTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationActivity target) { + target.init(); + } + + @Override + protected void updateToPass(ImmunizationActivity target) { + target.setDoseQuantity(DatatypesFactory.eINSTANCE.createIVL_PQ()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationActivityOperations.validateImmunizationActivityDoseQuantity( + (ImmunizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationActivityDoseQuantityTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateImmunizationActivityNegationInd() { + OperationsTestCase validateImmunizationActivityNegationIndTestCase = new OperationsTestCase( + "validateImmunizationActivityNegationInd", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_ACTIVITY_NEGATION_IND__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationActivity target) { + + } + + @Override + protected void updateToPass(ImmunizationActivity target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationActivityOperations.validateImmunizationActivityNegationInd( + (ImmunizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationActivityNegationIndTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateImmunizationActivityText() { + OperationsTestCase validateImmunizationActivityTextTestCase = new OperationsTestCase( + "validateImmunizationActivityText", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_ACTIVITY_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationActivity target) { + + } + + @Override + protected void updateToPass(ImmunizationActivity target) { + target.init(); + + ED text = DatatypesFactory.eINSTANCE.createED(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationActivityOperations.validateImmunizationActivityText( + (ImmunizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationActivityTextTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateImmunizationActivityRepeatNumber() { + OperationsTestCase validateImmunizationActivityRepeatNumberTestCase = new OperationsTestCase( + "validateImmunizationActivityRepeatNumber", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_ACTIVITY_REPEAT_NUMBER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationActivity target) { + target.init(); + } + + @Override + protected void updateToPass(ImmunizationActivity target) { + + target.setRepeatNumber(DatatypesFactory.eINSTANCE.createIVL_INT()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationActivityOperations.validateImmunizationActivityRepeatNumber( + (ImmunizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationActivityRepeatNumberTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateImmunizationActivityAdministrationUnitCode() { + OperationsTestCase validateImmunizationActivityAdministrationUnitCodeTestCase = new OperationsTestCase( + "validateImmunizationActivityAdministrationUnitCode", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_ACTIVITY_ADMINISTRATION_UNIT_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationActivity target) { + target.init(); + } + + @Override + protected void updateToPass(ImmunizationActivity target) { + target.setAdministrationUnitCode(DatatypesFactory.eINSTANCE.createCE( + "C42887", "2.16.840.1.113883.3.26.1.1")); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationActivityOperations.validateImmunizationActivityAdministrationUnitCode( + (ImmunizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationActivityAdministrationUnitCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateImmunizationActivityAdministrationUnitCodeP() { + OperationsTestCase validateImmunizationActivityAdministrationUnitCodePTestCase = new OperationsTestCase( + "validateImmunizationActivityAdministrationUnitCodeP", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_ACTIVITY_ADMINISTRATION_UNIT_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationActivity target) { + target.init(); + target.setAdministrationUnitCode(null); + } + + @Override + protected void updateToPass(ImmunizationActivity target) { + target.setAdministrationUnitCode(DatatypesFactory.eINSTANCE.createCE( + "code", "2.16.840.1.113883.3.26.1.1")); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationActivityOperations.validateImmunizationActivityAdministrationUnitCodeP( + (ImmunizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationActivityAdministrationUnitCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateImmunizationActivityDrugVehicle() { + OperationsTestCase validateImmunizationActivityDrugVehicleTestCase = new OperationsTestCase( + "validateImmunizationActivityDrugVehicle", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_ACTIVITY_DRUG_VEHICLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationActivity target) { + target.init(); + target.getParticipants().add(org.openhealthtools.mdht.uml.cda.CDAFactory.eINSTANCE.createParticipant2()); + } + + @Override + protected void updateToPass(ImmunizationActivity target) { + + for (Participant2 p : target.getParticipants()) { + p.setParticipantRole(ConsolFactory.eINSTANCE.createDrugVehicle().init()); + } + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationActivityOperations.validateImmunizationActivityDrugVehicle( + (ImmunizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationActivityDrugVehicleTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateImmunizationActivityIndication() { + OperationsTestCase validateImmunizationActivityIndicationTestCase = new OperationsTestCase( + "validateImmunizationActivityIndication", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_ACTIVITY_INDICATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationActivity target) { + + } + + @Override + protected void updateToPass(ImmunizationActivity target) { + target.init(); + Indication indication = ConsolFactory.eINSTANCE.createIndication().init(); + target.addObservation(indication); + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.RSON); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationActivityOperations.validateImmunizationActivityIndication( + (ImmunizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationActivityIndicationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateImmunizationActivityInstructions() { + OperationsTestCase validateImmunizationActivityInstructionsTestCase = new OperationsTestCase( + "validateImmunizationActivityInstructions", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_ACTIVITY_INSTRUCTIONS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationActivity target) { + + } + + @Override + protected void updateToPass(ImmunizationActivity target) { + target.init(); + Instructions instruction = ConsolFactory.eINSTANCE.createInstructions().init(); + target.addAct(instruction); + + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationActivityOperations.validateImmunizationActivityInstructions( + (ImmunizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationActivityInstructionsTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateImmunizationActivityMedicationDispense() { + OperationsTestCase validateImmunizationActivityMedicationDispenseTestCase = new OperationsTestCase( + "validateImmunizationActivityMedicationDispense", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_ACTIVITY_MEDICATION_DISPENSE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationActivity target) { + + } + + @Override + protected void updateToPass(ImmunizationActivity target) { + target.init(); + MedicationDispense md = ConsolFactory.eINSTANCE.createMedicationDispense().init(); + target.addSupply(md); + + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.REFR); + } + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationActivityOperations.validateImmunizationActivityMedicationDispense( + (ImmunizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationActivityMedicationDispenseTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateImmunizationActivityReactionObservation() { + OperationsTestCase validateImmunizationActivityReactionObservationTestCase = new OperationsTestCase( + "validateImmunizationActivityReactionObservation", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_ACTIVITY_REACTION_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationActivity target) { + + } + + @Override + protected void updateToPass(ImmunizationActivity target) { + target.init(); + + target.addObservation(ConsolFactory.eINSTANCE.createReactionObservation().init()); + + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.CAUS); + } + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationActivityOperations.validateImmunizationActivityReactionObservation( + (ImmunizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationActivityReactionObservationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateImmunizationActivityPrecondition() { + OperationsTestCase validateImmunizationActivityPreconditionTestCase = new OperationsTestCase( + "validateImmunizationActivityPrecondition", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_ACTIVITY_PRECONDITION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationActivity target) { + + } + + @Override + protected void updateToPass(ImmunizationActivity target) { + target.init(); + PreconditionForSubstanceAdministration pc = ConsolFactory.eINSTANCE.createPreconditionForSubstanceAdministration(); + pc.setTypeCode(ActRelationshipType.PRCN); + target.getPreconditions().add(pc); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationActivityOperations.validateImmunizationActivityPrecondition( + (ImmunizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationActivityPreconditionTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateImmunizationActivityImmunizationRefusalReason() { + OperationsTestCase validateImmunizationActivityImmunizationRefusalReasonTestCase = new OperationsTestCase( + "validateImmunizationActivityImmunizationRefusalReason", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_ACTIVITY_IMMUNIZATION_REFUSAL_REASON__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationActivity target) { + + } + + @Override + protected void updateToPass(ImmunizationActivity target) { + target.init(); + + target.addObservation(ConsolFactory.eINSTANCE.createImmunizationRefusalReason().init()); + + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.RSON); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationActivityOperations.validateImmunizationActivityImmunizationRefusalReason( + (ImmunizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationActivityImmunizationRefusalReasonTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateImmunizationActivityConsumable() { + OperationsTestCase validateImmunizationActivityConsumableTestCase = new OperationsTestCase( + "validateImmunizationActivityConsumable", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_ACTIVITY_CONSUMABLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationActivity target) { + + } + + @Override + protected void updateToPass(ImmunizationActivity target) { + target.init(); + target.setConsumable(CDAFactory.eINSTANCE.createConsumable()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationActivityOperations.validateImmunizationActivityConsumable( + (ImmunizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationActivityConsumableTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateImmunizationActivityPerformer() { + OperationsTestCase validateImmunizationActivityPerformerTestCase = new OperationsTestCase( + "validateImmunizationActivityPerformer", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_ACTIVITY_PERFORMER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationActivity target) { + + } + + @Override + protected void updateToPass(ImmunizationActivity target) { + target.init(); + target.getPerformers().add(CDAFactory.eINSTANCE.createPerformer2()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationActivityOperations.validateImmunizationActivityPerformer( + (ImmunizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationActivityPerformerTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateImmunizationActivityMedicationSupplyOrder() { + OperationsTestCase validateImmunizationActivityMedicationSupplyOrderTestCase = new OperationsTestCase( + "validateImmunizationActivityMedicationSupplyOrder", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_ACTIVITY_MEDICATION_SUPPLY_ORDER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationActivity target) { + + } + + @Override + protected void updateToPass(ImmunizationActivity target) { + target.init(); + target.addSupply(ConsolFactory.eINSTANCE.createMedicationSupplyOrder().init()); + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.REFR); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationActivityOperations.validateImmunizationActivityMedicationSupplyOrder( + (ImmunizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationActivityMedicationSupplyOrderTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateImmunizationActivityConsumableImmunizationMedicationInformation() { + OperationsTestCase validateImmunizationActivityConsumableImmunizationMedicationInformationTestCase = new OperationsTestCase( + "validateImmunizationActivityConsumableImmunizationMedicationInformation", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_ACTIVITY_CONSUMABLE_IMMUNIZATION_MEDICATION_INFORMATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationActivity target) { + target.init(); + target.setConsumable(CDAFactory.eINSTANCE.createConsumable()); + } + + @Override + protected void updateToPass(ImmunizationActivity target) { + Consumable con = CDAFactory.eINSTANCE.createConsumable(); + con.setManufacturedProduct(ConsolFactory.eINSTANCE.createImmunizationMedicationInformation()); + target.setConsumable(con); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationActivityOperations.validateImmunizationActivityConsumableImmunizationMedicationInformation( + (ImmunizationActivity) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationActivityConsumableImmunizationMedicationInformationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetDrugVehicle() { + + ImmunizationActivity target = objectFactory.create(); + target.getDrugVehicle(); + + } + + /** + * + * @generated + */ + @Test + public void testGetIndication() { + + ImmunizationActivity target = objectFactory.create(); + target.getIndication(); + + } + + /** + * + * @generated + */ + @Test + public void testGetInstructions() { + + ImmunizationActivity target = objectFactory.create(); + target.getInstructions(); + + } + + /** + * + * @generated + */ + @Test + public void testGetMedicationDispense() { + + ImmunizationActivity target = objectFactory.create(); + target.getMedicationDispense(); + + } + + /** + * + * @generated + */ + @Test + public void testGetReactionObservation() { + + ImmunizationActivity target = objectFactory.create(); + target.getReactionObservation(); + + } + + /** + * + * @generated + */ + @Test + public void testGetImmunizationRefusalReason() { + + ImmunizationActivity target = objectFactory.create(); + target.getImmunizationRefusalReason(); + + } + + /** + * + * @generated + */ + @Test + public void testGetMedicationSupplyOrder() { + + ImmunizationActivity target = objectFactory.create(); + target.getMedicationSupplyOrder(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ImmunizationActivityOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ImmunizationActivity create() { + return ConsolFactory.eINSTANCE.createImmunizationActivity(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ImmunizationActivityOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ImmunizationActivityOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ImmunizationMedicationInformationTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ImmunizationMedicationInformationTest.java new file mode 100644 index 000000000..716b2fca3 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ImmunizationMedicationInformationTest.java @@ -0,0 +1,550 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Material; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ImmunizationMedicationInformation; +import org.openhealthtools.mdht.uml.cda.consol.operations.ImmunizationMedicationInformationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; +import org.openhealthtools.mdht.uml.hl7.datatypes.TEL; + +/** + * + * A static utility class that provides operations related to 'Immunization Medication Information' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationMedicationInformation#validateImmunizationMedicationInformationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Medication Information Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationMedicationInformation#validateImmunizationMedicationInformationClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Medication Information Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationMedicationInformation#validateImmunizationMedicationInformationId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Medication Information Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationMedicationInformation#validateImmunizationMedicationInformationManufacturerOrganization(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Medication Information Manufacturer Organization}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationMedicationInformation#validateImmunizationMedicationInformationManufacturedMaterial(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Medication Information Manufactured Material}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationMedicationInformation#validateImmunizationMedicationInformationImmunizationMedicationInformationManufacturedMaterialCodeOriginalText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Medication Information Immunization Medication Information Manufactured Material Code Original Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationMedicationInformation#validateImmunizationMedicationInformationImmunizationMedicationInformationManufacturedMaterialOriginalTextReference(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Medication Information Immunization Medication Information Manufactured Material Original Text Reference}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationMedicationInformation#validateImmunizationMedicationInformationImmunizationMedicationInformationManufacturedMaterialTextReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Medication Information Immunization Medication Information Manufactured Material Text Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationMedicationInformation#validateImmunizationMedicationInformationImmunizationMedicationInformationManufacturedMaterialCodeTranslation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Medication Information Immunization Medication Information Manufactured Material Code Translation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationMedicationInformation#validateImmunizationMedicationInformationImmunizationMedicationInformationManufacturedMaterialCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Medication Information Immunization Medication Information Manufactured Material Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationMedicationInformation#validateImmunizationMedicationInformationImmunizationMedicationInformationManufacturedMaterialLotNumberText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Medication Information Immunization Medication Information Manufactured Material Lot Number Text}
  • + *
+ *

+ * + * @generated + */ + +public class ImmunizationMedicationInformationTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateImmunizationMedicationInformationTemplateId() { + OperationsTestCase validateImmunizationMedicationInformationTemplateIdTestCase = new OperationsTestCase( + "validateImmunizationMedicationInformationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_MEDICATION_INFORMATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationMedicationInformation target) { + + } + + @Override + protected void updateToPass(ImmunizationMedicationInformation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationMedicationInformationOperations.validateImmunizationMedicationInformationTemplateId( + (ImmunizationMedicationInformation) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationMedicationInformationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateImmunizationMedicationInformationClassCode() { + OperationsTestCase validateImmunizationMedicationInformationClassCodeTestCase = new OperationsTestCase( + "validateImmunizationMedicationInformationClassCode", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_MEDICATION_INFORMATION_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationMedicationInformation target) { + + } + + @Override + protected void updateToPass(ImmunizationMedicationInformation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationMedicationInformationOperations.validateImmunizationMedicationInformationClassCode( + (ImmunizationMedicationInformation) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationMedicationInformationClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateImmunizationMedicationInformationId() { + OperationsTestCase validateImmunizationMedicationInformationIdTestCase = new OperationsTestCase( + "validateImmunizationMedicationInformationId", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_MEDICATION_INFORMATION_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationMedicationInformation target) { + target.init(); + } + + @Override + protected void updateToPass(ImmunizationMedicationInformation target) { + target.getIds().add(DatatypesFactory.eINSTANCE.createII()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationMedicationInformationOperations.validateImmunizationMedicationInformationId( + (ImmunizationMedicationInformation) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationMedicationInformationIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateImmunizationMedicationInformationManufacturerOrganization() { + OperationsTestCase validateImmunizationMedicationInformationManufacturerOrganizationTestCase = new OperationsTestCase( + "validateImmunizationMedicationInformationManufacturerOrganization", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_MEDICATION_INFORMATION_MANUFACTURER_ORGANIZATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationMedicationInformation target) { + target.init(); + } + + @Override + protected void updateToPass(ImmunizationMedicationInformation target) { + target.setManufacturerOrganization(CDAFactory.eINSTANCE.createOrganization()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationMedicationInformationOperations.validateImmunizationMedicationInformationManufacturerOrganization( + (ImmunizationMedicationInformation) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationMedicationInformationManufacturerOrganizationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateImmunizationMedicationInformationManufacturedMaterial() { + OperationsTestCase validateImmunizationMedicationInformationManufacturedMaterialTestCase = new OperationsTestCase( + "validateImmunizationMedicationInformationManufacturedMaterial", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_MEDICATION_INFORMATION_MANUFACTURED_MATERIAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationMedicationInformation target) { + target.init(); + } + + @Override + protected void updateToPass(ImmunizationMedicationInformation target) { + target.setManufacturedMaterial(CDAFactory.eINSTANCE.createMaterial()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationMedicationInformationOperations.validateImmunizationMedicationInformationManufacturedMaterial( + (ImmunizationMedicationInformation) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationMedicationInformationManufacturedMaterialTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateImmunizationMedicationInformationImmunizationMedicationInformationManufacturedMaterialCodeOriginalText() { + OperationsTestCase validateImmunizationMedicationInformationImmunizationMedicationInformationManufacturedMaterialCodeOriginalTextTestCase = new OperationsTestCase( + "validateImmunizationMedicationInformationImmunizationMedicationInformationManufacturedMaterialCodeOriginalText", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_MEDICATION_INFORMATION_IMMUNIZATION_MEDICATION_INFORMATION_MANUFACTURED_MATERIAL_CODE_ORIGINAL_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationMedicationInformation target) { + target.init(); + Material mm = CDAFactory.eINSTANCE.createMaterial(); + CE code = DatatypesFactory.eINSTANCE.createCE(); + mm.setCode(code); + target.setManufacturedMaterial(mm); + } + + @Override + protected void updateToPass(ImmunizationMedicationInformation target) { + Material mm = CDAFactory.eINSTANCE.createMaterial(); + CE code = DatatypesFactory.eINSTANCE.createCE(); + code.setOriginalText(DatatypesFactory.eINSTANCE.createED()); + mm.setCode(code); + target.setManufacturedMaterial(mm); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationMedicationInformationOperations.validateImmunizationMedicationInformationImmunizationMedicationInformationManufacturedMaterialCodeOriginalText( + (ImmunizationMedicationInformation) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationMedicationInformationImmunizationMedicationInformationManufacturedMaterialCodeOriginalTextTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateImmunizationMedicationInformationImmunizationMedicationInformationManufacturedMaterialOriginalTextReference() { + OperationsTestCase validateImmunizationMedicationInformationImmunizationMedicationInformationManufacturedMaterialOriginalTextReferenceTestCase = new OperationsTestCase( + "validateImmunizationMedicationInformationImmunizationMedicationInformationManufacturedMaterialOriginalTextReference", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_MEDICATION_INFORMATION_IMMUNIZATION_MEDICATION_INFORMATION_MANUFACTURED_MATERIAL_ORIGINAL_TEXT_REFERENCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationMedicationInformation target) { + target.init(); + Material mm = CDAFactory.eINSTANCE.createMaterial(); + CE code = DatatypesFactory.eINSTANCE.createCE(); + ED orig = DatatypesFactory.eINSTANCE.createED(); + code.setOriginalText(orig); + mm.setCode(code); + target.setManufacturedMaterial(mm); + } + + @Override + protected void updateToPass(ImmunizationMedicationInformation target) { + Material mm = CDAFactory.eINSTANCE.createMaterial(); + CE code = DatatypesFactory.eINSTANCE.createCE(); + ED orig = DatatypesFactory.eINSTANCE.createED(); + orig.setReference(DatatypesFactory.eINSTANCE.createTEL("ref1")); + code.setOriginalText(orig); + mm.setCode(code); + target.setManufacturedMaterial(mm); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationMedicationInformationOperations.validateImmunizationMedicationInformationImmunizationMedicationInformationManufacturedMaterialOriginalTextReference( + (ImmunizationMedicationInformation) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationMedicationInformationImmunizationMedicationInformationManufacturedMaterialOriginalTextReferenceTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateImmunizationMedicationInformationImmunizationMedicationInformationManufacturedMaterialTextReferenceValue() { + OperationsTestCase validateImmunizationMedicationInformationImmunizationMedicationInformationManufacturedMaterialTextReferenceValueTestCase = new OperationsTestCase( + "validateImmunizationMedicationInformationImmunizationMedicationInformationManufacturedMaterialTextReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_MEDICATION_INFORMATION_IMMUNIZATION_MEDICATION_INFORMATION_MANUFACTURED_MATERIAL_TEXT_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationMedicationInformation target) { + target.init(); + Material material = CDAFactory.eINSTANCE.createMaterial(); + ED text = DatatypesFactory.eINSTANCE.createED(); + CE ce = DatatypesFactory.eINSTANCE.createCE(); + ce.setOriginalText(text); + TEL tel = DatatypesFactory.eINSTANCE.createTEL(); + text.setReference(tel); + material.setCode(ce); + target.setManufacturedMaterial(material); + } + + @Override + protected void updateToPass(ImmunizationMedicationInformation target) { + target.init(); + Material material = CDAFactory.eINSTANCE.createMaterial(); + ED text = DatatypesFactory.eINSTANCE.createED(); + CE ce = DatatypesFactory.eINSTANCE.createCE(); + ce.setOriginalText(text); + TEL tel = DatatypesFactory.eINSTANCE.createTEL(); + tel.setValue("aaaaaaaaaaaaaaaaaaaaa"); + text.setReference(tel); + material.setCode(ce); + target.setManufacturedMaterial(material); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationMedicationInformationOperations.validateImmunizationMedicationInformationImmunizationMedicationInformationManufacturedMaterialTextReferenceValue( + (ImmunizationMedicationInformation) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationMedicationInformationImmunizationMedicationInformationManufacturedMaterialTextReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateImmunizationMedicationInformationImmunizationMedicationInformationManufacturedMaterialCodeTranslation() { + OperationsTestCase validateImmunizationMedicationInformationImmunizationMedicationInformationManufacturedMaterialCodeTranslationTestCase = new OperationsTestCase( + "validateImmunizationMedicationInformationImmunizationMedicationInformationManufacturedMaterialCodeTranslation", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_MEDICATION_INFORMATION_IMMUNIZATION_MEDICATION_INFORMATION_MANUFACTURED_MATERIAL_CODE_TRANSLATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationMedicationInformation target) { + target.init(); + Material mm = CDAFactory.eINSTANCE.createMaterial(); + CE code = DatatypesFactory.eINSTANCE.createCE(); + mm.setCode(code); + target.setManufacturedMaterial(mm); + } + + @Override + protected void updateToPass(ImmunizationMedicationInformation target) { + Material mm = CDAFactory.eINSTANCE.createMaterial(); + CE code = DatatypesFactory.eINSTANCE.createCE(); + code.getTranslations().add(DatatypesFactory.eINSTANCE.createCD()); + mm.setCode(code); + target.setManufacturedMaterial(mm); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationMedicationInformationOperations.validateImmunizationMedicationInformationImmunizationMedicationInformationManufacturedMaterialCodeTranslation( + (ImmunizationMedicationInformation) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationMedicationInformationImmunizationMedicationInformationManufacturedMaterialCodeTranslationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateImmunizationMedicationInformationImmunizationMedicationInformationManufacturedMaterialCode() { + OperationsTestCase validateImmunizationMedicationInformationImmunizationMedicationInformationManufacturedMaterialCodeTestCase = new OperationsTestCase( + "validateImmunizationMedicationInformationImmunizationMedicationInformationManufacturedMaterialCode", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_MEDICATION_INFORMATION_IMMUNIZATION_MEDICATION_INFORMATION_MANUFACTURED_MATERIAL_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationMedicationInformation target) { + target.init(); + Material mm = CDAFactory.eINSTANCE.createMaterial(); + target.setManufacturedMaterial(mm); + } + + @Override + protected void updateToPass(ImmunizationMedicationInformation target) { + Material mm = CDAFactory.eINSTANCE.createMaterial(); + + mm.setCode(DatatypesFactory.eINSTANCE.createCE("143", "2.16.840.1.113883.6.59")); + target.setManufacturedMaterial(mm); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationMedicationInformationOperations.validateImmunizationMedicationInformationImmunizationMedicationInformationManufacturedMaterialCode( + (ImmunizationMedicationInformation) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationMedicationInformationImmunizationMedicationInformationManufacturedMaterialCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateImmunizationMedicationInformationImmunizationMedicationInformationManufacturedMaterialLotNumberText() { + OperationsTestCase validateImmunizationMedicationInformationImmunizationMedicationInformationManufacturedMaterialLotNumberTextTestCase = new OperationsTestCase( + "validateImmunizationMedicationInformationImmunizationMedicationInformationManufacturedMaterialLotNumberText", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_MEDICATION_INFORMATION_IMMUNIZATION_MEDICATION_INFORMATION_MANUFACTURED_MATERIAL_LOT_NUMBER_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationMedicationInformation target) { + target.init(); + Material mm = CDAFactory.eINSTANCE.createMaterial(); + target.setManufacturedMaterial(mm); + } + + @Override + protected void updateToPass(ImmunizationMedicationInformation target) { + Material mm = CDAFactory.eINSTANCE.createMaterial(); + + mm.setLotNumberText(DatatypesFactory.eINSTANCE.createST()); + target.setManufacturedMaterial(mm); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationMedicationInformationOperations.validateImmunizationMedicationInformationImmunizationMedicationInformationManufacturedMaterialLotNumberText( + (ImmunizationMedicationInformation) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationMedicationInformationImmunizationMedicationInformationManufacturedMaterialLotNumberTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ImmunizationMedicationInformationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ImmunizationMedicationInformation create() { + return ConsolFactory.eINSTANCE.createImmunizationMedicationInformation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ImmunizationMedicationInformationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ImmunizationMedicationInformationOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ImmunizationRefusalReasonTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ImmunizationRefusalReasonTest.java new file mode 100644 index 000000000..1516b90ca --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ImmunizationRefusalReasonTest.java @@ -0,0 +1,325 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ImmunizationRefusalReason; +import org.openhealthtools.mdht.uml.cda.consol.operations.ImmunizationRefusalReasonOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; + +/** + * + * A static utility class that provides operations related to 'Immunization Refusal Reason' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationRefusalReason#validateImmunizationRefusalReasonTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Refusal Reason Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationRefusalReason#validateImmunizationRefusalReasonClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Refusal Reason Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationRefusalReason#validateImmunizationRefusalReasonCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Refusal Reason Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationRefusalReason#validateImmunizationRefusalReasonId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Refusal Reason Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationRefusalReason#validateImmunizationRefusalReasonMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Refusal Reason Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationRefusalReason#validateImmunizationRefusalReasonStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Refusal Reason Status Code}
  • + *
+ *

+ * + * @generated + */ + +public class ImmunizationRefusalReasonTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateImmunizationRefusalReasonTemplateId() { + OperationsTestCase validateImmunizationRefusalReasonTemplateIdTestCase = new OperationsTestCase( + "validateImmunizationRefusalReasonTemplateId", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_REFUSAL_REASON_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationRefusalReason target) { + + } + + @Override + protected void updateToPass(ImmunizationRefusalReason target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationRefusalReasonOperations.validateImmunizationRefusalReasonTemplateId( + (ImmunizationRefusalReason) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationRefusalReasonTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateImmunizationRefusalReasonClassCode() { + OperationsTestCase validateImmunizationRefusalReasonClassCodeTestCase = new OperationsTestCase( + "validateImmunizationRefusalReasonClassCode", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_REFUSAL_REASON_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationRefusalReason target) { + + } + + @Override + protected void updateToPass(ImmunizationRefusalReason target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationRefusalReasonOperations.validateImmunizationRefusalReasonClassCode( + (ImmunizationRefusalReason) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationRefusalReasonClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateImmunizationRefusalReasonCode() { + OperationsTestCase validateImmunizationRefusalReasonCodeTestCase = new OperationsTestCase( + "validateImmunizationRefusalReasonCode", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_REFUSAL_REASON_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationRefusalReason target) { + target.init(); + } + + @Override + protected void updateToPass(ImmunizationRefusalReason target) { + + CD cd = DatatypesFactory.eINSTANCE.createCD("IMMUNE", "2.16.840.1.113883.5.8", "", ""); + target.setCode(cd); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationRefusalReasonOperations.validateImmunizationRefusalReasonCode( + (ImmunizationRefusalReason) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationRefusalReasonCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateImmunizationRefusalReasonId() { + OperationsTestCase validateImmunizationRefusalReasonIdTestCase = new OperationsTestCase( + "validateImmunizationRefusalReasonId", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_REFUSAL_REASON_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationRefusalReason target) { + + } + + @Override + protected void updateToPass(ImmunizationRefusalReason target) { + target.init(); + II ii = DatatypesFactory.eINSTANCE.createII(); + target.getIds().add(ii); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationRefusalReasonOperations.validateImmunizationRefusalReasonId( + (ImmunizationRefusalReason) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationRefusalReasonIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateImmunizationRefusalReasonMoodCode() { + OperationsTestCase validateImmunizationRefusalReasonMoodCodeTestCase = new OperationsTestCase( + "validateImmunizationRefusalReasonMoodCode", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_REFUSAL_REASON_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationRefusalReason target) { + + } + + @Override + protected void updateToPass(ImmunizationRefusalReason target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationRefusalReasonOperations.validateImmunizationRefusalReasonMoodCode( + (ImmunizationRefusalReason) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationRefusalReasonMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateImmunizationRefusalReasonStatusCode() { + OperationsTestCase validateImmunizationRefusalReasonStatusCodeTestCase = new OperationsTestCase( + "validateImmunizationRefusalReasonStatusCode", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_REFUSAL_REASON_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationRefusalReason target) { + + } + + @Override + protected void updateToPass(ImmunizationRefusalReason target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationRefusalReasonOperations.validateImmunizationRefusalReasonStatusCode( + (ImmunizationRefusalReason) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationRefusalReasonStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ImmunizationRefusalReasonOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ImmunizationRefusalReason create() { + return ConsolFactory.eINSTANCE.createImmunizationRefusalReason(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ImmunizationRefusalReasonOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ImmunizationRefusalReasonOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ImmunizationsSectionEntriesOptionalTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ImmunizationsSectionEntriesOptionalTest.java new file mode 100644 index 000000000..46b8c1723 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ImmunizationsSectionEntriesOptionalTest.java @@ -0,0 +1,336 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ImmunizationActivity; +import org.openhealthtools.mdht.uml.cda.consol.ImmunizationsSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.operations.ImmunizationsSectionEntriesOptionalOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; + +/** + * + * A static utility class that provides operations related to 'Immunizations Section Entries Optional' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationsSectionEntriesOptional#validateImmunizationsSectionEntriesOptionalTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunizations Section Entries Optional Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationsSectionEntriesOptional#validateImmunizationsSectionEntriesOptionalCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunizations Section Entries Optional Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationsSectionEntriesOptional#validateImmunizationsSectionEntriesOptionalCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunizations Section Entries Optional Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationsSectionEntriesOptional#validateImmunizationsSectionEntriesOptionalTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunizations Section Entries Optional Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationsSectionEntriesOptional#validateImmunizationsSectionEntriesOptionalText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunizations Section Entries Optional Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationsSectionEntriesOptional#validateImmunizationsSectionEntriesOptionalImmunizationActivity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunizations Section Entries Optional Immunization Activity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationsSectionEntriesOptional#getImmunizationActivities() Get Immunization Activities}
  • + *
+ *

+ * + * @generated + */ + +public class ImmunizationsSectionEntriesOptionalTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateImmunizationsSectionEntriesOptionalTemplateId() { + OperationsTestCase validateImmunizationsSectionEntriesOptionalTemplateIdTestCase = new OperationsTestCase( + "validateImmunizationsSectionEntriesOptionalTemplateId", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATIONS_SECTION_ENTRIES_OPTIONAL_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationsSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(ImmunizationsSectionEntriesOptional target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationsSectionEntriesOptionalOperations.validateImmunizationsSectionEntriesOptionalTemplateId( + (ImmunizationsSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationsSectionEntriesOptionalTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateImmunizationsSectionEntriesOptionalCode() { + OperationsTestCase validateImmunizationsSectionEntriesOptionalCodeTestCase = new OperationsTestCase( + "validateImmunizationsSectionEntriesOptionalCode", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATIONS_SECTION_ENTRIES_OPTIONAL_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationsSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(ImmunizationsSectionEntriesOptional target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationsSectionEntriesOptionalOperations.validateImmunizationsSectionEntriesOptionalCode( + (ImmunizationsSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationsSectionEntriesOptionalCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateImmunizationsSectionEntriesOptionalCodeP() { + OperationsTestCase validateImmunizationsSectionEntriesOptionalCodePTestCase = new OperationsTestCase( + "validateImmunizationsSectionEntriesOptionalCodeP", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATIONS_SECTION_ENTRIES_OPTIONAL_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationsSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(ImmunizationsSectionEntriesOptional target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationsSectionEntriesOptionalOperations.validateImmunizationsSectionEntriesOptionalCodeP( + (ImmunizationsSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationsSectionEntriesOptionalCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateImmunizationsSectionEntriesOptionalTitle() { + OperationsTestCase validateImmunizationsSectionEntriesOptionalTitleTestCase = new OperationsTestCase( + "validateImmunizationsSectionEntriesOptionalTitle", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATIONS_SECTION_ENTRIES_OPTIONAL_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationsSectionEntriesOptional target) { + target.init(); + } + + @Override + protected void updateToPass(ImmunizationsSectionEntriesOptional target) { + target.setTitle(DatatypesFactory.eINSTANCE.createST()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationsSectionEntriesOptionalOperations.validateImmunizationsSectionEntriesOptionalTitle( + (ImmunizationsSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationsSectionEntriesOptionalTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateImmunizationsSectionEntriesOptionalText() { + OperationsTestCase validateImmunizationsSectionEntriesOptionalTextTestCase = new OperationsTestCase( + "validateImmunizationsSectionEntriesOptionalText", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATIONS_SECTION_ENTRIES_OPTIONAL_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationsSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(ImmunizationsSectionEntriesOptional target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationsSectionEntriesOptionalOperations.validateImmunizationsSectionEntriesOptionalText( + (ImmunizationsSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationsSectionEntriesOptionalTextTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateImmunizationsSectionEntriesOptionalImmunizationActivity() { + OperationsTestCase validateImmunizationsSectionEntriesOptionalImmunizationActivityTestCase = new OperationsTestCase( + "validateImmunizationsSectionEntriesOptionalImmunizationActivity", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATIONS_SECTION_ENTRIES_OPTIONAL_IMMUNIZATION_ACTIVITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationsSectionEntriesOptional target) { + target.init(); + } + + @Override + protected void updateToPass(ImmunizationsSectionEntriesOptional target) { + ImmunizationActivity act = ConsolFactory.eINSTANCE.createImmunizationActivity().init(); + target.addSubstanceAdministration(act); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationsSectionEntriesOptionalOperations.validateImmunizationsSectionEntriesOptionalImmunizationActivity( + (ImmunizationsSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationsSectionEntriesOptionalImmunizationActivityTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetImmunizationActivities() { + + ImmunizationsSectionEntriesOptional target = objectFactory.create(); + target.getImmunizationActivities(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ImmunizationsSectionEntriesOptionalOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ImmunizationsSectionEntriesOptional create() { + return ConsolFactory.eINSTANCE.createImmunizationsSectionEntriesOptional(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ImmunizationsSectionEntriesOptionalOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ImmunizationsSectionEntriesOptionalOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ImmunizationsSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ImmunizationsSectionTest.java new file mode 100644 index 000000000..4b67c45a4 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ImmunizationsSectionTest.java @@ -0,0 +1,343 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ImmunizationActivity; +import org.openhealthtools.mdht.uml.cda.consol.ImmunizationsSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.ImmunizationsSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Immunizations Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationsSection#validateImmunizationsSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunizations Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationsSection#validateImmunizationsSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunizations Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationsSection#validateImmunizationsSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunizations Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationsSection#validateImmunizationsSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunizations Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationsSection#validateImmunizationsSectionImmunization(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunizations Section Immunization}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationsSection#getImmunizations() Get Immunizations}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ImmunizationsSection#validateImmunizationsSectionEntriesOptionalTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunizations Section Entries Optional Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class ImmunizationsSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateImmunizationsSectionCodeP() { + OperationsTestCase validateImmunizationsSectionCodePTestCase = new OperationsTestCase( + "validateImmunizationsSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATIONS_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationsSection target) { + + } + + @Override + protected void updateToPass(ImmunizationsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationsSectionOperations.validateImmunizationsSectionCodeP( + (ImmunizationsSection) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationsSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateImmunizationsSectionCode() { + OperationsTestCase validateImmunizationsSectionCodeTestCase = new OperationsTestCase( + "validateImmunizationsSectionCode", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATIONS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationsSection target) { + + } + + @Override + protected void updateToPass(ImmunizationsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationsSectionOperations.validateImmunizationsSectionCode( + (ImmunizationsSection) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationsSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateImmunizationsSectionTitle() { + OperationsTestCase validateImmunizationsSectionTitleTestCase = new OperationsTestCase( + "validateImmunizationsSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATIONS_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationsSection target) { + + } + + @Override + protected void updateToPass(ImmunizationsSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationsSectionOperations.validateImmunizationsSectionTitle( + (ImmunizationsSection) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationsSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateImmunizationsSectionText() { + OperationsTestCase validateImmunizationsSectionTextTestCase = new OperationsTestCase( + "validateImmunizationsSectionText", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATIONS_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationsSection target) { + + } + + @Override + protected void updateToPass(ImmunizationsSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationsSectionOperations.validateImmunizationsSectionText( + (ImmunizationsSection) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationsSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateImmunizationsSectionImmunization() { + OperationsTestCase validateImmunizationsSectionImmunizationTestCase = new OperationsTestCase( + "validateImmunizationsSectionImmunization", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATIONS_SECTION_IMMUNIZATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationsSection target) { + + } + + @Override + protected void updateToPass(ImmunizationsSection target) { + target.init(); + + ImmunizationActivity immunizationActivity = ConsolFactory.eINSTANCE.createImmunizationActivity().init(); + + target.addSubstanceAdministration(immunizationActivity); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationsSectionOperations.validateImmunizationsSectionImmunization( + (ImmunizationsSection) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationsSectionImmunizationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetImmunizations() { + + ImmunizationsSection target = objectFactory.create(); + target.getImmunizations(); + + } + + /** + * + * @generated + */ + @Test + public void testValidateImmunizationsSectionEntriesOptionalTemplateId() { + OperationsTestCase validateImmunizationsSectionEntriesOptionalTemplateIdTestCase = new OperationsTestCase( + "validateImmunizationsSectionEntriesOptionalTemplateId", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATIONS_SECTION_ENTRIES_OPTIONAL_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationsSection target) { + + } + + @Override + protected void updateToPass(ImmunizationsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationsSectionOperations.validateImmunizationsSectionEntriesOptionalTemplateId( + (ImmunizationsSection) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationsSectionEntriesOptionalTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ImmunizationsSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ImmunizationsSection create() { + return ConsolFactory.eINSTANCE.createImmunizationsSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ImmunizationsSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ImmunizationsSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/IndicationTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/IndicationTest.java new file mode 100644 index 000000000..67ca94b1e --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/IndicationTest.java @@ -0,0 +1,513 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.Indication; +import org.openhealthtools.mdht.uml.cda.consol.operations.IndicationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.vocab.NullFlavor; + +/** + * + * A static utility class that provides operations related to 'Indication' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.Indication#validateIndicationCodeNullFlavor(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Indication Code Null Flavor}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.Indication#validateIndicationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Indication Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.Indication#validateIndicationClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Indication Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.Indication#validateIndicationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Indication Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.Indication#validateIndicationId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Indication Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.Indication#validateIndicationCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Indication Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.Indication#validateIndicationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Indication Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.Indication#validateIndicationStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Indication Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.Indication#validateIndicationEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Indication Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.Indication#validateIndicationValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Indication Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.Indication#validateIndicationValueP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Indication Value P}
  • + *
+ *

+ * + * @generated + */ + +public class IndicationTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateIndicationCodeNullFlavor() { + OperationsTestCase validateIndicationCodeNullFlavorTestCase = new OperationsTestCase( + "validateIndicationCodeNullFlavor", + operationsForOCL.getOCLValue("VALIDATE_INDICATION_CODE_NULL_FLAVOR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Indication target) { + + } + + @Override + protected void updateToPass(Indication target) { + target.init(); + + CD cd = DatatypesFactory.eINSTANCE.createCD(); + + cd.setNullFlavor(NullFlavor.UNK); + + target.getValues().add(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return IndicationOperations.validateIndicationCodeNullFlavor( + (Indication) objectToTest, diagnostician, map); + } + + }; + + validateIndicationCodeNullFlavorTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateIndicationTemplateId() { + OperationsTestCase validateIndicationTemplateIdTestCase = new OperationsTestCase( + "validateIndicationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_INDICATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Indication target) { + + } + + @Override + protected void updateToPass(Indication target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return IndicationOperations.validateIndicationTemplateId((Indication) objectToTest, diagnostician, map); + } + + }; + + validateIndicationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateIndicationClassCode() { + OperationsTestCase validateIndicationClassCodeTestCase = new OperationsTestCase( + "validateIndicationClassCode", + operationsForOCL.getOCLValue("VALIDATE_INDICATION_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Indication target) { + + } + + @Override + protected void updateToPass(Indication target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return IndicationOperations.validateIndicationClassCode((Indication) objectToTest, diagnostician, map); + } + + }; + + validateIndicationClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateIndicationCode() { + OperationsTestCase validateIndicationCodeTestCase = new OperationsTestCase( + "validateIndicationCode", + operationsForOCL.getOCLValue("VALIDATE_INDICATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(Indication target) { + + } + + @Override + protected void updateToPass(Indication target) { + target.init(); + + CD cd = DatatypesFactory.eINSTANCE.createCD("404684003", "2.16.840.1.113883.6.96", "", ""); + + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return IndicationOperations.validateIndicationCode((Indication) objectToTest, diagnostician, map); + } + + }; + + validateIndicationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateIndicationEffectiveTime() { + OperationsTestCase validateIndicationEffectiveTimeTestCase = new OperationsTestCase( + "validateIndicationEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_INDICATION_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Indication target) { + + } + + @Override + protected void updateToPass(Indication target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return IndicationOperations.validateIndicationEffectiveTime( + (Indication) objectToTest, diagnostician, map); + } + + }; + + validateIndicationEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateIndicationId() { + OperationsTestCase validateIndicationIdTestCase = new OperationsTestCase( + "validateIndicationId", + operationsForOCL.getOCLValue("VALIDATE_INDICATION_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(Indication target) { + target.init(); + } + + @Override + protected void updateToPass(Indication target) { + + target.getIds().add(DatatypesFactory.eINSTANCE.createII()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return IndicationOperations.validateIndicationId((Indication) objectToTest, diagnostician, map); + } + + }; + + validateIndicationIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateIndicationCodeP() { + OperationsTestCase validateIndicationCodePTestCase = new OperationsTestCase( + "validateIndicationCodeP", + operationsForOCL.getOCLValue("VALIDATE_INDICATION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(Indication target) { + + } + + @Override + protected void updateToPass(Indication target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return IndicationOperations.validateIndicationCodeP((Indication) objectToTest, diagnostician, map); + } + + }; + + validateIndicationCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateIndicationMoodCode() { + OperationsTestCase validateIndicationMoodCodeTestCase = new OperationsTestCase( + "validateIndicationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_INDICATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Indication target) { + + } + + @Override + protected void updateToPass(Indication target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return IndicationOperations.validateIndicationMoodCode((Indication) objectToTest, diagnostician, map); + } + + }; + + validateIndicationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateIndicationStatusCode() { + OperationsTestCase validateIndicationStatusCodeTestCase = new OperationsTestCase( + "validateIndicationStatusCode", + operationsForOCL.getOCLValue("VALIDATE_INDICATION_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Indication target) { + + } + + @Override + protected void updateToPass(Indication target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return IndicationOperations.validateIndicationStatusCode((Indication) objectToTest, diagnostician, map); + } + + }; + + validateIndicationStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateIndicationValue() { + OperationsTestCase validateIndicationValueTestCase = new OperationsTestCase( + "validateIndicationValue", + operationsForOCL.getOCLValue("VALIDATE_INDICATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(Indication target) { + + target.getValues().add(DatatypesFactory.eINSTANCE.createCS()); + + } + + @Override + protected void updateToPass(Indication target) { + target.init(); + + target.getValues().clear(); + + CD value = DatatypesFactory.eINSTANCE.createCD("code", "2.16.840.1.113883.6.96", "", ""); + + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return IndicationOperations.validateIndicationValue((Indication) objectToTest, diagnostician, map); + } + + }; + + validateIndicationValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateIndicationValueP() { + OperationsTestCase validateIndicationValuePTestCase = new OperationsTestCase( + "validateIndicationValueP", + operationsForOCL.getOCLValue("VALIDATE_INDICATION_VALUE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(Indication target) { + + target.getValues().add(DatatypesFactory.eINSTANCE.createCS()); + + } + + @Override + protected void updateToPass(Indication target) { + target.init(); + + target.getValues().clear(); + + CD value = DatatypesFactory.eINSTANCE.createCD("code", "2.16.840.1.113883.6.96", "", ""); + + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return IndicationOperations.validateIndicationValueP((Indication) objectToTest, diagnostician, map); + } + + }; + + validateIndicationValuePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends IndicationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public Indication create() { + return ConsolFactory.eINSTANCE.createIndication(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends IndicationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // IndicationOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/InformantTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/InformantTest.java new file mode 100644 index 000000000..c27fd819c --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/InformantTest.java @@ -0,0 +1,45 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Informant' model objects. + * + * + * + * @generated + */ + +public class InformantTest extends CDAValidationTest { + + /** + * No Operations Test + * @generated + */ + @Test + public void testNoOperations() { + } + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // InformantOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/InformationRecipientTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/InformationRecipientTest.java new file mode 100644 index 000000000..2b30a3dca --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/InformationRecipientTest.java @@ -0,0 +1,45 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Information Recipient' model objects. + * + * + * + * @generated + */ + +public class InformationRecipientTest extends CDAValidationTest { + + /** + * No Operations Test + * @generated + */ + @Test + public void testNoOperations() { + } + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // InformationRecipientOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/InstructionsSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/InstructionsSectionTest.java new file mode 100644 index 000000000..d406c7959 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/InstructionsSectionTest.java @@ -0,0 +1,337 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.InstructionsSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.InstructionsSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Instructions Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.InstructionsSection#validateInstructionsSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Instructions Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.InstructionsSection#validateInstructionsSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Instructions Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.InstructionsSection#validateInstructionsSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Instructions Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.InstructionsSection#validateInstructionsSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Instructions Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.InstructionsSection#validateInstructionsSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Instructions Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.InstructionsSection#validateInstructionsSectionInstructions(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Instructions Section Instructions}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.InstructionsSection#getInstructionss() Get Instructionss}
  • + *
+ *

+ * + * @generated + */ + +public class InstructionsSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateInstructionsSectionTemplateId() { + OperationsTestCase validateInstructionsSectionTemplateIdTestCase = new OperationsTestCase( + "validateInstructionsSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_INSTRUCTIONS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(InstructionsSection target) { + + } + + @Override + protected void updateToPass(InstructionsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return InstructionsSectionOperations.validateInstructionsSectionTemplateId( + (InstructionsSection) objectToTest, diagnostician, map); + } + + }; + + validateInstructionsSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateInstructionsSectionCode() { + OperationsTestCase validateInstructionsSectionCodeTestCase = new OperationsTestCase( + "validateInstructionsSectionCode", + operationsForOCL.getOCLValue("VALIDATE_INSTRUCTIONS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(InstructionsSection target) { + + } + + @Override + protected void updateToPass(InstructionsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return InstructionsSectionOperations.validateInstructionsSectionCode( + (InstructionsSection) objectToTest, diagnostician, map); + } + + }; + + validateInstructionsSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateInstructionsSectionCodeP() { + OperationsTestCase validateInstructionsSectionCodePTestCase = new OperationsTestCase( + "validateInstructionsSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_INSTRUCTIONS_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(InstructionsSection target) { + + } + + @Override + protected void updateToPass(InstructionsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return InstructionsSectionOperations.validateInstructionsSectionCodeP( + (InstructionsSection) objectToTest, diagnostician, map); + } + + }; + + validateInstructionsSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateInstructionsSectionText() { + OperationsTestCase validateInstructionsSectionTextTestCase = new OperationsTestCase( + "validateInstructionsSectionText", + operationsForOCL.getOCLValue("VALIDATE_INSTRUCTIONS_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(InstructionsSection target) { + + } + + @Override + protected void updateToPass(InstructionsSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return InstructionsSectionOperations.validateInstructionsSectionText( + (InstructionsSection) objectToTest, diagnostician, map); + } + + }; + + validateInstructionsSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateInstructionsSectionTitle() { + OperationsTestCase validateInstructionsSectionTitleTestCase = new OperationsTestCase( + "validateInstructionsSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_INSTRUCTIONS_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(InstructionsSection target) { + + } + + @Override + protected void updateToPass(InstructionsSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return InstructionsSectionOperations.validateInstructionsSectionTitle( + (InstructionsSection) objectToTest, diagnostician, map); + } + + }; + + validateInstructionsSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateInstructionsSectionInstructions() { + OperationsTestCase validateInstructionsSectionInstructionsTestCase = new OperationsTestCase( + "validateInstructionsSectionInstructions", + operationsForOCL.getOCLValue("VALIDATE_INSTRUCTIONS_SECTION_INSTRUCTIONS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(InstructionsSection target) { + target.init(); + } + + @Override + protected void updateToPass(InstructionsSection target) { + target.addAct(ConsolFactory.eINSTANCE.createInstructions().init()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return InstructionsSectionOperations.validateInstructionsSectionInstructions( + (InstructionsSection) objectToTest, diagnostician, map); + } + + }; + + validateInstructionsSectionInstructionsTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetInstructionss() { + + InstructionsSection target = objectFactory.create(); + target.getInstructionss(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends InstructionsSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public InstructionsSection create() { + return ConsolFactory.eINSTANCE.createInstructionsSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends InstructionsSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // InstructionsSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/InstructionsTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/InstructionsTest.java new file mode 100644 index 000000000..8245416be --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/InstructionsTest.java @@ -0,0 +1,454 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ConsolPackage; +import org.openhealthtools.mdht.uml.cda.consol.GeneralStatusSection; +import org.openhealthtools.mdht.uml.cda.consol.Instructions; +import org.openhealthtools.mdht.uml.cda.consol.operations.InstructionsOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; + +/** + * + * A static utility class that provides operations related to 'Instructions' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.Instructions#validateInstructionsTextReference(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Instructions Text Reference}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.Instructions#validateInstructionsReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Instructions Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.Instructions#validateInstructionsTextReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Instructions Text Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.Instructions#validateInstructionsTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Instructions Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.Instructions#validateInstructionsClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Instructions Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.Instructions#validateInstructionsMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Instructions Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.Instructions#validateInstructionsCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Instructions Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.Instructions#validateInstructionsText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Instructions Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.Instructions#validateInstructionsStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Instructions Status Code}
  • + *
+ *

+ * + * @generated + */ + +public class InstructionsTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateInstructionsTextReference() { + OperationsTestCase validateInstructionsTextReferenceTestCase = new OperationsTestCase( + "validateInstructionsTextReference", + operationsForOCL.getOCLValue("VALIDATE_INSTRUCTIONS_TEXT_REFERENCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Instructions target) { + + target.init(); + + target.setText(DatatypesFactory.eINSTANCE.createED()); + } + + @Override + protected void updateToPass(Instructions target) { + + target.getText().setReference(DatatypesFactory.eINSTANCE.createTEL("aa")); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return InstructionsOperations.validateInstructionsTextReference( + (Instructions) objectToTest, diagnostician, map); + } + + }; + + validateInstructionsTextReferenceTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateInstructionsReferenceValue() { + OperationsTestCase validateInstructionsReferenceValueTestCase = new OperationsTestCase( + "validateInstructionsReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_INSTRUCTIONS_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Instructions target) { + target.init(); + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL()); + target.setText(txt); + } + + @Override + protected void updateToPass(Instructions target) { + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL("test")); + target.setText(txt); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return InstructionsOperations.validateInstructionsReferenceValue( + (Instructions) objectToTest, diagnostician, map); + } + + }; + + validateInstructionsReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateInstructionsTextReferenceValue() { + OperationsTestCase validateInstructionsTextReferenceValueTestCase = new NarrativeReferenceTestCase( + "validateInstructionsTextReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_INSTRUCTIONS_TEXT_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Instructions target) { + target.init(); + + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), "", + "No particular instructions provided."); + + // add a reference to the section text + target.setText(createEDWithReference("Some sample text", "#1.2.3.4")); + + } + + @Override + protected void updateToPass(Instructions target) { + + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), + "1.2.3.4", "No particular instructions provided."); + + // add a reference to the section text + target.setText(createEDWithReference("Some sample text", "#1.2.3.4")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return InstructionsOperations.validateInstructionsTextReferenceValue( + (Instructions) objectToTest, diagnostician, map); + } + + }; + + validateInstructionsTextReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateInstructionsTemplateId() { + OperationsTestCase validateInstructionsTemplateIdTestCase = new OperationsTestCase( + "validateInstructionsTemplateId", + operationsForOCL.getOCLValue("VALIDATE_INSTRUCTIONS_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Instructions target) { + + } + + @Override + protected void updateToPass(Instructions target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return InstructionsOperations.validateInstructionsTemplateId( + (Instructions) objectToTest, diagnostician, map); + } + + }; + + validateInstructionsTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateInstructionsClassCode() { + OperationsTestCase validateInstructionsClassCodeTestCase = new OperationsTestCase( + "validateInstructionsClassCode", + operationsForOCL.getOCLValue("VALIDATE_INSTRUCTIONS_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Instructions target) { + + } + + @Override + protected void updateToPass(Instructions target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return InstructionsOperations.validateInstructionsClassCode( + (Instructions) objectToTest, diagnostician, map); + } + + }; + + validateInstructionsClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateInstructionsMoodCode() { + OperationsTestCase validateInstructionsMoodCodeTestCase = new OperationsTestCase( + "validateInstructionsMoodCode", + operationsForOCL.getOCLValue("VALIDATE_INSTRUCTIONS_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Instructions target) { + + } + + @Override + protected void updateToPass(Instructions target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return InstructionsOperations.validateInstructionsMoodCode( + (Instructions) objectToTest, diagnostician, map); + } + + }; + + validateInstructionsMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateInstructionsCode() { + OperationsTestCase validateInstructionsCodeTestCase = new OperationsTestCase( + "validateInstructionsCode", + operationsForOCL.getOCLValue("VALIDATE_INSTRUCTIONS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(Instructions target) { + + } + + @Override + protected void updateToPass(Instructions target) { + target.init(); + + target.setCode(DatatypesFactory.eINSTANCE.createCE( + "", "2.16.840.1.113883.6.96", "codeSystemName", "displayName")); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return InstructionsOperations.validateInstructionsCode((Instructions) objectToTest, diagnostician, map); + } + + }; + + validateInstructionsCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateInstructionsText() { + OperationsTestCase validateInstructionsTextTestCase = new OperationsTestCase( + "validateInstructionsText", + operationsForOCL.getOCLValue("VALIDATE_INSTRUCTIONS_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(Instructions target) { + + } + + @Override + protected void updateToPass(Instructions target) { + target.init(); + + ED value = DatatypesFactory.eINSTANCE.createED(); + target.setText(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return InstructionsOperations.validateInstructionsText((Instructions) objectToTest, diagnostician, map); + } + + }; + + validateInstructionsTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateInstructionsStatusCode() { + OperationsTestCase validateInstructionsStatusCodeTestCase = new OperationsTestCase( + "validateInstructionsStatusCode", + operationsForOCL.getOCLValue("VALIDATE_INSTRUCTIONS_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Instructions target) { + + } + + @Override + protected void updateToPass(Instructions target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return InstructionsOperations.validateInstructionsStatusCode( + (Instructions) objectToTest, diagnostician, map); + } + + }; + + validateInstructionsStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends InstructionsOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public Instructions create() { + return ConsolFactory.eINSTANCE.createInstructions(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends InstructionsOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // InstructionsOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/InterventionsSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/InterventionsSectionTest.java new file mode 100644 index 000000000..8438a37e5 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/InterventionsSectionTest.java @@ -0,0 +1,290 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.InterventionsSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.InterventionsSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Interventions Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.InterventionsSection#validateInterventionsSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Interventions Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.InterventionsSection#validateInterventionsSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Interventions Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.InterventionsSection#validateInterventionsSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Interventions Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.InterventionsSection#validateInterventionsSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Interventions Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.InterventionsSection#validateInterventionsSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Interventions Section Title}
  • + *
+ *

+ * + * @generated + */ + +public class InterventionsSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateInterventionsSectionTemplateId() { + OperationsTestCase validateInterventionsSectionTemplateIdTestCase = new OperationsTestCase( + "validateInterventionsSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_INTERVENTIONS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(InterventionsSection target) { + + } + + @Override + protected void updateToPass(InterventionsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return InterventionsSectionOperations.validateInterventionsSectionTemplateId( + (InterventionsSection) objectToTest, diagnostician, map); + } + + }; + + validateInterventionsSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateInterventionsSectionCode() { + OperationsTestCase validateInterventionsSectionCodeTestCase = new OperationsTestCase( + "validateInterventionsSectionCode", + operationsForOCL.getOCLValue("VALIDATE_INTERVENTIONS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(InterventionsSection target) { + + } + + @Override + protected void updateToPass(InterventionsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return InterventionsSectionOperations.validateInterventionsSectionCode( + (InterventionsSection) objectToTest, diagnostician, map); + } + + }; + + validateInterventionsSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateInterventionsSectionCodeP() { + OperationsTestCase validateInterventionsSectionCodePTestCase = new OperationsTestCase( + "validateInterventionsSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_INTERVENTIONS_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(InterventionsSection target) { + + } + + @Override + protected void updateToPass(InterventionsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return InterventionsSectionOperations.validateInterventionsSectionCodeP( + (InterventionsSection) objectToTest, diagnostician, map); + } + + }; + + validateInterventionsSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateInterventionsSectionText() { + OperationsTestCase validateInterventionsSectionTextTestCase = new OperationsTestCase( + "validateInterventionsSectionText", + operationsForOCL.getOCLValue("VALIDATE_INTERVENTIONS_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(InterventionsSection target) { + + } + + @Override + protected void updateToPass(InterventionsSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return InterventionsSectionOperations.validateInterventionsSectionText( + (InterventionsSection) objectToTest, diagnostician, map); + } + + }; + + validateInterventionsSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateInterventionsSectionTitle() { + OperationsTestCase validateInterventionsSectionTitleTestCase = new OperationsTestCase( + "validateInterventionsSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_INTERVENTIONS_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(InterventionsSection target) { + + } + + @Override + protected void updateToPass(InterventionsSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return InterventionsSectionOperations.validateInterventionsSectionTitle( + (InterventionsSection) objectToTest, diagnostician, map); + } + + }; + + validateInterventionsSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends InterventionsSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public InterventionsSection create() { + return ConsolFactory.eINSTANCE.createInterventionsSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends InterventionsSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // InterventionsSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/MedicalEquipmentSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/MedicalEquipmentSectionTest.java new file mode 100644 index 000000000..8eda49d19 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/MedicalEquipmentSectionTest.java @@ -0,0 +1,338 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.MedicalEquipmentSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.MedicalEquipmentSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Medical Equipment Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicalEquipmentSection#validateMedicalEquipmentSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medical Equipment Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicalEquipmentSection#validateMedicalEquipmentSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medical Equipment Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicalEquipmentSection#validateMedicalEquipmentSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medical Equipment Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicalEquipmentSection#validateMedicalEquipmentSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medical Equipment Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicalEquipmentSection#validateMedicalEquipmentSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medical Equipment Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicalEquipmentSection#validateMedicalEquipmentSectionNonMedicinalSupplyActivity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medical Equipment Section Non Medicinal Supply Activity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicalEquipmentSection#getNonMedicinalSupplyActivities() Get Non Medicinal Supply Activities}
  • + *
+ *

+ * + * @generated + */ + +public class MedicalEquipmentSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateMedicalEquipmentSectionTemplateId() { + OperationsTestCase validateMedicalEquipmentSectionTemplateIdTestCase = new OperationsTestCase( + "validateMedicalEquipmentSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_MEDICAL_EQUIPMENT_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicalEquipmentSection target) { + + } + + @Override + protected void updateToPass(MedicalEquipmentSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicalEquipmentSectionOperations.validateMedicalEquipmentSectionTemplateId( + (MedicalEquipmentSection) objectToTest, diagnostician, map); + } + + }; + + validateMedicalEquipmentSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicalEquipmentSectionCode() { + OperationsTestCase validateMedicalEquipmentSectionCodeTestCase = new OperationsTestCase( + "validateMedicalEquipmentSectionCode", + operationsForOCL.getOCLValue("VALIDATE_MEDICAL_EQUIPMENT_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicalEquipmentSection target) { + + } + + @Override + protected void updateToPass(MedicalEquipmentSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicalEquipmentSectionOperations.validateMedicalEquipmentSectionCode( + (MedicalEquipmentSection) objectToTest, diagnostician, map); + } + + }; + + validateMedicalEquipmentSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicalEquipmentSectionCodeP() { + OperationsTestCase validateMedicalEquipmentSectionCodePTestCase = new OperationsTestCase( + "validateMedicalEquipmentSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_MEDICAL_EQUIPMENT_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicalEquipmentSection target) { + + } + + @Override + protected void updateToPass(MedicalEquipmentSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicalEquipmentSectionOperations.validateMedicalEquipmentSectionCodeP( + (MedicalEquipmentSection) objectToTest, diagnostician, map); + } + + }; + + validateMedicalEquipmentSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicalEquipmentSectionTitle() { + OperationsTestCase validateMedicalEquipmentSectionTitleTestCase = new OperationsTestCase( + "validateMedicalEquipmentSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_MEDICAL_EQUIPMENT_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicalEquipmentSection target) { + + } + + @Override + protected void updateToPass(MedicalEquipmentSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicalEquipmentSectionOperations.validateMedicalEquipmentSectionTitle( + (MedicalEquipmentSection) objectToTest, diagnostician, map); + } + + }; + + validateMedicalEquipmentSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicalEquipmentSectionText() { + OperationsTestCase validateMedicalEquipmentSectionTextTestCase = new OperationsTestCase( + "validateMedicalEquipmentSectionText", + operationsForOCL.getOCLValue("VALIDATE_MEDICAL_EQUIPMENT_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicalEquipmentSection target) { + + } + + @Override + protected void updateToPass(MedicalEquipmentSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicalEquipmentSectionOperations.validateMedicalEquipmentSectionText( + (MedicalEquipmentSection) objectToTest, diagnostician, map); + } + + }; + + validateMedicalEquipmentSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicalEquipmentSectionNonMedicinalSupplyActivity() { + OperationsTestCase validateMedicalEquipmentSectionNonMedicinalSupplyActivityTestCase = new OperationsTestCase( + "validateMedicalEquipmentSectionNonMedicinalSupplyActivity", + operationsForOCL.getOCLValue("VALIDATE_MEDICAL_EQUIPMENT_SECTION_NON_MEDICINAL_SUPPLY_ACTIVITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicalEquipmentSection target) { + + } + + @Override + protected void updateToPass(MedicalEquipmentSection target) { + target.init(); + target.addSupply(ConsolFactory.eINSTANCE.createNonMedicinalSupplyActivity()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicalEquipmentSectionOperations.validateMedicalEquipmentSectionNonMedicinalSupplyActivity( + (MedicalEquipmentSection) objectToTest, diagnostician, map); + } + + }; + + validateMedicalEquipmentSectionNonMedicinalSupplyActivityTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetNonMedicinalSupplyActivities() { + + MedicalEquipmentSection target = objectFactory.create(); + target.getNonMedicinalSupplyActivities(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends MedicalEquipmentSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public MedicalEquipmentSection create() { + return ConsolFactory.eINSTANCE.createMedicalEquipmentSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends MedicalEquipmentSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // MedicalEquipmentSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/MedicalHistorySectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/MedicalHistorySectionTest.java new file mode 100644 index 000000000..bcdd89084 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/MedicalHistorySectionTest.java @@ -0,0 +1,290 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.MedicalHistorySection; +import org.openhealthtools.mdht.uml.cda.consol.operations.MedicalHistorySectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Medical History Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicalHistorySection#validateMedicalHistorySectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medical History Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicalHistorySection#validateMedicalHistorySectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medical History Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicalHistorySection#validateMedicalHistorySectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medical History Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicalHistorySection#validateMedicalHistorySectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medical History Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicalHistorySection#validateMedicalHistorySectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medical History Section Title}
  • + *
+ *

+ * + * @generated + */ + +public class MedicalHistorySectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateMedicalHistorySectionTemplateId() { + OperationsTestCase validateMedicalHistorySectionTemplateIdTestCase = new OperationsTestCase( + "validateMedicalHistorySectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_MEDICAL_HISTORY_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicalHistorySection target) { + + } + + @Override + protected void updateToPass(MedicalHistorySection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicalHistorySectionOperations.validateMedicalHistorySectionTemplateId( + (MedicalHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateMedicalHistorySectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicalHistorySectionCode() { + OperationsTestCase validateMedicalHistorySectionCodeTestCase = new OperationsTestCase( + "validateMedicalHistorySectionCode", + operationsForOCL.getOCLValue("VALIDATE_MEDICAL_HISTORY_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicalHistorySection target) { + + } + + @Override + protected void updateToPass(MedicalHistorySection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicalHistorySectionOperations.validateMedicalHistorySectionCode( + (MedicalHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateMedicalHistorySectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicalHistorySectionCodeP() { + OperationsTestCase validateMedicalHistorySectionCodePTestCase = new OperationsTestCase( + "validateMedicalHistorySectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_MEDICAL_HISTORY_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicalHistorySection target) { + + } + + @Override + protected void updateToPass(MedicalHistorySection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicalHistorySectionOperations.validateMedicalHistorySectionCodeP( + (MedicalHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateMedicalHistorySectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicalHistorySectionText() { + OperationsTestCase validateMedicalHistorySectionTextTestCase = new OperationsTestCase( + "validateMedicalHistorySectionText", + operationsForOCL.getOCLValue("VALIDATE_MEDICAL_HISTORY_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicalHistorySection target) { + + } + + @Override + protected void updateToPass(MedicalHistorySection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicalHistorySectionOperations.validateMedicalHistorySectionText( + (MedicalHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateMedicalHistorySectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicalHistorySectionTitle() { + OperationsTestCase validateMedicalHistorySectionTitleTestCase = new OperationsTestCase( + "validateMedicalHistorySectionTitle", + operationsForOCL.getOCLValue("VALIDATE_MEDICAL_HISTORY_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicalHistorySection target) { + + } + + @Override + protected void updateToPass(MedicalHistorySection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicalHistorySectionOperations.validateMedicalHistorySectionTitle( + (MedicalHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateMedicalHistorySectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends MedicalHistorySectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public MedicalHistorySection create() { + return ConsolFactory.eINSTANCE.createMedicalHistorySection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends MedicalHistorySectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // MedicalHistorySectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/MedicationActivityTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/MedicationActivityTest.java new file mode 100644 index 000000000..f6c4c1021 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/MedicationActivityTest.java @@ -0,0 +1,1729 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import static org.openhealthtools.mdht.uml.hl7.vocab.x_DocumentSubstanceMood.EVN; +import static org.openhealthtools.mdht.uml.hl7.vocab.x_DocumentSubstanceMood.INT; + +import java.util.Arrays; +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Consumable; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.Participant2; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ConsolPackage; +import org.openhealthtools.mdht.uml.cda.consol.GeneralStatusSection; +import org.openhealthtools.mdht.uml.cda.consol.Indication; +import org.openhealthtools.mdht.uml.cda.consol.Instructions; +import org.openhealthtools.mdht.uml.cda.consol.MedicationActivity; +import org.openhealthtools.mdht.uml.cda.consol.MedicationDispense; +import org.openhealthtools.mdht.uml.cda.consol.PreconditionForSubstanceAdministration; +import org.openhealthtools.mdht.uml.cda.consol.operations.MedicationActivityOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; +import org.openhealthtools.mdht.uml.hl7.datatypes.EIVL_TS; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_PQ; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.vocab.ActClass; +import org.openhealthtools.mdht.uml.hl7.vocab.ActRelationshipType; +import org.openhealthtools.mdht.uml.hl7.vocab.ParticipationType; +import org.openhealthtools.mdht.uml.hl7.vocab.SetOperator; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; +import org.openhealthtools.mdht.uml.hl7.vocab.x_DocumentSubstanceMood; + +/** + * + * A static utility class that provides operations related to 'Medication Activity' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationActivity#validateMedicationActivityDoseQuantityorrateQuantity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Dose Quantityorrate Quantity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationActivity#validateMedicationActivityTextReference(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Text Reference}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationActivity#validateMedicationActivityReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationActivity#validateMedicationActivityTextReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Text Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationActivity#validateMedicationActivityEffectiveTimeIVLTS(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Effective Time IVLTS}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationActivity#validateMedicationActivityEffectiveTimeLow(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Effective Time Low}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationActivity#validateMedicationActivityEffectiveTimeHigh(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Effective Time High}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationActivity#validateMedicationActivityEffectiveTimePIVLTS(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Effective Time PIVLTS}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationActivity#validateMedicationActivityEffectiveTimeOperator(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Effective Time Operator}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationActivity#validateMedicationActivityDoseQuantityUnit(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Dose Quantity Unit}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationActivity#validateMedicationActivityDrugVehicleTypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Drug Vehicle Type Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationActivity#validateMedicationActivityInstructionsInversionInd(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Instructions Inversion Ind}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationActivity#validateMedicationActivityPreconditionSubstanceAdmTypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Precondition Substance Adm Type Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationActivity#validateMedicationActivityTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationActivity#validateMedicationActivityClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationActivity#validateMedicationActivityMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationActivity#validateMedicationActivityId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationActivity#validateMedicationActivityCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationActivity#validateMedicationActivityStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationActivity#validateMedicationActivityRouteCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Route Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationActivity#validateMedicationActivityRouteCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Route Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationActivity#validateMedicationActivityApproachSiteCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Approach Site Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationActivity#validateMedicationActivityApproachSiteCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Approach Site Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationActivity#validateMedicationActivityDoseQuantity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Dose Quantity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationActivity#validateMedicationActivityRateQuantity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Rate Quantity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationActivity#validateMedicationActivityMaxDoseQuantity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Max Dose Quantity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationActivity#validateMedicationActivityAdministrationUnitCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Administration Unit Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationActivity#validateMedicationActivityText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationActivity#validateMedicationActivityRepeatNumber(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Repeat Number}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationActivity#validateMedicationActivityMedicationSupplyOrder(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Medication Supply Order}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationActivity#validateMedicationActivityReactionObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Reaction Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationActivity#validateMedicationActivityPerformer(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Performer}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationActivity#validateMedicationActivityInstructions(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Instructions}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationActivity#validateMedicationActivityIndication(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Indication}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationActivity#validateMedicationActivityMedicationDispense(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Medication Dispense}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationActivity#validateMedicationActivityPrecondition(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Precondition}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationActivity#validateMedicationActivityDrugVehicle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Drug Vehicle}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationActivity#validateMedicationActivityConsumable(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Consumable}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationActivity#validateMedicationActivityConsumableMedicationInformation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Activity Consumable Medication Information}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationActivity#getMedicationSupplyOrder() Get Medication Supply Order}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationActivity#getReactionObservation() Get Reaction Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationActivity#getInstructions() Get Instructions}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationActivity#getIndications() Get Indications}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationActivity#getMedicationDispenses() Get Medication Dispenses}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationActivity#getDrugVehicles() Get Drug Vehicles}
  • + *
+ *

+ * + * @generated + */ + +public class MedicationActivityTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationActivityDoseQuantityorrateQuantity() { + OperationsTestCase validateMedicationActivityDoseQuantityorrateQuantityTestCase = new OperationsTestCase( + "validateMedicationActivityDoseQuantityorrateQuantity", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_DOSE_QUANTITYORRATE_QUANTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.init(); + target.setRateQuantity(DatatypesFactory.eINSTANCE.createIVL_PQ()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityDoseQuantityorrateQuantity( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityDoseQuantityorrateQuantityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationActivityTextReference() { + OperationsTestCase validateMedicationActivityTextReferenceTestCase = new OperationsTestCase( + "validateMedicationActivityTextReference", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_TEXT_REFERENCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + target.init(); + ED txt = DatatypesFactory.eINSTANCE.createED(); + target.setText(txt); + } + + @Override + protected void updateToPass(MedicationActivity target) { + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL("test")); + target.setText(txt); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityTextReference( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityTextReferenceTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationActivityReferenceValue() { + OperationsTestCase validateMedicationActivityReferenceValueTestCase = new OperationsTestCase( + "validateMedicationActivityReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + target.init(); + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL()); + target.setText(txt); + } + + @Override + protected void updateToPass(MedicationActivity target) { + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL("test")); + target.setText(txt); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityReferenceValue( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationActivityTextReferenceValue() { + OperationsTestCase validateMedicationActivityTextReferenceValueTestCase = new NarrativeReferenceTestCase( + "validateMedicationActivityTextReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_TEXT_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + target.init(); + + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), "", + "Not a particularly severe reaction."); + + // add a reference to the section text + target.setText(createEDWithReference("Some sample text", "#1.2.3.4")); + + } + + @Override + protected void updateToPass(MedicationActivity target) { + + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), + "1.2.3.4", "Not a particularly severe reaction."); + + // add a reference to the section text + target.setText(createEDWithReference("Some sample text", "#1.2.3.4")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityTextReferenceValue( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityTextReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationActivityEffectiveTimeIVLTS() { + OperationsTestCase validateMedicationActivityEffectiveTimeIVLTSTestCase = new OperationsTestCase( + "validateMedicationActivityEffectiveTimeIVLTS", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_EFFECTIVE_TIME_IVLTS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.init(); + target.getEffectiveTimes().add(DatatypesFactory.eINSTANCE.createIVL_TS()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityEffectiveTimeIVLTS( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityEffectiveTimeIVLTSTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationActivityEffectiveTimeLow() { + OperationsTestCase validateMedicationActivityEffectiveTimeLowTestCase = new OperationsTestCase( + "validateMedicationActivityEffectiveTimeLow", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_EFFECTIVE_TIME_LOW__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + target.init(); + target.getEffectiveTimes().add(DatatypesFactory.eINSTANCE.createIVL_TS()); + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.getEffectiveTimes().clear(); + IVL_TS ef = DatatypesFactory.eINSTANCE.createIVL_TS(); + ef.setLow(DatatypesFactory.eINSTANCE.createIVXB_TS()); + target.getEffectiveTimes().add(ef); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityEffectiveTimeLow( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityEffectiveTimeLowTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationActivityEffectiveTimeHigh() { + OperationsTestCase validateMedicationActivityEffectiveTimeHighTestCase = new OperationsTestCase( + "validateMedicationActivityEffectiveTimeHigh", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_EFFECTIVE_TIME_HIGH__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + target.init(); + target.getEffectiveTimes().add(DatatypesFactory.eINSTANCE.createIVL_TS()); + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.getEffectiveTimes().clear(); + IVL_TS ef = DatatypesFactory.eINSTANCE.createIVL_TS(); + ef.setHigh(DatatypesFactory.eINSTANCE.createIVXB_TS()); + target.getEffectiveTimes().add(ef); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityEffectiveTimeHigh( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityEffectiveTimeHighTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationActivityEffectiveTimePIVLTS() { + OperationsTestCase validateMedicationActivityEffectiveTimePIVLTSTestCase = new OperationsTestCase( + "validateMedicationActivityEffectiveTimePIVLTS", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_EFFECTIVE_TIME_PIVLTS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.init(); + target.getEffectiveTimes().add(DatatypesFactory.eINSTANCE.createEIVL_TS()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityEffectiveTimePIVLTS( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityEffectiveTimePIVLTSTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationActivityEffectiveTimeOperator() { + OperationsTestCase validateMedicationActivityEffectiveTimeOperatorTestCase = new OperationsTestCase( + "validateMedicationActivityEffectiveTimeOperator", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_EFFECTIVE_TIME_OPERATOR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + target.init(); + target.getEffectiveTimes().add(DatatypesFactory.eINSTANCE.createEIVL_TS()); + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.getEffectiveTimes().clear(); + EIVL_TS ef = DatatypesFactory.eINSTANCE.createEIVL_TS(); + ef.setOperator(SetOperator.A); + target.getEffectiveTimes().add(ef); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityEffectiveTimeOperator( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityEffectiveTimeOperatorTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationActivityDoseQuantityUnit() { + OperationsTestCase validateMedicationActivityDoseQuantityUnitTestCase = new OperationsTestCase( + "validateMedicationActivityDoseQuantityUnit", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_DOSE_QUANTITY_UNIT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + target.init(); + IVL_PQ dq = DatatypesFactory.eINSTANCE.createIVL_PQ(); + dq.setUnit(null); + target.setDoseQuantity(dq); + } + + @Override + protected void updateToPass(MedicationActivity target) { + + IVL_PQ dq = DatatypesFactory.eINSTANCE.createIVL_PQ(); + dq.setUnit("test"); + target.setDoseQuantity(dq); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityDoseQuantityUnit( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityDoseQuantityUnitTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationActivityDrugVehicleTypeCode() { + OperationsTestCase validateMedicationActivityDrugVehicleTypeCodeTestCase = new OperationsTestCase( + "validateMedicationActivityDrugVehicleTypeCode", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_DRUG_VEHICLE_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + target.init(); + Participant2 p = CDAFactory.eINSTANCE.createParticipant2(); + p.setParticipantRole(ConsolFactory.eINSTANCE.createDrugVehicle()); + target.getParticipants().add(p); + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.getParticipants().clear(); + Participant2 p = CDAFactory.eINSTANCE.createParticipant2(); + p.setParticipantRole(ConsolFactory.eINSTANCE.createDrugVehicle()); + p.setTypeCode(ParticipationType.CSM); + target.getParticipants().add(p); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityDrugVehicleTypeCode( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityDrugVehicleTypeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationActivityInstructionsInversionInd() { + OperationsTestCase validateMedicationActivityInstructionsInversionIndTestCase = new OperationsTestCase( + "validateMedicationActivityInstructionsInversionInd", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_INSTRUCTIONS_INVERSION_IND__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + target.init(); + target.addAct(ConsolFactory.eINSTANCE.createInstructions()); + } + + @Override + public void addPassTests() { + + addPassTest(new PassTest() { + + @Override + public void updateToPass(MedicationActivity target) { + // Test case with entry Relationship , but no Instruction Act + // Should pass + target.getEntryRelationships().clear(); + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + target.getEntryRelationships().add(er); + } + + }); + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.getEntryRelationships().clear(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setAct(ConsolFactory.eINSTANCE.createInstructions()); + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + er.setInversionInd(true); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityInstructionsInversionInd( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityInstructionsInversionIndTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationActivityPreconditionSubstanceAdmTypeCode() { + OperationsTestCase validateMedicationActivityPreconditionSubstanceAdmTypeCodeTestCase = new OperationsTestCase( + "validateMedicationActivityPreconditionSubstanceAdmTypeCode", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_PRECONDITION_SUBSTANCE_ADM_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + target.init(); + PreconditionForSubstanceAdministration pc = ConsolFactory.eINSTANCE.createPreconditionForSubstanceAdministration(); + pc.setTypeCode(ActRelationshipType.CAUS); + target.getPreconditions().add(pc); + + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.getPreconditions().clear(); + PreconditionForSubstanceAdministration pc = ConsolFactory.eINSTANCE.createPreconditionForSubstanceAdministration(); + pc.setTypeCode(ActRelationshipType.PRCN); + target.getPreconditions().add(pc); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityPreconditionSubstanceAdmTypeCode( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityPreconditionSubstanceAdmTypeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicationActivityTemplateId() { + OperationsTestCase validateMedicationActivityTemplateIdTestCase = new OperationsTestCase( + "validateMedicationActivityTemplateId", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityTemplateId( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationActivityClassCode() { + OperationsTestCase validateMedicationActivityClassCodeTestCase = new OperationsTestCase( + "validateMedicationActivityClassCode", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + target.setClassCode(ActClass.ACCM); + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityClassCode( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationActivityMoodCode() { + OperationsTestCase validateMedicationActivityMoodCodeTestCase = new OperationsTestCase( + "validateMedicationActivityMoodCode", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + // the EMF-generated default for x_DocumentSubstanceMood happens to be + // a value allowed by the constraint + target.setMoodCode(x_DocumentSubstanceMood.RQO); + } + + @Override + public void addPassTests() { + for (final x_DocumentSubstanceMood mood : Arrays.asList(EVN, INT)) { + addPassTest(new PassTest() { + @Override + public void updateToPass(MedicationActivity target) { + target.init(); + target.setMoodCode(mood); + } + }); + } + ; + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityMoodCode( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationActivityId() { + OperationsTestCase validateMedicationActivityIdTestCase = new OperationsTestCase( + "validateMedicationActivityId", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.init(); + target.getIds().add(DatatypesFactory.eINSTANCE.createII()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityId( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationActivityCode() { + OperationsTestCase validateMedicationActivityCodeTestCase = new OperationsTestCase( + "validateMedicationActivityCode", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.init(); + target.setCode(DatatypesFactory.eINSTANCE.createCD()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityCode( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicationActivityStatusCode() { + OperationsTestCase validateMedicationActivityStatusCodeTestCase = new OperationsTestCase( + "validateMedicationActivityStatusCode", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityStatusCode( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationActivityRouteCode() { + OperationsTestCase validateMedicationActivityRouteCodeTestCase = new OperationsTestCase( + "validateMedicationActivityRouteCode", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_ROUTE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.init(); + target.setRouteCode(DatatypesFactory.eINSTANCE.createCE("C38194", "2.16.840.1.113883.3.26.1.1")); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityRouteCode( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityRouteCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationActivityRouteCodeP() { + OperationsTestCase validateMedicationActivityRouteCodePTestCase = new OperationsTestCase( + "validateMedicationActivityRouteCodeP", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_ROUTE_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.init(); + target.setRouteCode(DatatypesFactory.eINSTANCE.createCE("code", "codeSystem")); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityRouteCodeP( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityRouteCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationActivityApproachSiteCode() { + OperationsTestCase validateMedicationActivityApproachSiteCodeTestCase = new OperationsTestCase( + "validateMedicationActivityApproachSiteCode", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_APPROACH_SITE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + + target.init(); + target.getApproachSiteCodes().add(DatatypesFactory.eINSTANCE.createCD()); + + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.getApproachSiteCodes().clear(); + target.getApproachSiteCodes().add( + DatatypesFactory.eINSTANCE.createCD( + "code", "2.16.840.1.113883.6.96", "codeSystemName", "displayName")); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityApproachSiteCode( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityApproachSiteCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationActivityApproachSiteCodeP() { + OperationsTestCase validateMedicationActivityApproachSiteCodePTestCase = new OperationsTestCase( + "validateMedicationActivityApproachSiteCodeP", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_APPROACH_SITE_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + + target.init(); + target.getApproachSiteCodes().clear(); + + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.getApproachSiteCodes().add( + DatatypesFactory.eINSTANCE.createCD( + "code", "2.16.840.1.113883.6.96", "codeSystemName", "displayName")); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityApproachSiteCodeP( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityApproachSiteCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationActivityDoseQuantity() { + OperationsTestCase validateMedicationActivityDoseQuantityTestCase = new OperationsTestCase( + "validateMedicationActivityDoseQuantity", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_DOSE_QUANTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.init(); + target.setDoseQuantity(DatatypesFactory.eINSTANCE.createIVL_PQ()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityDoseQuantity( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityDoseQuantityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationActivityRateQuantity() { + OperationsTestCase validateMedicationActivityRateQuantityTestCase = new OperationsTestCase( + "validateMedicationActivityRateQuantity", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_RATE_QUANTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.init(); + target.setRateQuantity(DatatypesFactory.eINSTANCE.createIVL_PQ()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityRateQuantity( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityRateQuantityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationActivityMaxDoseQuantity() { + OperationsTestCase validateMedicationActivityMaxDoseQuantityTestCase = new OperationsTestCase( + "validateMedicationActivityMaxDoseQuantity", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_MAX_DOSE_QUANTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.init(); + + target.setMaxDoseQuantity(DatatypesFactory.eINSTANCE.createRTO_PQ_PQ()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityMaxDoseQuantity( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityMaxDoseQuantityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationActivityAdministrationUnitCode() { + OperationsTestCase validateMedicationActivityAdministrationUnitCodeTestCase = new OperationsTestCase( + "validateMedicationActivityAdministrationUnitCode", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_ADMINISTRATION_UNIT_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.init(); + target.setAdministrationUnitCode(DatatypesFactory.eINSTANCE.createCE( + "code", "2.16.840.1.113883.3.26.1.1")); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityAdministrationUnitCode( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityAdministrationUnitCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicationActivityText() { + OperationsTestCase validateMedicationActivityTextTestCase = new OperationsTestCase( + "validateMedicationActivityText", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.init(); + + ED text = DatatypesFactory.eINSTANCE.createED(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityText( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityTextTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationActivityRepeatNumber() { + OperationsTestCase validateMedicationActivityRepeatNumberTestCase = new OperationsTestCase( + "validateMedicationActivityRepeatNumber", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_REPEAT_NUMBER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.init(); + + target.setRepeatNumber(DatatypesFactory.eINSTANCE.createIVL_INT()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityRepeatNumber( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityRepeatNumberTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationActivityMedicationSupplyOrder() { + OperationsTestCase validateMedicationActivityMedicationSupplyOrderTestCase = new OperationsTestCase( + "validateMedicationActivityMedicationSupplyOrder", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_MEDICATION_SUPPLY_ORDER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.init(); + target.init(); + target.addSupply(ConsolFactory.eINSTANCE.createMedicationSupplyOrder().init()); + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.REFR); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityMedicationSupplyOrder( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityMedicationSupplyOrderTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationActivityReactionObservation() { + OperationsTestCase validateMedicationActivityReactionObservationTestCase = new OperationsTestCase( + "validateMedicationActivityReactionObservation", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_REACTION_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.init(); + + target.addObservation(ConsolFactory.eINSTANCE.createReactionObservation().init()); + + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.CAUS); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityReactionObservation( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityReactionObservationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationActivityConsumable() { + OperationsTestCase validateMedicationActivityConsumableTestCase = new OperationsTestCase( + "validateMedicationActivityConsumable", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_CONSUMABLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.init(); + target.setConsumable(CDAFactory.eINSTANCE.createConsumable()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityConsumable( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityConsumableTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationActivityConsumableMedicationInformation() { + OperationsTestCase validateMedicationActivityConsumableMedicationInformationTestCase = new OperationsTestCase( + "validateMedicationActivityConsumableMedicationInformation", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_CONSUMABLE_MEDICATION_INFORMATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + target.init(); + target.setConsumable(CDAFactory.eINSTANCE.createConsumable()); + } + + @Override + protected void updateToPass(MedicationActivity target) { + Consumable con = CDAFactory.eINSTANCE.createConsumable(); + con.setManufacturedProduct(ConsolFactory.eINSTANCE.createMedicationInformation()); + target.setConsumable(con); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityConsumableMedicationInformation( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityConsumableMedicationInformationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetMedicationSupplyOrder() { + + MedicationActivity target = objectFactory.create(); + target.getMedicationSupplyOrder(); + + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationActivityPerformer() { + OperationsTestCase validateMedicationActivityPerformerTestCase = new OperationsTestCase( + "validateMedicationActivityPerformer", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_PERFORMER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.init(); + target.getPerformers().add(CDAFactory.eINSTANCE.createPerformer2()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityPerformer( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityPerformerTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationActivityInstructions() { + OperationsTestCase validateMedicationActivityInstructionsTestCase = new OperationsTestCase( + "validateMedicationActivityInstructions", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_INSTRUCTIONS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.init(); + target.init(); + Instructions instruction = ConsolFactory.eINSTANCE.createInstructions().init(); + target.addAct(instruction); + + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityInstructions( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityInstructionsTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationActivityIndication() { + OperationsTestCase validateMedicationActivityIndicationTestCase = new OperationsTestCase( + "validateMedicationActivityIndication", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_INDICATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + + } + + @Override + protected void updateToPass(MedicationActivity target) { + + target.init(); + Indication indication = ConsolFactory.eINSTANCE.createIndication().init(); + target.addObservation(indication); + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.RSON); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityIndication( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityIndicationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationActivityMedicationDispense() { + OperationsTestCase validateMedicationActivityMedicationDispenseTestCase = new OperationsTestCase( + "validateMedicationActivityMedicationDispense", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_MEDICATION_DISPENSE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + + } + + @Override + protected void updateToPass(MedicationActivity target) { + + target.init(); + MedicationDispense md = ConsolFactory.eINSTANCE.createMedicationDispense().init(); + target.addSupply(md); + + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.REFR); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityMedicationDispense( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityMedicationDispenseTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationActivityPrecondition() { + OperationsTestCase validateMedicationActivityPreconditionTestCase = new OperationsTestCase( + "validateMedicationActivityPrecondition", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_PRECONDITION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + + } + + @Override + protected void updateToPass(MedicationActivity target) { + target.init(); + PreconditionForSubstanceAdministration pc = ConsolFactory.eINSTANCE.createPreconditionForSubstanceAdministration(); + pc.setTypeCode(ActRelationshipType.PRCN); + target.getPreconditions().add(pc); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityPrecondition( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityPreconditionTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationActivityDrugVehicle() { + OperationsTestCase validateMedicationActivityDrugVehicleTestCase = new OperationsTestCase( + "validateMedicationActivityDrugVehicle", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ACTIVITY_DRUG_VEHICLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationActivity target) { + target.init(); + target.getParticipants().add(org.openhealthtools.mdht.uml.cda.CDAFactory.eINSTANCE.createParticipant2()); + + } + + @Override + protected void updateToPass(MedicationActivity target) { + for (Participant2 p : target.getParticipants()) { + p.setParticipantRole(ConsolFactory.eINSTANCE.createDrugVehicle().init()); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationActivityOperations.validateMedicationActivityDrugVehicle( + (MedicationActivity) objectToTest, diagnostician, map); + } + + }; + + validateMedicationActivityDrugVehicleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetReactionObservation() { + + MedicationActivity target = objectFactory.create(); + target.getReactionObservation(); + + } + + /** + * + * @generated + */ + @Test + public void testGetInstructions() { + + MedicationActivity target = objectFactory.create(); + target.getInstructions(); + + } + + /** + * + * @generated + */ + @Test + public void testGetIndications() { + + MedicationActivity target = objectFactory.create(); + target.getIndications(); + + } + + /** + * + * @generated + */ + @Test + public void testGetMedicationDispenses() { + + MedicationActivity target = objectFactory.create(); + target.getMedicationDispenses(); + + } + + /** + * + * @generated + */ + @Test + public void testGetDrugVehicles() { + + MedicationActivity target = objectFactory.create(); + target.getDrugVehicles(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends MedicationActivityOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public MedicationActivity create() { + return ConsolFactory.eINSTANCE.createMedicationActivity(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends MedicationActivityOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // MedicationActivityOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/MedicationDispenseTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/MedicationDispenseTest.java new file mode 100644 index 000000000..f54e47ff1 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/MedicationDispenseTest.java @@ -0,0 +1,1064 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.AssignedEntity; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.Performer2; +import org.openhealthtools.mdht.uml.cda.Product; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.MedicationDispense; +import org.openhealthtools.mdht.uml.cda.consol.MedicationSupplyOrder; +import org.openhealthtools.mdht.uml.cda.consol.operations.MedicationDispenseOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.AD; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_INT; +import org.openhealthtools.mdht.uml.hl7.datatypes.SXCM_TS; +import org.openhealthtools.mdht.uml.hl7.vocab.ActClassSupply; +import org.openhealthtools.mdht.uml.hl7.vocab.PostalAddressUse; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; +import org.openhealthtools.mdht.uml.hl7.vocab.x_DocumentSubstanceMood; + +/** + * + * A static utility class that provides operations related to 'Medication Dispense' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationDispense#validateMedicationDispenseTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Dispense Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationDispense#validateMedicationDispenseClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Dispense Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationDispense#validateMedicationDispenseEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Dispense Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationDispense#validateMedicationDispenseId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Dispense Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationDispense#validateMedicationDispenseMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Dispense Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationDispense#validateMedicationDispenseRepeatNumber(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Dispense Repeat Number}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationDispense#validateMedicationDispenseStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Dispense Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationDispense#validateMedicationDispenseQuantity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Dispense Quantity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationDispense#validateMedicationDispenseMedicationSupplyOrder(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Dispense Medication Supply Order}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationDispense#validateMedicationDispenseProduct(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Dispense Product}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationDispense#validateMedicationDispensePerformer(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Dispense Performer}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationDispense#validateMedicationDispenseProductContainsMedicationOrImmunization(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Dispense Product Contains Medication Or Immunization}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationDispense#validateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressStreet(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Dispense Performer Medication Dispense Assigned Entity US Realm Address Street}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationDispense#validateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressCity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Dispense Performer Medication Dispense Assigned Entity US Realm Address City}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationDispense#validateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressCountry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Dispense Performer Medication Dispense Assigned Entity US Realm Address Country}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationDispense#validateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressPostalCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Dispense Performer Medication Dispense Assigned Entity US Realm Address Postal Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationDispense#validateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressState(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Dispense Performer Medication Dispense Assigned Entity US Realm Address State}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationDispense#validateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressStreetAddressLine(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Dispense Performer Medication Dispense Assigned Entity US Realm Address Street Address Line}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationDispense#validateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressUseP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Dispense Performer Medication Dispense Assigned Entity US Realm Address Use P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationDispense#validateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressUse(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Dispense Performer Medication Dispense Assigned Entity US Realm Address Use}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationDispense#validateMedicationDispensePerformerMedicationDispenseAssignedEntityAddr(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Dispense Performer Medication Dispense Assigned Entity Addr}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationDispense#validateMedicationDispensePerformerMedicationDispenseAssignedEntity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Dispense Performer Medication Dispense Assigned Entity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationDispense#getMedicationSupplyOrder() Get Medication Supply Order}
  • + *
+ *

+ * + * @generated + */ + +public class MedicationDispenseTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateMedicationDispenseTemplateId() { + OperationsTestCase validateMedicationDispenseTemplateIdTestCase = new OperationsTestCase( + "validateMedicationDispenseTemplateId", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_DISPENSE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationDispense target) { + + } + + @Override + protected void updateToPass(MedicationDispense target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationDispenseOperations.validateMedicationDispenseTemplateId( + (MedicationDispense) objectToTest, diagnostician, map); + } + + }; + + validateMedicationDispenseTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationDispenseClassCode() { + OperationsTestCase validateMedicationDispenseClassCodeTestCase = new OperationsTestCase( + "validateMedicationDispenseClassCode", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_DISPENSE_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationDispense target) { + target.setClassCode(ActClassSupply.DIET); + } + + @Override + protected void updateToPass(MedicationDispense target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationDispenseOperations.validateMedicationDispenseClassCode( + (MedicationDispense) objectToTest, diagnostician, map); + } + + }; + + validateMedicationDispenseClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationDispenseEffectiveTime() { + OperationsTestCase validateMedicationDispenseEffectiveTimeTestCase = new OperationsTestCase( + "validateMedicationDispenseEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_DISPENSE_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationDispense target) { + + } + + @Override + protected void updateToPass(MedicationDispense target) { + target.init(); + + SXCM_TS e = DatatypesFactory.eINSTANCE.createSXCM_TS(); + target.getEffectiveTimes().add(e); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationDispenseOperations.validateMedicationDispenseEffectiveTime( + (MedicationDispense) objectToTest, diagnostician, map); + } + + }; + + validateMedicationDispenseEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationDispenseId() { + OperationsTestCase validateMedicationDispenseIdTestCase = new OperationsTestCase( + "validateMedicationDispenseId", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_DISPENSE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationDispense target) { + + } + + @Override + protected void updateToPass(MedicationDispense target) { + target.init(); + + II ii = DatatypesFactory.eINSTANCE.createII(); + target.getIds().add(ii); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationDispenseOperations.validateMedicationDispenseId( + (MedicationDispense) objectToTest, diagnostician, map); + } + + }; + + validateMedicationDispenseIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationDispenseMoodCode() { + OperationsTestCase validateMedicationDispenseMoodCodeTestCase = new OperationsTestCase( + "validateMedicationDispenseMoodCode", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_DISPENSE_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationDispense target) { + target.setMoodCode(x_DocumentSubstanceMood.INT); + } + + @Override + protected void updateToPass(MedicationDispense target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationDispenseOperations.validateMedicationDispenseMoodCode( + (MedicationDispense) objectToTest, diagnostician, map); + } + + }; + + validateMedicationDispenseMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationDispenseRepeatNumber() { + OperationsTestCase validateMedicationDispenseRepeatNumberTestCase = new OperationsTestCase( + "validateMedicationDispenseRepeatNumber", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_DISPENSE_REPEAT_NUMBER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationDispense target) { + + } + + @Override + protected void updateToPass(MedicationDispense target) { + target.init(); + + IVL_INT value = DatatypesFactory.eINSTANCE.createIVL_INT(); + target.setRepeatNumber(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationDispenseOperations.validateMedicationDispenseRepeatNumber( + (MedicationDispense) objectToTest, diagnostician, map); + } + + }; + + validateMedicationDispenseRepeatNumberTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationDispenseStatusCode() { + OperationsTestCase validateMedicationDispenseStatusCodeTestCase = new OperationsTestCase( + "validateMedicationDispenseStatusCode", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_DISPENSE_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationDispense target) { + + } + + @Override + protected void updateToPass(MedicationDispense target) { + target.init(); + target.setStatusCode(DatatypesFactory.eINSTANCE.createCS("completed")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationDispenseOperations.validateMedicationDispenseStatusCode( + (MedicationDispense) objectToTest, diagnostician, map); + } + + }; + + validateMedicationDispenseStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationDispenseQuantity() { + OperationsTestCase validateMedicationDispenseQuantityTestCase = new OperationsTestCase( + "validateMedicationDispenseQuantity", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_DISPENSE_QUANTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationDispense target) { + + } + + @Override + protected void updateToPass(MedicationDispense target) { + target.init(); + target.setQuantity(DatatypesFactory.eINSTANCE.createPQ()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationDispenseOperations.validateMedicationDispenseQuantity( + (MedicationDispense) objectToTest, diagnostician, map); + } + + }; + + validateMedicationDispenseQuantityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationDispenseProduct() { + OperationsTestCase validateMedicationDispenseProductTestCase = new OperationsTestCase( + "validateMedicationDispenseProduct", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_DISPENSE_PRODUCT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationDispense target) { + target.init(); + } + + @Override + protected void updateToPass(MedicationDispense target) { + target.setProduct(CDAFactory.eINSTANCE.createProduct()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationDispenseOperations.validateMedicationDispenseProduct( + (MedicationDispense) objectToTest, diagnostician, map); + } + + }; + + validateMedicationDispenseProductTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationDispensePerformer() { + OperationsTestCase validateMedicationDispensePerformerTestCase = new OperationsTestCase( + "validateMedicationDispensePerformer", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_DISPENSE_PERFORMER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationDispense target) { + + } + + @Override + protected void updateToPass(MedicationDispense target) { + target.init(); + target.getPerformers().add(CDAFactory.eINSTANCE.createPerformer2()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationDispenseOperations.validateMedicationDispensePerformer( + (MedicationDispense) objectToTest, diagnostician, map); + } + + }; + + validateMedicationDispensePerformerTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationDispenseProductContainsMedicationOrImmunization() { + OperationsTestCase validateMedicationDispenseProductContainsMedicationOrImmunizationTestCase = new OperationsTestCase( + "validateMedicationDispenseProductContainsMedicationOrImmunization", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_DISPENSE_PRODUCT_CONTAINS_MEDICATION_OR_IMMUNIZATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationDispense target) { + target.init(); + Product prod = CDAFactory.eINSTANCE.createProduct(); + target.setProduct(prod); + } + + @Override + protected void updateToPass(MedicationDispense target) { + Product prod = CDAFactory.eINSTANCE.createProduct(); + prod.setManufacturedProduct(ConsolFactory.eINSTANCE.createImmunizationMedicationInformation()); + target.setProduct(prod); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationDispenseOperations.validateMedicationDispenseProductContainsMedicationOrImmunization( + (MedicationDispense) objectToTest, diagnostician, map); + } + + }; + + validateMedicationDispenseProductContainsMedicationOrImmunizationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressStreet() { + OperationsTestCase validateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressStreetTestCase = new OperationsTestCase( + "validateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressStreet", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_DISPENSE_PERFORMER_MEDICATION_DISPENSE_ASSIGNED_ENTITY_US_REALM_ADDRESS_STREET__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + public void addFailTests() { + + addFailTest(new FailTest() { + + @Override + public void updateToFail(MedicationDispense target) { + target.init(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + + ae.getAddrs().add(ad); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(MedicationDispense target) { + target.init(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + + ae.getAddrs().add(ad); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + } + }); + + } + + @Override + protected void updateToPass(MedicationDispense target) { + target.getPerformers().clear(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(createUSRealmAddress()); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationDispenseOperations.validateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressStreet( + (MedicationDispense) objectToTest, diagnostician, map); + } + + }; + + validateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressStreetTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressCity() { + OperationsTestCase validateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressCityTestCase = new OperationsTestCase( + "validateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressCity", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_DISPENSE_PERFORMER_MEDICATION_DISPENSE_ASSIGNED_ENTITY_US_REALM_ADDRESS_CITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationDispense target) { + target.init(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + + ae.getAddrs().add(ad); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + } + + @Override + protected void updateToPass(MedicationDispense target) { + target.getPerformers().clear(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(createUSRealmAddress()); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationDispenseOperations.validateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressCity( + (MedicationDispense) objectToTest, diagnostician, map); + } + + }; + + validateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressCityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressCountry() { + OperationsTestCase validateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressCountryTestCase = new OperationsTestCase( + "validateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressCountry", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_DISPENSE_PERFORMER_MEDICATION_DISPENSE_ASSIGNED_ENTITY_US_REALM_ADDRESS_COUNTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationDispense target) { + target.init(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + + ae.getAddrs().add(ad); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + } + + @Override + protected void updateToPass(MedicationDispense target) { + target.getPerformers().clear(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(createUSRealmAddress()); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationDispenseOperations.validateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressCountry( + (MedicationDispense) objectToTest, diagnostician, map); + } + + }; + + validateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressCountryTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressPostalCode() { + OperationsTestCase validateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressPostalCodeTestCase = new OperationsTestCase( + "validateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressPostalCode", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_DISPENSE_PERFORMER_MEDICATION_DISPENSE_ASSIGNED_ENTITY_US_REALM_ADDRESS_POSTAL_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationDispense target) { + target.init(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + + ae.getAddrs().add(ad); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + } + + @Override + protected void updateToPass(MedicationDispense target) { + target.getPerformers().clear(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(createUSRealmAddress()); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationDispenseOperations.validateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressPostalCode( + (MedicationDispense) objectToTest, diagnostician, map); + } + + }; + + validateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressPostalCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressState() { + OperationsTestCase validateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressStateTestCase = new OperationsTestCase( + "validateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressState", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_DISPENSE_PERFORMER_MEDICATION_DISPENSE_ASSIGNED_ENTITY_US_REALM_ADDRESS_STATE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationDispense target) { + target.init(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + + ae.getAddrs().add(ad); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + } + + @Override + protected void updateToPass(MedicationDispense target) { + target.getPerformers().clear(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(createUSRealmAddress()); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationDispenseOperations.validateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressState( + (MedicationDispense) objectToTest, diagnostician, map); + } + + }; + + validateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressStateTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressStreetAddressLine() { + OperationsTestCase validateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressStreetAddressLineTestCase = new OperationsTestCase( + "validateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressStreetAddressLine", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_DISPENSE_PERFORMER_MEDICATION_DISPENSE_ASSIGNED_ENTITY_US_REALM_ADDRESS_STREET_ADDRESS_LINE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationDispense target) { + target.init(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + + ae.getAddrs().add(ad); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + } + + @Override + protected void updateToPass(MedicationDispense target) { + target.getPerformers().clear(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(createUSRealmAddress()); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationDispenseOperations.validateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressStreetAddressLine( + (MedicationDispense) objectToTest, diagnostician, map); + } + + }; + + validateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressStreetAddressLineTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressUseP() { + OperationsTestCase validateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressUsePTestCase = new OperationsTestCase( + "validateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressUseP", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_DISPENSE_PERFORMER_MEDICATION_DISPENSE_ASSIGNED_ENTITY_US_REALM_ADDRESS_USE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationDispense target) { + target.init(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + + ae.getAddrs().add(ad); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + } + + @Override + protected void updateToPass(MedicationDispense target) { + target.getPerformers().clear(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(createUSRealmAddress()); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationDispenseOperations.validateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressUseP( + (MedicationDispense) objectToTest, diagnostician, map); + } + + }; + + validateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressUsePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressUse() { + OperationsTestCase validateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressUseTestCase = new OperationsTestCase( + "validateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressUse", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_DISPENSE_PERFORMER_MEDICATION_DISPENSE_ASSIGNED_ENTITY_US_REALM_ADDRESS_USE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationDispense target) { + target.init(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + ad.getUses().add(null); + + ae.getAddrs().add(ad); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + } + + @Override + protected void updateToPass(MedicationDispense target) { + target.getPerformers().clear(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(createUSRealmAddress()); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationDispenseOperations.validateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressUse( + (MedicationDispense) objectToTest, diagnostician, map); + } + + }; + + validateMedicationDispensePerformerMedicationDispenseAssignedEntityUSRealmAddressUseTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationDispensePerformerMedicationDispenseAssignedEntityAddr() { + OperationsTestCase validateMedicationDispensePerformerMedicationDispenseAssignedEntityAddrTestCase = new OperationsTestCase( + "validateMedicationDispensePerformerMedicationDispenseAssignedEntityAddr", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_DISPENSE_PERFORMER_MEDICATION_DISPENSE_ASSIGNED_ENTITY_ADDR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationDispense target) { + target.init(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + per.setAssignedEntity(CDAFactory.eINSTANCE.createAssignedEntity()); + target.getPerformers().add(per); + } + + @Override + protected void updateToPass(MedicationDispense target) { + target.getPerformers().clear(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationDispenseOperations.validateMedicationDispensePerformerMedicationDispenseAssignedEntityAddr( + (MedicationDispense) objectToTest, diagnostician, map); + } + + }; + + validateMedicationDispensePerformerMedicationDispenseAssignedEntityAddrTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationDispensePerformerMedicationDispenseAssignedEntity() { + OperationsTestCase validateMedicationDispensePerformerMedicationDispenseAssignedEntityTestCase = new OperationsTestCase( + "validateMedicationDispensePerformerMedicationDispenseAssignedEntity", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_DISPENSE_PERFORMER_MEDICATION_DISPENSE_ASSIGNED_ENTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationDispense target) { + target.init(); + target.getPerformers().add(CDAFactory.eINSTANCE.createPerformer2()); + } + + @Override + protected void updateToPass(MedicationDispense target) { + target.getPerformers().clear(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + per.setAssignedEntity(CDAFactory.eINSTANCE.createAssignedEntity()); + target.getPerformers().add(per); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationDispenseOperations.validateMedicationDispensePerformerMedicationDispenseAssignedEntity( + (MedicationDispense) objectToTest, diagnostician, map); + } + + }; + + validateMedicationDispensePerformerMedicationDispenseAssignedEntityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationDispenseMedicationSupplyOrder() { + OperationsTestCase validateMedicationDispenseMedicationSupplyOrderTestCase = new OperationsTestCase( + "validateMedicationDispenseMedicationSupplyOrder", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_DISPENSE_MEDICATION_SUPPLY_ORDER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationDispense target) { + + } + + @Override + protected void updateToPass(MedicationDispense target) { + target.init(); + MedicationSupplyOrder supply = ConsolFactory.eINSTANCE.createMedicationSupplyOrder().init(); + + target.addSupply(supply); + + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.REFR); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationDispenseOperations.validateMedicationDispenseMedicationSupplyOrder( + (MedicationDispense) objectToTest, diagnostician, map); + } + + }; + + validateMedicationDispenseMedicationSupplyOrderTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetMedicationSupplyOrder() { + + MedicationDispense target = objectFactory.create(); + target.getMedicationSupplyOrder(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends MedicationDispenseOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public MedicationDispense create() { + return ConsolFactory.eINSTANCE.createMedicationDispense(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends MedicationDispenseOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + + private AD createUSRealmAddress() { + AD addr = DatatypesFactory.eINSTANCE.createAD(); + addr.getUses().add(PostalAddressUse.HP); + addr.addStreetAddressLine("123 Main Street"); + addr.addCity("Boston"); + addr.addState("MA"); + addr.addCountry("US"); + addr.addPostalCode("01001"); + + return addr; + + } + +} // MedicationDispenseOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/MedicationInformationTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/MedicationInformationTest.java new file mode 100644 index 000000000..e04df63a5 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/MedicationInformationTest.java @@ -0,0 +1,522 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Material; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.MedicationInformation; +import org.openhealthtools.mdht.uml.cda.consol.operations.MedicationInformationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; +import org.openhealthtools.mdht.uml.hl7.datatypes.TEL; + +/** + * + * A static utility class that provides operations related to 'Medication Information' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationInformation#validateMedicationInformationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Information Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationInformation#validateMedicationInformationId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Information Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationInformation#validateMedicationInformationClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Information Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationInformation#validateMedicationInformationManufacturerOrganization(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Information Manufacturer Organization}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationInformation#validateMedicationInformationManufacturedMaterial(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Information Manufactured Material}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationInformation#validateMedicationInformationMedicationInformationManufacturedMaterialCodeOriginalText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Information Medication Information Manufactured Material Code Original Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationInformation#validateMedicationInformationMedicationInformationManufacturedMaterialReference(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Information Medication Information Manufactured Material Reference}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationInformation#validateMedicationInformationMedicationInformationManufacturedMaterialOriginalTextReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Information Medication Information Manufactured Material Original Text Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationInformation#validateMedicationInformationMedicationInformationManufacturedMaterialCodeTranslation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Information Medication Information Manufactured Material Code Translation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationInformation#validateMedicationInformationMedicationInformationManufacturedMaterialCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Information Medication Information Manufactured Material Code}
  • + *
+ *

+ * + * @generated + */ + +public class MedicationInformationTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationInformationTemplateId() { + OperationsTestCase validateMedicationInformationTemplateIdTestCase = new OperationsTestCase( + "validateMedicationInformationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_INFORMATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationInformation target) { + + } + + @Override + protected void updateToPass(MedicationInformation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationInformationOperations.validateMedicationInformationTemplateId( + (MedicationInformation) objectToTest, diagnostician, map); + } + + }; + + validateMedicationInformationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationInformationId() { + OperationsTestCase validateMedicationInformationIdTestCase = new OperationsTestCase( + "validateMedicationInformationId", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_INFORMATION_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationInformation target) { + target.init(); + } + + @Override + protected void updateToPass(MedicationInformation target) { + + target.getIds().add(DatatypesFactory.eINSTANCE.createII()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationInformationOperations.validateMedicationInformationId( + (MedicationInformation) objectToTest, diagnostician, map); + } + + }; + + validateMedicationInformationIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationInformationClassCode() { + OperationsTestCase validateMedicationInformationClassCodeTestCase = new OperationsTestCase( + "validateMedicationInformationClassCode", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_INFORMATION_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationInformation target) { + + } + + @Override + protected void updateToPass(MedicationInformation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationInformationOperations.validateMedicationInformationClassCode( + (MedicationInformation) objectToTest, diagnostician, map); + } + + }; + + validateMedicationInformationClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationInformationManufacturedMaterial() { + OperationsTestCase validateMedicationInformationManufacturedMaterialTestCase = new OperationsTestCase( + "validateMedicationInformationManufacturedMaterial", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_INFORMATION_MANUFACTURED_MATERIAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationInformation target) { + target.init(); + } + + @Override + protected void updateToPass(MedicationInformation target) { + target.setManufacturedMaterial(CDAFactory.eINSTANCE.createMaterial()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationInformationOperations.validateMedicationInformationManufacturedMaterial( + (MedicationInformation) objectToTest, diagnostician, map); + } + + }; + + validateMedicationInformationManufacturedMaterialTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationInformationMedicationInformationManufacturedMaterialCodeOriginalText() { + OperationsTestCase validateMedicationInformationMedicationInformationManufacturedMaterialCodeOriginalTextTestCase = new OperationsTestCase( + "validateMedicationInformationMedicationInformationManufacturedMaterialCodeOriginalText", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_INFORMATION_MEDICATION_INFORMATION_MANUFACTURED_MATERIAL_CODE_ORIGINAL_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationInformation target) { + target.init(); + Material material = CDAFactory.eINSTANCE.createMaterial(); + // DatatypesFactory.eINSTANCE.createED(); + CE ce = DatatypesFactory.eINSTANCE.createCE(); + material.setCode(ce); + target.setManufacturedMaterial(material); + + } + + @Override + protected void updateToPass(MedicationInformation target) { + target.init(); + + Material material = CDAFactory.eINSTANCE.createMaterial(); + ED text = DatatypesFactory.eINSTANCE.createED(); + CE ce = DatatypesFactory.eINSTANCE.createCE(); + ce.setOriginalText(text); + material.setCode(ce); + target.setManufacturedMaterial(material); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationInformationOperations.validateMedicationInformationMedicationInformationManufacturedMaterialCodeOriginalText( + (MedicationInformation) objectToTest, diagnostician, map); + } + + }; + + validateMedicationInformationMedicationInformationManufacturedMaterialCodeOriginalTextTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationInformationMedicationInformationManufacturedMaterialReference() { + OperationsTestCase validateMedicationInformationMedicationInformationManufacturedMaterialReferenceTestCase = new OperationsTestCase( + "validateMedicationInformationMedicationInformationManufacturedMaterialReference", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_INFORMATION_MEDICATION_INFORMATION_MANUFACTURED_MATERIAL_REFERENCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationInformation target) { + target.init(); + Material material = CDAFactory.eINSTANCE.createMaterial(); + ED text = DatatypesFactory.eINSTANCE.createED(); + CE ce = DatatypesFactory.eINSTANCE.createCE(); + ce.setOriginalText(text); + material.setCode(ce); + target.setManufacturedMaterial(material); + } + + @Override + protected void updateToPass(MedicationInformation target) { + target.init(); + Material material = CDAFactory.eINSTANCE.createMaterial(); + ED text = DatatypesFactory.eINSTANCE.createED(); + CE ce = DatatypesFactory.eINSTANCE.createCE(); + ce.setOriginalText(text); + TEL tel = DatatypesFactory.eINSTANCE.createTEL(); + tel.setValue("aaaaaaaaaaaaaaaaaaaaa"); + text.setReference(tel); + material.setCode(ce); + target.setManufacturedMaterial(material); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationInformationOperations.validateMedicationInformationMedicationInformationManufacturedMaterialReference( + (MedicationInformation) objectToTest, diagnostician, map); + } + + }; + + validateMedicationInformationMedicationInformationManufacturedMaterialReferenceTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationInformationMedicationInformationManufacturedMaterialOriginalTextReferenceValue() { + OperationsTestCase validateMedicationInformationMedicationInformationManufacturedMaterialOriginalTextReferenceValueTestCase = new OperationsTestCase( + "validateMedicationInformationMedicationInformationManufacturedMaterialOriginalTextReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_INFORMATION_MEDICATION_INFORMATION_MANUFACTURED_MATERIAL_ORIGINAL_TEXT_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationInformation target) { + target.init(); + Material material = CDAFactory.eINSTANCE.createMaterial(); + ED text = DatatypesFactory.eINSTANCE.createED(); + CE ce = DatatypesFactory.eINSTANCE.createCE(); + ce.setOriginalText(text); + TEL tel = DatatypesFactory.eINSTANCE.createTEL(); + text.setReference(tel); + material.setCode(ce); + target.setManufacturedMaterial(material); + } + + @Override + protected void updateToPass(MedicationInformation target) { + target.init(); + Material material = CDAFactory.eINSTANCE.createMaterial(); + ED text = DatatypesFactory.eINSTANCE.createED(); + CE ce = DatatypesFactory.eINSTANCE.createCE(); + ce.setOriginalText(text); + TEL tel = DatatypesFactory.eINSTANCE.createTEL(); + tel.setValue("aaaaaaaaaaaaaaaaaaaaa"); + text.setReference(tel); + material.setCode(ce); + target.setManufacturedMaterial(material); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationInformationOperations.validateMedicationInformationMedicationInformationManufacturedMaterialOriginalTextReferenceValue( + (MedicationInformation) objectToTest, diagnostician, map); + } + + }; + + validateMedicationInformationMedicationInformationManufacturedMaterialOriginalTextReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationInformationMedicationInformationManufacturedMaterialCodeTranslation() { + OperationsTestCase validateMedicationInformationMedicationInformationManufacturedMaterialCodeTranslationTestCase = new OperationsTestCase( + "validateMedicationInformationMedicationInformationManufacturedMaterialCodeTranslation", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_INFORMATION_MEDICATION_INFORMATION_MANUFACTURED_MATERIAL_CODE_TRANSLATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationInformation target) { + target.init(); + Material material = CDAFactory.eINSTANCE.createMaterial(); + // DatatypesFactory.eINSTANCE.createED(); + CE ce = DatatypesFactory.eINSTANCE.createCE(); + material.setCode(ce); + target.setManufacturedMaterial(material); + } + + @Override + protected void updateToPass(MedicationInformation target) { + target.init(); + Material material = CDAFactory.eINSTANCE.createMaterial(); + CE ce = DatatypesFactory.eINSTANCE.createCE(); + material.setCode(ce); + ce.getTranslations().add(DatatypesFactory.eINSTANCE.createCD()); + target.setManufacturedMaterial(material); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationInformationOperations.validateMedicationInformationMedicationInformationManufacturedMaterialCodeTranslation( + (MedicationInformation) objectToTest, diagnostician, map); + } + + }; + + validateMedicationInformationMedicationInformationManufacturedMaterialCodeTranslationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationInformationMedicationInformationManufacturedMaterialCode() { + OperationsTestCase validateMedicationInformationMedicationInformationManufacturedMaterialCodeTestCase = new OperationsTestCase( + "validateMedicationInformationMedicationInformationManufacturedMaterialCode", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_INFORMATION_MEDICATION_INFORMATION_MANUFACTURED_MATERIAL_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationInformation target) { + target.init(); + Material material = CDAFactory.eINSTANCE.createMaterial(); + CE ce = DatatypesFactory.eINSTANCE.createCE(); + material.setCode(ce); + target.setManufacturedMaterial(material); + } + + @Override + protected void updateToPass(MedicationInformation target) { + // target.init(); + Material material = CDAFactory.eINSTANCE.createMaterial(); + CE ce = DatatypesFactory.eINSTANCE.createCE(); + material.setCode(ce); + ce.setCodeSystem("2.16.840.1.113883.6.88"); + ce.setCode("16552"); + target.setManufacturedMaterial(material); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationInformationOperations.validateMedicationInformationMedicationInformationManufacturedMaterialCode( + (MedicationInformation) objectToTest, diagnostician, map); + } + + }; + + validateMedicationInformationMedicationInformationManufacturedMaterialCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationInformationManufacturerOrganization() { + OperationsTestCase validateMedicationInformationManufacturerOrganizationTestCase = new OperationsTestCase( + "validateMedicationInformationManufacturerOrganization", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_INFORMATION_MANUFACTURER_ORGANIZATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationInformation target) { + target.init(); + } + + @Override + protected void updateToPass(MedicationInformation target) { + + target.setManufacturerOrganization(CDAFactory.eINSTANCE.createOrganization()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationInformationOperations.validateMedicationInformationManufacturerOrganization( + (MedicationInformation) objectToTest, diagnostician, map); + } + + }; + + validateMedicationInformationManufacturerOrganizationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends MedicationInformationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public MedicationInformation create() { + return ConsolFactory.eINSTANCE.createMedicationInformation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends MedicationInformationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // MedicationInformationOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/MedicationSupplyOrderTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/MedicationSupplyOrderTest.java new file mode 100644 index 000000000..f785199b0 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/MedicationSupplyOrderTest.java @@ -0,0 +1,676 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.Product; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.Instructions; +import org.openhealthtools.mdht.uml.cda.consol.MedicationSupplyOrder; +import org.openhealthtools.mdht.uml.cda.consol.operations.MedicationSupplyOrderOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_INT; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.datatypes.PQ; +import org.openhealthtools.mdht.uml.hl7.vocab.ActClassSupply; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * + * A static utility class that provides operations related to 'Medication Supply Order' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationSupplyOrder#validateMedicationSupplyOrderInstructionInversionInd(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Supply Order Instruction Inversion Ind}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationSupplyOrder#validateMedicationSupplyOrderEffectiveTimeHigh(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Supply Order Effective Time High}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationSupplyOrder#validateMedicationSupplyOrderTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Supply Order Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationSupplyOrder#validateMedicationSupplyOrderClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Supply Order Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationSupplyOrder#validateMedicationSupplyOrderEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Supply Order Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationSupplyOrder#validateMedicationSupplyOrderMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Supply Order Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationSupplyOrder#validateMedicationSupplyOrderQuantity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Supply Order Quantity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationSupplyOrder#validateMedicationSupplyOrderRepeatNumber(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Supply Order Repeat Number}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationSupplyOrder#validateMedicationSupplyOrderStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Supply Order Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationSupplyOrder#validateMedicationSupplyOrderId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Supply Order Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationSupplyOrder#validateMedicationSupplyOrderProduct(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Supply Order Product}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationSupplyOrder#validateMedicationSupplyOrderAuthor(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Supply Order Author}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationSupplyOrder#validateMedicationSupplyOrderInstructions(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Supply Order Instructions}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationSupplyOrder#validateMedicationSupplyOrderProductContainsMedicationOrImmunization(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Supply Order Product Contains Medication Or Immunization}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationSupplyOrder#getInstructions() Get Instructions}
  • + *
+ *

+ * + * @generated + */ + +public class MedicationSupplyOrderTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationSupplyOrderInstructionInversionInd() { + OperationsTestCase validateMedicationSupplyOrderInstructionInversionIndTestCase = new OperationsTestCase( + "validateMedicationSupplyOrderInstructionInversionInd", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_SUPPLY_ORDER_INSTRUCTION_INVERSION_IND__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationSupplyOrder target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + + er.setAct(ConsolFactory.eINSTANCE.createInstructions()); + target.getEntryRelationships().add(er); + } + + @Override + public void addPassTests() { + + addPassTest(new PassTest() { + + @Override + public void updateToPass(MedicationSupplyOrder target) { + // Test case with only entry Relationship + // Should pass + target.getEntryRelationships().clear(); + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + target.getEntryRelationships().add(er); + } + + }); + } + + @Override + protected void updateToPass(MedicationSupplyOrder target) { + target.getEntryRelationships().clear(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + er.setInversionInd(true); + er.setAct(ConsolFactory.eINSTANCE.createInstructions()); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationSupplyOrderOperations.validateMedicationSupplyOrderInstructionInversionInd( + (MedicationSupplyOrder) objectToTest, diagnostician, map); + } + + }; + + validateMedicationSupplyOrderInstructionInversionIndTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationSupplyOrderEffectiveTimeHigh() { + OperationsTestCase validateMedicationSupplyOrderEffectiveTimeHighTestCase = new OperationsTestCase( + "validateMedicationSupplyOrderEffectiveTimeHigh", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_SUPPLY_ORDER_EFFECTIVE_TIME_HIGH__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationSupplyOrder target) { + target.init(); + IVL_TS e = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.getEffectiveTimes().add(e); + } + + @Override + protected void updateToPass(MedicationSupplyOrder target) { + target.getEffectiveTimes().clear(); + + IVL_TS e = DatatypesFactory.eINSTANCE.createIVL_TS(); + e.setHigh(DatatypesFactory.eINSTANCE.createIVXB_TS()); + target.getEffectiveTimes().add(e); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationSupplyOrderOperations.validateMedicationSupplyOrderEffectiveTimeHigh( + (MedicationSupplyOrder) objectToTest, diagnostician, map); + } + + }; + + validateMedicationSupplyOrderEffectiveTimeHighTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicationSupplyOrderTemplateId() { + OperationsTestCase validateMedicationSupplyOrderTemplateIdTestCase = new OperationsTestCase( + "validateMedicationSupplyOrderTemplateId", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_SUPPLY_ORDER_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationSupplyOrder target) { + + } + + @Override + protected void updateToPass(MedicationSupplyOrder target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationSupplyOrderOperations.validateMedicationSupplyOrderTemplateId( + (MedicationSupplyOrder) objectToTest, diagnostician, map); + } + + }; + + validateMedicationSupplyOrderTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationSupplyOrderClassCode() { + OperationsTestCase validateMedicationSupplyOrderClassCodeTestCase = new OperationsTestCase( + "validateMedicationSupplyOrderClassCode", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_SUPPLY_ORDER_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationSupplyOrder target) { + target.setClassCode(ActClassSupply.DIET); + } + + @Override + protected void updateToPass(MedicationSupplyOrder target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationSupplyOrderOperations.validateMedicationSupplyOrderClassCode( + (MedicationSupplyOrder) objectToTest, diagnostician, map); + } + + }; + + validateMedicationSupplyOrderClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationSupplyOrderEffectiveTime() { + OperationsTestCase validateMedicationSupplyOrderEffectiveTimeTestCase = new OperationsTestCase( + "validateMedicationSupplyOrderEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_SUPPLY_ORDER_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationSupplyOrder target) { + target.init(); + target.getEffectiveTimes().clear(); + } + + @Override + protected void updateToPass(MedicationSupplyOrder target) { + + IVL_TS e = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.getEffectiveTimes().add(e); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationSupplyOrderOperations.validateMedicationSupplyOrderEffectiveTime( + (MedicationSupplyOrder) objectToTest, diagnostician, map); + } + + }; + + validateMedicationSupplyOrderEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicationSupplyOrderMoodCode() { + OperationsTestCase validateMedicationSupplyOrderMoodCodeTestCase = new OperationsTestCase( + "validateMedicationSupplyOrderMoodCode", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_SUPPLY_ORDER_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationSupplyOrder target) { + + } + + @Override + protected void updateToPass(MedicationSupplyOrder target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationSupplyOrderOperations.validateMedicationSupplyOrderMoodCode( + (MedicationSupplyOrder) objectToTest, diagnostician, map); + } + + }; + + validateMedicationSupplyOrderMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationSupplyOrderQuantity() { + OperationsTestCase validateMedicationSupplyOrderQuantityTestCase = new OperationsTestCase( + "validateMedicationSupplyOrderQuantity", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_SUPPLY_ORDER_QUANTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationSupplyOrder target) { + + } + + @Override + protected void updateToPass(MedicationSupplyOrder target) { + target.init(); + + PQ value = DatatypesFactory.eINSTANCE.createPQ(); + target.setQuantity(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationSupplyOrderOperations.validateMedicationSupplyOrderQuantity( + (MedicationSupplyOrder) objectToTest, diagnostician, map); + } + + }; + + validateMedicationSupplyOrderQuantityTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationSupplyOrderRepeatNumber() { + OperationsTestCase validateMedicationSupplyOrderRepeatNumberTestCase = new OperationsTestCase( + "validateMedicationSupplyOrderRepeatNumber", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_SUPPLY_ORDER_REPEAT_NUMBER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationSupplyOrder target) { + + } + + @Override + protected void updateToPass(MedicationSupplyOrder target) { + target.init(); + + IVL_INT value = DatatypesFactory.eINSTANCE.createIVL_INT(); + target.setRepeatNumber(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationSupplyOrderOperations.validateMedicationSupplyOrderRepeatNumber( + (MedicationSupplyOrder) objectToTest, diagnostician, map); + } + + }; + + validateMedicationSupplyOrderRepeatNumberTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicationSupplyOrderStatusCode() { + OperationsTestCase validateMedicationSupplyOrderStatusCodeTestCase = new OperationsTestCase( + "validateMedicationSupplyOrderStatusCode", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_SUPPLY_ORDER_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationSupplyOrder target) { + + } + + @Override + protected void updateToPass(MedicationSupplyOrder target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationSupplyOrderOperations.validateMedicationSupplyOrderStatusCode( + (MedicationSupplyOrder) objectToTest, diagnostician, map); + } + + }; + + validateMedicationSupplyOrderStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationSupplyOrderId() { + OperationsTestCase validateMedicationSupplyOrderIdTestCase = new OperationsTestCase( + "validateMedicationSupplyOrderId", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_SUPPLY_ORDER_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationSupplyOrder target) { + + } + + @Override + protected void updateToPass(MedicationSupplyOrder target) { + target.init(); + + II ii = DatatypesFactory.eINSTANCE.createII(); + target.getIds().add(ii); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationSupplyOrderOperations.validateMedicationSupplyOrderId( + (MedicationSupplyOrder) objectToTest, diagnostician, map); + } + + }; + + validateMedicationSupplyOrderIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationSupplyOrderProduct() { + OperationsTestCase validateMedicationSupplyOrderProductTestCase = new OperationsTestCase( + "validateMedicationSupplyOrderProduct", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_SUPPLY_ORDER_PRODUCT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationSupplyOrder target) { + target.init(); + } + + @Override + protected void updateToPass(MedicationSupplyOrder target) { + target.setProduct(CDAFactory.eINSTANCE.createProduct()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationSupplyOrderOperations.validateMedicationSupplyOrderProduct( + (MedicationSupplyOrder) objectToTest, diagnostician, map); + } + + }; + + validateMedicationSupplyOrderProductTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationSupplyOrderAuthor() { + OperationsTestCase validateMedicationSupplyOrderAuthorTestCase = new OperationsTestCase( + "validateMedicationSupplyOrderAuthor", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_SUPPLY_ORDER_AUTHOR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationSupplyOrder target) { + + } + + @Override + protected void updateToPass(MedicationSupplyOrder target) { + target.init(); + target.getAuthors().add(CDAFactory.eINSTANCE.createAuthor()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationSupplyOrderOperations.validateMedicationSupplyOrderAuthor( + (MedicationSupplyOrder) objectToTest, diagnostician, map); + } + + }; + + validateMedicationSupplyOrderAuthorTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationSupplyOrderInstructions() { + OperationsTestCase validateMedicationSupplyOrderInstructionsTestCase = new OperationsTestCase( + "validateMedicationSupplyOrderInstructions", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_SUPPLY_ORDER_INSTRUCTIONS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationSupplyOrder target) { + + } + + @Override + protected void updateToPass(MedicationSupplyOrder target) { + target.init(); + Instructions instructions = ConsolFactory.eINSTANCE.createInstructions().init(); + target.addAct(instructions); + for (org.openhealthtools.mdht.uml.cda.EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationSupplyOrderOperations.validateMedicationSupplyOrderInstructions( + (MedicationSupplyOrder) objectToTest, diagnostician, map); + } + + }; + + validateMedicationSupplyOrderInstructionsTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationSupplyOrderProductContainsMedicationOrImmunization() { + OperationsTestCase validateMedicationSupplyOrderProductContainsMedicationOrImmunizationTestCase = new OperationsTestCase( + "validateMedicationSupplyOrderProductContainsMedicationOrImmunization", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_SUPPLY_ORDER_PRODUCT_CONTAINS_MEDICATION_OR_IMMUNIZATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationSupplyOrder target) { + target.init(); + Product prod = CDAFactory.eINSTANCE.createProduct(); + target.setProduct(prod); + + } + + @Override + protected void updateToPass(MedicationSupplyOrder target) { + Product prod = CDAFactory.eINSTANCE.createProduct(); + prod.setManufacturedProduct(ConsolFactory.eINSTANCE.createImmunizationMedicationInformation()); + target.setProduct(prod); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationSupplyOrderOperations.validateMedicationSupplyOrderProductContainsMedicationOrImmunization( + (MedicationSupplyOrder) objectToTest, diagnostician, map); + } + + }; + + validateMedicationSupplyOrderProductContainsMedicationOrImmunizationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetInstructions() { + + MedicationSupplyOrder target = objectFactory.create(); + target.getInstructions(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends MedicationSupplyOrderOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public MedicationSupplyOrder create() { + return ConsolFactory.eINSTANCE.createMedicationSupplyOrder(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends MedicationSupplyOrderOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // MedicationSupplyOrderOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/MedicationUseNoneKnownTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/MedicationUseNoneKnownTest.java new file mode 100644 index 000000000..f00341a6a --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/MedicationUseNoneKnownTest.java @@ -0,0 +1,632 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ConsolPackage; +import org.openhealthtools.mdht.uml.cda.consol.GeneralStatusSection; +import org.openhealthtools.mdht.uml.cda.consol.MedicationUseNoneKnown; +import org.openhealthtools.mdht.uml.cda.consol.operations.MedicationUseNoneKnownOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; + +/** + * + * A static utility class that provides operations related to 'Medication Use None Known' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationUseNoneKnown#validateMedicationUseNoneKnownTextReference(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Use None Known Text Reference}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationUseNoneKnown#validateMedicationUseNoneKnownTextReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Use None Known Text Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationUseNoneKnown#validateMedicationUseNoneKnownReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Use None Known Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationUseNoneKnown#validateMedicationUseNoneKnownTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Use None Known Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationUseNoneKnown#validateMedicationUseNoneKnownClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Use None Known Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationUseNoneKnown#validateMedicationUseNoneKnownMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Use None Known Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationUseNoneKnown#validateMedicationUseNoneKnownId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Use None Known Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationUseNoneKnown#validateMedicationUseNoneKnownCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Use None Known Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationUseNoneKnown#validateMedicationUseNoneKnownCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Use None Known Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationUseNoneKnown#validateMedicationUseNoneKnownEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Use None Known Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationUseNoneKnown#validateMedicationUseNoneKnownStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Use None Known Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationUseNoneKnown#validateMedicationUseNoneKnownStatusCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Use None Known Status Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationUseNoneKnown#validateMedicationUseNoneKnownText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Use None Known Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationUseNoneKnown#validateMedicationUseNoneKnownValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Use None Known Value}
  • + *
+ *

+ * + * @generated + */ + +public class MedicationUseNoneKnownTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationUseNoneKnownTextReference() { + OperationsTestCase validateMedicationUseNoneKnownTextReferenceTestCase = new OperationsTestCase( + "validateMedicationUseNoneKnownTextReference", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_USE_NONE_KNOWN_TEXT_REFERENCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationUseNoneKnown target) { + target.init(); + ED txt = DatatypesFactory.eINSTANCE.createED(); + target.setText(txt); + } + + @Override + protected void updateToPass(MedicationUseNoneKnown target) { + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL()); + target.setText(txt); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationUseNoneKnownOperations.validateMedicationUseNoneKnownTextReference( + (MedicationUseNoneKnown) objectToTest, diagnostician, map); + } + + }; + + validateMedicationUseNoneKnownTextReferenceTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationUseNoneKnownTextReferenceValue() { + OperationsTestCase validateMedicationUseNoneKnownTextReferenceValueTestCase = new OperationsTestCase( + "validateMedicationUseNoneKnownTextReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_USE_NONE_KNOWN_TEXT_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationUseNoneKnown target) { + target.init(); + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL()); + target.setText(txt); + } + + @Override + protected void updateToPass(MedicationUseNoneKnown target) { + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL("test")); + target.setText(txt); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationUseNoneKnownOperations.validateMedicationUseNoneKnownTextReferenceValue( + (MedicationUseNoneKnown) objectToTest, diagnostician, map); + } + + }; + + validateMedicationUseNoneKnownTextReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationUseNoneKnownReferenceValue() { + OperationsTestCase validateMedicationUseNoneKnownReferenceValueTestCase = new NarrativeReferenceTestCase( + "validateMedicationUseNoneKnownReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_USE_NONE_KNOWN_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationUseNoneKnown target) { + target.init(); + + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), "", + "No particular health status observed."); + + // add a reference to the section text + target.setText(createEDWithReference("Some sample text", "#1.2.3.4")); + } + + @Override + protected void updateToPass(MedicationUseNoneKnown target) { + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), + "1.2.3.4", "No particular health status observed."); + + // add a reference to the section text + target.setText(createEDWithReference("Some sample text", "#1.2.3.4")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationUseNoneKnownOperations.validateMedicationUseNoneKnownReferenceValue( + (MedicationUseNoneKnown) objectToTest, diagnostician, map); + } + + }; + + validateMedicationUseNoneKnownReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicationUseNoneKnownTemplateId() { + OperationsTestCase validateMedicationUseNoneKnownTemplateIdTestCase = new OperationsTestCase( + "validateMedicationUseNoneKnownTemplateId", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_USE_NONE_KNOWN_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationUseNoneKnown target) { + + } + + @Override + protected void updateToPass(MedicationUseNoneKnown target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationUseNoneKnownOperations.validateMedicationUseNoneKnownTemplateId( + (MedicationUseNoneKnown) objectToTest, diagnostician, map); + } + + }; + + validateMedicationUseNoneKnownTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicationUseNoneKnownClassCode() { + OperationsTestCase validateMedicationUseNoneKnownClassCodeTestCase = new OperationsTestCase( + "validateMedicationUseNoneKnownClassCode", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_USE_NONE_KNOWN_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationUseNoneKnown target) { + + } + + @Override + protected void updateToPass(MedicationUseNoneKnown target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationUseNoneKnownOperations.validateMedicationUseNoneKnownClassCode( + (MedicationUseNoneKnown) objectToTest, diagnostician, map); + } + + }; + + validateMedicationUseNoneKnownClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicationUseNoneKnownMoodCode() { + OperationsTestCase validateMedicationUseNoneKnownMoodCodeTestCase = new OperationsTestCase( + "validateMedicationUseNoneKnownMoodCode", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_USE_NONE_KNOWN_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationUseNoneKnown target) { + + } + + @Override + protected void updateToPass(MedicationUseNoneKnown target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationUseNoneKnownOperations.validateMedicationUseNoneKnownMoodCode( + (MedicationUseNoneKnown) objectToTest, diagnostician, map); + } + + }; + + validateMedicationUseNoneKnownMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationUseNoneKnownId() { + OperationsTestCase validateMedicationUseNoneKnownIdTestCase = new OperationsTestCase( + "validateMedicationUseNoneKnownId", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_USE_NONE_KNOWN_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationUseNoneKnown target) { + + } + + @Override + protected void updateToPass(MedicationUseNoneKnown target) { + target.init(); + target.getIds().add(DatatypesFactory.eINSTANCE.createII()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationUseNoneKnownOperations.validateMedicationUseNoneKnownId( + (MedicationUseNoneKnown) objectToTest, diagnostician, map); + } + + }; + + validateMedicationUseNoneKnownIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicationUseNoneKnownCodeP() { + OperationsTestCase validateMedicationUseNoneKnownCodePTestCase = new OperationsTestCase( + "validateMedicationUseNoneKnownCodeP", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_USE_NONE_KNOWN_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationUseNoneKnown target) { + + } + + @Override + protected void updateToPass(MedicationUseNoneKnown target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationUseNoneKnownOperations.validateMedicationUseNoneKnownCodeP( + (MedicationUseNoneKnown) objectToTest, diagnostician, map); + } + + }; + + validateMedicationUseNoneKnownCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicationUseNoneKnownCode() { + OperationsTestCase validateMedicationUseNoneKnownCodeTestCase = new OperationsTestCase( + "validateMedicationUseNoneKnownCode", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_USE_NONE_KNOWN_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationUseNoneKnown target) { + + } + + @Override + protected void updateToPass(MedicationUseNoneKnown target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationUseNoneKnownOperations.validateMedicationUseNoneKnownCode( + (MedicationUseNoneKnown) objectToTest, diagnostician, map); + } + + }; + + validateMedicationUseNoneKnownCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicationUseNoneKnownEffectiveTime() { + OperationsTestCase validateMedicationUseNoneKnownEffectiveTimeTestCase = new OperationsTestCase( + "validateMedicationUseNoneKnownEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_USE_NONE_KNOWN_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationUseNoneKnown target) { + + } + + @Override + protected void updateToPass(MedicationUseNoneKnown target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationUseNoneKnownOperations.validateMedicationUseNoneKnownEffectiveTime( + (MedicationUseNoneKnown) objectToTest, diagnostician, map); + } + + }; + + validateMedicationUseNoneKnownEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicationUseNoneKnownStatusCode() { + OperationsTestCase validateMedicationUseNoneKnownStatusCodeTestCase = new OperationsTestCase( + "validateMedicationUseNoneKnownStatusCode", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_USE_NONE_KNOWN_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationUseNoneKnown target) { + + } + + @Override + protected void updateToPass(MedicationUseNoneKnown target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationUseNoneKnownOperations.validateMedicationUseNoneKnownStatusCode( + (MedicationUseNoneKnown) objectToTest, diagnostician, map); + } + + }; + + validateMedicationUseNoneKnownStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicationUseNoneKnownStatusCodeP() { + OperationsTestCase validateMedicationUseNoneKnownStatusCodePTestCase = new OperationsTestCase( + "validateMedicationUseNoneKnownStatusCodeP", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_USE_NONE_KNOWN_STATUS_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationUseNoneKnown target) { + + } + + @Override + protected void updateToPass(MedicationUseNoneKnown target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationUseNoneKnownOperations.validateMedicationUseNoneKnownStatusCodeP( + (MedicationUseNoneKnown) objectToTest, diagnostician, map); + } + + }; + + validateMedicationUseNoneKnownStatusCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicationUseNoneKnownText() { + OperationsTestCase validateMedicationUseNoneKnownTextTestCase = new OperationsTestCase( + "validateMedicationUseNoneKnownText", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_USE_NONE_KNOWN_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationUseNoneKnown target) { + + } + + @Override + protected void updateToPass(MedicationUseNoneKnown target) { + target.init(); + + ED text = DatatypesFactory.eINSTANCE.createED(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationUseNoneKnownOperations.validateMedicationUseNoneKnownText( + (MedicationUseNoneKnown) objectToTest, diagnostician, map); + } + + }; + + validateMedicationUseNoneKnownTextTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationUseNoneKnownValue() { + OperationsTestCase validateMedicationUseNoneKnownValueTestCase = new OperationsTestCase( + "validateMedicationUseNoneKnownValue", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_USE_NONE_KNOWN_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationUseNoneKnown target) { + + } + + @Override + protected void updateToPass(MedicationUseNoneKnown target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD("182904002", "2.16.840.1.113883.6.96", "", ""); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationUseNoneKnownOperations.validateMedicationUseNoneKnownValue( + (MedicationUseNoneKnown) objectToTest, diagnostician, map); + } + + }; + + validateMedicationUseNoneKnownValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends MedicationUseNoneKnownOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public MedicationUseNoneKnown create() { + return ConsolFactory.eINSTANCE.createMedicationUseNoneKnown(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends MedicationUseNoneKnownOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // MedicationUseNoneKnownOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/MedicationsAdministeredSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/MedicationsAdministeredSectionTest.java new file mode 100644 index 000000000..90e88072a --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/MedicationsAdministeredSectionTest.java @@ -0,0 +1,338 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.MedicationsAdministeredSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.MedicationsAdministeredSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Medications Administered Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationsAdministeredSection#validateMedicationsAdministeredSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medications Administered Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationsAdministeredSection#validateMedicationsAdministeredSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medications Administered Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationsAdministeredSection#validateMedicationsAdministeredSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medications Administered Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationsAdministeredSection#validateMedicationsAdministeredSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medications Administered Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationsAdministeredSection#validateMedicationsAdministeredSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medications Administered Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationsAdministeredSection#validateMedicationsAdministeredSectionMedicationActivity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medications Administered Section Medication Activity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationsAdministeredSection#getMedicationActivities() Get Medication Activities}
  • + *
+ *

+ * + * @generated + */ + +public class MedicationsAdministeredSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateMedicationsAdministeredSectionTemplateId() { + OperationsTestCase validateMedicationsAdministeredSectionTemplateIdTestCase = new OperationsTestCase( + "validateMedicationsAdministeredSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_MEDICATIONS_ADMINISTERED_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationsAdministeredSection target) { + + } + + @Override + protected void updateToPass(MedicationsAdministeredSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationsAdministeredSectionOperations.validateMedicationsAdministeredSectionTemplateId( + (MedicationsAdministeredSection) objectToTest, diagnostician, map); + } + + }; + + validateMedicationsAdministeredSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicationsAdministeredSectionCode() { + OperationsTestCase validateMedicationsAdministeredSectionCodeTestCase = new OperationsTestCase( + "validateMedicationsAdministeredSectionCode", + operationsForOCL.getOCLValue("VALIDATE_MEDICATIONS_ADMINISTERED_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationsAdministeredSection target) { + + } + + @Override + protected void updateToPass(MedicationsAdministeredSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationsAdministeredSectionOperations.validateMedicationsAdministeredSectionCode( + (MedicationsAdministeredSection) objectToTest, diagnostician, map); + } + + }; + + validateMedicationsAdministeredSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicationsAdministeredSectionCodeP() { + OperationsTestCase validateMedicationsAdministeredSectionCodePTestCase = new OperationsTestCase( + "validateMedicationsAdministeredSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_MEDICATIONS_ADMINISTERED_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationsAdministeredSection target) { + + } + + @Override + protected void updateToPass(MedicationsAdministeredSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationsAdministeredSectionOperations.validateMedicationsAdministeredSectionCodeP( + (MedicationsAdministeredSection) objectToTest, diagnostician, map); + } + + }; + + validateMedicationsAdministeredSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicationsAdministeredSectionText() { + OperationsTestCase validateMedicationsAdministeredSectionTextTestCase = new OperationsTestCase( + "validateMedicationsAdministeredSectionText", + operationsForOCL.getOCLValue("VALIDATE_MEDICATIONS_ADMINISTERED_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationsAdministeredSection target) { + + } + + @Override + protected void updateToPass(MedicationsAdministeredSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationsAdministeredSectionOperations.validateMedicationsAdministeredSectionText( + (MedicationsAdministeredSection) objectToTest, diagnostician, map); + } + + }; + + validateMedicationsAdministeredSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicationsAdministeredSectionTitle() { + OperationsTestCase validateMedicationsAdministeredSectionTitleTestCase = new OperationsTestCase( + "validateMedicationsAdministeredSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_MEDICATIONS_ADMINISTERED_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationsAdministeredSection target) { + + } + + @Override + protected void updateToPass(MedicationsAdministeredSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationsAdministeredSectionOperations.validateMedicationsAdministeredSectionTitle( + (MedicationsAdministeredSection) objectToTest, diagnostician, map); + } + + }; + + validateMedicationsAdministeredSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationsAdministeredSectionMedicationActivity() { + OperationsTestCase validateMedicationsAdministeredSectionMedicationActivityTestCase = new OperationsTestCase( + "validateMedicationsAdministeredSectionMedicationActivity", + operationsForOCL.getOCLValue("VALIDATE_MEDICATIONS_ADMINISTERED_SECTION_MEDICATION_ACTIVITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationsAdministeredSection target) { + + } + + @Override + protected void updateToPass(MedicationsAdministeredSection target) { + target.init(); + target.addSubstanceAdministration(ConsolFactory.eINSTANCE.createMedicationActivity()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationsAdministeredSectionOperations.validateMedicationsAdministeredSectionMedicationActivity( + (MedicationsAdministeredSection) objectToTest, diagnostician, map); + } + + }; + + validateMedicationsAdministeredSectionMedicationActivityTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetMedicationActivities() { + + MedicationsAdministeredSection target = objectFactory.create(); + target.getMedicationActivities(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends MedicationsAdministeredSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public MedicationsAdministeredSection create() { + return ConsolFactory.eINSTANCE.createMedicationsAdministeredSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends MedicationsAdministeredSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // MedicationsAdministeredSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/MedicationsSectionEntriesOptionalTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/MedicationsSectionEntriesOptionalTest.java new file mode 100644 index 000000000..4f66cdba2 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/MedicationsSectionEntriesOptionalTest.java @@ -0,0 +1,305 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.MedicationsSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.operations.MedicationsSectionEntriesOptionalOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Medications Section Entries Optional' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationsSectionEntriesOptional#validateMedicationsSectionEntriesOptionalTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medications Section Entries Optional Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationsSectionEntriesOptional#validateMedicationsSectionEntriesOptionalCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medications Section Entries Optional Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationsSectionEntriesOptional#validateMedicationsSectionEntriesOptionalTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medications Section Entries Optional Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationsSectionEntriesOptional#validateMedicationsSectionEntriesOptionalText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medications Section Entries Optional Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationsSectionEntriesOptional#validateMedicationsSectionEntriesOptionalMedicationActivity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medications Section Entries Optional Medication Activity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationsSectionEntriesOptional#getMedicationActivities() Get Medication Activities}
  • + *
+ *

+ * + * @generated + */ + +public class MedicationsSectionEntriesOptionalTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateMedicationsSectionEntriesOptionalTemplateId() { + OperationsTestCase validateMedicationsSectionEntriesOptionalTemplateIdTestCase = new OperationsTestCase( + "validateMedicationsSectionEntriesOptionalTemplateId", + operationsForOCL.getOCLValue("VALIDATE_MEDICATIONS_SECTION_ENTRIES_OPTIONAL_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationsSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(MedicationsSectionEntriesOptional target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationsSectionEntriesOptionalOperations.validateMedicationsSectionEntriesOptionalTemplateId( + (MedicationsSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateMedicationsSectionEntriesOptionalTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicationsSectionEntriesOptionalCode() { + OperationsTestCase validateMedicationsSectionEntriesOptionalCodeTestCase = new OperationsTestCase( + "validateMedicationsSectionEntriesOptionalCode", + operationsForOCL.getOCLValue("VALIDATE_MEDICATIONS_SECTION_ENTRIES_OPTIONAL_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationsSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(MedicationsSectionEntriesOptional target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationsSectionEntriesOptionalOperations.validateMedicationsSectionEntriesOptionalCode( + (MedicationsSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateMedicationsSectionEntriesOptionalCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationsSectionEntriesOptionalTitle() { + OperationsTestCase validateMedicationsSectionEntriesOptionalTitleTestCase = new OperationsTestCase( + "validateMedicationsSectionEntriesOptionalTitle", + operationsForOCL.getOCLValue("VALIDATE_MEDICATIONS_SECTION_ENTRIES_OPTIONAL_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationsSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(MedicationsSectionEntriesOptional target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("Medications"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationsSectionEntriesOptionalOperations.validateMedicationsSectionEntriesOptionalTitle( + (MedicationsSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateMedicationsSectionEntriesOptionalTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicationsSectionEntriesOptionalText() { + OperationsTestCase validateMedicationsSectionEntriesOptionalTextTestCase = new OperationsTestCase( + "validateMedicationsSectionEntriesOptionalText", + operationsForOCL.getOCLValue("VALIDATE_MEDICATIONS_SECTION_ENTRIES_OPTIONAL_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationsSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(MedicationsSectionEntriesOptional target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationsSectionEntriesOptionalOperations.validateMedicationsSectionEntriesOptionalText( + (MedicationsSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateMedicationsSectionEntriesOptionalTextTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationsSectionEntriesOptionalMedicationActivity() { + OperationsTestCase validateMedicationsSectionEntriesOptionalMedicationActivityTestCase = new OperationsTestCase( + "validateMedicationsSectionEntriesOptionalMedicationActivity", + operationsForOCL.getOCLValue("VALIDATE_MEDICATIONS_SECTION_ENTRIES_OPTIONAL_MEDICATION_ACTIVITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationsSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(MedicationsSectionEntriesOptional target) { + target.init(); + + target.addSubstanceAdministration(ConsolFactory.eINSTANCE.createMedicationActivity().init()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationsSectionEntriesOptionalOperations.validateMedicationsSectionEntriesOptionalMedicationActivity( + (MedicationsSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateMedicationsSectionEntriesOptionalMedicationActivityTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetMedicationActivities() { + + MedicationsSectionEntriesOptional target = objectFactory.create(); + target.getMedicationActivities(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends MedicationsSectionEntriesOptionalOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public MedicationsSectionEntriesOptional create() { + return ConsolFactory.eINSTANCE.createMedicationsSectionEntriesOptional(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends MedicationsSectionEntriesOptionalOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // MedicationsSectionEntriesOptionalOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/MedicationsSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/MedicationsSectionTest.java new file mode 100644 index 000000000..48cb80629 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/MedicationsSectionTest.java @@ -0,0 +1,305 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.MedicationsSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.MedicationsSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Medications Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationsSection#validateMedicationsSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medications Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationsSection#validateMedicationsSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medications Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationsSection#validateMedicationsSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medications Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationsSection#validateMedicationsSectionMedication(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medications Section Medication}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationsSection#getMedications() Get Medications}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.MedicationsSection#validateMedicationsSectionEntriesOptionalTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medications Section Entries Optional Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class MedicationsSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateMedicationsSectionCode() { + OperationsTestCase validateMedicationsSectionCodeTestCase = new OperationsTestCase( + "validateMedicationsSectionCode", + operationsForOCL.getOCLValue("VALIDATE_MEDICATIONS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationsSection target) { + + } + + @Override + protected void updateToPass(MedicationsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationsSectionOperations.validateMedicationsSectionCode( + (MedicationsSection) objectToTest, diagnostician, map); + } + + }; + + validateMedicationsSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationsSectionTitle() { + OperationsTestCase validateMedicationsSectionTitleTestCase = new OperationsTestCase( + "validateMedicationsSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_MEDICATIONS_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationsSection target) { + + } + + @Override + protected void updateToPass(MedicationsSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("Medications"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationsSectionOperations.validateMedicationsSectionTitle( + (MedicationsSection) objectToTest, diagnostician, map); + } + + }; + + validateMedicationsSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicationsSectionText() { + OperationsTestCase validateMedicationsSectionTextTestCase = new OperationsTestCase( + "validateMedicationsSectionText", + operationsForOCL.getOCLValue("VALIDATE_MEDICATIONS_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationsSection target) { + + } + + @Override + protected void updateToPass(MedicationsSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationsSectionOperations.validateMedicationsSectionText( + (MedicationsSection) objectToTest, diagnostician, map); + } + + }; + + validateMedicationsSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationsSectionMedication() { + OperationsTestCase validateMedicationsSectionMedicationTestCase = new OperationsTestCase( + "validateMedicationsSectionMedication", + operationsForOCL.getOCLValue("VALIDATE_MEDICATIONS_SECTION_MEDICATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationsSection target) { + + } + + @Override + protected void updateToPass(MedicationsSection target) { + target.init(); + + target.addSubstanceAdministration(ConsolFactory.eINSTANCE.createMedicationActivity().init()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationsSectionOperations.validateMedicationsSectionMedication( + (MedicationsSection) objectToTest, diagnostician, map); + } + + }; + + validateMedicationsSectionMedicationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetMedications() { + + MedicationsSection target = objectFactory.create(); + target.getMedications(); + + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicationsSectionEntriesOptionalTemplateId() { + OperationsTestCase validateMedicationsSectionEntriesOptionalTemplateIdTestCase = new OperationsTestCase( + "validateMedicationsSectionEntriesOptionalTemplateId", + operationsForOCL.getOCLValue("VALIDATE_MEDICATIONS_SECTION_ENTRIES_OPTIONAL_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationsSection target) { + + } + + @Override + protected void updateToPass(MedicationsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationsSectionOperations.validateMedicationsSectionEntriesOptionalTemplateId( + (MedicationsSection) objectToTest, diagnostician, map); + } + + }; + + validateMedicationsSectionEntriesOptionalTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends MedicationsSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public MedicationsSection create() { + return ConsolFactory.eINSTANCE.createMedicationsSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends MedicationsSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // MedicationsSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/NonMedicinalSupplyActivityTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/NonMedicinalSupplyActivityTest.java new file mode 100644 index 000000000..2564b09e1 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/NonMedicinalSupplyActivityTest.java @@ -0,0 +1,506 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import static org.openhealthtools.mdht.uml.hl7.vocab.x_DocumentSubstanceMood.EVN; +import static org.openhealthtools.mdht.uml.hl7.vocab.x_DocumentSubstanceMood.INT; + +import java.util.Arrays; +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Participant2; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.NonMedicinalSupplyActivity; +import org.openhealthtools.mdht.uml.cda.consol.operations.NonMedicinalSupplyActivityOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.vocab.ActClassSupply; +import org.openhealthtools.mdht.uml.hl7.vocab.ParticipationType; +import org.openhealthtools.mdht.uml.hl7.vocab.x_DocumentSubstanceMood; + +/** + * + * A static utility class that provides operations related to 'Non Medicinal Supply Activity' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.NonMedicinalSupplyActivity#validateNonMedicinalSupplyActivityEffectiveTimeHigh(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Non Medicinal Supply Activity Effective Time High}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.NonMedicinalSupplyActivity#validateNonMedicinalSupplyActivityProductInstanceTypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Non Medicinal Supply Activity Product Instance Type Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.NonMedicinalSupplyActivity#validateNonMedicinalSupplyActivityTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Non Medicinal Supply Activity Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.NonMedicinalSupplyActivity#validateNonMedicinalSupplyActivityClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Non Medicinal Supply Activity Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.NonMedicinalSupplyActivity#validateNonMedicinalSupplyActivityMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Non Medicinal Supply Activity Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.NonMedicinalSupplyActivity#validateNonMedicinalSupplyActivityId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Non Medicinal Supply Activity Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.NonMedicinalSupplyActivity#validateNonMedicinalSupplyActivityStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Non Medicinal Supply Activity Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.NonMedicinalSupplyActivity#validateNonMedicinalSupplyActivityEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Non Medicinal Supply Activity Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.NonMedicinalSupplyActivity#validateNonMedicinalSupplyActivityQuantity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Non Medicinal Supply Activity Quantity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.NonMedicinalSupplyActivity#validateNonMedicinalSupplyActivityProductInstance(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Non Medicinal Supply Activity Product Instance}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.NonMedicinalSupplyActivity#getProductInstance() Get Product Instance}
  • + *
+ *

+ * + * @generated + */ + +public class NonMedicinalSupplyActivityTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateNonMedicinalSupplyActivityEffectiveTimeHigh() { + OperationsTestCase validateNonMedicinalSupplyActivityEffectiveTimeHighTestCase = new OperationsTestCase( + "validateNonMedicinalSupplyActivityEffectiveTimeHigh", + operationsForOCL.getOCLValue("VALIDATE_NON_MEDICINAL_SUPPLY_ACTIVITY_EFFECTIVE_TIME_HIGH__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(NonMedicinalSupplyActivity target) { + target.init(); + target.getEffectiveTimes().add(DatatypesFactory.eINSTANCE.createIVL_TS()); + } + + @Override + protected void updateToPass(NonMedicinalSupplyActivity target) { + target.getEffectiveTimes().clear(); + target.getEffectiveTimes().add(DatatypesFactory.eINSTANCE.createIVL_TS("1", "2")); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return NonMedicinalSupplyActivityOperations.validateNonMedicinalSupplyActivityEffectiveTimeHigh( + (NonMedicinalSupplyActivity) objectToTest, diagnostician, map); + } + + }; + + validateNonMedicinalSupplyActivityEffectiveTimeHighTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateNonMedicinalSupplyActivityProductInstanceTypeCode() { + OperationsTestCase validateNonMedicinalSupplyActivityProductInstanceTypeCodeTestCase = new OperationsTestCase( + "validateNonMedicinalSupplyActivityProductInstanceTypeCode", + operationsForOCL.getOCLValue("VALIDATE_NON_MEDICINAL_SUPPLY_ACTIVITY_PRODUCT_INSTANCE_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(NonMedicinalSupplyActivity target) { + target.init(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setParticipantRole(ConsolFactory.eINSTANCE.createProductInstance()); + + target.getParticipants().add(par); + } + + @Override + protected void updateToPass(NonMedicinalSupplyActivity target) { + target.getParticipants().clear(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setParticipantRole(ConsolFactory.eINSTANCE.createProductInstance()); + par.setTypeCode(ParticipationType.PRD); + target.getParticipants().add(par); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return NonMedicinalSupplyActivityOperations.validateNonMedicinalSupplyActivityProductInstanceTypeCode( + (NonMedicinalSupplyActivity) objectToTest, diagnostician, map); + } + + }; + + validateNonMedicinalSupplyActivityProductInstanceTypeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateNonMedicinalSupplyActivityTemplateId() { + OperationsTestCase validateNonMedicinalSupplyActivityTemplateIdTestCase = new OperationsTestCase( + "validateNonMedicinalSupplyActivityTemplateId", + operationsForOCL.getOCLValue("VALIDATE_NON_MEDICINAL_SUPPLY_ACTIVITY_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(NonMedicinalSupplyActivity target) { + + } + + @Override + protected void updateToPass(NonMedicinalSupplyActivity target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return NonMedicinalSupplyActivityOperations.validateNonMedicinalSupplyActivityTemplateId( + (NonMedicinalSupplyActivity) objectToTest, diagnostician, map); + } + + }; + + validateNonMedicinalSupplyActivityTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateNonMedicinalSupplyActivityClassCode() { + OperationsTestCase validateNonMedicinalSupplyActivityClassCodeTestCase = new OperationsTestCase( + "validateNonMedicinalSupplyActivityClassCode", + operationsForOCL.getOCLValue("VALIDATE_NON_MEDICINAL_SUPPLY_ACTIVITY_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(NonMedicinalSupplyActivity target) { + target.setClassCode(ActClassSupply.DIET); + } + + @Override + protected void updateToPass(NonMedicinalSupplyActivity target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return NonMedicinalSupplyActivityOperations.validateNonMedicinalSupplyActivityClassCode( + (NonMedicinalSupplyActivity) objectToTest, diagnostician, map); + } + + }; + + validateNonMedicinalSupplyActivityClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateNonMedicinalSupplyActivityMoodCode() { + OperationsTestCase validateNonMedicinalSupplyActivityMoodCodeTestCase = new OperationsTestCase( + "validateNonMedicinalSupplyActivityMoodCode", + operationsForOCL.getOCLValue("VALIDATE_NON_MEDICINAL_SUPPLY_ACTIVITY_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(NonMedicinalSupplyActivity target) { + // the EMF-generated default for x_DocumentSubstanceMood happens to be + // a value allowed by the constraint + target.setMoodCode(x_DocumentSubstanceMood.RQO); + } + + @Override + public void addPassTests() { + for (final x_DocumentSubstanceMood mood : Arrays.asList(EVN, INT)) { + addPassTest(new PassTest() { + @Override + public void updateToPass(NonMedicinalSupplyActivity target) { + target.init(); + target.setMoodCode(mood); + } + }); + } + ; + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return NonMedicinalSupplyActivityOperations.validateNonMedicinalSupplyActivityMoodCode( + (NonMedicinalSupplyActivity) objectToTest, diagnostician, map); + } + + }; + + validateNonMedicinalSupplyActivityMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateNonMedicinalSupplyActivityId() { + OperationsTestCase validateNonMedicinalSupplyActivityIdTestCase = new OperationsTestCase( + "validateNonMedicinalSupplyActivityId", + operationsForOCL.getOCLValue("VALIDATE_NON_MEDICINAL_SUPPLY_ACTIVITY_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(NonMedicinalSupplyActivity target) { + + } + + @Override + protected void updateToPass(NonMedicinalSupplyActivity target) { + target.init(); + target.getIds().add(DatatypesFactory.eINSTANCE.createII()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return NonMedicinalSupplyActivityOperations.validateNonMedicinalSupplyActivityId( + (NonMedicinalSupplyActivity) objectToTest, diagnostician, map); + } + + }; + + validateNonMedicinalSupplyActivityIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateNonMedicinalSupplyActivityStatusCode() { + OperationsTestCase validateNonMedicinalSupplyActivityStatusCodeTestCase = new OperationsTestCase( + "validateNonMedicinalSupplyActivityStatusCode", + operationsForOCL.getOCLValue("VALIDATE_NON_MEDICINAL_SUPPLY_ACTIVITY_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(NonMedicinalSupplyActivity target) { + + } + + @Override + protected void updateToPass(NonMedicinalSupplyActivity target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return NonMedicinalSupplyActivityOperations.validateNonMedicinalSupplyActivityStatusCode( + (NonMedicinalSupplyActivity) objectToTest, diagnostician, map); + } + + }; + + validateNonMedicinalSupplyActivityStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateNonMedicinalSupplyActivityEffectiveTime() { + OperationsTestCase validateNonMedicinalSupplyActivityEffectiveTimeTestCase = new OperationsTestCase( + "validateNonMedicinalSupplyActivityEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_NON_MEDICINAL_SUPPLY_ACTIVITY_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(NonMedicinalSupplyActivity target) { + + } + + @Override + protected void updateToPass(NonMedicinalSupplyActivity target) { + target.init(); + + target.getEffectiveTimes().add(DatatypesFactory.eINSTANCE.createSXCM_TS()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return NonMedicinalSupplyActivityOperations.validateNonMedicinalSupplyActivityEffectiveTime( + (NonMedicinalSupplyActivity) objectToTest, diagnostician, map); + } + + }; + + validateNonMedicinalSupplyActivityEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateNonMedicinalSupplyActivityQuantity() { + OperationsTestCase validateNonMedicinalSupplyActivityQuantityTestCase = new OperationsTestCase( + "validateNonMedicinalSupplyActivityQuantity", + operationsForOCL.getOCLValue("VALIDATE_NON_MEDICINAL_SUPPLY_ACTIVITY_QUANTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(NonMedicinalSupplyActivity target) { + + } + + @Override + protected void updateToPass(NonMedicinalSupplyActivity target) { + target.init(); + target.setQuantity(DatatypesFactory.eINSTANCE.createPQ()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return NonMedicinalSupplyActivityOperations.validateNonMedicinalSupplyActivityQuantity( + (NonMedicinalSupplyActivity) objectToTest, diagnostician, map); + } + + }; + + validateNonMedicinalSupplyActivityQuantityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateNonMedicinalSupplyActivityProductInstance() { + OperationsTestCase validateNonMedicinalSupplyActivityProductInstanceTestCase = new OperationsTestCase( + "validateNonMedicinalSupplyActivityProductInstance", + operationsForOCL.getOCLValue("VALIDATE_NON_MEDICINAL_SUPPLY_ACTIVITY_PRODUCT_INSTANCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(NonMedicinalSupplyActivity target) { + + } + + @Override + protected void updateToPass(NonMedicinalSupplyActivity target) { + target.init(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setParticipantRole(ConsolFactory.eINSTANCE.createProductInstance()); + par.setTypeCode(ParticipationType.PRD); + target.getParticipants().add(par); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return NonMedicinalSupplyActivityOperations.validateNonMedicinalSupplyActivityProductInstance( + (NonMedicinalSupplyActivity) objectToTest, diagnostician, map); + } + + }; + + validateNonMedicinalSupplyActivityProductInstanceTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProductInstance() { + + NonMedicinalSupplyActivity target = objectFactory.create(); + target.getProductInstance(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends NonMedicinalSupplyActivityOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public NonMedicinalSupplyActivity create() { + return ConsolFactory.eINSTANCE.createNonMedicinalSupplyActivity(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends NonMedicinalSupplyActivityOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // NonMedicinalSupplyActivityOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/NumberOfPressureUlcersObservationTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/NumberOfPressureUlcersObservationTest.java new file mode 100644 index 000000000..f3d48899f --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/NumberOfPressureUlcersObservationTest.java @@ -0,0 +1,824 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.Observation; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.NumberOfPressureUlcersObservation; +import org.openhealthtools.mdht.uml.cda.consol.operations.NumberOfPressureUlcersObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.datatypes.INT; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.vocab.ActClassObservation; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActMoodDocumentObservation; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * + * A static utility class that provides operations related to 'Number Of Pressure Ulcers Observation' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.NumberOfPressureUlcersObservation#validateNumberOfPressureUlcersObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Number Of Pressure Ulcers Observation Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.NumberOfPressureUlcersObservation#validateNumberOfPressureUlcersObservationClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Number Of Pressure Ulcers Observation Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.NumberOfPressureUlcersObservation#validateNumberOfPressureUlcersObservationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Number Of Pressure Ulcers Observation Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.NumberOfPressureUlcersObservation#validateNumberOfPressureUlcersObservationId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Number Of Pressure Ulcers Observation Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.NumberOfPressureUlcersObservation#validateNumberOfPressureUlcersObservationCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Number Of Pressure Ulcers Observation Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.NumberOfPressureUlcersObservation#validateNumberOfPressureUlcersObservationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Number Of Pressure Ulcers Observation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.NumberOfPressureUlcersObservation#validateNumberOfPressureUlcersObservationStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Number Of Pressure Ulcers Observation Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.NumberOfPressureUlcersObservation#validateNumberOfPressureUlcersObservationStatusCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Number Of Pressure Ulcers Observation Status Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.NumberOfPressureUlcersObservation#validateNumberOfPressureUlcersObservationEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Number Of Pressure Ulcers Observation Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.NumberOfPressureUlcersObservation#validateNumberOfPressureUlcersObservationValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Number Of Pressure Ulcers Observation Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.NumberOfPressureUlcersObservation#validateNumberOfPressureUlcersObservationAuthor(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Number Of Pressure Ulcers Observation Author}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.NumberOfPressureUlcersObservation#validateNumberOfPressureUlcersObservationEntryRelationship(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Number Of Pressure Ulcers Observation Entry Relationship}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.NumberOfPressureUlcersObservation#validateNumberOfPressureUlcersObservationEntryRelationshipObservationClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Number Of Pressure Ulcers Observation Entry Relationship Observation Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.NumberOfPressureUlcersObservation#validateNumberOfPressureUlcersObservationEntryRelationshipObservationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Number Of Pressure Ulcers Observation Entry Relationship Observation Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.NumberOfPressureUlcersObservation#validateNumberOfPressureUlcersObservationEntryRelationshipObservationValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Number Of Pressure Ulcers Observation Entry Relationship Observation Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.NumberOfPressureUlcersObservation#validateNumberOfPressureUlcersObservationEntryRelationshipObservationValueP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Number Of Pressure Ulcers Observation Entry Relationship Observation Value P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.NumberOfPressureUlcersObservation#validateNumberOfPressureUlcersObservationEntryRelationshipTypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Number Of Pressure Ulcers Observation Entry Relationship Type Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.NumberOfPressureUlcersObservation#validateNumberOfPressureUlcersObservationEntryRelationshipObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Number Of Pressure Ulcers Observation Entry Relationship Observation}
  • + *
+ *

+ * + * @generated + */ + +public class NumberOfPressureUlcersObservationTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateNumberOfPressureUlcersObservationTemplateId() { + OperationsTestCase validateNumberOfPressureUlcersObservationTemplateIdTestCase = new OperationsTestCase( + "validateNumberOfPressureUlcersObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_NUMBER_OF_PRESSURE_ULCERS_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(NumberOfPressureUlcersObservation target) { + + } + + @Override + protected void updateToPass(NumberOfPressureUlcersObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return NumberOfPressureUlcersObservationOperations.validateNumberOfPressureUlcersObservationTemplateId( + (NumberOfPressureUlcersObservation) objectToTest, diagnostician, map); + } + + }; + + validateNumberOfPressureUlcersObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateNumberOfPressureUlcersObservationClassCode() { + OperationsTestCase validateNumberOfPressureUlcersObservationClassCodeTestCase = new OperationsTestCase( + "validateNumberOfPressureUlcersObservationClassCode", + operationsForOCL.getOCLValue("VALIDATE_NUMBER_OF_PRESSURE_ULCERS_OBSERVATION_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(NumberOfPressureUlcersObservation target) { + + } + + @Override + protected void updateToPass(NumberOfPressureUlcersObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return NumberOfPressureUlcersObservationOperations.validateNumberOfPressureUlcersObservationClassCode( + (NumberOfPressureUlcersObservation) objectToTest, diagnostician, map); + } + + }; + + validateNumberOfPressureUlcersObservationClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateNumberOfPressureUlcersObservationMoodCode() { + OperationsTestCase validateNumberOfPressureUlcersObservationMoodCodeTestCase = new OperationsTestCase( + "validateNumberOfPressureUlcersObservationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_NUMBER_OF_PRESSURE_ULCERS_OBSERVATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(NumberOfPressureUlcersObservation target) { + + } + + @Override + protected void updateToPass(NumberOfPressureUlcersObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return NumberOfPressureUlcersObservationOperations.validateNumberOfPressureUlcersObservationMoodCode( + (NumberOfPressureUlcersObservation) objectToTest, diagnostician, map); + } + + }; + + validateNumberOfPressureUlcersObservationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateNumberOfPressureUlcersObservationId() { + OperationsTestCase validateNumberOfPressureUlcersObservationIdTestCase = new OperationsTestCase( + "validateNumberOfPressureUlcersObservationId", + operationsForOCL.getOCLValue("VALIDATE_NUMBER_OF_PRESSURE_ULCERS_OBSERVATION_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(NumberOfPressureUlcersObservation target) { + + } + + @Override + protected void updateToPass(NumberOfPressureUlcersObservation target) { + target.init(); + + II ii = DatatypesFactory.eINSTANCE.createII(); + target.getIds().add(ii); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return NumberOfPressureUlcersObservationOperations.validateNumberOfPressureUlcersObservationId( + (NumberOfPressureUlcersObservation) objectToTest, diagnostician, map); + } + + }; + + validateNumberOfPressureUlcersObservationIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateNumberOfPressureUlcersObservationCodeP() { + OperationsTestCase validateNumberOfPressureUlcersObservationCodePTestCase = new OperationsTestCase( + "validateNumberOfPressureUlcersObservationCodeP", + operationsForOCL.getOCLValue("VALIDATE_NUMBER_OF_PRESSURE_ULCERS_OBSERVATION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(NumberOfPressureUlcersObservation target) { + + } + + @Override + protected void updateToPass(NumberOfPressureUlcersObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return NumberOfPressureUlcersObservationOperations.validateNumberOfPressureUlcersObservationCodeP( + (NumberOfPressureUlcersObservation) objectToTest, diagnostician, map); + } + + }; + + validateNumberOfPressureUlcersObservationCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateNumberOfPressureUlcersObservationCode() { + OperationsTestCase validateNumberOfPressureUlcersObservationCodeTestCase = new OperationsTestCase( + "validateNumberOfPressureUlcersObservationCode", + operationsForOCL.getOCLValue("VALIDATE_NUMBER_OF_PRESSURE_ULCERS_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(NumberOfPressureUlcersObservation target) { + + } + + @Override + protected void updateToPass(NumberOfPressureUlcersObservation target) { + target.init(); + + CD cd = DatatypesFactory.eINSTANCE.createCD("2264892003", "2.16.840.1.113883.6.96", "", ""); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return NumberOfPressureUlcersObservationOperations.validateNumberOfPressureUlcersObservationCode( + (NumberOfPressureUlcersObservation) objectToTest, diagnostician, map); + } + + }; + + validateNumberOfPressureUlcersObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateNumberOfPressureUlcersObservationStatusCode() { + OperationsTestCase validateNumberOfPressureUlcersObservationStatusCodeTestCase = new OperationsTestCase( + "validateNumberOfPressureUlcersObservationStatusCode", + operationsForOCL.getOCLValue("VALIDATE_NUMBER_OF_PRESSURE_ULCERS_OBSERVATION_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(NumberOfPressureUlcersObservation target) { + + } + + @Override + protected void updateToPass(NumberOfPressureUlcersObservation target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return NumberOfPressureUlcersObservationOperations.validateNumberOfPressureUlcersObservationStatusCode( + (NumberOfPressureUlcersObservation) objectToTest, diagnostician, map); + } + + }; + + validateNumberOfPressureUlcersObservationStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateNumberOfPressureUlcersObservationStatusCodeP() { + OperationsTestCase validateNumberOfPressureUlcersObservationStatusCodePTestCase = new OperationsTestCase( + "validateNumberOfPressureUlcersObservationStatusCodeP", + operationsForOCL.getOCLValue("VALIDATE_NUMBER_OF_PRESSURE_ULCERS_OBSERVATION_STATUS_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(NumberOfPressureUlcersObservation target) { + + } + + @Override + protected void updateToPass(NumberOfPressureUlcersObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return NumberOfPressureUlcersObservationOperations.validateNumberOfPressureUlcersObservationStatusCodeP( + (NumberOfPressureUlcersObservation) objectToTest, diagnostician, map); + } + + }; + + validateNumberOfPressureUlcersObservationStatusCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateNumberOfPressureUlcersObservationEffectiveTime() { + OperationsTestCase validateNumberOfPressureUlcersObservationEffectiveTimeTestCase = new OperationsTestCase( + "validateNumberOfPressureUlcersObservationEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_NUMBER_OF_PRESSURE_ULCERS_OBSERVATION_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(NumberOfPressureUlcersObservation target) { + + } + + @Override + protected void updateToPass(NumberOfPressureUlcersObservation target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return NumberOfPressureUlcersObservationOperations.validateNumberOfPressureUlcersObservationEffectiveTime( + (NumberOfPressureUlcersObservation) objectToTest, diagnostician, map); + } + + }; + + validateNumberOfPressureUlcersObservationEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateNumberOfPressureUlcersObservationValue() { + OperationsTestCase validateNumberOfPressureUlcersObservationValueTestCase = new OperationsTestCase( + "validateNumberOfPressureUlcersObservationValue", + operationsForOCL.getOCLValue("VALIDATE_NUMBER_OF_PRESSURE_ULCERS_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(NumberOfPressureUlcersObservation target) { + + } + + @Override + protected void updateToPass(NumberOfPressureUlcersObservation target) { + target.init(); + + INT value = DatatypesFactory.eINSTANCE.createINT(); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return NumberOfPressureUlcersObservationOperations.validateNumberOfPressureUlcersObservationValue( + (NumberOfPressureUlcersObservation) objectToTest, diagnostician, map); + } + + }; + + validateNumberOfPressureUlcersObservationValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateNumberOfPressureUlcersObservationAuthor() { + OperationsTestCase validateNumberOfPressureUlcersObservationAuthorTestCase = new OperationsTestCase( + "validateNumberOfPressureUlcersObservationAuthor", + operationsForOCL.getOCLValue("VALIDATE_NUMBER_OF_PRESSURE_ULCERS_OBSERVATION_AUTHOR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(NumberOfPressureUlcersObservation target) { + + } + + @Override + protected void updateToPass(NumberOfPressureUlcersObservation target) { + target.init(); + target.getAuthors().add(CDAFactory.eINSTANCE.createAuthor()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return NumberOfPressureUlcersObservationOperations.validateNumberOfPressureUlcersObservationAuthor( + (NumberOfPressureUlcersObservation) objectToTest, diagnostician, map); + } + + }; + + validateNumberOfPressureUlcersObservationAuthorTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateNumberOfPressureUlcersObservationEntryRelationship() { + OperationsTestCase validateNumberOfPressureUlcersObservationEntryRelationshipTestCase = new OperationsTestCase( + "validateNumberOfPressureUlcersObservationEntryRelationship", + operationsForOCL.getOCLValue("VALIDATE_NUMBER_OF_PRESSURE_ULCERS_OBSERVATION_ENTRY_RELATIONSHIP__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(NumberOfPressureUlcersObservation target) { + + } + + @Override + protected void updateToPass(NumberOfPressureUlcersObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + er.setObservation(CDAFactory.eINSTANCE.createObservation()); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return NumberOfPressureUlcersObservationOperations.validateNumberOfPressureUlcersObservationEntryRelationship( + (NumberOfPressureUlcersObservation) objectToTest, diagnostician, map); + } + + }; + + validateNumberOfPressureUlcersObservationEntryRelationshipTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateNumberOfPressureUlcersObservationEntryRelationshipObservationClassCode() { + OperationsTestCase validateNumberOfPressureUlcersObservationEntryRelationshipObservationClassCodeTestCase = new OperationsTestCase( + "validateNumberOfPressureUlcersObservationEntryRelationshipObservationClassCode", + operationsForOCL.getOCLValue("VALIDATE_NUMBER_OF_PRESSURE_ULCERS_OBSERVATION_ENTRY_RELATIONSHIP_OBSERVATION_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(NumberOfPressureUlcersObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + er.setObservation(CDAFactory.eINSTANCE.createObservation()); + target.getEntryRelationships().add(er); + } + + @Override + protected void updateToPass(NumberOfPressureUlcersObservation target) { + target.getEntryRelationships().clear(); + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + Observation obs = CDAFactory.eINSTANCE.createObservation(); + obs.setClassCode(ActClassObservation.OBS); + er.setObservation(obs); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return NumberOfPressureUlcersObservationOperations.validateNumberOfPressureUlcersObservationEntryRelationshipObservationClassCode( + (NumberOfPressureUlcersObservation) objectToTest, diagnostician, map); + } + + }; + + validateNumberOfPressureUlcersObservationEntryRelationshipObservationClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateNumberOfPressureUlcersObservationEntryRelationshipObservationMoodCode() { + OperationsTestCase validateNumberOfPressureUlcersObservationEntryRelationshipObservationMoodCodeTestCase = new OperationsTestCase( + "validateNumberOfPressureUlcersObservationEntryRelationshipObservationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_NUMBER_OF_PRESSURE_ULCERS_OBSERVATION_ENTRY_RELATIONSHIP_OBSERVATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(NumberOfPressureUlcersObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + er.setObservation(CDAFactory.eINSTANCE.createObservation()); + target.getEntryRelationships().add(er); + } + + @Override + protected void updateToPass(NumberOfPressureUlcersObservation target) { + target.getEntryRelationships().clear(); + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + Observation obs = CDAFactory.eINSTANCE.createObservation(); + obs.setMoodCode(x_ActMoodDocumentObservation.EVN); + er.setObservation(obs); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return NumberOfPressureUlcersObservationOperations.validateNumberOfPressureUlcersObservationEntryRelationshipObservationMoodCode( + (NumberOfPressureUlcersObservation) objectToTest, diagnostician, map); + } + + }; + + validateNumberOfPressureUlcersObservationEntryRelationshipObservationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateNumberOfPressureUlcersObservationEntryRelationshipObservationValue() { + OperationsTestCase validateNumberOfPressureUlcersObservationEntryRelationshipObservationValueTestCase = new OperationsTestCase( + "validateNumberOfPressureUlcersObservationEntryRelationshipObservationValue", + operationsForOCL.getOCLValue("VALIDATE_NUMBER_OF_PRESSURE_ULCERS_OBSERVATION_ENTRY_RELATIONSHIP_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(NumberOfPressureUlcersObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + Observation obs = CDAFactory.eINSTANCE.createObservation(); + obs.getValues().add(DatatypesFactory.eINSTANCE.createCD()); + + er.setObservation(obs); + target.getEntryRelationships().add(er); + } + + @Override + protected void updateToPass(NumberOfPressureUlcersObservation target) { + target.getEntryRelationships().clear(); + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + Observation obs = CDAFactory.eINSTANCE.createObservation(); + obs.getValues().add(DatatypesFactory.eINSTANCE.createCD("421076008", "2.16.840.1.113883.6.96", "", "")); + + er.setObservation(obs); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return NumberOfPressureUlcersObservationOperations.validateNumberOfPressureUlcersObservationEntryRelationshipObservationValue( + (NumberOfPressureUlcersObservation) objectToTest, diagnostician, map); + } + + }; + + validateNumberOfPressureUlcersObservationEntryRelationshipObservationValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateNumberOfPressureUlcersObservationEntryRelationshipObservationValueP() { + OperationsTestCase validateNumberOfPressureUlcersObservationEntryRelationshipObservationValuePTestCase = new OperationsTestCase( + "validateNumberOfPressureUlcersObservationEntryRelationshipObservationValueP", + operationsForOCL.getOCLValue("VALIDATE_NUMBER_OF_PRESSURE_ULCERS_OBSERVATION_ENTRY_RELATIONSHIP_OBSERVATION_VALUE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(NumberOfPressureUlcersObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + Observation obs = CDAFactory.eINSTANCE.createObservation(); + er.setObservation(obs); + target.getEntryRelationships().add(er); + } + + @Override + protected void updateToPass(NumberOfPressureUlcersObservation target) { + target.getEntryRelationships().clear(); + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + Observation obs = CDAFactory.eINSTANCE.createObservation(); + obs.getValues().add(DatatypesFactory.eINSTANCE.createCD("421076008", "2.16.840.1.113883.6.96", "", "")); + + er.setObservation(obs); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return NumberOfPressureUlcersObservationOperations.validateNumberOfPressureUlcersObservationEntryRelationshipObservationValueP( + (NumberOfPressureUlcersObservation) objectToTest, diagnostician, map); + } + + }; + + validateNumberOfPressureUlcersObservationEntryRelationshipObservationValuePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateNumberOfPressureUlcersObservationEntryRelationshipTypeCode() { + OperationsTestCase validateNumberOfPressureUlcersObservationEntryRelationshipTypeCodeTestCase = new OperationsTestCase( + "validateNumberOfPressureUlcersObservationEntryRelationshipTypeCode", + operationsForOCL.getOCLValue("VALIDATE_NUMBER_OF_PRESSURE_ULCERS_OBSERVATION_ENTRY_RELATIONSHIP_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + { + this.skipFailsTest(); + } + + @Override + protected void updateToFail(NumberOfPressureUlcersObservation target) { + + } + + @Override + protected void updateToPass(NumberOfPressureUlcersObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + er.setObservation(CDAFactory.eINSTANCE.createObservation()); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return NumberOfPressureUlcersObservationOperations.validateNumberOfPressureUlcersObservationEntryRelationshipTypeCode( + (NumberOfPressureUlcersObservation) objectToTest, diagnostician, map); + } + + }; + + validateNumberOfPressureUlcersObservationEntryRelationshipTypeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateNumberOfPressureUlcersObservationEntryRelationshipObservation() { + OperationsTestCase validateNumberOfPressureUlcersObservationEntryRelationshipObservationTestCase = new OperationsTestCase( + "validateNumberOfPressureUlcersObservationEntryRelationshipObservation", + operationsForOCL.getOCLValue("VALIDATE_NUMBER_OF_PRESSURE_ULCERS_OBSERVATION_ENTRY_RELATIONSHIP_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(NumberOfPressureUlcersObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + target.getEntryRelationships().add(er); + } + + @Override + protected void updateToPass(NumberOfPressureUlcersObservation target) { + target.getEntryRelationships().clear(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + er.setObservation(CDAFactory.eINSTANCE.createObservation()); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return NumberOfPressureUlcersObservationOperations.validateNumberOfPressureUlcersObservationEntryRelationshipObservation( + (NumberOfPressureUlcersObservation) objectToTest, diagnostician, map); + } + + }; + + validateNumberOfPressureUlcersObservationEntryRelationshipObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends NumberOfPressureUlcersObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public NumberOfPressureUlcersObservation create() { + return ConsolFactory.eINSTANCE.createNumberOfPressureUlcersObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends NumberOfPressureUlcersObservationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // NumberOfPressureUlcersObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ObjectiveSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ObjectiveSectionTest.java new file mode 100644 index 000000000..e1819d73b --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ObjectiveSectionTest.java @@ -0,0 +1,290 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ObjectiveSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.ObjectiveSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Objective Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ObjectiveSection#validateObjectiveSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Objective Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ObjectiveSection#validateObjectiveSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Objective Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ObjectiveSection#validateObjectiveSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Objective Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ObjectiveSection#validateObjectiveSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Objective Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ObjectiveSection#validateObjectiveSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Objective Section Title}
  • + *
+ *

+ * + * @generated + */ + +public class ObjectiveSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateObjectiveSectionTemplateId() { + OperationsTestCase validateObjectiveSectionTemplateIdTestCase = new OperationsTestCase( + "validateObjectiveSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_OBJECTIVE_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ObjectiveSection target) { + + } + + @Override + protected void updateToPass(ObjectiveSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ObjectiveSectionOperations.validateObjectiveSectionTemplateId( + (ObjectiveSection) objectToTest, diagnostician, map); + } + + }; + + validateObjectiveSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateObjectiveSectionCode() { + OperationsTestCase validateObjectiveSectionCodeTestCase = new OperationsTestCase( + "validateObjectiveSectionCode", + operationsForOCL.getOCLValue("VALIDATE_OBJECTIVE_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ObjectiveSection target) { + + } + + @Override + protected void updateToPass(ObjectiveSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ObjectiveSectionOperations.validateObjectiveSectionCode( + (ObjectiveSection) objectToTest, diagnostician, map); + } + + }; + + validateObjectiveSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateObjectiveSectionCodeP() { + OperationsTestCase validateObjectiveSectionCodePTestCase = new OperationsTestCase( + "validateObjectiveSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_OBJECTIVE_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ObjectiveSection target) { + + } + + @Override + protected void updateToPass(ObjectiveSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ObjectiveSectionOperations.validateObjectiveSectionCodeP( + (ObjectiveSection) objectToTest, diagnostician, map); + } + + }; + + validateObjectiveSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateObjectiveSectionText() { + OperationsTestCase validateObjectiveSectionTextTestCase = new OperationsTestCase( + "validateObjectiveSectionText", + operationsForOCL.getOCLValue("VALIDATE_OBJECTIVE_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ObjectiveSection target) { + + } + + @Override + protected void updateToPass(ObjectiveSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ObjectiveSectionOperations.validateObjectiveSectionText( + (ObjectiveSection) objectToTest, diagnostician, map); + } + + }; + + validateObjectiveSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateObjectiveSectionTitle() { + OperationsTestCase validateObjectiveSectionTitleTestCase = new OperationsTestCase( + "validateObjectiveSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_OBJECTIVE_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ObjectiveSection target) { + + } + + @Override + protected void updateToPass(ObjectiveSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ObjectiveSectionOperations.validateObjectiveSectionTitle( + (ObjectiveSection) objectToTest, diagnostician, map); + } + + }; + + validateObjectiveSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ObjectiveSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ObjectiveSection create() { + return ConsolFactory.eINSTANCE.createObjectiveSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ObjectiveSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ObjectiveSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ObserverContextTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ObserverContextTest.java new file mode 100644 index 000000000..9da601cf9 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ObserverContextTest.java @@ -0,0 +1,172 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ObserverContext; +import org.openhealthtools.mdht.uml.cda.consol.operations.ObserverContextOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Observer Context' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ObserverContext#validateObserverContextTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Observer Context Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ObserverContext#validateObserverContextAssignedAuthor(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Observer Context Assigned Author}
  • + *
+ *

+ * + * @generated + */ + +public class ObserverContextTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateObserverContextTemplateId() { + OperationsTestCase validateObserverContextTemplateIdTestCase = new OperationsTestCase( + "validateObserverContextTemplateId", + operationsForOCL.getOCLValue("VALIDATE_OBSERVER_CONTEXT_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ObserverContext target) { + + } + + @Override + protected void updateToPass(ObserverContext target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ObserverContextOperations.validateObserverContextTemplateId( + (ObserverContext) objectToTest, diagnostician, map); + } + + }; + + validateObserverContextTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateObserverContextAssignedAuthor() { + OperationsTestCase validateObserverContextAssignedAuthorTestCase = new OperationsTestCase( + "validateObserverContextAssignedAuthor", + operationsForOCL.getOCLValue("VALIDATE_OBSERVER_CONTEXT_ASSIGNED_AUTHOR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ObserverContext target) { + target.init(); + } + + @Override + protected void updateToPass(ObserverContext target) { + target.setAssignedAuthor(CDAFactory.eINSTANCE.createAssignedAuthor()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ObserverContextOperations.validateObserverContextAssignedAuthor( + (ObserverContext) objectToTest, diagnostician, map); + } + + }; + + validateObserverContextAssignedAuthorTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ObserverContextOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ObserverContext create() { + return ConsolFactory.eINSTANCE.createObserverContext(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ObserverContextOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ObserverContextOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/OperativeNoteFluidSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/OperativeNoteFluidSectionTest.java new file mode 100644 index 000000000..5e53852fd --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/OperativeNoteFluidSectionTest.java @@ -0,0 +1,290 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.OperativeNoteFluidSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.OperativeNoteFluidSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Operative Note Fluid Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNoteFluidSection#validateOperativeNoteFluidSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Operative Note Fluid Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNoteFluidSection#validateOperativeNoteFluidSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Operative Note Fluid Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNoteFluidSection#validateOperativeNoteFluidSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Operative Note Fluid Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNoteFluidSection#validateOperativeNoteFluidSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Operative Note Fluid Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNoteFluidSection#validateOperativeNoteFluidSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Operative Note Fluid Section Title}
  • + *
+ *

+ * + * @generated + */ + +public class OperativeNoteFluidSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateOperativeNoteFluidSectionTemplateId() { + OperationsTestCase validateOperativeNoteFluidSectionTemplateIdTestCase = new OperationsTestCase( + "validateOperativeNoteFluidSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_OPERATIVE_NOTE_FLUID_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(OperativeNoteFluidSection target) { + + } + + @Override + protected void updateToPass(OperativeNoteFluidSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return OperativeNoteFluidSectionOperations.validateOperativeNoteFluidSectionTemplateId( + (OperativeNoteFluidSection) objectToTest, diagnostician, map); + } + + }; + + validateOperativeNoteFluidSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateOperativeNoteFluidSectionCode() { + OperationsTestCase validateOperativeNoteFluidSectionCodeTestCase = new OperationsTestCase( + "validateOperativeNoteFluidSectionCode", + operationsForOCL.getOCLValue("VALIDATE_OPERATIVE_NOTE_FLUID_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(OperativeNoteFluidSection target) { + + } + + @Override + protected void updateToPass(OperativeNoteFluidSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return OperativeNoteFluidSectionOperations.validateOperativeNoteFluidSectionCode( + (OperativeNoteFluidSection) objectToTest, diagnostician, map); + } + + }; + + validateOperativeNoteFluidSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateOperativeNoteFluidSectionCodeP() { + OperationsTestCase validateOperativeNoteFluidSectionCodePTestCase = new OperationsTestCase( + "validateOperativeNoteFluidSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_OPERATIVE_NOTE_FLUID_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(OperativeNoteFluidSection target) { + + } + + @Override + protected void updateToPass(OperativeNoteFluidSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return OperativeNoteFluidSectionOperations.validateOperativeNoteFluidSectionCodeP( + (OperativeNoteFluidSection) objectToTest, diagnostician, map); + } + + }; + + validateOperativeNoteFluidSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateOperativeNoteFluidSectionText() { + OperationsTestCase validateOperativeNoteFluidSectionTextTestCase = new OperationsTestCase( + "validateOperativeNoteFluidSectionText", + operationsForOCL.getOCLValue("VALIDATE_OPERATIVE_NOTE_FLUID_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(OperativeNoteFluidSection target) { + + } + + @Override + protected void updateToPass(OperativeNoteFluidSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return OperativeNoteFluidSectionOperations.validateOperativeNoteFluidSectionText( + (OperativeNoteFluidSection) objectToTest, diagnostician, map); + } + + }; + + validateOperativeNoteFluidSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateOperativeNoteFluidSectionTitle() { + OperationsTestCase validateOperativeNoteFluidSectionTitleTestCase = new OperationsTestCase( + "validateOperativeNoteFluidSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_OPERATIVE_NOTE_FLUID_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(OperativeNoteFluidSection target) { + + } + + @Override + protected void updateToPass(OperativeNoteFluidSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return OperativeNoteFluidSectionOperations.validateOperativeNoteFluidSectionTitle( + (OperativeNoteFluidSection) objectToTest, diagnostician, map); + } + + }; + + validateOperativeNoteFluidSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends OperativeNoteFluidSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public OperativeNoteFluidSection create() { + return ConsolFactory.eINSTANCE.createOperativeNoteFluidSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends OperativeNoteFluidSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // OperativeNoteFluidSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/OperativeNoteSurgicalProcedureSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/OperativeNoteSurgicalProcedureSectionTest.java new file mode 100644 index 000000000..ce7b38935 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/OperativeNoteSurgicalProcedureSectionTest.java @@ -0,0 +1,290 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.OperativeNoteSurgicalProcedureSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.OperativeNoteSurgicalProcedureSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Operative Note Surgical Procedure Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNoteSurgicalProcedureSection#validateOperativeNoteSurgicalProcedureSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Operative Note Surgical Procedure Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNoteSurgicalProcedureSection#validateOperativeNoteSurgicalProcedureSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Operative Note Surgical Procedure Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNoteSurgicalProcedureSection#validateOperativeNoteSurgicalProcedureSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Operative Note Surgical Procedure Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNoteSurgicalProcedureSection#validateOperativeNoteSurgicalProcedureSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Operative Note Surgical Procedure Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNoteSurgicalProcedureSection#validateOperativeNoteSurgicalProcedureSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Operative Note Surgical Procedure Section Title}
  • + *
+ *

+ * + * @generated + */ + +public class OperativeNoteSurgicalProcedureSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateOperativeNoteSurgicalProcedureSectionTemplateId() { + OperationsTestCase validateOperativeNoteSurgicalProcedureSectionTemplateIdTestCase = new OperationsTestCase( + "validateOperativeNoteSurgicalProcedureSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_OPERATIVE_NOTE_SURGICAL_PROCEDURE_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(OperativeNoteSurgicalProcedureSection target) { + + } + + @Override + protected void updateToPass(OperativeNoteSurgicalProcedureSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return OperativeNoteSurgicalProcedureSectionOperations.validateOperativeNoteSurgicalProcedureSectionTemplateId( + (OperativeNoteSurgicalProcedureSection) objectToTest, diagnostician, map); + } + + }; + + validateOperativeNoteSurgicalProcedureSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateOperativeNoteSurgicalProcedureSectionCode() { + OperationsTestCase validateOperativeNoteSurgicalProcedureSectionCodeTestCase = new OperationsTestCase( + "validateOperativeNoteSurgicalProcedureSectionCode", + operationsForOCL.getOCLValue("VALIDATE_OPERATIVE_NOTE_SURGICAL_PROCEDURE_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(OperativeNoteSurgicalProcedureSection target) { + + } + + @Override + protected void updateToPass(OperativeNoteSurgicalProcedureSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return OperativeNoteSurgicalProcedureSectionOperations.validateOperativeNoteSurgicalProcedureSectionCode( + (OperativeNoteSurgicalProcedureSection) objectToTest, diagnostician, map); + } + + }; + + validateOperativeNoteSurgicalProcedureSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateOperativeNoteSurgicalProcedureSectionCodeP() { + OperationsTestCase validateOperativeNoteSurgicalProcedureSectionCodePTestCase = new OperationsTestCase( + "validateOperativeNoteSurgicalProcedureSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_OPERATIVE_NOTE_SURGICAL_PROCEDURE_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(OperativeNoteSurgicalProcedureSection target) { + + } + + @Override + protected void updateToPass(OperativeNoteSurgicalProcedureSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return OperativeNoteSurgicalProcedureSectionOperations.validateOperativeNoteSurgicalProcedureSectionCodeP( + (OperativeNoteSurgicalProcedureSection) objectToTest, diagnostician, map); + } + + }; + + validateOperativeNoteSurgicalProcedureSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateOperativeNoteSurgicalProcedureSectionText() { + OperationsTestCase validateOperativeNoteSurgicalProcedureSectionTextTestCase = new OperationsTestCase( + "validateOperativeNoteSurgicalProcedureSectionText", + operationsForOCL.getOCLValue("VALIDATE_OPERATIVE_NOTE_SURGICAL_PROCEDURE_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(OperativeNoteSurgicalProcedureSection target) { + + } + + @Override + protected void updateToPass(OperativeNoteSurgicalProcedureSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return OperativeNoteSurgicalProcedureSectionOperations.validateOperativeNoteSurgicalProcedureSectionText( + (OperativeNoteSurgicalProcedureSection) objectToTest, diagnostician, map); + } + + }; + + validateOperativeNoteSurgicalProcedureSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateOperativeNoteSurgicalProcedureSectionTitle() { + OperationsTestCase validateOperativeNoteSurgicalProcedureSectionTitleTestCase = new OperationsTestCase( + "validateOperativeNoteSurgicalProcedureSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_OPERATIVE_NOTE_SURGICAL_PROCEDURE_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(OperativeNoteSurgicalProcedureSection target) { + + } + + @Override + protected void updateToPass(OperativeNoteSurgicalProcedureSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return OperativeNoteSurgicalProcedureSectionOperations.validateOperativeNoteSurgicalProcedureSectionTitle( + (OperativeNoteSurgicalProcedureSection) objectToTest, diagnostician, map); + } + + }; + + validateOperativeNoteSurgicalProcedureSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends OperativeNoteSurgicalProcedureSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public OperativeNoteSurgicalProcedureSection create() { + return ConsolFactory.eINSTANCE.createOperativeNoteSurgicalProcedureSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends OperativeNoteSurgicalProcedureSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // OperativeNoteSurgicalProcedureSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/OperativeNoteTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/OperativeNoteTest.java new file mode 100644 index 000000000..618c3b41e --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/OperativeNoteTest.java @@ -0,0 +1,1830 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.AssignedEntity; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.DocumentationOf; +import org.openhealthtools.mdht.uml.cda.Performer1; +import org.openhealthtools.mdht.uml.cda.ServiceEvent; +import org.openhealthtools.mdht.uml.cda.consol.AnesthesiaSection; +import org.openhealthtools.mdht.uml.cda.consol.ComplicationsSection; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.OperativeNote; +import org.openhealthtools.mdht.uml.cda.consol.OperativeNoteFluidSection; +import org.openhealthtools.mdht.uml.cda.consol.OperativeNoteSurgicalProcedureSection; +import org.openhealthtools.mdht.uml.cda.consol.PlanOfCareSection; +import org.openhealthtools.mdht.uml.cda.consol.PlannedProcedureSection; +import org.openhealthtools.mdht.uml.cda.consol.PostoperativeDiagnosisSection; +import org.openhealthtools.mdht.uml.cda.consol.PreoperativeDiagnosisSection; +import org.openhealthtools.mdht.uml.cda.consol.ProcedureDescriptionSection; +import org.openhealthtools.mdht.uml.cda.consol.ProcedureDispositionSection; +import org.openhealthtools.mdht.uml.cda.consol.ProcedureEstimatedBloodLossSection; +import org.openhealthtools.mdht.uml.cda.consol.ProcedureFindingsSection; +import org.openhealthtools.mdht.uml.cda.consol.ProcedureImplantsSection; +import org.openhealthtools.mdht.uml.cda.consol.ProcedureIndicationsSection; +import org.openhealthtools.mdht.uml.cda.consol.ProcedureSpecimensTakenSection; +import org.openhealthtools.mdht.uml.cda.consol.SurgicalDrainsSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.GeneralHeaderConstraintsOperations; +import org.openhealthtools.mdht.uml.cda.consol.operations.OperativeNoteOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVXB_TS; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ServiceEventPerformer; + +/** + * + * A static utility class that provides operations related to 'Operative Note' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNote#validateOperativeNoteTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Operative Note Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNote#validateOperativeNoteCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Operative Note Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNote#validateOperativeNoteCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Operative Note Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNote#validateOperativeNoteDocumentationOf(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Operative Note Documentation Of}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNote#validateOperativeNoteAnesthesiaSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Operative Note Anesthesia Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNote#validateOperativeNoteComplicationsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Operative Note Complications Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNote#validateOperativeNotePostoperativeDiagnosisSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Operative Note Postoperative Diagnosis Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNote#validateOperativeNotePreoperativeDiagnosisSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Operative Note Preoperative Diagnosis Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNote#validateOperativeNoteProcedureEstimatedBloodLossSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Operative Note Procedure Estimated Blood Loss Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNote#validateOperativeNoteProcedureFindingsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Operative Note Procedure Findings Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNote#validateOperativeNoteProcedureSpecimensTakenSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Operative Note Procedure Specimens Taken Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNote#validateOperativeNoteProcedureDescriptionSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Operative Note Procedure Description Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNote#validateOperativeNoteProcedureImplantsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Operative Note Procedure Implants Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNote#validateOperativeNoteOperativeNoteFluidSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Operative Note Operative Note Fluid Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNote#validateOperativeNoteOperativeNoteSurgicalProcedureSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Operative Note Operative Note Surgical Procedure Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNote#validateOperativeNotePlanOfCareSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Operative Note Plan Of Care Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNote#validateOperativeNotePlannedProcedureSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Operative Note Planned Procedure Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNote#validateOperativeNoteProcedureDispositionSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Operative Note Procedure Disposition Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNote#validateOperativeNoteProcedureIndicationsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Operative Note Procedure Indications Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNote#validateOperativeNoteSurgicalDrainsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Operative Note Surgical Drains Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNote#validateOperativeNoteDocumentationOfServiceEventPrimaryPerformerAssignedEntityCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Operative Note Documentation Of Service Event Primary Performer Assigned Entity Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNote#validateOperativeNoteDocumentationOfServiceEventPrimaryPerformerAssignedEntityCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Operative Note Documentation Of Service Event Primary Performer Assigned Entity Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNote#validateOperativeNoteDocumentationOfServiceEventPrimaryPerformerTypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Operative Note Documentation Of Service Event Primary Performer Type Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNote#validateOperativeNoteDocumentationOfServiceEventPrimaryPerformerAssignedEntity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Operative Note Documentation Of Service Event Primary Performer Assigned Entity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNote#validateOperativeNoteDocumentationOfServiceEventProcedureCodes(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Operative Note Documentation Of Service Event Procedure Codes}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNote#validateOperativeNoteDocumentationOfServiceEventEffectiveTimeHasLow(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Operative Note Documentation Of Service Event Effective Time Has Low}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNote#validateOperativeNoteDocumentationOfServiceEventEffectiveTimeHasHighWhenNoWidth(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Operative Note Documentation Of Service Event Effective Time Has High When No Width}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNote#validateOperativeNoteDocumentationOfServiceEventEffectiveTimeNoHighIfWidth(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Operative Note Documentation Of Service Event Effective Time No High If Width}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNote#validateOperativeNoteDocumentationOfServiceEventCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Operative Note Documentation Of Service Event Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNote#validateOperativeNoteDocumentationOfServiceEventEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Operative Note Documentation Of Service Event Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNote#validateOperativeNoteDocumentationOfServiceEventPrimaryPerformer(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Operative Note Documentation Of Service Event Primary Performer}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNote#validateOperativeNoteDocumentationOfServiceEvent(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Operative Note Documentation Of Service Event}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNote#getAnesthesiaSection() Get Anesthesia Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNote#getComplicationsSection() Get Complications Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNote#getPostoperativeDiagnosisSection() Get Postoperative Diagnosis Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNote#getPreoperativeDiagnosisSection() Get Preoperative Diagnosis Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNote#getProcedureEstimatedBloodLossSection() Get Procedure Estimated Blood Loss Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNote#getProcedureFindingsSection() Get Procedure Findings Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNote#getProcedureSpecimensTakenSection() Get Procedure Specimens Taken Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNote#getProcedureDescriptionSection() Get Procedure Description Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNote#getProcedureImplantsSection() Get Procedure Implants Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNote#getOperativeNoteFluidSection() Get Operative Note Fluid Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNote#getOperativeNoteSurgicalProcedureSection() Get Operative Note Surgical Procedure Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNote#getPlanOfCareSection() Get Plan Of Care Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNote#getPlannedProcedureSection() Get Planned Procedure Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNote#getProcedureDispositionSection() Get Procedure Disposition Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNote#getProcedureIndicationsSection() Get Procedure Indications Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.OperativeNote#getSurgicalDrainsSection() Get Surgical Drains Section}
  • + *
+ *

+ * + * @generated + */ + +public class OperativeNoteTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateOperativeNoteTemplateId() { + OperationsTestCase validateOperativeNoteTemplateIdTestCase = new OperationsTestCase( + "validateOperativeNoteTemplateId", + operationsForOCL.getOCLValue("VALIDATE_OPERATIVE_NOTE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(OperativeNote target) { + + } + + @Override + protected void updateToPass(OperativeNote target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return OperativeNoteOperations.validateOperativeNoteTemplateId( + (OperativeNote) objectToTest, diagnostician, map); + } + + }; + + validateOperativeNoteTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateOperativeNoteCodeP() { + OperationsTestCase validateOperativeNoteCodePTestCase = new OperationsTestCase( + "validateOperativeNoteCodeP", + operationsForOCL.getOCLValue("VALIDATE_OPERATIVE_NOTE_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(OperativeNote target) { + + } + + @Override + protected void updateToPass(OperativeNote target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return OperativeNoteOperations.validateOperativeNoteCodeP( + (OperativeNote) objectToTest, diagnostician, map); + } + + }; + + validateOperativeNoteCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateOperativeNoteCode() { + OperationsTestCase validateOperativeNoteCodeTestCase = new OperationsTestCase( + "validateOperativeNoteCode", + operationsForOCL.getOCLValue("VALIDATE_OPERATIVE_NOTE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(OperativeNote target) { + + } + + @Override + protected void updateToPass(OperativeNote target) { + target.init(); + target.setCode(DatatypesFactory.eINSTANCE.createCE("34868-0", "2.16.840.1.113883.6.1")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return OperativeNoteOperations.validateOperativeNoteCode( + (OperativeNote) objectToTest, diagnostician, map); + } + + }; + + validateOperativeNoteCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateOperativeNoteDocumentationOf() { + OperationsTestCase validateOperativeNoteDocumentationOfTestCase = new OperationsTestCase( + "validateOperativeNoteDocumentationOf", + operationsForOCL.getOCLValue("VALIDATE_OPERATIVE_NOTE_DOCUMENTATION_OF__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(OperativeNote target) { + target.init(); + } + + @Override + protected void updateToPass(OperativeNote target) { + + target.getDocumentationOfs().add(CDAFactory.eINSTANCE.createDocumentationOf()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return OperativeNoteOperations.validateOperativeNoteDocumentationOf( + (OperativeNote) objectToTest, diagnostician, map); + } + + }; + + validateOperativeNoteDocumentationOfTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateOperativeNoteAnesthesiaSection() { + OperationsTestCase validateOperativeNoteAnesthesiaSectionTestCase = new OperationsTestCase( + "validateOperativeNoteAnesthesiaSection", + operationsForOCL.getOCLValue("VALIDATE_OPERATIVE_NOTE_ANESTHESIA_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(OperativeNote target) { + + } + + @Override + protected void updateToPass(OperativeNote target) { + target.init(); + + /* AnesthesiaSection */ + AnesthesiaSection section = + + ConsolFactory.eINSTANCE.createAnesthesiaSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return OperativeNoteOperations.validateOperativeNoteAnesthesiaSection( + (OperativeNote) objectToTest, diagnostician, map); + } + + }; + + validateOperativeNoteAnesthesiaSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateOperativeNoteComplicationsSection() { + OperationsTestCase validateOperativeNoteComplicationsSectionTestCase = new OperationsTestCase( + "validateOperativeNoteComplicationsSection", + operationsForOCL.getOCLValue("VALIDATE_OPERATIVE_NOTE_COMPLICATIONS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(OperativeNote target) { + + } + + @Override + protected void updateToPass(OperativeNote target) { + target.init(); + + /* ComplicationsSection */ + ComplicationsSection section = + + ConsolFactory.eINSTANCE.createComplicationsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return OperativeNoteOperations.validateOperativeNoteComplicationsSection( + (OperativeNote) objectToTest, diagnostician, map); + } + + }; + + validateOperativeNoteComplicationsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateOperativeNotePostoperativeDiagnosisSection() { + OperationsTestCase validateOperativeNotePostoperativeDiagnosisSectionTestCase = new OperationsTestCase( + "validateOperativeNotePostoperativeDiagnosisSection", + operationsForOCL.getOCLValue("VALIDATE_OPERATIVE_NOTE_POSTOPERATIVE_DIAGNOSIS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(OperativeNote target) { + + } + + @Override + protected void updateToPass(OperativeNote target) { + target.init(); + + /* PostoperativeDiagnosisSection */ + PostoperativeDiagnosisSection section = + + ConsolFactory.eINSTANCE.createPostoperativeDiagnosisSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return OperativeNoteOperations.validateOperativeNotePostoperativeDiagnosisSection( + (OperativeNote) objectToTest, diagnostician, map); + } + + }; + + validateOperativeNotePostoperativeDiagnosisSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateOperativeNotePreoperativeDiagnosisSection() { + OperationsTestCase validateOperativeNotePreoperativeDiagnosisSectionTestCase = new OperationsTestCase( + "validateOperativeNotePreoperativeDiagnosisSection", + operationsForOCL.getOCLValue("VALIDATE_OPERATIVE_NOTE_PREOPERATIVE_DIAGNOSIS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(OperativeNote target) { + + } + + @Override + protected void updateToPass(OperativeNote target) { + target.init(); + + /* PreoperativeDiagnosisSection */ + PreoperativeDiagnosisSection section = + + ConsolFactory.eINSTANCE.createPreoperativeDiagnosisSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return OperativeNoteOperations.validateOperativeNotePreoperativeDiagnosisSection( + (OperativeNote) objectToTest, diagnostician, map); + } + + }; + + validateOperativeNotePreoperativeDiagnosisSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateOperativeNoteProcedureEstimatedBloodLossSection() { + OperationsTestCase validateOperativeNoteProcedureEstimatedBloodLossSectionTestCase = new OperationsTestCase( + "validateOperativeNoteProcedureEstimatedBloodLossSection", + operationsForOCL.getOCLValue("VALIDATE_OPERATIVE_NOTE_PROCEDURE_ESTIMATED_BLOOD_LOSS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(OperativeNote target) { + + } + + @Override + protected void updateToPass(OperativeNote target) { + target.init(); + + /* ProcedureEstimatedBloodLossSection */ + ProcedureEstimatedBloodLossSection section = + + ConsolFactory.eINSTANCE.createProcedureEstimatedBloodLossSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return OperativeNoteOperations.validateOperativeNoteProcedureEstimatedBloodLossSection( + (OperativeNote) objectToTest, diagnostician, map); + } + + }; + + validateOperativeNoteProcedureEstimatedBloodLossSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateOperativeNoteProcedureFindingsSection() { + OperationsTestCase validateOperativeNoteProcedureFindingsSectionTestCase = new OperationsTestCase( + "validateOperativeNoteProcedureFindingsSection", + operationsForOCL.getOCLValue("VALIDATE_OPERATIVE_NOTE_PROCEDURE_FINDINGS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(OperativeNote target) { + + } + + @Override + protected void updateToPass(OperativeNote target) { + target.init(); + + /* ProcedureFindingsSection */ + ProcedureFindingsSection section = + + ConsolFactory.eINSTANCE.createProcedureFindingsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return OperativeNoteOperations.validateOperativeNoteProcedureFindingsSection( + (OperativeNote) objectToTest, diagnostician, map); + } + + }; + + validateOperativeNoteProcedureFindingsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateOperativeNoteProcedureSpecimensTakenSection() { + OperationsTestCase validateOperativeNoteProcedureSpecimensTakenSectionTestCase = new OperationsTestCase( + "validateOperativeNoteProcedureSpecimensTakenSection", + operationsForOCL.getOCLValue("VALIDATE_OPERATIVE_NOTE_PROCEDURE_SPECIMENS_TAKEN_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(OperativeNote target) { + + } + + @Override + protected void updateToPass(OperativeNote target) { + target.init(); + + /* ProcedureSpecimensTakenSection */ + ProcedureSpecimensTakenSection section = + + ConsolFactory.eINSTANCE.createProcedureSpecimensTakenSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return OperativeNoteOperations.validateOperativeNoteProcedureSpecimensTakenSection( + (OperativeNote) objectToTest, diagnostician, map); + } + + }; + + validateOperativeNoteProcedureSpecimensTakenSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateOperativeNoteProcedureDescriptionSection() { + OperationsTestCase validateOperativeNoteProcedureDescriptionSectionTestCase = new OperationsTestCase( + "validateOperativeNoteProcedureDescriptionSection", + operationsForOCL.getOCLValue("VALIDATE_OPERATIVE_NOTE_PROCEDURE_DESCRIPTION_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(OperativeNote target) { + + } + + @Override + protected void updateToPass(OperativeNote target) { + target.init(); + + /* ProcedureDescriptionSection */ + ProcedureDescriptionSection section = + + ConsolFactory.eINSTANCE.createProcedureDescriptionSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return OperativeNoteOperations.validateOperativeNoteProcedureDescriptionSection( + (OperativeNote) objectToTest, diagnostician, map); + } + + }; + + validateOperativeNoteProcedureDescriptionSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateOperativeNoteProcedureImplantsSection() { + OperationsTestCase validateOperativeNoteProcedureImplantsSectionTestCase = new OperationsTestCase( + "validateOperativeNoteProcedureImplantsSection", + operationsForOCL.getOCLValue("VALIDATE_OPERATIVE_NOTE_PROCEDURE_IMPLANTS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(OperativeNote target) { + + } + + @Override + protected void updateToPass(OperativeNote target) { + target.init(); + + /* ProcedureImplantsSection */ + ProcedureImplantsSection section = + + ConsolFactory.eINSTANCE.createProcedureImplantsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return OperativeNoteOperations.validateOperativeNoteProcedureImplantsSection( + (OperativeNote) objectToTest, diagnostician, map); + } + + }; + + validateOperativeNoteProcedureImplantsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateOperativeNoteOperativeNoteFluidSection() { + OperationsTestCase validateOperativeNoteOperativeNoteFluidSectionTestCase = new OperationsTestCase( + "validateOperativeNoteOperativeNoteFluidSection", + operationsForOCL.getOCLValue("VALIDATE_OPERATIVE_NOTE_OPERATIVE_NOTE_FLUID_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(OperativeNote target) { + + } + + @Override + protected void updateToPass(OperativeNote target) { + target.init(); + + /* OperativeNoteFluidSection */ + OperativeNoteFluidSection section = + + ConsolFactory.eINSTANCE.createOperativeNoteFluidSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return OperativeNoteOperations.validateOperativeNoteOperativeNoteFluidSection( + (OperativeNote) objectToTest, diagnostician, map); + } + + }; + + validateOperativeNoteOperativeNoteFluidSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateOperativeNoteOperativeNoteSurgicalProcedureSection() { + OperationsTestCase validateOperativeNoteOperativeNoteSurgicalProcedureSectionTestCase = new OperationsTestCase( + "validateOperativeNoteOperativeNoteSurgicalProcedureSection", + operationsForOCL.getOCLValue("VALIDATE_OPERATIVE_NOTE_OPERATIVE_NOTE_SURGICAL_PROCEDURE_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(OperativeNote target) { + + } + + @Override + protected void updateToPass(OperativeNote target) { + target.init(); + + /* OperativeNoteSurgicalProcedureSection */ + OperativeNoteSurgicalProcedureSection section = + + ConsolFactory.eINSTANCE.createOperativeNoteSurgicalProcedureSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return OperativeNoteOperations.validateOperativeNoteOperativeNoteSurgicalProcedureSection( + (OperativeNote) objectToTest, diagnostician, map); + } + + }; + + validateOperativeNoteOperativeNoteSurgicalProcedureSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateOperativeNotePlanOfCareSection() { + OperationsTestCase validateOperativeNotePlanOfCareSectionTestCase = new OperationsTestCase( + "validateOperativeNotePlanOfCareSection", + operationsForOCL.getOCLValue("VALIDATE_OPERATIVE_NOTE_PLAN_OF_CARE_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(OperativeNote target) { + + } + + @Override + protected void updateToPass(OperativeNote target) { + target.init(); + + /* PlanOfCareSection */ + PlanOfCareSection section = + + ConsolFactory.eINSTANCE.createPlanOfCareSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return OperativeNoteOperations.validateOperativeNotePlanOfCareSection( + (OperativeNote) objectToTest, diagnostician, map); + } + + }; + + validateOperativeNotePlanOfCareSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateOperativeNotePlannedProcedureSection() { + OperationsTestCase validateOperativeNotePlannedProcedureSectionTestCase = new OperationsTestCase( + "validateOperativeNotePlannedProcedureSection", + operationsForOCL.getOCLValue("VALIDATE_OPERATIVE_NOTE_PLANNED_PROCEDURE_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(OperativeNote target) { + + } + + @Override + protected void updateToPass(OperativeNote target) { + target.init(); + + /* PlannedProcedureSection */ + PlannedProcedureSection section = + + ConsolFactory.eINSTANCE.createPlannedProcedureSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return OperativeNoteOperations.validateOperativeNotePlannedProcedureSection( + (OperativeNote) objectToTest, diagnostician, map); + } + + }; + + validateOperativeNotePlannedProcedureSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateOperativeNoteProcedureDispositionSection() { + OperationsTestCase validateOperativeNoteProcedureDispositionSectionTestCase = new OperationsTestCase( + "validateOperativeNoteProcedureDispositionSection", + operationsForOCL.getOCLValue("VALIDATE_OPERATIVE_NOTE_PROCEDURE_DISPOSITION_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(OperativeNote target) { + + } + + @Override + protected void updateToPass(OperativeNote target) { + target.init(); + + /* ProcedureDispositionSection */ + ProcedureDispositionSection section = + + ConsolFactory.eINSTANCE.createProcedureDispositionSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return OperativeNoteOperations.validateOperativeNoteProcedureDispositionSection( + (OperativeNote) objectToTest, diagnostician, map); + } + + }; + + validateOperativeNoteProcedureDispositionSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateOperativeNoteProcedureIndicationsSection() { + OperationsTestCase validateOperativeNoteProcedureIndicationsSectionTestCase = new OperationsTestCase( + "validateOperativeNoteProcedureIndicationsSection", + operationsForOCL.getOCLValue("VALIDATE_OPERATIVE_NOTE_PROCEDURE_INDICATIONS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(OperativeNote target) { + + } + + @Override + protected void updateToPass(OperativeNote target) { + target.init(); + + /* ProcedureIndicationsSection */ + ProcedureIndicationsSection section = + + ConsolFactory.eINSTANCE.createProcedureIndicationsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return OperativeNoteOperations.validateOperativeNoteProcedureIndicationsSection( + (OperativeNote) objectToTest, diagnostician, map); + } + + }; + + validateOperativeNoteProcedureIndicationsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateOperativeNoteSurgicalDrainsSection() { + OperationsTestCase validateOperativeNoteSurgicalDrainsSectionTestCase = new OperationsTestCase( + "validateOperativeNoteSurgicalDrainsSection", + operationsForOCL.getOCLValue("VALIDATE_OPERATIVE_NOTE_SURGICAL_DRAINS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(OperativeNote target) { + + } + + @Override + protected void updateToPass(OperativeNote target) { + target.init(); + + /* SurgicalDrainsSection */ + SurgicalDrainsSection section = + + ConsolFactory.eINSTANCE.createSurgicalDrainsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return OperativeNoteOperations.validateOperativeNoteSurgicalDrainsSection( + (OperativeNote) objectToTest, diagnostician, map); + } + + }; + + validateOperativeNoteSurgicalDrainsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateOperativeNoteDocumentationOfServiceEventPrimaryPerformerAssignedEntityCode() { + OperationsTestCase validateOperativeNoteDocumentationOfServiceEventPrimaryPerformerAssignedEntityCodeTestCase = new OperationsTestCase( + "validateOperativeNoteDocumentationOfServiceEventPrimaryPerformerAssignedEntityCode", + operationsForOCL.getOCLValue("VALIDATE_OPERATIVE_NOTE_DOCUMENTATION_OF_SERVICE_EVENT_PRIMARY_PERFORMER_ASSIGNED_ENTITY_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(OperativeNote target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + Performer1 perf = CDAFactory.eINSTANCE.createPerformer1(); + perf.setTypeCode(x_ServiceEventPerformer.PPRF); + perf.setAssignedEntity(CDAFactory.eINSTANCE.createAssignedEntity()); + se.getPerformers().add(perf); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected void updateToPass(OperativeNote target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + Performer1 perf = CDAFactory.eINSTANCE.createPerformer1(); + perf.setTypeCode(x_ServiceEventPerformer.PPRF); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.setCode(DatatypesFactory.eINSTANCE.createCE("test", "2.16.840.1.113883.6.101")); + perf.setAssignedEntity(ae); + se.getPerformers().add(perf); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return OperativeNoteOperations.validateOperativeNoteDocumentationOfServiceEventPrimaryPerformerAssignedEntityCode( + (OperativeNote) objectToTest, diagnostician, map); + } + + }; + + validateOperativeNoteDocumentationOfServiceEventPrimaryPerformerAssignedEntityCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateOperativeNoteDocumentationOfServiceEventPrimaryPerformerAssignedEntityCodeP() { + OperationsTestCase validateOperativeNoteDocumentationOfServiceEventPrimaryPerformerAssignedEntityCodePTestCase = new OperationsTestCase( + "validateOperativeNoteDocumentationOfServiceEventPrimaryPerformerAssignedEntityCodeP", + operationsForOCL.getOCLValue("VALIDATE_OPERATIVE_NOTE_DOCUMENTATION_OF_SERVICE_EVENT_PRIMARY_PERFORMER_ASSIGNED_ENTITY_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(OperativeNote target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + Performer1 perf = CDAFactory.eINSTANCE.createPerformer1(); + perf.setTypeCode(x_ServiceEventPerformer.PPRF); + perf.setAssignedEntity(CDAFactory.eINSTANCE.createAssignedEntity()); + se.getPerformers().add(perf); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected void updateToPass(OperativeNote target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + Performer1 perf = CDAFactory.eINSTANCE.createPerformer1(); + perf.setTypeCode(x_ServiceEventPerformer.PPRF); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.setCode(DatatypesFactory.eINSTANCE.createCE("test", "2.16.840.1.113883.6.101")); + perf.setAssignedEntity(ae); + se.getPerformers().add(perf); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return OperativeNoteOperations.validateOperativeNoteDocumentationOfServiceEventPrimaryPerformerAssignedEntityCodeP( + (OperativeNote) objectToTest, diagnostician, map); + } + + }; + + validateOperativeNoteDocumentationOfServiceEventPrimaryPerformerAssignedEntityCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateOperativeNoteDocumentationOfServiceEventPrimaryPerformerTypeCode() { + OperationsTestCase validateOperativeNoteDocumentationOfServiceEventPrimaryPerformerTypeCodeTestCase = new OperationsTestCase( + "validateOperativeNoteDocumentationOfServiceEventPrimaryPerformerTypeCode", + operationsForOCL.getOCLValue("VALIDATE_OPERATIVE_NOTE_DOCUMENTATION_OF_SERVICE_EVENT_PRIMARY_PERFORMER_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + { + this.skipFailsTest(); + } + + @Override + protected void updateToFail(OperativeNote target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + Performer1 perf = CDAFactory.eINSTANCE.createPerformer1(); + + perf.setTypeCode(x_ServiceEventPerformer.SPRF); + se.getPerformers().add(perf); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected void updateToPass(OperativeNote target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + Performer1 perf = CDAFactory.eINSTANCE.createPerformer1(); + perf.setTypeCode(x_ServiceEventPerformer.PPRF); + se.getPerformers().add(perf); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return OperativeNoteOperations.validateOperativeNoteDocumentationOfServiceEventPrimaryPerformerTypeCode( + (OperativeNote) objectToTest, diagnostician, map); + } + + }; + + validateOperativeNoteDocumentationOfServiceEventPrimaryPerformerTypeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateOperativeNoteDocumentationOfServiceEventPrimaryPerformerAssignedEntity() { + OperationsTestCase validateOperativeNoteDocumentationOfServiceEventPrimaryPerformerAssignedEntityTestCase = new OperationsTestCase( + "validateOperativeNoteDocumentationOfServiceEventPrimaryPerformerAssignedEntity", + operationsForOCL.getOCLValue("VALIDATE_OPERATIVE_NOTE_DOCUMENTATION_OF_SERVICE_EVENT_PRIMARY_PERFORMER_ASSIGNED_ENTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(OperativeNote target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + Performer1 perf = CDAFactory.eINSTANCE.createPerformer1(); + perf.setTypeCode(x_ServiceEventPerformer.PPRF); + se.getPerformers().add(perf); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected void updateToPass(OperativeNote target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + Performer1 perf = CDAFactory.eINSTANCE.createPerformer1(); + perf.setTypeCode(x_ServiceEventPerformer.PPRF); + perf.setAssignedEntity(CDAFactory.eINSTANCE.createAssignedEntity()); + se.getPerformers().add(perf); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return OperativeNoteOperations.validateOperativeNoteDocumentationOfServiceEventPrimaryPerformerAssignedEntity( + (OperativeNote) objectToTest, diagnostician, map); + } + + }; + + validateOperativeNoteDocumentationOfServiceEventPrimaryPerformerAssignedEntityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateOperativeNoteDocumentationOfServiceEventProcedureCodes() { + OperationsTestCase validateOperativeNoteDocumentationOfServiceEventProcedureCodesTestCase = new OperationsTestCase( + "validateOperativeNoteDocumentationOfServiceEventProcedureCodes", + operationsForOCL.getOCLValue("VALIDATE_OPERATIVE_NOTE_DOCUMENTATION_OF_SERVICE_EVENT_PROCEDURE_CODES__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + // 2.16.840.1.113883.6.104' or code.codeSystem = '2.16.840.1.113883.6.12' or code.codeSystem = '2.16.840.1.113883.6.96' + + @Override + protected void updateToFail(OperativeNote target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + se.setCode(DatatypesFactory.eINSTANCE.createCE("code", "NOT2.16.840.1.113883.6.104")); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + /* + * (non-Javadoc) + * + * @see org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest.OperationsTestCase#addPassTests() + */ + @Override + public void addPassTests() { + + addPassTest(new PassTest() { + + @Override + public void updateToPass(OperativeNote target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + se.setCode(DatatypesFactory.eINSTANCE.createCE("code", "2.16.840.1.113883.6.104")); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + }); + + addPassTest(new PassTest() { + + @Override + public void updateToPass(OperativeNote target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + se.setCode(DatatypesFactory.eINSTANCE.createCE("code", "2.16.840.1.113883.6.12")); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + }); + + addPassTest(new PassTest() { + + @Override + public void updateToPass(OperativeNote target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + se.setCode(DatatypesFactory.eINSTANCE.createCE("code", "2.16.840.1.113883.6.96")); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + }); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return OperativeNoteOperations.validateOperativeNoteDocumentationOfServiceEventProcedureCodes( + (OperativeNote) objectToTest, diagnostician, map); + } + + }; + + validateOperativeNoteDocumentationOfServiceEventProcedureCodesTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateOperativeNoteDocumentationOfServiceEventEffectiveTimeHasLow() { + OperationsTestCase validateOperativeNoteDocumentationOfServiceEventEffectiveTimeHasLowTestCase = new OperationsTestCase( + "validateOperativeNoteDocumentationOfServiceEventEffectiveTimeHasLow", + operationsForOCL.getOCLValue("VALIDATE_OPERATIVE_NOTE_DOCUMENTATION_OF_SERVICE_EVENT_EFFECTIVE_TIME_HAS_LOW__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(OperativeNote target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + se.setEffectiveTime(ts); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected void updateToPass(OperativeNote target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + IVXB_TS low = DatatypesFactory.eINSTANCE.createIVXB_TS(); + + low.setValue("12345"); + ts.setLow(low); + se.setEffectiveTime(ts); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return OperativeNoteOperations.validateOperativeNoteDocumentationOfServiceEventEffectiveTimeHasLow( + (OperativeNote) objectToTest, diagnostician, map); + } + + }; + + validateOperativeNoteDocumentationOfServiceEventEffectiveTimeHasLowTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateOperativeNoteDocumentationOfServiceEventEffectiveTimeHasHighWhenNoWidth() { + OperationsTestCase validateOperativeNoteDocumentationOfServiceEventEffectiveTimeHasHighWhenNoWidthTestCase = new OperationsTestCase( + "validateOperativeNoteDocumentationOfServiceEventEffectiveTimeHasHighWhenNoWidth", + operationsForOCL.getOCLValue("VALIDATE_OPERATIVE_NOTE_DOCUMENTATION_OF_SERVICE_EVENT_EFFECTIVE_TIME_HAS_HIGH_WHEN_NO_WIDTH__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(OperativeNote target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + ts.setHigh(DatatypesFactory.eINSTANCE.createIVXB_TS()); + ts.setWidth(DatatypesFactory.eINSTANCE.createPQ()); + target.setEffectiveTime(ts); + se.setEffectiveTime(ts); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected void updateToPass(OperativeNote target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + ts.setHigh(DatatypesFactory.eINSTANCE.createIVXB_TS()); + target.setEffectiveTime(ts); + se.setEffectiveTime(ts); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return OperativeNoteOperations.validateOperativeNoteDocumentationOfServiceEventEffectiveTimeHasHighWhenNoWidth( + (OperativeNote) objectToTest, diagnostician, map); + } + + }; + + validateOperativeNoteDocumentationOfServiceEventEffectiveTimeHasHighWhenNoWidthTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateOperativeNoteDocumentationOfServiceEventEffectiveTimeNoHighIfWidth() { + OperationsTestCase validateOperativeNoteDocumentationOfServiceEventEffectiveTimeNoHighIfWidthTestCase = new OperationsTestCase( + "validateOperativeNoteDocumentationOfServiceEventEffectiveTimeNoHighIfWidth", + operationsForOCL.getOCLValue("VALIDATE_OPERATIVE_NOTE_DOCUMENTATION_OF_SERVICE_EVENT_EFFECTIVE_TIME_NO_HIGH_IF_WIDTH__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(OperativeNote target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + ts.setHigh(DatatypesFactory.eINSTANCE.createIVXB_TS()); + ts.setWidth(DatatypesFactory.eINSTANCE.createPQ()); + target.setEffectiveTime(ts); + se.setEffectiveTime(ts); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected void updateToPass(OperativeNote target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + + ts.setWidth(DatatypesFactory.eINSTANCE.createPQ()); + target.setEffectiveTime(ts); + se.setEffectiveTime(ts); + + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return OperativeNoteOperations.validateOperativeNoteDocumentationOfServiceEventEffectiveTimeNoHighIfWidth( + (OperativeNote) objectToTest, diagnostician, map); + } + + }; + + validateOperativeNoteDocumentationOfServiceEventEffectiveTimeNoHighIfWidthTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateOperativeNoteDocumentationOfServiceEventCode() { + OperationsTestCase validateOperativeNoteDocumentationOfServiceEventCodeTestCase = new OperationsTestCase( + "validateOperativeNoteDocumentationOfServiceEventCode", + operationsForOCL.getOCLValue("VALIDATE_OPERATIVE_NOTE_DOCUMENTATION_OF_SERVICE_EVENT_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(OperativeNote target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected void updateToPass(OperativeNote target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + CE ce = DatatypesFactory.eINSTANCE.createCE(); + se.setCode(ce); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return OperativeNoteOperations.validateOperativeNoteDocumentationOfServiceEventCode( + (OperativeNote) objectToTest, diagnostician, map); + } + + }; + + validateOperativeNoteDocumentationOfServiceEventCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateOperativeNoteDocumentationOfServiceEventEffectiveTime() { + OperationsTestCase validateOperativeNoteDocumentationOfServiceEventEffectiveTimeTestCase = new OperationsTestCase( + "validateOperativeNoteDocumentationOfServiceEventEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_OPERATIVE_NOTE_DOCUMENTATION_OF_SERVICE_EVENT_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(OperativeNote target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected void updateToPass(OperativeNote target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + se.setEffectiveTime(ts); + + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return OperativeNoteOperations.validateOperativeNoteDocumentationOfServiceEventEffectiveTime( + (OperativeNote) objectToTest, diagnostician, map); + } + + }; + + validateOperativeNoteDocumentationOfServiceEventEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateOperativeNoteDocumentationOfServiceEventPrimaryPerformer() { + OperationsTestCase validateOperativeNoteDocumentationOfServiceEventPrimaryPerformerTestCase = new OperationsTestCase( + "validateOperativeNoteDocumentationOfServiceEventPrimaryPerformer", + operationsForOCL.getOCLValue("VALIDATE_OPERATIVE_NOTE_DOCUMENTATION_OF_SERVICE_EVENT_PRIMARY_PERFORMER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(OperativeNote target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + Performer1 perf = CDAFactory.eINSTANCE.createPerformer1(); + se.getPerformers().add(perf); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected void updateToPass(OperativeNote target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + Performer1 perf = CDAFactory.eINSTANCE.createPerformer1(); + perf.setTypeCode(x_ServiceEventPerformer.PPRF); + se.getPerformers().add(perf); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return OperativeNoteOperations.validateOperativeNoteDocumentationOfServiceEventPrimaryPerformer( + (OperativeNote) objectToTest, diagnostician, map); + } + + }; + + validateOperativeNoteDocumentationOfServiceEventPrimaryPerformerTestCase.doValidationTest(); + } + + /** + * + * @generated not not + */ + @Test + public void testValidateOperativeNoteDocumentationOfServiceEvent() { + OperationsTestCase validateOperativeNoteDocumentationOfServiceEventTestCase = new OperationsTestCase( + "validateOperativeNoteDocumentationOfServiceEvent", + operationsForOCL.getOCLValue("VALIDATE_OPERATIVE_NOTE_DOCUMENTATION_OF_SERVICE_EVENT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(OperativeNote target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + + target.getDocumentationOfs().add(dof); + + } + + @Override + protected void updateToPass(OperativeNote target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return OperativeNoteOperations.validateOperativeNoteDocumentationOfServiceEvent( + (OperativeNote) objectToTest, diagnostician, map); + } + + }; + + validateOperativeNoteDocumentationOfServiceEventTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetAnesthesiaSection() { + + OperativeNote target = objectFactory.create(); + target.getAnesthesiaSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetComplicationsSection() { + + OperativeNote target = objectFactory.create(); + target.getComplicationsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPostoperativeDiagnosisSection() { + + OperativeNote target = objectFactory.create(); + target.getPostoperativeDiagnosisSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPreoperativeDiagnosisSection() { + + OperativeNote target = objectFactory.create(); + target.getPreoperativeDiagnosisSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProcedureEstimatedBloodLossSection() { + + OperativeNote target = objectFactory.create(); + target.getProcedureEstimatedBloodLossSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProcedureFindingsSection() { + + OperativeNote target = objectFactory.create(); + target.getProcedureFindingsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProcedureSpecimensTakenSection() { + + OperativeNote target = objectFactory.create(); + target.getProcedureSpecimensTakenSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProcedureDescriptionSection() { + + OperativeNote target = objectFactory.create(); + target.getProcedureDescriptionSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProcedureImplantsSection() { + + OperativeNote target = objectFactory.create(); + target.getProcedureImplantsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetOperativeNoteFluidSection() { + + OperativeNote target = objectFactory.create(); + target.getOperativeNoteFluidSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetOperativeNoteSurgicalProcedureSection() { + + OperativeNote target = objectFactory.create(); + target.getOperativeNoteSurgicalProcedureSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPlanOfCareSection() { + + OperativeNote target = objectFactory.create(); + target.getPlanOfCareSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPlannedProcedureSection() { + + OperativeNote target = objectFactory.create(); + target.getPlannedProcedureSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProcedureDispositionSection() { + + OperativeNote target = objectFactory.create(); + target.getProcedureDispositionSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProcedureIndicationsSection() { + + OperativeNote target = objectFactory.create(); + target.getProcedureIndicationsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetSurgicalDrainsSection() { + + OperativeNote target = objectFactory.create(); + target.getSurgicalDrainsSection(); + + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsCode() { + OperationsTestCase validateGeneralHeaderConstraintsCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(OperativeNote target) { + + } + + @Override + protected void updateToPass(OperativeNote target) { + target.init(); + target.setCode(DatatypesFactory.eINSTANCE.createCE("code", "2.16.840.1.113883.6.1")); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsCode( + (OperativeNote) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends OperativeNoteOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public OperativeNote create() { + return ConsolFactory.eINSTANCE.createOperativeNote(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends OperativeNoteOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // OperativeNoteOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PayersSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PayersSectionTest.java new file mode 100644 index 000000000..68ff9e034 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PayersSectionTest.java @@ -0,0 +1,336 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.PayersSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.PayersSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Payers Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PayersSection#validatePayersSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Payers Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PayersSection#validatePayersSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Payers Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PayersSection#validatePayersSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Payers Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PayersSection#validatePayersSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Payers Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PayersSection#validatePayersSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Payers Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PayersSection#validatePayersSectionCoverageActivity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Payers Section Coverage Activity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PayersSection#getCoverageActivities() Get Coverage Activities}
  • + *
+ *

+ * + * @generated + */ + +public class PayersSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidatePayersSectionTemplateId() { + OperationsTestCase validatePayersSectionTemplateIdTestCase = new OperationsTestCase( + "validatePayersSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PAYERS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PayersSection target) { + + } + + @Override + protected void updateToPass(PayersSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PayersSectionOperations.validatePayersSectionTemplateId( + (PayersSection) objectToTest, diagnostician, map); + } + + }; + + validatePayersSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePayersSectionCode() { + OperationsTestCase validatePayersSectionCodeTestCase = new OperationsTestCase( + "validatePayersSectionCode", + operationsForOCL.getOCLValue("VALIDATE_PAYERS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(PayersSection target) { + + } + + @Override + protected void updateToPass(PayersSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PayersSectionOperations.validatePayersSectionCode( + (PayersSection) objectToTest, diagnostician, map); + } + + }; + + validatePayersSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePayersSectionCodeP() { + OperationsTestCase validatePayersSectionCodePTestCase = new OperationsTestCase( + "validatePayersSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_PAYERS_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PayersSection target) { + + } + + @Override + protected void updateToPass(PayersSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PayersSectionOperations.validatePayersSectionCodeP( + (PayersSection) objectToTest, diagnostician, map); + } + + }; + + validatePayersSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePayersSectionTitle() { + OperationsTestCase validatePayersSectionTitleTestCase = new OperationsTestCase( + "validatePayersSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_PAYERS_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PayersSection target) { + + } + + @Override + protected void updateToPass(PayersSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PayersSectionOperations.validatePayersSectionTitle( + (PayersSection) objectToTest, diagnostician, map); + } + + }; + + validatePayersSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePayersSectionText() { + OperationsTestCase validatePayersSectionTextTestCase = new OperationsTestCase( + "validatePayersSectionText", + operationsForOCL.getOCLValue("VALIDATE_PAYERS_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(PayersSection target) { + + } + + @Override + protected void updateToPass(PayersSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PayersSectionOperations.validatePayersSectionText( + (PayersSection) objectToTest, diagnostician, map); + } + + }; + + validatePayersSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePayersSectionCoverageActivity() { + OperationsTestCase validatePayersSectionCoverageActivityTestCase = new OperationsTestCase( + "validatePayersSectionCoverageActivity", + operationsForOCL.getOCLValue("VALIDATE_PAYERS_SECTION_COVERAGE_ACTIVITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PayersSection target) { + target.init(); + } + + @Override + protected void updateToPass(PayersSection target) { + target.addAct(ConsolFactory.eINSTANCE.createCoverageActivity().init()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PayersSectionOperations.validatePayersSectionCoverageActivity( + (PayersSection) objectToTest, diagnostician, map); + } + + }; + + validatePayersSectionCoverageActivityTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetCoverageActivities() { + + PayersSection target = objectFactory.create(); + target.getCoverageActivities(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PayersSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public PayersSection create() { + return ConsolFactory.eINSTANCE.createPayersSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PayersSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PayersSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PersonTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PersonTest.java new file mode 100644 index 000000000..a2de9a46f --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PersonTest.java @@ -0,0 +1,45 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Person' model objects. + * + * + * + * @generated + */ + +public class PersonTest extends CDAValidationTest { + + /** + * No Operations Test + * @generated + */ + @Test + public void testNoOperations() { + } + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PersonOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PhysicalExamSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PhysicalExamSectionTest.java new file mode 100644 index 000000000..22eef5f11 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PhysicalExamSectionTest.java @@ -0,0 +1,434 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.PhysicalExamSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.PhysicalExamSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Physical Exam Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PhysicalExamSection#validatePhysicalExamSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physical Exam Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PhysicalExamSection#validatePhysicalExamSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physical Exam Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PhysicalExamSection#validatePhysicalExamSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physical Exam Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PhysicalExamSection#validatePhysicalExamSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physical Exam Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PhysicalExamSection#validatePhysicalExamSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physical Exam Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PhysicalExamSection#validatePhysicalExamSectionPressureUlcerObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physical Exam Section Pressure Ulcer Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PhysicalExamSection#validatePhysicalExamSectionNumberOfPressureUlcersObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physical Exam Section Number Of Pressure Ulcers Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PhysicalExamSection#validatePhysicalExamSectionHighestPressureUlcerStage(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physical Exam Section Highest Pressure Ulcer Stage}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PhysicalExamSection#getPressureUlcerObservations() Get Pressure Ulcer Observations}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PhysicalExamSection#getNumberOfPressureUlcersObservations() Get Number Of Pressure Ulcers Observations}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PhysicalExamSection#getHighestPressureUlcerStages() Get Highest Pressure Ulcer Stages}
  • + *
+ *

+ * + * @generated + */ + +public class PhysicalExamSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidatePhysicalExamSectionTemplateId() { + OperationsTestCase validatePhysicalExamSectionTemplateIdTestCase = new OperationsTestCase( + "validatePhysicalExamSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PHYSICAL_EXAM_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicalExamSection target) { + + } + + @Override + protected void updateToPass(PhysicalExamSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicalExamSectionOperations.validatePhysicalExamSectionTemplateId( + (PhysicalExamSection) objectToTest, diagnostician, map); + } + + }; + + validatePhysicalExamSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePhysicalExamSectionCode() { + OperationsTestCase validatePhysicalExamSectionCodeTestCase = new OperationsTestCase( + "validatePhysicalExamSectionCode", + operationsForOCL.getOCLValue("VALIDATE_PHYSICAL_EXAM_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicalExamSection target) { + + } + + @Override + protected void updateToPass(PhysicalExamSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicalExamSectionOperations.validatePhysicalExamSectionCode( + (PhysicalExamSection) objectToTest, diagnostician, map); + } + + }; + + validatePhysicalExamSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePhysicalExamSectionCodeP() { + OperationsTestCase validatePhysicalExamSectionCodePTestCase = new OperationsTestCase( + "validatePhysicalExamSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_PHYSICAL_EXAM_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicalExamSection target) { + + } + + @Override + protected void updateToPass(PhysicalExamSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicalExamSectionOperations.validatePhysicalExamSectionCodeP( + (PhysicalExamSection) objectToTest, diagnostician, map); + } + + }; + + validatePhysicalExamSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePhysicalExamSectionTitle() { + OperationsTestCase validatePhysicalExamSectionTitleTestCase = new OperationsTestCase( + "validatePhysicalExamSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_PHYSICAL_EXAM_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicalExamSection target) { + + } + + @Override + protected void updateToPass(PhysicalExamSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicalExamSectionOperations.validatePhysicalExamSectionTitle( + (PhysicalExamSection) objectToTest, diagnostician, map); + } + + }; + + validatePhysicalExamSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePhysicalExamSectionText() { + OperationsTestCase validatePhysicalExamSectionTextTestCase = new OperationsTestCase( + "validatePhysicalExamSectionText", + operationsForOCL.getOCLValue("VALIDATE_PHYSICAL_EXAM_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicalExamSection target) { + + } + + @Override + protected void updateToPass(PhysicalExamSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicalExamSectionOperations.validatePhysicalExamSectionText( + (PhysicalExamSection) objectToTest, diagnostician, map); + } + + }; + + validatePhysicalExamSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePhysicalExamSectionPressureUlcerObservation() { + OperationsTestCase validatePhysicalExamSectionPressureUlcerObservationTestCase = new OperationsTestCase( + "validatePhysicalExamSectionPressureUlcerObservation", + operationsForOCL.getOCLValue("VALIDATE_PHYSICAL_EXAM_SECTION_PRESSURE_ULCER_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicalExamSection target) { + + } + + @Override + protected void updateToPass(PhysicalExamSection target) { + target.init(); + target.addObservation(ConsolFactory.eINSTANCE.createPressureUlcerObservation()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicalExamSectionOperations.validatePhysicalExamSectionPressureUlcerObservation( + (PhysicalExamSection) objectToTest, diagnostician, map); + } + + }; + + validatePhysicalExamSectionPressureUlcerObservationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePhysicalExamSectionNumberOfPressureUlcersObservation() { + OperationsTestCase validatePhysicalExamSectionNumberOfPressureUlcersObservationTestCase = new OperationsTestCase( + "validatePhysicalExamSectionNumberOfPressureUlcersObservation", + operationsForOCL.getOCLValue("VALIDATE_PHYSICAL_EXAM_SECTION_NUMBER_OF_PRESSURE_ULCERS_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicalExamSection target) { + + } + + @Override + protected void updateToPass(PhysicalExamSection target) { + target.init(); + target.addObservation(ConsolFactory.eINSTANCE.createNumberOfPressureUlcersObservation()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicalExamSectionOperations.validatePhysicalExamSectionNumberOfPressureUlcersObservation( + (PhysicalExamSection) objectToTest, diagnostician, map); + } + + }; + + validatePhysicalExamSectionNumberOfPressureUlcersObservationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePhysicalExamSectionHighestPressureUlcerStage() { + OperationsTestCase validatePhysicalExamSectionHighestPressureUlcerStageTestCase = new OperationsTestCase( + "validatePhysicalExamSectionHighestPressureUlcerStage", + operationsForOCL.getOCLValue("VALIDATE_PHYSICAL_EXAM_SECTION_HIGHEST_PRESSURE_ULCER_STAGE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicalExamSection target) { + + } + + @Override + protected void updateToPass(PhysicalExamSection target) { + target.init(); + target.addObservation(ConsolFactory.eINSTANCE.createHighestPressureUlcerStage()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicalExamSectionOperations.validatePhysicalExamSectionHighestPressureUlcerStage( + (PhysicalExamSection) objectToTest, diagnostician, map); + } + + }; + + validatePhysicalExamSectionHighestPressureUlcerStageTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetPressureUlcerObservations() { + + PhysicalExamSection target = objectFactory.create(); + target.getPressureUlcerObservations(); + + } + + /** + * + * @generated + */ + @Test + public void testGetNumberOfPressureUlcersObservations() { + + PhysicalExamSection target = objectFactory.create(); + target.getNumberOfPressureUlcersObservations(); + + } + + /** + * + * @generated + */ + @Test + public void testGetHighestPressureUlcerStages() { + + PhysicalExamSection target = objectFactory.create(); + target.getHighestPressureUlcerStages(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PhysicalExamSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public PhysicalExamSection create() { + return ConsolFactory.eINSTANCE.createPhysicalExamSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PhysicalExamSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PhysicalExamSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PhysicianReadingStudyPerformerTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PhysicianReadingStudyPerformerTest.java new file mode 100644 index 000000000..dbb7e8f20 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PhysicianReadingStudyPerformerTest.java @@ -0,0 +1,453 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.AssignedEntity; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.PhysicianReadingStudyPerformer; +import org.openhealthtools.mdht.uml.cda.consol.operations.PhysicianReadingStudyPerformerOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ServiceEventPerformer; + +/** + * + * A static utility class that provides operations related to 'Physician Reading Study Performer' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PhysicianReadingStudyPerformer#validatePhysicianReadingStudyPerformerTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physician Reading Study Performer Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PhysicianReadingStudyPerformer#validatePhysicianReadingStudyPerformerTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physician Reading Study Performer Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PhysicianReadingStudyPerformer#validatePhysicianReadingStudyPerformerTypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physician Reading Study Performer Type Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PhysicianReadingStudyPerformer#validatePhysicianReadingStudyPerformerAssignedEntity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physician Reading Study Performer Assigned Entity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PhysicianReadingStudyPerformer#validatePhysicianReadingStudyPerformerAssignedEntityHasNationalProviderId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physician Reading Study Performer Assigned Entity Has National Provider Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PhysicianReadingStudyPerformer#validatePhysicianReadingStudyPerformerAssignedEntityHasDICOM(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physician Reading Study Performer Assigned Entity Has DICOM}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PhysicianReadingStudyPerformer#validatePhysicianReadingStudyPerformerAssignedEntityHasAssignedPersonOrRepresentedOrganization(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physician Reading Study Performer Assigned Entity Has Assigned Person Or Represented Organization}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PhysicianReadingStudyPerformer#validatePhysicianReadingStudyPerformerAssignedEntityCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physician Reading Study Performer Assigned Entity Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PhysicianReadingStudyPerformer#validatePhysicianReadingStudyPerformerAssignedEntityId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physician Reading Study Performer Assigned Entity Id}
  • + *
+ *

+ * + * @generated + */ + +public class PhysicianReadingStudyPerformerTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidatePhysicianReadingStudyPerformerTemplateId() { + OperationsTestCase validatePhysicianReadingStudyPerformerTemplateIdTestCase = new OperationsTestCase( + "validatePhysicianReadingStudyPerformerTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PHYSICIAN_READING_STUDY_PERFORMER_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicianReadingStudyPerformer target) { + + } + + @Override + protected void updateToPass(PhysicianReadingStudyPerformer target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicianReadingStudyPerformerOperations.validatePhysicianReadingStudyPerformerTemplateId( + (PhysicianReadingStudyPerformer) objectToTest, diagnostician, map); + } + + }; + + validatePhysicianReadingStudyPerformerTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePhysicianReadingStudyPerformerTime() { + OperationsTestCase validatePhysicianReadingStudyPerformerTimeTestCase = new OperationsTestCase( + "validatePhysicianReadingStudyPerformerTime", + operationsForOCL.getOCLValue("VALIDATE_PHYSICIAN_READING_STUDY_PERFORMER_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicianReadingStudyPerformer target) { + target.init(); + } + + @Override + protected void updateToPass(PhysicianReadingStudyPerformer target) { + target.setTime(DatatypesFactory.eINSTANCE.createIVL_TS()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicianReadingStudyPerformerOperations.validatePhysicianReadingStudyPerformerTime( + (PhysicianReadingStudyPerformer) objectToTest, diagnostician, map); + } + + }; + + validatePhysicianReadingStudyPerformerTimeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePhysicianReadingStudyPerformerTypeCode() { + OperationsTestCase validatePhysicianReadingStudyPerformerTypeCodeTestCase = new OperationsTestCase( + "validatePhysicianReadingStudyPerformerTypeCode", + operationsForOCL.getOCLValue("VALIDATE_PHYSICIAN_READING_STUDY_PERFORMER_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicianReadingStudyPerformer target) { + target.init(); + } + + @Override + protected void updateToPass(PhysicianReadingStudyPerformer target) { + + target.setTypeCode(x_ServiceEventPerformer.PPRF); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicianReadingStudyPerformerOperations.validatePhysicianReadingStudyPerformerTypeCode( + (PhysicianReadingStudyPerformer) objectToTest, diagnostician, map); + } + + }; + + validatePhysicianReadingStudyPerformerTypeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePhysicianReadingStudyPerformerAssignedEntity() { + OperationsTestCase validatePhysicianReadingStudyPerformerAssignedEntityTestCase = new OperationsTestCase( + "validatePhysicianReadingStudyPerformerAssignedEntity", + operationsForOCL.getOCLValue("VALIDATE_PHYSICIAN_READING_STUDY_PERFORMER_ASSIGNED_ENTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicianReadingStudyPerformer target) { + target.init(); + } + + @Override + protected void updateToPass(PhysicianReadingStudyPerformer target) { + + target.setAssignedEntity(CDAFactory.eINSTANCE.createAssignedEntity()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicianReadingStudyPerformerOperations.validatePhysicianReadingStudyPerformerAssignedEntity( + (PhysicianReadingStudyPerformer) objectToTest, diagnostician, map); + } + + }; + + validatePhysicianReadingStudyPerformerAssignedEntityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePhysicianReadingStudyPerformerAssignedEntityHasNationalProviderId() { + OperationsTestCase validatePhysicianReadingStudyPerformerAssignedEntityHasNationalProviderIdTestCase = new OperationsTestCase( + "validatePhysicianReadingStudyPerformerAssignedEntityHasNationalProviderId", + operationsForOCL.getOCLValue("VALIDATE_PHYSICIAN_READING_STUDY_PERFORMER_ASSIGNED_ENTITY_HAS_NATIONAL_PROVIDER_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicianReadingStudyPerformer target) { + target.init(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getIds().add(DatatypesFactory.eINSTANCE.createII()); + target.setAssignedEntity(ae); + } + + @Override + protected void updateToPass(PhysicianReadingStudyPerformer target) { + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + II id = DatatypesFactory.eINSTANCE.createII(); + id.setRoot("2.16.840.1.113883.4.6"); + ae.getIds().add(id); + target.setAssignedEntity(ae); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicianReadingStudyPerformerOperations.validatePhysicianReadingStudyPerformerAssignedEntityHasNationalProviderId( + (PhysicianReadingStudyPerformer) objectToTest, diagnostician, map); + } + + }; + + validatePhysicianReadingStudyPerformerAssignedEntityHasNationalProviderIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePhysicianReadingStudyPerformerAssignedEntityHasDICOM() { + OperationsTestCase validatePhysicianReadingStudyPerformerAssignedEntityHasDICOMTestCase = new OperationsTestCase( + "validatePhysicianReadingStudyPerformerAssignedEntityHasDICOM", + operationsForOCL.getOCLValue("VALIDATE_PHYSICIAN_READING_STUDY_PERFORMER_ASSIGNED_ENTITY_HAS_DICOM__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicianReadingStudyPerformer target) { + target.init(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.setCode(DatatypesFactory.eINSTANCE.createCE()); + target.setAssignedEntity(ae); + } + + @Override + protected void updateToPass(PhysicianReadingStudyPerformer target) { + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.setCode(DatatypesFactory.eINSTANCE.createCE("test", "1.2.840.10008.2.16.4")); + target.setAssignedEntity(ae); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicianReadingStudyPerformerOperations.validatePhysicianReadingStudyPerformerAssignedEntityHasDICOM( + (PhysicianReadingStudyPerformer) objectToTest, diagnostician, map); + } + + }; + + validatePhysicianReadingStudyPerformerAssignedEntityHasDICOMTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePhysicianReadingStudyPerformerAssignedEntityHasAssignedPersonOrRepresentedOrganization() { + OperationsTestCase validatePhysicianReadingStudyPerformerAssignedEntityHasAssignedPersonOrRepresentedOrganizationTestCase = new OperationsTestCase( + "validatePhysicianReadingStudyPerformerAssignedEntityHasAssignedPersonOrRepresentedOrganization", + operationsForOCL.getOCLValue("VALIDATE_PHYSICIAN_READING_STUDY_PERFORMER_ASSIGNED_ENTITY_HAS_ASSIGNED_PERSON_OR_REPRESENTED_ORGANIZATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicianReadingStudyPerformer target) { + target.init(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + + target.setAssignedEntity(ae); + } + + @Override + protected void updateToPass(PhysicianReadingStudyPerformer target) { + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.setAssignedPerson(CDAFactory.eINSTANCE.createPerson()); + target.setAssignedEntity(ae); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicianReadingStudyPerformerOperations.validatePhysicianReadingStudyPerformerAssignedEntityHasAssignedPersonOrRepresentedOrganization( + (PhysicianReadingStudyPerformer) objectToTest, diagnostician, map); + } + + }; + + validatePhysicianReadingStudyPerformerAssignedEntityHasAssignedPersonOrRepresentedOrganizationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePhysicianReadingStudyPerformerAssignedEntityCode() { + OperationsTestCase validatePhysicianReadingStudyPerformerAssignedEntityCodeTestCase = new OperationsTestCase( + "validatePhysicianReadingStudyPerformerAssignedEntityCode", + operationsForOCL.getOCLValue("VALIDATE_PHYSICIAN_READING_STUDY_PERFORMER_ASSIGNED_ENTITY_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicianReadingStudyPerformer target) { + target.init(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + target.setAssignedEntity(ae); + } + + @Override + protected void updateToPass(PhysicianReadingStudyPerformer target) { + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.setCode(DatatypesFactory.eINSTANCE.createCE("test", "1.2.840.10008.2.16.4")); + target.setAssignedEntity(ae); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicianReadingStudyPerformerOperations.validatePhysicianReadingStudyPerformerAssignedEntityCode( + (PhysicianReadingStudyPerformer) objectToTest, diagnostician, map); + } + + }; + + validatePhysicianReadingStudyPerformerAssignedEntityCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePhysicianReadingStudyPerformerAssignedEntityId() { + OperationsTestCase validatePhysicianReadingStudyPerformerAssignedEntityIdTestCase = new OperationsTestCase( + "validatePhysicianReadingStudyPerformerAssignedEntityId", + operationsForOCL.getOCLValue("VALIDATE_PHYSICIAN_READING_STUDY_PERFORMER_ASSIGNED_ENTITY_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicianReadingStudyPerformer target) { + target.init(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + target.setAssignedEntity(ae); + } + + @Override + protected void updateToPass(PhysicianReadingStudyPerformer target) { + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + II id = DatatypesFactory.eINSTANCE.createII(); + id.setRoot("2.16.840.1.113883.4.6"); + ae.getIds().add(id); + target.setAssignedEntity(ae); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicianReadingStudyPerformerOperations.validatePhysicianReadingStudyPerformerAssignedEntityId( + (PhysicianReadingStudyPerformer) objectToTest, diagnostician, map); + } + + }; + + validatePhysicianReadingStudyPerformerAssignedEntityIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PhysicianReadingStudyPerformerOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public PhysicianReadingStudyPerformer create() { + return ConsolFactory.eINSTANCE.createPhysicianReadingStudyPerformer(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PhysicianReadingStudyPerformerOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PhysicianReadingStudyPerformerOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PhysicianofRecordParticipantTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PhysicianofRecordParticipantTest.java new file mode 100644 index 000000000..0a8178789 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PhysicianofRecordParticipantTest.java @@ -0,0 +1,457 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.AssignedEntity; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Person; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.PhysicianofRecordParticipant; +import org.openhealthtools.mdht.uml.cda.consol.operations.PhysicianofRecordParticipantOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; + +/** + * + * A static utility class that provides operations related to 'Physicianof Record Participant' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PhysicianofRecordParticipant#validatePhysicianofRecordParticipantTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physicianof Record Participant Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PhysicianofRecordParticipant#validatePhysicianofRecordParticipantTypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physicianof Record Participant Type Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PhysicianofRecordParticipant#validatePhysicianofRecordParticipantAssignedEntity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physicianof Record Participant Assigned Entity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PhysicianofRecordParticipant#validatePhysicianofRecordParticipantAssignedEntityAssignedPersonName(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physicianof Record Participant Assigned Entity Assigned Person Name}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PhysicianofRecordParticipant#validatePhysicianofRecordParticipantAssignedEntityHasDICOMOrNUCCCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physicianof Record Participant Assigned Entity Has DICOM Or NUCC Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PhysicianofRecordParticipant#validatePhysicianofRecordParticipantAssignedEntityHasNationalProviderId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physicianof Record Participant Assigned Entity Has National Provider Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PhysicianofRecordParticipant#validatePhysicianofRecordParticipantAssignedEntityCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physicianof Record Participant Assigned Entity Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PhysicianofRecordParticipant#validatePhysicianofRecordParticipantAssignedEntityId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physicianof Record Participant Assigned Entity Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PhysicianofRecordParticipant#validatePhysicianofRecordParticipantAssignedEntityAssignedPerson(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physicianof Record Participant Assigned Entity Assigned Person}
  • + *
+ *

+ * + * @generated + */ + +public class PhysicianofRecordParticipantTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidatePhysicianofRecordParticipantTemplateId() { + OperationsTestCase validatePhysicianofRecordParticipantTemplateIdTestCase = new OperationsTestCase( + "validatePhysicianofRecordParticipantTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PHYSICIANOF_RECORD_PARTICIPANT_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicianofRecordParticipant target) { + + } + + @Override + protected void updateToPass(PhysicianofRecordParticipant target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicianofRecordParticipantOperations.validatePhysicianofRecordParticipantTemplateId( + (PhysicianofRecordParticipant) objectToTest, diagnostician, map); + } + + }; + + validatePhysicianofRecordParticipantTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePhysicianofRecordParticipantTypeCode() { + OperationsTestCase validatePhysicianofRecordParticipantTypeCodeTestCase = new OperationsTestCase( + "validatePhysicianofRecordParticipantTypeCode", + operationsForOCL.getOCLValue("VALIDATE_PHYSICIANOF_RECORD_PARTICIPANT_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicianofRecordParticipant target) { + + } + + @Override + protected void updateToPass(PhysicianofRecordParticipant target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicianofRecordParticipantOperations.validatePhysicianofRecordParticipantTypeCode( + (PhysicianofRecordParticipant) objectToTest, diagnostician, map); + } + + }; + + validatePhysicianofRecordParticipantTypeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePhysicianofRecordParticipantAssignedEntity() { + OperationsTestCase validatePhysicianofRecordParticipantAssignedEntityTestCase = new OperationsTestCase( + "validatePhysicianofRecordParticipantAssignedEntity", + operationsForOCL.getOCLValue("VALIDATE_PHYSICIANOF_RECORD_PARTICIPANT_ASSIGNED_ENTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicianofRecordParticipant target) { + target.init(); + } + + @Override + protected void updateToPass(PhysicianofRecordParticipant target) { + target.setAssignedEntity(CDAFactory.eINSTANCE.createAssignedEntity()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicianofRecordParticipantOperations.validatePhysicianofRecordParticipantAssignedEntity( + (PhysicianofRecordParticipant) objectToTest, diagnostician, map); + } + + }; + + validatePhysicianofRecordParticipantAssignedEntityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePhysicianofRecordParticipantAssignedEntityAssignedPersonName() { + OperationsTestCase validatePhysicianofRecordParticipantAssignedEntityAssignedPersonNameTestCase = new OperationsTestCase( + "validatePhysicianofRecordParticipantAssignedEntityAssignedPersonName", + operationsForOCL.getOCLValue("VALIDATE_PHYSICIANOF_RECORD_PARTICIPANT_ASSIGNED_ENTITY_ASSIGNED_PERSON_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicianofRecordParticipant target) { + target.init(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + Person ap = CDAFactory.eINSTANCE.createPerson(); + ae.setAssignedPerson(ap); + target.setAssignedEntity(ae); + } + + @Override + protected void updateToPass(PhysicianofRecordParticipant target) { + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + Person ap = CDAFactory.eINSTANCE.createPerson(); + ap.getNames().add(DatatypesFactory.eINSTANCE.createPN()); + ae.setAssignedPerson(ap); + target.setAssignedEntity(ae); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicianofRecordParticipantOperations.validatePhysicianofRecordParticipantAssignedEntityAssignedPersonName( + (PhysicianofRecordParticipant) objectToTest, diagnostician, map); + } + + }; + + validatePhysicianofRecordParticipantAssignedEntityAssignedPersonNameTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePhysicianofRecordParticipantAssignedEntityHasDICOMOrNUCCCode() { + OperationsTestCase validatePhysicianofRecordParticipantAssignedEntityHasDICOMOrNUCCCodeTestCase = new OperationsTestCase( + "validatePhysicianofRecordParticipantAssignedEntityHasDICOMOrNUCCCode", + operationsForOCL.getOCLValue("VALIDATE_PHYSICIANOF_RECORD_PARTICIPANT_ASSIGNED_ENTITY_HAS_DICOM_OR_NUCC_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicianofRecordParticipant target) { + target.init(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.setCode(DatatypesFactory.eINSTANCE.createCE()); + target.setAssignedEntity(ae); + } + + @Override + protected void updateToPass(PhysicianofRecordParticipant target) { + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.setCode(DatatypesFactory.eINSTANCE.createCE("test", "1.2.840.10008.2.16.4")); + target.setAssignedEntity(ae); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicianofRecordParticipantOperations.validatePhysicianofRecordParticipantAssignedEntityHasDICOMOrNUCCCode( + (PhysicianofRecordParticipant) objectToTest, diagnostician, map); + } + + }; + + validatePhysicianofRecordParticipantAssignedEntityHasDICOMOrNUCCCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePhysicianofRecordParticipantAssignedEntityHasNationalProviderId() { + OperationsTestCase validatePhysicianofRecordParticipantAssignedEntityHasNationalProviderIdTestCase = new OperationsTestCase( + "validatePhysicianofRecordParticipantAssignedEntityHasNationalProviderId", + operationsForOCL.getOCLValue("VALIDATE_PHYSICIANOF_RECORD_PARTICIPANT_ASSIGNED_ENTITY_HAS_NATIONAL_PROVIDER_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicianofRecordParticipant target) { + target.init(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getIds().add(DatatypesFactory.eINSTANCE.createII()); + target.setAssignedEntity(ae); + } + + @Override + protected void updateToPass(PhysicianofRecordParticipant target) { + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + II id = DatatypesFactory.eINSTANCE.createII(); + id.setRoot("2.16.840.1.113883.4.6"); + ae.getIds().add(id); + target.setAssignedEntity(ae); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicianofRecordParticipantOperations.validatePhysicianofRecordParticipantAssignedEntityHasNationalProviderId( + (PhysicianofRecordParticipant) objectToTest, diagnostician, map); + } + + }; + + validatePhysicianofRecordParticipantAssignedEntityHasNationalProviderIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePhysicianofRecordParticipantAssignedEntityCode() { + OperationsTestCase validatePhysicianofRecordParticipantAssignedEntityCodeTestCase = new OperationsTestCase( + "validatePhysicianofRecordParticipantAssignedEntityCode", + operationsForOCL.getOCLValue("VALIDATE_PHYSICIANOF_RECORD_PARTICIPANT_ASSIGNED_ENTITY_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicianofRecordParticipant target) { + target.init(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + target.setAssignedEntity(ae); + } + + @Override + protected void updateToPass(PhysicianofRecordParticipant target) { + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.setCode(DatatypesFactory.eINSTANCE.createCE("test", "1.2.840.10008.2.16.4")); + target.setAssignedEntity(ae); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicianofRecordParticipantOperations.validatePhysicianofRecordParticipantAssignedEntityCode( + (PhysicianofRecordParticipant) objectToTest, diagnostician, map); + } + + }; + + validatePhysicianofRecordParticipantAssignedEntityCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePhysicianofRecordParticipantAssignedEntityId() { + OperationsTestCase validatePhysicianofRecordParticipantAssignedEntityIdTestCase = new OperationsTestCase( + "validatePhysicianofRecordParticipantAssignedEntityId", + operationsForOCL.getOCLValue("VALIDATE_PHYSICIANOF_RECORD_PARTICIPANT_ASSIGNED_ENTITY_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicianofRecordParticipant target) { + target.init(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + target.setAssignedEntity(ae); + } + + @Override + protected void updateToPass(PhysicianofRecordParticipant target) { + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getIds().add(DatatypesFactory.eINSTANCE.createII()); + target.setAssignedEntity(ae); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicianofRecordParticipantOperations.validatePhysicianofRecordParticipantAssignedEntityId( + (PhysicianofRecordParticipant) objectToTest, diagnostician, map); + } + + }; + + validatePhysicianofRecordParticipantAssignedEntityIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePhysicianofRecordParticipantAssignedEntityAssignedPerson() { + OperationsTestCase validatePhysicianofRecordParticipantAssignedEntityAssignedPersonTestCase = new OperationsTestCase( + "validatePhysicianofRecordParticipantAssignedEntityAssignedPerson", + operationsForOCL.getOCLValue("VALIDATE_PHYSICIANOF_RECORD_PARTICIPANT_ASSIGNED_ENTITY_ASSIGNED_PERSON__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicianofRecordParticipant target) { + target.init(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + target.setAssignedEntity(ae); + } + + @Override + protected void updateToPass(PhysicianofRecordParticipant target) { + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.setAssignedPerson(CDAFactory.eINSTANCE.createPerson()); + target.setAssignedEntity(ae); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicianofRecordParticipantOperations.validatePhysicianofRecordParticipantAssignedEntityAssignedPerson( + (PhysicianofRecordParticipant) objectToTest, diagnostician, map); + } + + }; + + validatePhysicianofRecordParticipantAssignedEntityAssignedPersonTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PhysicianofRecordParticipantOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public PhysicianofRecordParticipant create() { + return ConsolFactory.eINSTANCE.createPhysicianofRecordParticipant(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PhysicianofRecordParticipantOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PhysicianofRecordParticipantOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PlanOfCareActivityActTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PlanOfCareActivityActTest.java new file mode 100644 index 000000000..dbbe1978d --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PlanOfCareActivityActTest.java @@ -0,0 +1,257 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.PlanOfCareActivityAct; +import org.openhealthtools.mdht.uml.cda.consol.operations.PlanOfCareActivityActOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.vocab.x_DocumentActMood; + +/** + * + * A static utility class that provides operations related to 'Plan Of Care Activity Act' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlanOfCareActivityAct#validatePlanOfCareActivityActTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Activity Act Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlanOfCareActivityAct#validatePlanOfCareActivityActClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Activity Act Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlanOfCareActivityAct#validatePlanOfCareActivityActMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Activity Act Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlanOfCareActivityAct#validatePlanOfCareActivityActId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Activity Act Id}
  • + *
+ *

+ * + * @generated + */ + +public class PlanOfCareActivityActTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidatePlanOfCareActivityActTemplateId() { + OperationsTestCase validatePlanOfCareActivityActTemplateIdTestCase = new OperationsTestCase( + "validatePlanOfCareActivityActTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_ACTIVITY_ACT_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareActivityAct target) { + + } + + @Override + protected void updateToPass(PlanOfCareActivityAct target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareActivityActOperations.validatePlanOfCareActivityActTemplateId( + (PlanOfCareActivityAct) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareActivityActTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePlanOfCareActivityActClassCode() { + OperationsTestCase validatePlanOfCareActivityActClassCodeTestCase = new OperationsTestCase( + "validatePlanOfCareActivityActClassCode", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_ACTIVITY_ACT_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareActivityAct target) { + + } + + @Override + protected void updateToPass(PlanOfCareActivityAct target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareActivityActOperations.validatePlanOfCareActivityActClassCode( + (PlanOfCareActivityAct) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareActivityActClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePlanOfCareActivityActMoodCode() { + OperationsTestCase validatePlanOfCareActivityActMoodCodeTestCase = new OperationsTestCase( + "validatePlanOfCareActivityActMoodCode", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_ACTIVITY_ACT_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + { + // we cannot violate the constraint because it only checks that the mood + // code is non-null and of type x_DocumentActMood but EMF and Java enforce + // this + this.skipFailsTest(); + } + + @Override + protected void updateToFail(PlanOfCareActivityAct target) { + + } + + @Override + protected void updateToPass(PlanOfCareActivityAct target) { + target.init(); + target.setMoodCode(x_DocumentActMood.INT); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareActivityActOperations.validatePlanOfCareActivityActMoodCode( + (PlanOfCareActivityAct) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareActivityActMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePlanOfCareActivityActId() { + OperationsTestCase validatePlanOfCareActivityActIdTestCase = new OperationsTestCase( + "validatePlanOfCareActivityActId", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_ACTIVITY_ACT_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareActivityAct target) { + + } + + @Override + protected void updateToPass(PlanOfCareActivityAct target) { + target.init(); + II id = DatatypesFactory.eINSTANCE.createII(); + target.getIds().add(id); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareActivityActOperations.validatePlanOfCareActivityActId( + (PlanOfCareActivityAct) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareActivityActIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PlanOfCareActivityActOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public PlanOfCareActivityAct create() { + return ConsolFactory.eINSTANCE.createPlanOfCareActivityAct(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PlanOfCareActivityActOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PlanOfCareActivityActOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PlanOfCareActivityEncounterTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PlanOfCareActivityEncounterTest.java new file mode 100644 index 000000000..362d21aac --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PlanOfCareActivityEncounterTest.java @@ -0,0 +1,263 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.PlanOfCareActivityEncounter; +import org.openhealthtools.mdht.uml.cda.consol.operations.PlanOfCareActivityEncounterOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.vocab.x_DocumentEncounterMood; + +/** + * + * A static utility class that provides operations related to 'Plan Of Care Activity Encounter' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlanOfCareActivityEncounter#validatePlanOfCareActivityEncounterTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Activity Encounter Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlanOfCareActivityEncounter#validatePlanOfCareActivityEncounterClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Activity Encounter Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlanOfCareActivityEncounter#validatePlanOfCareActivityEncounterMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Activity Encounter Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlanOfCareActivityEncounter#validatePlanOfCareActivityEncounterId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Activity Encounter Id}
  • + *
+ *

+ * + * @generated + */ + +public class PlanOfCareActivityEncounterTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidatePlanOfCareActivityEncounterTemplateId() { + OperationsTestCase validatePlanOfCareActivityEncounterTemplateIdTestCase = new OperationsTestCase( + "validatePlanOfCareActivityEncounterTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_ACTIVITY_ENCOUNTER_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareActivityEncounter target) { + + } + + @Override + protected void updateToPass(PlanOfCareActivityEncounter target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareActivityEncounterOperations.validatePlanOfCareActivityEncounterTemplateId( + (PlanOfCareActivityEncounter) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareActivityEncounterTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePlanOfCareActivityEncounterClassCode() { + OperationsTestCase validatePlanOfCareActivityEncounterClassCodeTestCase = new OperationsTestCase( + "validatePlanOfCareActivityEncounterClassCode", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_ACTIVITY_ENCOUNTER_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + { + // we cannot violate the constraint because it only checks that the class + // code is non-null and of type ActClass but EMF and Java enforce this + this.skipFailsTest(); + } + + @Override + protected void updateToFail(PlanOfCareActivityEncounter target) { + + } + + @Override + protected void updateToPass(PlanOfCareActivityEncounter target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareActivityEncounterOperations.validatePlanOfCareActivityEncounterClassCode( + (PlanOfCareActivityEncounter) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareActivityEncounterClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePlanOfCareActivityEncounterMoodCode() { + OperationsTestCase validatePlanOfCareActivityEncounterMoodCodeTestCase = new OperationsTestCase( + "validatePlanOfCareActivityEncounterMoodCode", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_ACTIVITY_ENCOUNTER_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + { + // we cannot violate the constraint because it only checks that the mood + // code is non-null and of type x_DocumentEncounterMood but EMF and Java + // enforce this + this.skipFailsTest(); + } + + @Override + protected void updateToFail(PlanOfCareActivityEncounter target) { + + } + + @Override + protected void updateToPass(PlanOfCareActivityEncounter target) { + target.init(); + target.setMoodCode(x_DocumentEncounterMood.INT); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareActivityEncounterOperations.validatePlanOfCareActivityEncounterMoodCode( + (PlanOfCareActivityEncounter) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareActivityEncounterMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePlanOfCareActivityEncounterId() { + OperationsTestCase validatePlanOfCareActivityEncounterIdTestCase = new OperationsTestCase( + "validatePlanOfCareActivityEncounterId", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_ACTIVITY_ENCOUNTER_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareActivityEncounter target) { + + } + + @Override + protected void updateToPass(PlanOfCareActivityEncounter target) { + target.init(); + II id = DatatypesFactory.eINSTANCE.createII(); + target.getIds().add(id); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareActivityEncounterOperations.validatePlanOfCareActivityEncounterId( + (PlanOfCareActivityEncounter) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareActivityEncounterIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PlanOfCareActivityEncounterOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public PlanOfCareActivityEncounter create() { + return ConsolFactory.eINSTANCE.createPlanOfCareActivityEncounter(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PlanOfCareActivityEncounterOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PlanOfCareActivityEncounterOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PlanOfCareActivityObservationTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PlanOfCareActivityObservationTest.java new file mode 100644 index 000000000..7d3556402 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PlanOfCareActivityObservationTest.java @@ -0,0 +1,266 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.PlanOfCareActivityObservation; +import org.openhealthtools.mdht.uml.cda.consol.operations.PlanOfCareActivityObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActMoodDocumentObservation; + +/** + * + * A static utility class that provides operations related to 'Plan Of Care Activity Observation' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlanOfCareActivityObservation#validatePlanOfCareActivityObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Activity Observation Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlanOfCareActivityObservation#validatePlanOfCareActivityObservationClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Activity Observation Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlanOfCareActivityObservation#validatePlanOfCareActivityObservationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Activity Observation Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlanOfCareActivityObservation#validatePlanOfCareActivityObservationId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Activity Observation Id}
  • + *
+ *

+ * + * @generated + */ + +public class PlanOfCareActivityObservationTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidatePlanOfCareActivityObservationTemplateId() { + OperationsTestCase validatePlanOfCareActivityObservationTemplateIdTestCase = new OperationsTestCase( + "validatePlanOfCareActivityObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_ACTIVITY_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareActivityObservation target) { + + } + + @Override + protected void updateToPass(PlanOfCareActivityObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareActivityObservationOperations.validatePlanOfCareActivityObservationTemplateId( + (PlanOfCareActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareActivityObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePlanOfCareActivityObservationClassCode() { + OperationsTestCase validatePlanOfCareActivityObservationClassCodeTestCase = new OperationsTestCase( + "validatePlanOfCareActivityObservationClassCode", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_ACTIVITY_OBSERVATION_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + { + // we cannot violate the constraint because it only checks that the class + // code is non-null and of type ActClassObservation but EMF and Java enforce + // this + this.skipFailsTest(); + } + + @Override + protected void updateToFail(PlanOfCareActivityObservation target) { + + } + + @Override + protected void updateToPass(PlanOfCareActivityObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareActivityObservationOperations.validatePlanOfCareActivityObservationClassCode( + (PlanOfCareActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareActivityObservationClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePlanOfCareActivityObservationMoodCode() { + OperationsTestCase validatePlanOfCareActivityObservationMoodCodeTestCase = new OperationsTestCase( + "validatePlanOfCareActivityObservationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_ACTIVITY_OBSERVATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + { + // we cannot violate the constraint because it only checks that the mood + // code is non-null of type x_ActMoodDocumentObservation but EMF and Java + // enforce this + this.skipFailsTest(); + } + + @Override + protected void updateToFail(PlanOfCareActivityObservation target) { + + } + + @Override + protected void updateToPass(PlanOfCareActivityObservation target) { + target.init(); + + target.setMoodCode(x_ActMoodDocumentObservation.INT); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareActivityObservationOperations.validatePlanOfCareActivityObservationMoodCode( + (PlanOfCareActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareActivityObservationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePlanOfCareActivityObservationId() { + OperationsTestCase validatePlanOfCareActivityObservationIdTestCase = new OperationsTestCase( + "validatePlanOfCareActivityObservationId", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_ACTIVITY_OBSERVATION_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareActivityObservation target) { + + } + + @Override + protected void updateToPass(PlanOfCareActivityObservation target) { + target.init(); + + II ii = DatatypesFactory.eINSTANCE.createII(); + target.getIds().add(ii); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareActivityObservationOperations.validatePlanOfCareActivityObservationId( + (PlanOfCareActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareActivityObservationIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PlanOfCareActivityObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public PlanOfCareActivityObservation create() { + return ConsolFactory.eINSTANCE.createPlanOfCareActivityObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PlanOfCareActivityObservationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PlanOfCareActivityObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PlanOfCareActivityProcedureTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PlanOfCareActivityProcedureTest.java new file mode 100644 index 000000000..e7382e5a4 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PlanOfCareActivityProcedureTest.java @@ -0,0 +1,263 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.PlanOfCareActivityProcedure; +import org.openhealthtools.mdht.uml.cda.consol.operations.PlanOfCareActivityProcedureOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.vocab.x_DocumentProcedureMood; + +/** + * + * A static utility class that provides operations related to 'Plan Of Care Activity Procedure' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlanOfCareActivityProcedure#validatePlanOfCareActivityProcedureTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Activity Procedure Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlanOfCareActivityProcedure#validatePlanOfCareActivityProcedureClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Activity Procedure Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlanOfCareActivityProcedure#validatePlanOfCareActivityProcedureMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Activity Procedure Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlanOfCareActivityProcedure#validatePlanOfCareActivityProcedureId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Activity Procedure Id}
  • + *
+ *

+ * + * @generated + */ + +public class PlanOfCareActivityProcedureTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidatePlanOfCareActivityProcedureTemplateId() { + OperationsTestCase validatePlanOfCareActivityProcedureTemplateIdTestCase = new OperationsTestCase( + "validatePlanOfCareActivityProcedureTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_ACTIVITY_PROCEDURE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareActivityProcedure target) { + + } + + @Override + protected void updateToPass(PlanOfCareActivityProcedure target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareActivityProcedureOperations.validatePlanOfCareActivityProcedureTemplateId( + (PlanOfCareActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareActivityProcedureTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePlanOfCareActivityProcedureClassCode() { + OperationsTestCase validatePlanOfCareActivityProcedureClassCodeTestCase = new OperationsTestCase( + "validatePlanOfCareActivityProcedureClassCode", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_ACTIVITY_PROCEDURE_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + { + // we cannot violate the constraint because it only checks that the class + // code is non-null and of type ActClass but EMF and Java enforce this + this.skipFailsTest(); + } + + @Override + protected void updateToFail(PlanOfCareActivityProcedure target) { + + } + + @Override + protected void updateToPass(PlanOfCareActivityProcedure target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareActivityProcedureOperations.validatePlanOfCareActivityProcedureClassCode( + (PlanOfCareActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareActivityProcedureClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePlanOfCareActivityProcedureMoodCode() { + OperationsTestCase validatePlanOfCareActivityProcedureMoodCodeTestCase = new OperationsTestCase( + "validatePlanOfCareActivityProcedureMoodCode", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_ACTIVITY_PROCEDURE_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + { + // we cannot violate the constraint because it only checks that the mood + // code is non-null and of type x_DocumentProcedureMood but EMF and Java + // enforce this + this.skipFailsTest(); + } + + @Override + protected void updateToFail(PlanOfCareActivityProcedure target) { + + } + + @Override + protected void updateToPass(PlanOfCareActivityProcedure target) { + target.init(); + target.setMoodCode(x_DocumentProcedureMood.INT); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareActivityProcedureOperations.validatePlanOfCareActivityProcedureMoodCode( + (PlanOfCareActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareActivityProcedureMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePlanOfCareActivityProcedureId() { + OperationsTestCase validatePlanOfCareActivityProcedureIdTestCase = new OperationsTestCase( + "validatePlanOfCareActivityProcedureId", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_ACTIVITY_PROCEDURE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareActivityProcedure target) { + + } + + @Override + protected void updateToPass(PlanOfCareActivityProcedure target) { + target.init(); + II id = DatatypesFactory.eINSTANCE.createII(); + target.getIds().add(id); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareActivityProcedureOperations.validatePlanOfCareActivityProcedureId( + (PlanOfCareActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareActivityProcedureIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PlanOfCareActivityProcedureOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public PlanOfCareActivityProcedure create() { + return ConsolFactory.eINSTANCE.createPlanOfCareActivityProcedure(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PlanOfCareActivityProcedureOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PlanOfCareActivityProcedureOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PlanOfCareActivitySubstanceAdministrationTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PlanOfCareActivitySubstanceAdministrationTest.java new file mode 100644 index 000000000..cea897cbd --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PlanOfCareActivitySubstanceAdministrationTest.java @@ -0,0 +1,263 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.PlanOfCareActivitySubstanceAdministration; +import org.openhealthtools.mdht.uml.cda.consol.operations.PlanOfCareActivitySubstanceAdministrationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.vocab.x_DocumentSubstanceMood; + +/** + * + * A static utility class that provides operations related to 'Plan Of Care Activity Substance Administration' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlanOfCareActivitySubstanceAdministration#validatePlanOfCareActivitySubstanceAdministrationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Activity Substance Administration Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlanOfCareActivitySubstanceAdministration#validatePlanOfCareActivitySubstanceAdministrationClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Activity Substance Administration Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlanOfCareActivitySubstanceAdministration#validatePlanOfCareActivitySubstanceAdministrationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Activity Substance Administration Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlanOfCareActivitySubstanceAdministration#validatePlanOfCareActivitySubstanceAdministrationId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Activity Substance Administration Id}
  • + *
+ *

+ * + * @generated + */ + +public class PlanOfCareActivitySubstanceAdministrationTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidatePlanOfCareActivitySubstanceAdministrationTemplateId() { + OperationsTestCase validatePlanOfCareActivitySubstanceAdministrationTemplateIdTestCase = new OperationsTestCase( + "validatePlanOfCareActivitySubstanceAdministrationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_ACTIVITY_SUBSTANCE_ADMINISTRATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareActivitySubstanceAdministration target) { + + } + + @Override + protected void updateToPass(PlanOfCareActivitySubstanceAdministration target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareActivitySubstanceAdministrationOperations.validatePlanOfCareActivitySubstanceAdministrationTemplateId( + (PlanOfCareActivitySubstanceAdministration) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareActivitySubstanceAdministrationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePlanOfCareActivitySubstanceAdministrationClassCode() { + OperationsTestCase validatePlanOfCareActivitySubstanceAdministrationClassCodeTestCase = new OperationsTestCase( + "validatePlanOfCareActivitySubstanceAdministrationClassCode", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_ACTIVITY_SUBSTANCE_ADMINISTRATION_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + { + // we cannot violate the constraint because it only checks that the class + // code is non-null and of type ActClass but EMF and Java enforce this + this.skipFailsTest(); + } + + @Override + protected void updateToFail(PlanOfCareActivitySubstanceAdministration target) { + + } + + @Override + protected void updateToPass(PlanOfCareActivitySubstanceAdministration target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareActivitySubstanceAdministrationOperations.validatePlanOfCareActivitySubstanceAdministrationClassCode( + (PlanOfCareActivitySubstanceAdministration) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareActivitySubstanceAdministrationClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePlanOfCareActivitySubstanceAdministrationMoodCode() { + OperationsTestCase validatePlanOfCareActivitySubstanceAdministrationMoodCodeTestCase = new OperationsTestCase( + "validatePlanOfCareActivitySubstanceAdministrationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_ACTIVITY_SUBSTANCE_ADMINISTRATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + { + // we cannot violate the constraint because it only checks that the mood + // code is non-null and of type x_DocumentSubstanceMood but EMF and Java + // enforce this + this.skipFailsTest(); + } + + @Override + protected void updateToFail(PlanOfCareActivitySubstanceAdministration target) { + + } + + @Override + protected void updateToPass(PlanOfCareActivitySubstanceAdministration target) { + target.init(); + target.setMoodCode(x_DocumentSubstanceMood.INT); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareActivitySubstanceAdministrationOperations.validatePlanOfCareActivitySubstanceAdministrationMoodCode( + (PlanOfCareActivitySubstanceAdministration) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareActivitySubstanceAdministrationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePlanOfCareActivitySubstanceAdministrationId() { + OperationsTestCase validatePlanOfCareActivitySubstanceAdministrationIdTestCase = new OperationsTestCase( + "validatePlanOfCareActivitySubstanceAdministrationId", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_ACTIVITY_SUBSTANCE_ADMINISTRATION_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareActivitySubstanceAdministration target) { + + } + + @Override + protected void updateToPass(PlanOfCareActivitySubstanceAdministration target) { + target.init(); + II id = DatatypesFactory.eINSTANCE.createII(); + target.getIds().add(id); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareActivitySubstanceAdministrationOperations.validatePlanOfCareActivitySubstanceAdministrationId( + (PlanOfCareActivitySubstanceAdministration) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareActivitySubstanceAdministrationIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PlanOfCareActivitySubstanceAdministrationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public PlanOfCareActivitySubstanceAdministration create() { + return ConsolFactory.eINSTANCE.createPlanOfCareActivitySubstanceAdministration(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PlanOfCareActivitySubstanceAdministrationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PlanOfCareActivitySubstanceAdministrationOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PlanOfCareActivitySupplyTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PlanOfCareActivitySupplyTest.java new file mode 100644 index 000000000..807fac68d --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PlanOfCareActivitySupplyTest.java @@ -0,0 +1,263 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.PlanOfCareActivitySupply; +import org.openhealthtools.mdht.uml.cda.consol.operations.PlanOfCareActivitySupplyOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.vocab.x_DocumentSubstanceMood; + +/** + * + * A static utility class that provides operations related to 'Plan Of Care Activity Supply' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlanOfCareActivitySupply#validatePlanOfCareActivitySupplyTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Activity Supply Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlanOfCareActivitySupply#validatePlanOfCareActivitySupplyClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Activity Supply Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlanOfCareActivitySupply#validatePlanOfCareActivitySupplyMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Activity Supply Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlanOfCareActivitySupply#validatePlanOfCareActivitySupplyId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Activity Supply Id}
  • + *
+ *

+ * + * @generated + */ + +public class PlanOfCareActivitySupplyTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidatePlanOfCareActivitySupplyTemplateId() { + OperationsTestCase validatePlanOfCareActivitySupplyTemplateIdTestCase = new OperationsTestCase( + "validatePlanOfCareActivitySupplyTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_ACTIVITY_SUPPLY_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareActivitySupply target) { + + } + + @Override + protected void updateToPass(PlanOfCareActivitySupply target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareActivitySupplyOperations.validatePlanOfCareActivitySupplyTemplateId( + (PlanOfCareActivitySupply) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareActivitySupplyTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePlanOfCareActivitySupplyClassCode() { + OperationsTestCase validatePlanOfCareActivitySupplyClassCodeTestCase = new OperationsTestCase( + "validatePlanOfCareActivitySupplyClassCode", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_ACTIVITY_SUPPLY_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + { + // we cannot violate the constraint because it only checks that the class + // code is non-null and of type ActClassSupply but EMF and Java enforce this + this.skipFailsTest(); + } + + @Override + protected void updateToFail(PlanOfCareActivitySupply target) { + + } + + @Override + protected void updateToPass(PlanOfCareActivitySupply target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareActivitySupplyOperations.validatePlanOfCareActivitySupplyClassCode( + (PlanOfCareActivitySupply) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareActivitySupplyClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePlanOfCareActivitySupplyMoodCode() { + OperationsTestCase validatePlanOfCareActivitySupplyMoodCodeTestCase = new OperationsTestCase( + "validatePlanOfCareActivitySupplyMoodCode", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_ACTIVITY_SUPPLY_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + { + // we cannot violate the constraint because it only checks that the mood + // code is non-null and of type x_DocumentSubstanceMood but EMF and Java + // enforce this + this.skipFailsTest(); + } + + @Override + protected void updateToFail(PlanOfCareActivitySupply target) { + + } + + @Override + protected void updateToPass(PlanOfCareActivitySupply target) { + target.init(); + target.setMoodCode(x_DocumentSubstanceMood.INT); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareActivitySupplyOperations.validatePlanOfCareActivitySupplyMoodCode( + (PlanOfCareActivitySupply) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareActivitySupplyMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePlanOfCareActivitySupplyId() { + OperationsTestCase validatePlanOfCareActivitySupplyIdTestCase = new OperationsTestCase( + "validatePlanOfCareActivitySupplyId", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_ACTIVITY_SUPPLY_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareActivitySupply target) { + + } + + @Override + protected void updateToPass(PlanOfCareActivitySupply target) { + target.init(); + II id = DatatypesFactory.eINSTANCE.createII(); + target.getIds().add(id); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareActivitySupplyOperations.validatePlanOfCareActivitySupplyId( + (PlanOfCareActivitySupply) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareActivitySupplyIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PlanOfCareActivitySupplyOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public PlanOfCareActivitySupply create() { + return ConsolFactory.eINSTANCE.createPlanOfCareActivitySupply(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PlanOfCareActivitySupplyOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PlanOfCareActivitySupplyOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PlanOfCareSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PlanOfCareSectionTest.java new file mode 100644 index 000000000..e1b9cc426 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PlanOfCareSectionTest.java @@ -0,0 +1,639 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.PlanOfCareActivityAct; +import org.openhealthtools.mdht.uml.cda.consol.PlanOfCareActivityEncounter; +import org.openhealthtools.mdht.uml.cda.consol.PlanOfCareActivityObservation; +import org.openhealthtools.mdht.uml.cda.consol.PlanOfCareActivityProcedure; +import org.openhealthtools.mdht.uml.cda.consol.PlanOfCareActivitySubstanceAdministration; +import org.openhealthtools.mdht.uml.cda.consol.PlanOfCareActivitySupply; +import org.openhealthtools.mdht.uml.cda.consol.PlanOfCareSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.PlanOfCareSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Plan Of Care Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlanOfCareSection#validatePlanOfCareSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlanOfCareSection#validatePlanOfCareSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlanOfCareSection#validatePlanOfCareSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlanOfCareSection#validatePlanOfCareSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlanOfCareSection#validatePlanOfCareSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlanOfCareSection#validatePlanOfCareSectionPlanOfCareActivityAct(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Section Plan Of Care Activity Act}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlanOfCareSection#validatePlanOfCareSectionPlanOfCareActivityEncounter(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Section Plan Of Care Activity Encounter}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlanOfCareSection#validatePlanOfCareSectionPlanOfCareActivityObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Section Plan Of Care Activity Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlanOfCareSection#validatePlanOfCareSectionPlanOfCareActivityProcedure(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Section Plan Of Care Activity Procedure}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlanOfCareSection#validatePlanOfCareSectionPlanOfCareActivitySubstanceAdministration(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Section Plan Of Care Activity Substance Administration}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlanOfCareSection#validatePlanOfCareSectionPlanOfCareActivitySupply(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Section Plan Of Care Activity Supply}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlanOfCareSection#validatePlanOfCareSectionInstructions(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Section Instructions}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlanOfCareSection#getPlanOfCareActivityActs() Get Plan Of Care Activity Acts}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlanOfCareSection#getPlanOfCareActivityEncounters() Get Plan Of Care Activity Encounters}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlanOfCareSection#getPlanOfCareActivityObservations() Get Plan Of Care Activity Observations}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlanOfCareSection#getPlanOfCareActivityProcedures() Get Plan Of Care Activity Procedures}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlanOfCareSection#getPlanOfCareActivitySubstanceAdministrations() Get Plan Of Care Activity Substance Administrations}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlanOfCareSection#getPlanOfCareActivitySupplies() Get Plan Of Care Activity Supplies}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlanOfCareSection#getInstructionss() Get Instructionss}
  • + *
+ *

+ * + * @generated + */ + +public class PlanOfCareSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidatePlanOfCareSectionTemplateId() { + OperationsTestCase validatePlanOfCareSectionTemplateIdTestCase = new OperationsTestCase( + "validatePlanOfCareSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareSection target) { + + } + + @Override + protected void updateToPass(PlanOfCareSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareSectionOperations.validatePlanOfCareSectionTemplateId( + (PlanOfCareSection) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePlanOfCareSectionCode() { + OperationsTestCase validatePlanOfCareSectionCodeTestCase = new OperationsTestCase( + "validatePlanOfCareSectionCode", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareSection target) { + + } + + @Override + protected void updateToPass(PlanOfCareSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareSectionOperations.validatePlanOfCareSectionCode( + (PlanOfCareSection) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePlanOfCareSectionCodeP() { + OperationsTestCase validatePlanOfCareSectionCodePTestCase = new OperationsTestCase( + "validatePlanOfCareSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareSection target) { + + } + + @Override + protected void updateToPass(PlanOfCareSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareSectionOperations.validatePlanOfCareSectionCodeP( + (PlanOfCareSection) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePlanOfCareSectionTitle() { + OperationsTestCase validatePlanOfCareSectionTitleTestCase = new OperationsTestCase( + "validatePlanOfCareSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareSection target) { + + } + + @Override + protected void updateToPass(PlanOfCareSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareSectionOperations.validatePlanOfCareSectionTitle( + (PlanOfCareSection) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePlanOfCareSectionText() { + OperationsTestCase validatePlanOfCareSectionTextTestCase = new OperationsTestCase( + "validatePlanOfCareSectionText", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareSection target) { + + } + + @Override + protected void updateToPass(PlanOfCareSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareSectionOperations.validatePlanOfCareSectionText( + (PlanOfCareSection) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePlanOfCareSectionPlanOfCareActivityAct() { + OperationsTestCase validatePlanOfCareSectionPlanOfCareActivityActTestCase = new OperationsTestCase( + "validatePlanOfCareSectionPlanOfCareActivityAct", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_SECTION_PLAN_OF_CARE_ACTIVITY_ACT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareSection target) { + + } + + @Override + protected void updateToPass(PlanOfCareSection target) { + target.init(); + PlanOfCareActivityAct ActivityAct = ConsolFactory.eINSTANCE.createPlanOfCareActivityAct(); + target.addAct(ActivityAct); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareSectionOperations.validatePlanOfCareSectionPlanOfCareActivityAct( + (PlanOfCareSection) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareSectionPlanOfCareActivityActTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePlanOfCareSectionPlanOfCareActivityEncounter() { + OperationsTestCase validatePlanOfCareSectionPlanOfCareActivityEncounterTestCase = new OperationsTestCase( + "validatePlanOfCareSectionPlanOfCareActivityEncounter", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_SECTION_PLAN_OF_CARE_ACTIVITY_ENCOUNTER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareSection target) { + + } + + @Override + protected void updateToPass(PlanOfCareSection target) { + target.init(); + PlanOfCareActivityEncounter Actent = ConsolFactory.eINSTANCE.createPlanOfCareActivityEncounter(); + target.addEncounter(Actent); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareSectionOperations.validatePlanOfCareSectionPlanOfCareActivityEncounter( + (PlanOfCareSection) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareSectionPlanOfCareActivityEncounterTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePlanOfCareSectionPlanOfCareActivityObservation() { + OperationsTestCase validatePlanOfCareSectionPlanOfCareActivityObservationTestCase = new OperationsTestCase( + "validatePlanOfCareSectionPlanOfCareActivityObservation", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_SECTION_PLAN_OF_CARE_ACTIVITY_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareSection target) { + + } + + @Override + protected void updateToPass(PlanOfCareSection target) { + target.init(); + PlanOfCareActivityObservation ActObs = ConsolFactory.eINSTANCE.createPlanOfCareActivityObservation(); + target.addObservation(ActObs); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareSectionOperations.validatePlanOfCareSectionPlanOfCareActivityObservation( + (PlanOfCareSection) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareSectionPlanOfCareActivityObservationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePlanOfCareSectionPlanOfCareActivityProcedure() { + OperationsTestCase validatePlanOfCareSectionPlanOfCareActivityProcedureTestCase = new OperationsTestCase( + "validatePlanOfCareSectionPlanOfCareActivityProcedure", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_SECTION_PLAN_OF_CARE_ACTIVITY_PROCEDURE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareSection target) { + + } + + @Override + protected void updateToPass(PlanOfCareSection target) { + target.init(); + PlanOfCareActivityProcedure ActProc = ConsolFactory.eINSTANCE.createPlanOfCareActivityProcedure(); + target.addProcedure(ActProc); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareSectionOperations.validatePlanOfCareSectionPlanOfCareActivityProcedure( + (PlanOfCareSection) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareSectionPlanOfCareActivityProcedureTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePlanOfCareSectionPlanOfCareActivitySubstanceAdministration() { + OperationsTestCase validatePlanOfCareSectionPlanOfCareActivitySubstanceAdministrationTestCase = new OperationsTestCase( + "validatePlanOfCareSectionPlanOfCareActivitySubstanceAdministration", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_SECTION_PLAN_OF_CARE_ACTIVITY_SUBSTANCE_ADMINISTRATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareSection target) { + + } + + @Override + protected void updateToPass(PlanOfCareSection target) { + target.init(); + PlanOfCareActivitySubstanceAdministration ActObs = ConsolFactory.eINSTANCE.createPlanOfCareActivitySubstanceAdministration(); + target.addSubstanceAdministration(ActObs); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareSectionOperations.validatePlanOfCareSectionPlanOfCareActivitySubstanceAdministration( + (PlanOfCareSection) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareSectionPlanOfCareActivitySubstanceAdministrationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePlanOfCareSectionPlanOfCareActivitySupply() { + OperationsTestCase validatePlanOfCareSectionPlanOfCareActivitySupplyTestCase = new OperationsTestCase( + "validatePlanOfCareSectionPlanOfCareActivitySupply", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_SECTION_PLAN_OF_CARE_ACTIVITY_SUPPLY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareSection target) { + + } + + @Override + protected void updateToPass(PlanOfCareSection target) { + target.init(); + PlanOfCareActivitySupply ActSupply = ConsolFactory.eINSTANCE.createPlanOfCareActivitySupply(); + target.addSupply(ActSupply); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareSectionOperations.validatePlanOfCareSectionPlanOfCareActivitySupply( + (PlanOfCareSection) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareSectionPlanOfCareActivitySupplyTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePlanOfCareSectionInstructions() { + OperationsTestCase validatePlanOfCareSectionInstructionsTestCase = new OperationsTestCase( + "validatePlanOfCareSectionInstructions", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_SECTION_INSTRUCTIONS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareSection target) { + + } + + @Override + protected void updateToPass(PlanOfCareSection target) { + target.init(); + target.addAct(ConsolFactory.eINSTANCE.createInstructions()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareSectionOperations.validatePlanOfCareSectionInstructions( + (PlanOfCareSection) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareSectionInstructionsTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetPlanOfCareActivityActs() { + + PlanOfCareSection target = objectFactory.create(); + target.getPlanOfCareActivityActs(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPlanOfCareActivityEncounters() { + + PlanOfCareSection target = objectFactory.create(); + target.getPlanOfCareActivityEncounters(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPlanOfCareActivityObservations() { + + PlanOfCareSection target = objectFactory.create(); + target.getPlanOfCareActivityObservations(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPlanOfCareActivityProcedures() { + + PlanOfCareSection target = objectFactory.create(); + target.getPlanOfCareActivityProcedures(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPlanOfCareActivitySubstanceAdministrations() { + + PlanOfCareSection target = objectFactory.create(); + target.getPlanOfCareActivitySubstanceAdministrations(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPlanOfCareActivitySupplies() { + + PlanOfCareSection target = objectFactory.create(); + target.getPlanOfCareActivitySupplies(); + + } + + /** + * + * @generated + */ + @Test + public void testGetInstructionss() { + + PlanOfCareSection target = objectFactory.create(); + target.getInstructionss(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PlanOfCareSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public PlanOfCareSection create() { + return ConsolFactory.eINSTANCE.createPlanOfCareSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PlanOfCareSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PlanOfCareSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PlannedProcedureSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PlannedProcedureSectionTest.java new file mode 100644 index 000000000..8403a361a --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PlannedProcedureSectionTest.java @@ -0,0 +1,339 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.PlannedProcedureSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.PlannedProcedureSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Planned Procedure Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlannedProcedureSection#validatePlannedProcedureSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Planned Procedure Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlannedProcedureSection#validatePlannedProcedureSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Planned Procedure Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlannedProcedureSection#validatePlannedProcedureSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Planned Procedure Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlannedProcedureSection#validatePlannedProcedureSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Planned Procedure Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlannedProcedureSection#validatePlannedProcedureSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Planned Procedure Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlannedProcedureSection#validatePlannedProcedureSectionPlanOfCareActivityProcedure(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Planned Procedure Section Plan Of Care Activity Procedure}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PlannedProcedureSection#getPlanOfCareActivityProcedures() Get Plan Of Care Activity Procedures}
  • + *
+ *

+ * + * @generated + */ + +public class PlannedProcedureSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidatePlannedProcedureSectionTemplateId() { + OperationsTestCase validatePlannedProcedureSectionTemplateIdTestCase = new OperationsTestCase( + "validatePlannedProcedureSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PLANNED_PROCEDURE_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlannedProcedureSection target) { + + } + + @Override + protected void updateToPass(PlannedProcedureSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlannedProcedureSectionOperations.validatePlannedProcedureSectionTemplateId( + (PlannedProcedureSection) objectToTest, diagnostician, map); + } + + }; + + validatePlannedProcedureSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePlannedProcedureSectionCode() { + OperationsTestCase validatePlannedProcedureSectionCodeTestCase = new OperationsTestCase( + "validatePlannedProcedureSectionCode", + operationsForOCL.getOCLValue("VALIDATE_PLANNED_PROCEDURE_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlannedProcedureSection target) { + + } + + @Override + protected void updateToPass(PlannedProcedureSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlannedProcedureSectionOperations.validatePlannedProcedureSectionCode( + (PlannedProcedureSection) objectToTest, diagnostician, map); + } + + }; + + validatePlannedProcedureSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePlannedProcedureSectionCodeP() { + OperationsTestCase validatePlannedProcedureSectionCodePTestCase = new OperationsTestCase( + "validatePlannedProcedureSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_PLANNED_PROCEDURE_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlannedProcedureSection target) { + + } + + @Override + protected void updateToPass(PlannedProcedureSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlannedProcedureSectionOperations.validatePlannedProcedureSectionCodeP( + (PlannedProcedureSection) objectToTest, diagnostician, map); + } + + }; + + validatePlannedProcedureSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePlannedProcedureSectionText() { + OperationsTestCase validatePlannedProcedureSectionTextTestCase = new OperationsTestCase( + "validatePlannedProcedureSectionText", + operationsForOCL.getOCLValue("VALIDATE_PLANNED_PROCEDURE_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlannedProcedureSection target) { + + } + + @Override + protected void updateToPass(PlannedProcedureSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlannedProcedureSectionOperations.validatePlannedProcedureSectionText( + (PlannedProcedureSection) objectToTest, diagnostician, map); + } + + }; + + validatePlannedProcedureSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePlannedProcedureSectionTitle() { + OperationsTestCase validatePlannedProcedureSectionTitleTestCase = new OperationsTestCase( + "validatePlannedProcedureSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_PLANNED_PROCEDURE_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlannedProcedureSection target) { + + } + + @Override + protected void updateToPass(PlannedProcedureSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlannedProcedureSectionOperations.validatePlannedProcedureSectionTitle( + (PlannedProcedureSection) objectToTest, diagnostician, map); + } + + }; + + validatePlannedProcedureSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePlannedProcedureSectionPlanOfCareActivityProcedure() { + OperationsTestCase validatePlannedProcedureSectionPlanOfCareActivityProcedureTestCase = new OperationsTestCase( + "validatePlannedProcedureSectionPlanOfCareActivityProcedure", + operationsForOCL.getOCLValue("VALIDATE_PLANNED_PROCEDURE_SECTION_PLAN_OF_CARE_ACTIVITY_PROCEDURE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlannedProcedureSection target) { + target.init(); + + } + + @Override + protected void updateToPass(PlannedProcedureSection target) { + target.addProcedure(ConsolFactory.eINSTANCE.createPlanOfCareActivityProcedure().init()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlannedProcedureSectionOperations.validatePlannedProcedureSectionPlanOfCareActivityProcedure( + (PlannedProcedureSection) objectToTest, diagnostician, map); + } + + }; + + validatePlannedProcedureSectionPlanOfCareActivityProcedureTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetPlanOfCareActivityProcedures() { + + PlannedProcedureSection target = objectFactory.create(); + target.getPlanOfCareActivityProcedures(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PlannedProcedureSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public PlannedProcedureSection create() { + return ConsolFactory.eINSTANCE.createPlannedProcedureSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PlannedProcedureSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PlannedProcedureSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PolicyActivityTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PolicyActivityTest.java new file mode 100644 index 000000000..1a6452a8a --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PolicyActivityTest.java @@ -0,0 +1,4154 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.Act; +import org.openhealthtools.mdht.uml.cda.AssignedEntity; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.Organization; +import org.openhealthtools.mdht.uml.cda.Participant2; +import org.openhealthtools.mdht.uml.cda.ParticipantRole; +import org.openhealthtools.mdht.uml.cda.Performer2; +import org.openhealthtools.mdht.uml.cda.Person; +import org.openhealthtools.mdht.uml.cda.PlayingEntity; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.PolicyActivity; +import org.openhealthtools.mdht.uml.cda.consol.operations.PolicyActivityOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.AD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.datatypes.ON; +import org.openhealthtools.mdht.uml.hl7.datatypes.PN; +import org.openhealthtools.mdht.uml.hl7.vocab.ParticipationPhysicalPerformer; +import org.openhealthtools.mdht.uml.hl7.vocab.ParticipationType; +import org.openhealthtools.mdht.uml.hl7.vocab.PostalAddressUse; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActClassDocumentEntryAct; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; +import org.openhealthtools.mdht.uml.hl7.vocab.x_DocumentActMood; + +/** + * + * A static utility class that provides operations related to 'Policy Activity' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityPayer(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Payer}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityGuarantor(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Guarantor}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityCoverage(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Coverage}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityHolder(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Holder}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityEntryRelationship(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Entry Relationship}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityPayerPayerAssignedEntityUSRealmAddressStreet(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Payer Payer Assigned Entity US Realm Address Street}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityPayerPayerAssignedEntityUSRealmAddressCity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Payer Payer Assigned Entity US Realm Address City}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityPayerPayerAssignedEntityUSRealmAddressCountry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Payer Payer Assigned Entity US Realm Address Country}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityPayerPayerAssignedEntityUSRealmAddressPostalCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Payer Payer Assigned Entity US Realm Address Postal Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityPayerPayerAssignedEntityUSRealmAddressState(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Payer Payer Assigned Entity US Realm Address State}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityPayerPayerAssignedEntityUSRealmAddressStreetAddressLine(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Payer Payer Assigned Entity US Realm Address Street Address Line}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityPayerPayerAssignedEntityUSRealmAddressUseP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Payer Payer Assigned Entity US Realm Address Use P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityPayerPayerAssignedEntityUSRealmAddressUse(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Payer Payer Assigned Entity US Realm Address Use}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityPayerPayerAssignedEntityPayerOrganizationName(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Payer Payer Assigned Entity Payer Organization Name}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityPayerPayerAssignedEntityId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Payer Payer Assigned Entity Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityPayerPayerAssignedEntityCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Payer Payer Assigned Entity Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityPayerPayerAssignedEntityCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Payer Payer Assigned Entity Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityPayerPayerAssignedEntityAddr(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Payer Payer Assigned Entity Addr}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityPayerPayerAssignedEntityTelecom(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Payer Payer Assigned Entity Telecom}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityPayerPayerAssignedEntityPayerOrganization(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Payer Payer Assigned Entity Payer Organization}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityPayerTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Payer Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityPayerTypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Payer Type Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityPayerPayerAssignedEntity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Payer Payer Assigned Entity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityGuarantorGuarantorAssignedEntityUSRealmAddressStreet(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Guarantor Guarantor Assigned Entity US Realm Address Street}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityGuarantorGuarantorAssignedEntityUSRealmAddressCity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Guarantor Guarantor Assigned Entity US Realm Address City}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityGuarantorGuarantorAssignedEntityUSRealmAddressCountry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Guarantor Guarantor Assigned Entity US Realm Address Country}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityGuarantorGuarantorAssignedEntityUSRealmAddressPostalCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Guarantor Guarantor Assigned Entity US Realm Address Postal Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityGuarantorGuarantorAssignedEntityUSRealmAddressState(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Guarantor Guarantor Assigned Entity US Realm Address State}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityGuarantorGuarantorAssignedEntityUSRealmAddressStreetAddressLine(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Guarantor Guarantor Assigned Entity US Realm Address Street Address Line}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityGuarantorGuarantorAssignedEntityUSRealmAddressUseP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Guarantor Guarantor Assigned Entity US Realm Address Use P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityGuarantorGuarantorAssignedEntityUSRealmAddressUse(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Guarantor Guarantor Assigned Entity US Realm Address Use}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityGuarantorGuarantorAssignedEntityPersonNameAndOrOrgName(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Guarantor Guarantor Assigned Entity Person Name And Or Org Name}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityGuarantorGuarantorAssignedEntityCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Guarantor Guarantor Assigned Entity Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityGuarantorGuarantorAssignedEntityCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Guarantor Guarantor Assigned Entity Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityGuarantorGuarantorAssignedEntityAddr(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Guarantor Guarantor Assigned Entity Addr}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityGuarantorGuarantorAssignedEntityTelecom(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Guarantor Guarantor Assigned Entity Telecom}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityGuarantorTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Guarantor Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityGuarantorTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Guarantor Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityGuarantorTypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Guarantor Type Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityGuarantorGuarantorAssignedEntity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Guarantor Guarantor Assigned Entity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityCoverageCoverageRoleUSRealmAddressStreet(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Coverage Coverage Role US Realm Address Street}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityCoverageCoverageRoleUSRealmAddressCity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Coverage Coverage Role US Realm Address City}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityCoverageCoverageRoleUSRealmAddressCountry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Coverage Coverage Role US Realm Address Country}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityCoverageCoverageRoleUSRealmAddressPostalCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Coverage Coverage Role US Realm Address Postal Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityCoverageCoverageRoleUSRealmAddressState(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Coverage Coverage Role US Realm Address State}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityCoverageCoverageRoleUSRealmAddressStreetAddressLine(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Coverage Coverage Role US Realm Address Street Address Line}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityCoverageCoverageRoleUSRealmAddressUseP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Coverage Coverage Role US Realm Address Use P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityCoverageCoverageRoleUSRealmAddressUse(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Coverage Coverage Role US Realm Address Use}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityCoverageCoverageRoleCoveragePlayingEntityName(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Coverage Coverage Role Coverage Playing Entity Name}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityCoverageCoverageRoleId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Coverage Coverage Role Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityCoverageCoverageRoleCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Coverage Coverage Role Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityCoverageCoverageRoleCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Coverage Coverage Role Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityCoverageCoverageRoleAddr(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Coverage Coverage Role Addr}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityCoverageCoverageRoleCoveragePlayingEntity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Coverage Coverage Role Coverage Playing Entity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityCoverageLowTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Coverage Low Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityCoverageHighTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Coverage High Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityCoverageTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Coverage Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityCoverageTypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Coverage Type Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityCoverageTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Coverage Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityCoverageCoverageRole(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Coverage Coverage Role}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityHolderHolderRoleUSRealmAddressStreet(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Holder Holder Role US Realm Address Street}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityHolderHolderRoleUSRealmAddressCity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Holder Holder Role US Realm Address City}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityHolderHolderRoleUSRealmAddressCountry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Holder Holder Role US Realm Address Country}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityHolderHolderRoleUSRealmAddressPostalCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Holder Holder Role US Realm Address Postal Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityHolderHolderRoleUSRealmAddressState(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Holder Holder Role US Realm Address State}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityHolderHolderRoleUSRealmAddressStreetAddressLine(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Holder Holder Role US Realm Address Street Address Line}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityHolderHolderRoleUSRealmAddressUseP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Holder Holder Role US Realm Address Use P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityHolderHolderRoleUSRealmAddressUse(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Holder Holder Role US Realm Address Use}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityHolderHolderRoleId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Holder Holder Role Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityHolderHolderRoleAddr(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Holder Holder Role Addr}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityHolderTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Holder Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityHolderTypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Holder Type Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityHolderTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Holder Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityHolderHolderRole(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Holder Holder Role}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityEntryRelationshipTargetActActivity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Entry Relationship Target Act Activity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityEntryRelationshipDescriptionCoveragePlan(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Entry Relationship Description Coverage Plan}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PolicyActivity#validatePolicyActivityEntryRelationshipTypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Entry Relationship Type Code}
  • + *
+ *

+ * + * @generated + */ + +public class PolicyActivityTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidatePolicyActivityTemplateId() { + OperationsTestCase validatePolicyActivityTemplateIdTestCase = new OperationsTestCase( + "validatePolicyActivityTemplateId", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityTemplateId( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePolicyActivityClassCode() { + OperationsTestCase validatePolicyActivityClassCodeTestCase = new OperationsTestCase( + "validatePolicyActivityClassCode", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityClassCode( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePolicyActivityCode() { + OperationsTestCase validatePolicyActivityCodeTestCase = new OperationsTestCase( + "validatePolicyActivityCode", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + CE cd = DatatypesFactory.eINSTANCE.createCE("AP", "2.16.840.1.113883.6.1", null, null); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityCode( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityCodeP() { + OperationsTestCase validatePolicyActivityCodePTestCase = new OperationsTestCase( + "validatePolicyActivityCodeP", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + target.setCode(DatatypesFactory.eINSTANCE.createCE()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityCodeP( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityCodePTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePolicyActivityId() { + OperationsTestCase validatePolicyActivityIdTestCase = new OperationsTestCase( + "validatePolicyActivityId", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + II ii = DatatypesFactory.eINSTANCE.createII("12345678-0"); + target.getIds().add(ii); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityId( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePolicyActivityMoodCode() { + OperationsTestCase validatePolicyActivityMoodCodeTestCase = new OperationsTestCase( + "validatePolicyActivityMoodCode", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityMoodCode( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePolicyActivityStatusCode() { + OperationsTestCase validatePolicyActivityStatusCodeTestCase = new OperationsTestCase( + "validatePolicyActivityStatusCode", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityStatusCode( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePolicyActivityPayer() { + OperationsTestCase validatePolicyActivityPayerTestCase = new OperationsTestCase( + "validatePolicyActivityPayer", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_PAYER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + Performer2 payer = createPerformer(); + target.getPerformers().add(payer); + + Performer2 guarantor = createPerformer(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.setCode(DatatypesFactory.eINSTANCE.createCE("GUAR", "")); + + guarantor.setAssignedEntity(ae); + target.getPerformers().add(guarantor); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityPayer( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityPayerTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePolicyActivityGuarantor() { + OperationsTestCase validatePolicyActivityGuarantorTestCase = new OperationsTestCase( + "validatePolicyActivityGuarantor", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_GUARANTOR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + Performer2 guarantor = createPerformer(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.setCode(DatatypesFactory.eINSTANCE.createCE("GUAR", "")); + + guarantor.setAssignedEntity(ae); + target.getPerformers().add(guarantor); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityGuarantor( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityGuarantorTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePolicyActivityCoverage() { + OperationsTestCase validatePolicyActivityCoverageTestCase = new OperationsTestCase( + "validatePolicyActivityCoverage", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_COVERAGE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + target.getParticipants().add(createCoverage()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityCoverage( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityCoverageTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePolicyActivityHolder() { + OperationsTestCase validatePolicyActivityHolderTestCase = new OperationsTestCase( + "validatePolicyActivityHolder", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_HOLDER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + Participant2 holder = CDAFactory.eINSTANCE.createParticipant2(); + holder.setTypeCode(ParticipationType.HLD); + target.getParticipants().add(holder); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityHolder( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityHolderTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityEntryRelationship() { + OperationsTestCase validatePolicyActivityEntryRelationshipTestCase = new OperationsTestCase( + "validatePolicyActivityEntryRelationship", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_ENTRY_RELATIONSHIP__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.REFR); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityEntryRelationship( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityEntryRelationshipTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityPayerPayerAssignedEntityUSRealmAddressStreet() { + OperationsTestCase validatePolicyActivityPayerPayerAssignedEntityUSRealmAddressStreetTestCase = new OperationsTestCase( + "validatePolicyActivityPayerPayerAssignedEntityUSRealmAddressStreet", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_PAYER_PAYER_ASSIGNED_ENTITY_US_REALM_ADDRESS_STREET__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + public void addFailTests() { + + addFailTest(new FailTest() { + + @Override + public void updateToFail(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 payer = createPerformer(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + target.getPerformers().add(payer); + AssignedEntity payerEntity = createPayerAssignedEntity(); + payerEntity.getAddrs().add(ad); + payer.setAssignedEntity(payerEntity); + + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 payer = createPerformer(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + + target.getPerformers().add(payer); + AssignedEntity payerEntity = createPayerAssignedEntity(); + payerEntity.getAddrs().clear(); + payerEntity.getAddrs().add(ad); + payer.setAssignedEntity(payerEntity); + } + }); + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 payer = createPerformer(); + target.getPerformers().add(payer); + AssignedEntity payerEntity = createPayerAssignedEntity(); + payerEntity.getAddrs().clear(); + payerEntity.getAddrs().add(createUSRealmAddress()); + payer.setAssignedEntity(payerEntity); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityPayerPayerAssignedEntityUSRealmAddressStreet( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityPayerPayerAssignedEntityUSRealmAddressStreetTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityPayerPayerAssignedEntityUSRealmAddressCity() { + OperationsTestCase validatePolicyActivityPayerPayerAssignedEntityUSRealmAddressCityTestCase = new OperationsTestCase( + "validatePolicyActivityPayerPayerAssignedEntityUSRealmAddressCity", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_PAYER_PAYER_ASSIGNED_ENTITY_US_REALM_ADDRESS_CITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 payer = createPerformer(); + target.getPerformers().add(payer); + AssignedEntity payerEntity = createPayerAssignedEntity(); + + payer.setAssignedEntity(payerEntity); + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 payer = createPerformer(); + target.getPerformers().add(payer); + AssignedEntity payerEntity = createPayerAssignedEntity(); + payerEntity.getAddrs().clear(); + payerEntity.getAddrs().add(createUSRealmAddress()); + payer.setAssignedEntity(payerEntity); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityPayerPayerAssignedEntityUSRealmAddressCity( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityPayerPayerAssignedEntityUSRealmAddressCityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityPayerPayerAssignedEntityUSRealmAddressCountry() { + OperationsTestCase validatePolicyActivityPayerPayerAssignedEntityUSRealmAddressCountryTestCase = new OperationsTestCase( + "validatePolicyActivityPayerPayerAssignedEntityUSRealmAddressCountry", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_PAYER_PAYER_ASSIGNED_ENTITY_US_REALM_ADDRESS_COUNTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 payer = createPerformer(); + target.getPerformers().add(payer); + AssignedEntity payerEntity = createPayerAssignedEntity(); + + payer.setAssignedEntity(payerEntity); + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 payer = createPerformer(); + target.getPerformers().add(payer); + AssignedEntity payerEntity = createPayerAssignedEntity(); + payerEntity.getAddrs().clear(); + payerEntity.getAddrs().add(createUSRealmAddress()); + payer.setAssignedEntity(payerEntity); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityPayerPayerAssignedEntityUSRealmAddressCountry( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityPayerPayerAssignedEntityUSRealmAddressCountryTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityPayerPayerAssignedEntityUSRealmAddressPostalCode() { + OperationsTestCase validatePolicyActivityPayerPayerAssignedEntityUSRealmAddressPostalCodeTestCase = new OperationsTestCase( + "validatePolicyActivityPayerPayerAssignedEntityUSRealmAddressPostalCode", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_PAYER_PAYER_ASSIGNED_ENTITY_US_REALM_ADDRESS_POSTAL_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 payer = createPerformer(); + target.getPerformers().add(payer); + AssignedEntity payerEntity = createPayerAssignedEntity(); + + payer.setAssignedEntity(payerEntity); + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 payer = createPerformer(); + target.getPerformers().add(payer); + AssignedEntity payerEntity = createPayerAssignedEntity(); + payerEntity.getAddrs().clear(); + payerEntity.getAddrs().add(createUSRealmAddress()); + payer.setAssignedEntity(payerEntity); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityPayerPayerAssignedEntityUSRealmAddressPostalCode( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityPayerPayerAssignedEntityUSRealmAddressPostalCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityPayerPayerAssignedEntityUSRealmAddressState() { + OperationsTestCase validatePolicyActivityPayerPayerAssignedEntityUSRealmAddressStateTestCase = new OperationsTestCase( + "validatePolicyActivityPayerPayerAssignedEntityUSRealmAddressState", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_PAYER_PAYER_ASSIGNED_ENTITY_US_REALM_ADDRESS_STATE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 payer = createPerformer(); + target.getPerformers().add(payer); + AssignedEntity payerEntity = createPayerAssignedEntity(); + + payer.setAssignedEntity(payerEntity); + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 payer = createPerformer(); + target.getPerformers().add(payer); + AssignedEntity payerEntity = createPayerAssignedEntity(); + payerEntity.getAddrs().clear(); + payerEntity.getAddrs().add(createUSRealmAddress()); + payer.setAssignedEntity(payerEntity); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityPayerPayerAssignedEntityUSRealmAddressState( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityPayerPayerAssignedEntityUSRealmAddressStateTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityPayerPayerAssignedEntityUSRealmAddressStreetAddressLine() { + OperationsTestCase validatePolicyActivityPayerPayerAssignedEntityUSRealmAddressStreetAddressLineTestCase = new OperationsTestCase( + "validatePolicyActivityPayerPayerAssignedEntityUSRealmAddressStreetAddressLine", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_PAYER_PAYER_ASSIGNED_ENTITY_US_REALM_ADDRESS_STREET_ADDRESS_LINE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 payer = createPerformer(); + target.getPerformers().add(payer); + AssignedEntity payerEntity = createPayerAssignedEntity(); + + payer.setAssignedEntity(payerEntity); + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 payer = createPerformer(); + target.getPerformers().add(payer); + AssignedEntity payerEntity = createPayerAssignedEntity(); + payerEntity.getAddrs().clear(); + payerEntity.getAddrs().add(createUSRealmAddress()); + payer.setAssignedEntity(payerEntity); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityPayerPayerAssignedEntityUSRealmAddressStreetAddressLine( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityPayerPayerAssignedEntityUSRealmAddressStreetAddressLineTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityPayerPayerAssignedEntityUSRealmAddressUseP() { + OperationsTestCase validatePolicyActivityPayerPayerAssignedEntityUSRealmAddressUsePTestCase = new OperationsTestCase( + "validatePolicyActivityPayerPayerAssignedEntityUSRealmAddressUseP", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_PAYER_PAYER_ASSIGNED_ENTITY_US_REALM_ADDRESS_USE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 payer = createPerformer(); + target.getPerformers().add(payer); + AssignedEntity payerEntity = createPayerAssignedEntity(); + + payer.setAssignedEntity(payerEntity); + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 payer = createPerformer(); + target.getPerformers().add(payer); + AssignedEntity payerEntity = createPayerAssignedEntity(); + payerEntity.getAddrs().clear(); + payerEntity.getAddrs().add(createUSRealmAddress()); + payer.setAssignedEntity(payerEntity); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityPayerPayerAssignedEntityUSRealmAddressUseP( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityPayerPayerAssignedEntityUSRealmAddressUsePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityPayerPayerAssignedEntityUSRealmAddressUse() { + OperationsTestCase validatePolicyActivityPayerPayerAssignedEntityUSRealmAddressUseTestCase = new OperationsTestCase( + "validatePolicyActivityPayerPayerAssignedEntityUSRealmAddressUse", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_PAYER_PAYER_ASSIGNED_ENTITY_US_REALM_ADDRESS_USE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 payer = createPerformer(); + target.getPerformers().add(payer); + AssignedEntity payerEntity = createPayerAssignedEntity(); + payerEntity.getAddrs().clear(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + ad.getUses().add(null); + payerEntity.getAddrs().add(ad); + payer.setAssignedEntity(payerEntity); + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 payer = createPerformer(); + target.getPerformers().add(payer); + AssignedEntity payerEntity = createPayerAssignedEntity(); + payerEntity.getAddrs().clear(); + payerEntity.getAddrs().add(createUSRealmAddress()); + payer.setAssignedEntity(payerEntity); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityPayerPayerAssignedEntityUSRealmAddressUse( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityPayerPayerAssignedEntityUSRealmAddressUseTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePolicyActivityPayerPayerAssignedEntityPayerOrganizationName() { + OperationsTestCase validatePolicyActivityPayerPayerAssignedEntityPayerOrganizationNameTestCase = new OperationsTestCase( + "validatePolicyActivityPayerPayerAssignedEntityPayerOrganizationName", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_PAYER_PAYER_ASSIGNED_ENTITY_PAYER_ORGANIZATION_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 payer = createPerformer(); + target.getPerformers().add(payer); + AssignedEntity payerEntity = createPayerAssignedEntity(); + payer.setAssignedEntity(payerEntity); + + Organization repOrg = CDAFactory.eINSTANCE.createOrganization(); + payerEntity.getRepresentedOrganizations().add(repOrg); + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 payer = createPerformer(); + target.getPerformers().add(payer); + AssignedEntity payerEntity = createPayerAssignedEntity(); + payer.setAssignedEntity(payerEntity); + + Organization repOrg = CDAFactory.eINSTANCE.createOrganization(); + ON name = DatatypesFactory.eINSTANCE.createON(); + repOrg.getNames().add(name); + + payerEntity.getRepresentedOrganizations().add(repOrg); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityPayerPayerAssignedEntityPayerOrganizationName( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityPayerPayerAssignedEntityPayerOrganizationNameTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePolicyActivityPayerPayerAssignedEntityId() { + OperationsTestCase validatePolicyActivityPayerPayerAssignedEntityIdTestCase = new OperationsTestCase( + "validatePolicyActivityPayerPayerAssignedEntityId", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_PAYER_PAYER_ASSIGNED_ENTITY_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 payer = createPerformer(); + target.getPerformers().add(payer); + AssignedEntity payerEntity = createPayerAssignedEntity(); + payerEntity.getIds().clear(); + payer.setAssignedEntity(payerEntity); + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 payer = createPerformer(); + target.getPerformers().add(payer); + AssignedEntity payerEntity = createPayerAssignedEntity(); + payer.setAssignedEntity(payerEntity); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityPayerPayerAssignedEntityId( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityPayerPayerAssignedEntityIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePolicyActivityPayerPayerAssignedEntityCode() { + OperationsTestCase validatePolicyActivityPayerPayerAssignedEntityCodeTestCase = new OperationsTestCase( + "validatePolicyActivityPayerPayerAssignedEntityCode", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_PAYER_PAYER_ASSIGNED_ENTITY_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 payer = createPerformer(); + target.getPerformers().add(payer); + AssignedEntity payerEntity = createPayerAssignedEntity(); + payerEntity.setCode(null); + payer.setAssignedEntity(payerEntity); + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 payer = createPerformer(); + target.getPerformers().add(payer); + AssignedEntity payerEntity = createPayerAssignedEntity(); + payer.setAssignedEntity(payerEntity); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityPayerPayerAssignedEntityCode( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityPayerPayerAssignedEntityCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityPayerPayerAssignedEntityCodeP() { + OperationsTestCase validatePolicyActivityPayerPayerAssignedEntityCodePTestCase = new OperationsTestCase( + "validatePolicyActivityPayerPayerAssignedEntityCodeP", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_PAYER_PAYER_ASSIGNED_ENTITY_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 payer = createPerformer(); + target.getPerformers().add(payer); + AssignedEntity payerEntity = createPayerAssignedEntity(); + payerEntity.setCode(null); + payer.setAssignedEntity(payerEntity); + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 payer = createPerformer(); + target.getPerformers().add(payer); + AssignedEntity payerEntity = createPayerAssignedEntity(); + payer.setAssignedEntity(payerEntity); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityPayerPayerAssignedEntityCodeP( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityPayerPayerAssignedEntityCodePTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePolicyActivityPayerPayerAssignedEntityAddr() { + OperationsTestCase validatePolicyActivityPayerPayerAssignedEntityAddrTestCase = new OperationsTestCase( + "validatePolicyActivityPayerPayerAssignedEntityAddr", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_PAYER_PAYER_ASSIGNED_ENTITY_ADDR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 payer = createPerformer(); + target.getPerformers().add(payer); + AssignedEntity payerEntity = createPayerAssignedEntity(); + payerEntity.getAddrs().clear(); + payer.setAssignedEntity(payerEntity); + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 payer = createPerformer(); + target.getPerformers().add(payer); + AssignedEntity payerEntity = createPayerAssignedEntity(); + payer.setAssignedEntity(payerEntity); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityPayerPayerAssignedEntityAddr( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityPayerPayerAssignedEntityAddrTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePolicyActivityPayerPayerAssignedEntityTelecom() { + OperationsTestCase validatePolicyActivityPayerPayerAssignedEntityTelecomTestCase = new OperationsTestCase( + "validatePolicyActivityPayerPayerAssignedEntityTelecom", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_PAYER_PAYER_ASSIGNED_ENTITY_TELECOM__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 payer = createPerformer(); + target.getPerformers().add(payer); + AssignedEntity payerEntity = createPayerAssignedEntity(); + payerEntity.getTelecoms().clear(); + payer.setAssignedEntity(payerEntity); + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 payer = createPerformer(); + target.getPerformers().add(payer); + AssignedEntity payerEntity = createPayerAssignedEntity(); + payer.setAssignedEntity(payerEntity); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityPayerPayerAssignedEntityTelecom( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityPayerPayerAssignedEntityTelecomTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePolicyActivityPayerPayerAssignedEntityPayerOrganization() { + OperationsTestCase validatePolicyActivityPayerPayerAssignedEntityPayerOrganizationTestCase = new OperationsTestCase( + "validatePolicyActivityPayerPayerAssignedEntityPayerOrganization", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_PAYER_PAYER_ASSIGNED_ENTITY_PAYER_ORGANIZATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 payer = createPerformer(); + target.getPerformers().add(payer); + AssignedEntity payerEntity = createPayerAssignedEntity(); + payer.setAssignedEntity(payerEntity); + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 payer = createPerformer(); + target.getPerformers().add(payer); + AssignedEntity payerEntity = createPayerAssignedEntity(); + payer.setAssignedEntity(payerEntity); + + Organization repOrg = CDAFactory.eINSTANCE.createOrganization(); + payerEntity.getRepresentedOrganizations().add(repOrg); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityPayerPayerAssignedEntityPayerOrganization( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityPayerPayerAssignedEntityPayerOrganizationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityPayerTemplateId() { + OperationsTestCase validatePolicyActivityPayerTemplateIdTestCase = new OperationsTestCase( + "validatePolicyActivityPayerTemplateId", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_PAYER_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.getPerformers().clear(); + Performer2 payer = createPerformer(); + target.getPerformers().add(payer); + payer.setTypeCode(ParticipationPhysicalPerformer.SPRF); + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 payer = createPerformer(); + target.getPerformers().add(payer); + payer.setTypeCode(ParticipationPhysicalPerformer.PRF); + payer.getTemplateIds().add(DatatypesFactory.eINSTANCE.createII("2.16.840.1.113883.10.20.22.4.87")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityPayerTemplateId( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityPayerTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePolicyActivityPayerTypeCode() { + OperationsTestCase validatePolicyActivityPayerTypeCodeTestCase = new OperationsTestCase( + "validatePolicyActivityPayerTypeCode", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_PAYER_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.getPerformers().clear(); + Performer2 payer = createPerformer(); + target.getPerformers().add(payer); + payer.setTypeCode(ParticipationPhysicalPerformer.SPRF); + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 payer = createPerformer(); + target.getPerformers().add(payer); + payer.setTypeCode(ParticipationPhysicalPerformer.PRF); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityPayerTypeCode( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityPayerTypeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePolicyActivityPayerPayerAssignedEntity() { + OperationsTestCase validatePolicyActivityPayerPayerAssignedEntityTestCase = new OperationsTestCase( + "validatePolicyActivityPayerPayerAssignedEntity", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_PAYER_PAYER_ASSIGNED_ENTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 payer = CDAFactory.eINSTANCE.createPerformer2(); + target.getPerformers().add(payer); + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 payer = CDAFactory.eINSTANCE.createPerformer2(); + payer.setAssignedEntity(createPayerAssignedEntity()); + target.getPerformers().add(payer); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityPayerPayerAssignedEntity( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityPayerPayerAssignedEntityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityGuarantorGuarantorAssignedEntityUSRealmAddressStreet() { + OperationsTestCase validatePolicyActivityGuarantorGuarantorAssignedEntityUSRealmAddressStreetTestCase = new OperationsTestCase( + "validatePolicyActivityGuarantorGuarantorAssignedEntityUSRealmAddressStreet", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_GUARANTOR_GUARANTOR_ASSIGNED_ENTITY_US_REALM_ADDRESS_STREET__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + public void addFailTests() { + + addFailTest(new FailTest() { + + @Override + public void updateToFail(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 guarantor = createPerformer(); + target.getPerformers().add(guarantor); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + AssignedEntity gEntity = createGuarantorAssignedEntity(); + gEntity.getAddrs().clear(); + gEntity.getAddrs().add(ad); + guarantor.setAssignedEntity(gEntity); + + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 guarantor = createPerformer(); + target.getPerformers().add(guarantor); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + AssignedEntity gEntity = createGuarantorAssignedEntity(); + gEntity.getAddrs().clear(); + gEntity.getAddrs().add(ad); + guarantor.setAssignedEntity(gEntity); + } + }); + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 guarantor = createPerformer(); + target.getPerformers().add(guarantor); + AssignedEntity gEntity = createGuarantorAssignedEntity(); + guarantor.setAssignedEntity(gEntity); + gEntity.getAddrs().clear(); + gEntity.getAddrs().add(createUSRealmAddress()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityGuarantorGuarantorAssignedEntityUSRealmAddressStreet( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityGuarantorGuarantorAssignedEntityUSRealmAddressStreetTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityGuarantorGuarantorAssignedEntityUSRealmAddressCity() { + OperationsTestCase validatePolicyActivityGuarantorGuarantorAssignedEntityUSRealmAddressCityTestCase = new OperationsTestCase( + "validatePolicyActivityGuarantorGuarantorAssignedEntityUSRealmAddressCity", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_GUARANTOR_GUARANTOR_ASSIGNED_ENTITY_US_REALM_ADDRESS_CITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 guarantor = createPerformer(); + target.getPerformers().add(guarantor); + AssignedEntity gEntity = createGuarantorAssignedEntity(); + guarantor.setAssignedEntity(gEntity); + gEntity.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 guarantor = createPerformer(); + target.getPerformers().add(guarantor); + AssignedEntity gEntity = createGuarantorAssignedEntity(); + guarantor.setAssignedEntity(gEntity); + gEntity.getAddrs().clear(); + gEntity.getAddrs().add(createUSRealmAddress()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityGuarantorGuarantorAssignedEntityUSRealmAddressCity( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityGuarantorGuarantorAssignedEntityUSRealmAddressCityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityGuarantorGuarantorAssignedEntityUSRealmAddressCountry() { + OperationsTestCase validatePolicyActivityGuarantorGuarantorAssignedEntityUSRealmAddressCountryTestCase = new OperationsTestCase( + "validatePolicyActivityGuarantorGuarantorAssignedEntityUSRealmAddressCountry", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_GUARANTOR_GUARANTOR_ASSIGNED_ENTITY_US_REALM_ADDRESS_COUNTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 guarantor = createPerformer(); + target.getPerformers().add(guarantor); + AssignedEntity gEntity = createGuarantorAssignedEntity(); + guarantor.setAssignedEntity(gEntity); + gEntity.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 guarantor = createPerformer(); + target.getPerformers().add(guarantor); + AssignedEntity gEntity = createGuarantorAssignedEntity(); + guarantor.setAssignedEntity(gEntity); + gEntity.getAddrs().clear(); + gEntity.getAddrs().add(createUSRealmAddress()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityGuarantorGuarantorAssignedEntityUSRealmAddressCountry( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityGuarantorGuarantorAssignedEntityUSRealmAddressCountryTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityGuarantorGuarantorAssignedEntityUSRealmAddressPostalCode() { + OperationsTestCase validatePolicyActivityGuarantorGuarantorAssignedEntityUSRealmAddressPostalCodeTestCase = new OperationsTestCase( + "validatePolicyActivityGuarantorGuarantorAssignedEntityUSRealmAddressPostalCode", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_GUARANTOR_GUARANTOR_ASSIGNED_ENTITY_US_REALM_ADDRESS_POSTAL_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 guarantor = createPerformer(); + target.getPerformers().add(guarantor); + AssignedEntity gEntity = createGuarantorAssignedEntity(); + guarantor.setAssignedEntity(gEntity); + gEntity.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 guarantor = createPerformer(); + target.getPerformers().add(guarantor); + AssignedEntity gEntity = createGuarantorAssignedEntity(); + guarantor.setAssignedEntity(gEntity); + gEntity.getAddrs().clear(); + gEntity.getAddrs().add(createUSRealmAddress()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityGuarantorGuarantorAssignedEntityUSRealmAddressPostalCode( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityGuarantorGuarantorAssignedEntityUSRealmAddressPostalCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityGuarantorGuarantorAssignedEntityUSRealmAddressState() { + OperationsTestCase validatePolicyActivityGuarantorGuarantorAssignedEntityUSRealmAddressStateTestCase = new OperationsTestCase( + "validatePolicyActivityGuarantorGuarantorAssignedEntityUSRealmAddressState", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_GUARANTOR_GUARANTOR_ASSIGNED_ENTITY_US_REALM_ADDRESS_STATE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 guarantor = createPerformer(); + target.getPerformers().add(guarantor); + AssignedEntity gEntity = createGuarantorAssignedEntity(); + guarantor.setAssignedEntity(gEntity); + gEntity.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 guarantor = createPerformer(); + target.getPerformers().add(guarantor); + AssignedEntity gEntity = createGuarantorAssignedEntity(); + guarantor.setAssignedEntity(gEntity); + gEntity.getAddrs().clear(); + gEntity.getAddrs().add(createUSRealmAddress()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityGuarantorGuarantorAssignedEntityUSRealmAddressState( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityGuarantorGuarantorAssignedEntityUSRealmAddressStateTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityGuarantorGuarantorAssignedEntityUSRealmAddressStreetAddressLine() { + OperationsTestCase validatePolicyActivityGuarantorGuarantorAssignedEntityUSRealmAddressStreetAddressLineTestCase = new OperationsTestCase( + "validatePolicyActivityGuarantorGuarantorAssignedEntityUSRealmAddressStreetAddressLine", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_GUARANTOR_GUARANTOR_ASSIGNED_ENTITY_US_REALM_ADDRESS_STREET_ADDRESS_LINE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 guarantor = createPerformer(); + target.getPerformers().add(guarantor); + AssignedEntity gEntity = createGuarantorAssignedEntity(); + guarantor.setAssignedEntity(gEntity); + gEntity.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 guarantor = createPerformer(); + target.getPerformers().add(guarantor); + AssignedEntity gEntity = createGuarantorAssignedEntity(); + guarantor.setAssignedEntity(gEntity); + gEntity.getAddrs().clear(); + gEntity.getAddrs().add(createUSRealmAddress()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityGuarantorGuarantorAssignedEntityUSRealmAddressStreetAddressLine( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityGuarantorGuarantorAssignedEntityUSRealmAddressStreetAddressLineTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityGuarantorGuarantorAssignedEntityUSRealmAddressUseP() { + OperationsTestCase validatePolicyActivityGuarantorGuarantorAssignedEntityUSRealmAddressUsePTestCase = new OperationsTestCase( + "validatePolicyActivityGuarantorGuarantorAssignedEntityUSRealmAddressUseP", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_GUARANTOR_GUARANTOR_ASSIGNED_ENTITY_US_REALM_ADDRESS_USE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 guarantor = createPerformer(); + target.getPerformers().add(guarantor); + AssignedEntity gEntity = createGuarantorAssignedEntity(); + guarantor.setAssignedEntity(gEntity); + gEntity.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 guarantor = createPerformer(); + target.getPerformers().add(guarantor); + AssignedEntity gEntity = createGuarantorAssignedEntity(); + guarantor.setAssignedEntity(gEntity); + gEntity.getAddrs().clear(); + gEntity.getAddrs().add(createUSRealmAddress()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityGuarantorGuarantorAssignedEntityUSRealmAddressUseP( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityGuarantorGuarantorAssignedEntityUSRealmAddressUsePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityGuarantorGuarantorAssignedEntityUSRealmAddressUse() { + OperationsTestCase validatePolicyActivityGuarantorGuarantorAssignedEntityUSRealmAddressUseTestCase = new OperationsTestCase( + "validatePolicyActivityGuarantorGuarantorAssignedEntityUSRealmAddressUse", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_GUARANTOR_GUARANTOR_ASSIGNED_ENTITY_US_REALM_ADDRESS_USE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 guarantor = createPerformer(); + target.getPerformers().add(guarantor); + AssignedEntity gEntity = createGuarantorAssignedEntity(); + guarantor.setAssignedEntity(gEntity); + gEntity.getAddrs().clear(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + ad.getUses().add(null); + gEntity.getAddrs().add(ad); + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 guarantor = createPerformer(); + target.getPerformers().add(guarantor); + AssignedEntity gEntity = createGuarantorAssignedEntity(); + guarantor.setAssignedEntity(gEntity); + gEntity.getAddrs().clear(); + gEntity.getAddrs().add(createUSRealmAddress()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityGuarantorGuarantorAssignedEntityUSRealmAddressUse( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityGuarantorGuarantorAssignedEntityUSRealmAddressUseTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePolicyActivityGuarantorGuarantorAssignedEntityPersonNameAndOrOrgName() { + OperationsTestCase validatePolicyActivityGuarantorGuarantorAssignedEntityPersonNameAndOrOrgNameTestCase = new OperationsTestCase( + "validatePolicyActivityGuarantorGuarantorAssignedEntityPersonNameAndOrOrgName", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_GUARANTOR_GUARANTOR_ASSIGNED_ENTITY_PERSON_NAME_AND_OR_ORG_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 payer = createPerformer(); + target.getPerformers().add(payer); + AssignedEntity guarantorEntity = createGuarantorAssignedEntity(); + payer.setAssignedEntity(guarantorEntity); + + Person person = CDAFactory.eINSTANCE.createPerson(); + guarantorEntity.setAssignedPerson(person); + + } + + // Case with Person & Represented Organization + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 payer = createPerformer(); + target.getPerformers().add(payer); + AssignedEntity guarantorEntity = createGuarantorAssignedEntity(); + payer.setAssignedEntity(guarantorEntity); + + Person person = CDAFactory.eINSTANCE.createPerson(); + PN pn11 = DatatypesFactory.eINSTANCE.createPN(); + person.getNames().add(pn11); + guarantorEntity.setAssignedPerson(person); + + Organization org = CDAFactory.eINSTANCE.createOrganization(); + guarantorEntity.getRepresentedOrganizations().add(org); + ON on1 = DatatypesFactory.eINSTANCE.createON(); + org.getNames().add(on1); + } + + @Override + public void addPassTests() { + + addPassTest(new PassTest() { + + @Override + // Case with Person only + public void updateToPass(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 payer = createPerformer(); + target.getPerformers().add(payer); + AssignedEntity guarantorEntity = createGuarantorAssignedEntity(); + payer.setAssignedEntity(guarantorEntity); + + Person person = CDAFactory.eINSTANCE.createPerson(); + PN pn11 = DatatypesFactory.eINSTANCE.createPN(); + person.getNames().add(pn11); + guarantorEntity.setAssignedPerson(person); + } + + }); + + addPassTest(new PassTest() { + + @Override + // Case with RepresentedOrganization only + public void updateToPass(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 payer = createPerformer(); + target.getPerformers().add(payer); + AssignedEntity guarantorEntity = createGuarantorAssignedEntity(); + payer.setAssignedEntity(guarantorEntity); + + Organization org = CDAFactory.eINSTANCE.createOrganization(); + guarantorEntity.getRepresentedOrganizations().add(org); + ON on1 = DatatypesFactory.eINSTANCE.createON(); + org.getNames().add(on1); + } + + }); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityGuarantorGuarantorAssignedEntityPersonNameAndOrOrgName( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityGuarantorGuarantorAssignedEntityPersonNameAndOrOrgNameTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePolicyActivityGuarantorGuarantorAssignedEntityCode() { + OperationsTestCase validatePolicyActivityGuarantorGuarantorAssignedEntityCodeTestCase = new OperationsTestCase( + "validatePolicyActivityGuarantorGuarantorAssignedEntityCode", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_GUARANTOR_GUARANTOR_ASSIGNED_ENTITY_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 guarantor = createPerformer(); + guarantor.setAssignedEntity(createGuarantorAssignedEntity()); + guarantor.getAssignedEntity().setCode( + DatatypesFactory.eINSTANCE.createCE("GUAR", "2.16.840.1.113883.5.111X")); + target.getPerformers().add(guarantor); + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 guarantor = createPerformer(); + guarantor.setAssignedEntity(createGuarantorAssignedEntity()); + target.getPerformers().add(guarantor); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityGuarantorGuarantorAssignedEntityCode( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityGuarantorGuarantorAssignedEntityCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityGuarantorGuarantorAssignedEntityCodeP() { + OperationsTestCase validatePolicyActivityGuarantorGuarantorAssignedEntityCodePTestCase = new OperationsTestCase( + "validatePolicyActivityGuarantorGuarantorAssignedEntityCodeP", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_GUARANTOR_GUARANTOR_ASSIGNED_ENTITY_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + { + this.skipFailsTest(); + } + + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 guarantor = createPerformer(); + guarantor.setAssignedEntity(createGuarantorAssignedEntity()); + guarantor.getAssignedEntity().setCode(null); + target.getPerformers().add(guarantor); + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 guarantor = createPerformer(); + guarantor.setAssignedEntity(createGuarantorAssignedEntity()); + target.getPerformers().add(guarantor); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityGuarantorGuarantorAssignedEntityCodeP( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityGuarantorGuarantorAssignedEntityCodePTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePolicyActivityGuarantorGuarantorAssignedEntityAddr() { + OperationsTestCase validatePolicyActivityGuarantorGuarantorAssignedEntityAddrTestCase = new OperationsTestCase( + "validatePolicyActivityGuarantorGuarantorAssignedEntityAddr", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_GUARANTOR_GUARANTOR_ASSIGNED_ENTITY_ADDR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 guarantor = createPerformer(); + target.getPerformers().add(guarantor); + AssignedEntity gEntity = createGuarantorAssignedEntity(); + guarantor.setAssignedEntity(gEntity); + // gEntity.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 guarantor = createPerformer(); + target.getPerformers().add(guarantor); + AssignedEntity gEntity = createGuarantorAssignedEntity(); + guarantor.setAssignedEntity(gEntity); + gEntity.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityGuarantorGuarantorAssignedEntityAddr( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityGuarantorGuarantorAssignedEntityAddrTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePolicyActivityGuarantorGuarantorAssignedEntityTelecom() { + OperationsTestCase validatePolicyActivityGuarantorGuarantorAssignedEntityTelecomTestCase = new OperationsTestCase( + "validatePolicyActivityGuarantorGuarantorAssignedEntityTelecom", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_GUARANTOR_GUARANTOR_ASSIGNED_ENTITY_TELECOM__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 guarantor = createPerformer(); + target.getPerformers().add(guarantor); + AssignedEntity gEntity = createGuarantorAssignedEntity(); + guarantor.setAssignedEntity(gEntity); + // gEntity.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 guarantor = createPerformer(); + target.getPerformers().add(guarantor); + AssignedEntity gEntity = createGuarantorAssignedEntity(); + guarantor.setAssignedEntity(gEntity); + // gEntity.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + gEntity.getTelecoms().add(DatatypesFactory.eINSTANCE.createTEL()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityGuarantorGuarantorAssignedEntityTelecom( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityGuarantorGuarantorAssignedEntityTelecomTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityGuarantorTemplateId() { + OperationsTestCase validatePolicyActivityGuarantorTemplateIdTestCase = new OperationsTestCase( + "validatePolicyActivityGuarantorTemplateId", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_GUARANTOR_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 guarantor = createPerformer(); + target.getPerformers().add(guarantor); + AssignedEntity gEntity = createGuarantorAssignedEntity(); + guarantor.setAssignedEntity(gEntity); + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.getPerformers().clear(); + Performer2 guarantor = createPerformer(); + target.getPerformers().add(guarantor); + AssignedEntity gEntity = createGuarantorAssignedEntity(); + guarantor.setAssignedEntity(gEntity); + guarantor.getTemplateIds().add(DatatypesFactory.eINSTANCE.createII("2.16.840.1.113883.10.20.22.4.88")); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityGuarantorTemplateId( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityGuarantorTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePolicyActivityGuarantorTime() { + OperationsTestCase validatePolicyActivityGuarantorTimeTestCase = new OperationsTestCase( + "validatePolicyActivityGuarantorTime", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_GUARANTOR_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 guarantor = createPerformer(); + target.getPerformers().add(guarantor); + AssignedEntity gEntity = createGuarantorAssignedEntity(); + guarantor.setAssignedEntity(gEntity); + // guarantor.setTime(DatatypesFactory.eINSTANCE.createIVL_TS()); + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 guarantor = createPerformer(); + target.getPerformers().add(guarantor); + AssignedEntity gEntity = createGuarantorAssignedEntity(); + guarantor.setAssignedEntity(gEntity); + guarantor.setTime(DatatypesFactory.eINSTANCE.createIVL_TS()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityGuarantorTime( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityGuarantorTimeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePolicyActivityGuarantorTypeCode() { + OperationsTestCase validatePolicyActivityGuarantorTypeCodeTestCase = new OperationsTestCase( + "validatePolicyActivityGuarantorTypeCode", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_GUARANTOR_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 guarantor = createPerformer(); + target.getPerformers().add(guarantor); + AssignedEntity gEntity = createGuarantorAssignedEntity(); + guarantor.setAssignedEntity(gEntity); + guarantor.setTypeCode(ParticipationPhysicalPerformer.PPRF); + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 guarantor = createPerformer(); + target.getPerformers().add(guarantor); + AssignedEntity gEntity = createGuarantorAssignedEntity(); + guarantor.setAssignedEntity(gEntity); + guarantor.setTypeCode(ParticipationPhysicalPerformer.PRF); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityGuarantorTypeCode( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityGuarantorTypeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePolicyActivityGuarantorGuarantorAssignedEntity() { + OperationsTestCase validatePolicyActivityGuarantorGuarantorAssignedEntityTestCase = new OperationsTestCase( + "validatePolicyActivityGuarantorGuarantorAssignedEntity", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_GUARANTOR_GUARANTOR_ASSIGNED_ENTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + { + skipFailsTest(); + } + + // Skipping this test as the condition requires AssignedEntity code is + // checked for a Guarantor.. + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 guarantor = createPerformer(); + target.getPerformers().add(guarantor); + // AssignedEntity gEntity = createPayerAssignedEntity(); + // guarantor.setAssignedEntity(gEntity); + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + target.getPerformers().clear(); + Performer2 guarantor = createPerformer(); + target.getPerformers().add(guarantor); + AssignedEntity gEntity = createGuarantorAssignedEntity(); + guarantor.setAssignedEntity(gEntity); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityGuarantorGuarantorAssignedEntity( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityGuarantorGuarantorAssignedEntityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityCoverageCoverageRoleUSRealmAddressStreet() { + OperationsTestCase validatePolicyActivityCoverageCoverageRoleUSRealmAddressStreetTestCase = new OperationsTestCase( + "validatePolicyActivityCoverageCoverageRoleUSRealmAddressStreet", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_COVERAGE_COVERAGE_ROLE_US_REALM_ADDRESS_STREET__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + public void addFailTests() { + + addFailTest(new FailTest() { + + @Override + public void updateToFail(PolicyActivity target) { + target.init(); + target.getParticipants().clear(); + Participant2 coverage = createCoverage(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + coverage.getParticipantRole().getAddrs().add(ad); + target.getParticipants().add(coverage); + + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(PolicyActivity target) { + target.init(); + target.getParticipants().clear(); + Participant2 coverage = createCoverage(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + + coverage.getParticipantRole().getAddrs().add(ad); + target.getParticipants().add(coverage); + } + }); + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.getParticipants().clear(); + Participant2 coverage = createCoverage(); + target.getParticipants().add(coverage); + coverage.getParticipantRole().getAddrs().add(createUSRealmAddress()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityCoverageCoverageRoleUSRealmAddressStreet( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityCoverageCoverageRoleUSRealmAddressStreetTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityCoverageCoverageRoleUSRealmAddressCity() { + OperationsTestCase validatePolicyActivityCoverageCoverageRoleUSRealmAddressCityTestCase = new OperationsTestCase( + "validatePolicyActivityCoverageCoverageRoleUSRealmAddressCity", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_COVERAGE_COVERAGE_ROLE_US_REALM_ADDRESS_CITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.getParticipants().clear(); + Participant2 coverage = createCoverage(); + target.getParticipants().add(coverage); + coverage.getParticipantRole().getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.getParticipants().clear(); + Participant2 coverage = createCoverage(); + target.getParticipants().add(coverage); + coverage.getParticipantRole().getAddrs().add(createUSRealmAddress()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityCoverageCoverageRoleUSRealmAddressCity( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityCoverageCoverageRoleUSRealmAddressCityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityCoverageCoverageRoleUSRealmAddressCountry() { + OperationsTestCase validatePolicyActivityCoverageCoverageRoleUSRealmAddressCountryTestCase = new OperationsTestCase( + "validatePolicyActivityCoverageCoverageRoleUSRealmAddressCountry", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_COVERAGE_COVERAGE_ROLE_US_REALM_ADDRESS_COUNTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.getParticipants().clear(); + Participant2 coverage = createCoverage(); + target.getParticipants().add(coverage); + coverage.getParticipantRole().getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.getParticipants().clear(); + Participant2 coverage = createCoverage(); + target.getParticipants().add(coverage); + coverage.getParticipantRole().getAddrs().add(createUSRealmAddress()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityCoverageCoverageRoleUSRealmAddressCountry( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityCoverageCoverageRoleUSRealmAddressCountryTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityCoverageCoverageRoleUSRealmAddressPostalCode() { + OperationsTestCase validatePolicyActivityCoverageCoverageRoleUSRealmAddressPostalCodeTestCase = new OperationsTestCase( + "validatePolicyActivityCoverageCoverageRoleUSRealmAddressPostalCode", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_COVERAGE_COVERAGE_ROLE_US_REALM_ADDRESS_POSTAL_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.getParticipants().clear(); + Participant2 coverage = createCoverage(); + target.getParticipants().add(coverage); + coverage.getParticipantRole().getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.getParticipants().clear(); + Participant2 coverage = createCoverage(); + target.getParticipants().add(coverage); + coverage.getParticipantRole().getAddrs().add(createUSRealmAddress()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityCoverageCoverageRoleUSRealmAddressPostalCode( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityCoverageCoverageRoleUSRealmAddressPostalCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityCoverageCoverageRoleUSRealmAddressState() { + OperationsTestCase validatePolicyActivityCoverageCoverageRoleUSRealmAddressStateTestCase = new OperationsTestCase( + "validatePolicyActivityCoverageCoverageRoleUSRealmAddressState", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_COVERAGE_COVERAGE_ROLE_US_REALM_ADDRESS_STATE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.getParticipants().clear(); + Participant2 coverage = createCoverage(); + target.getParticipants().add(coverage); + coverage.getParticipantRole().getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.getParticipants().clear(); + Participant2 coverage = createCoverage(); + target.getParticipants().add(coverage); + coverage.getParticipantRole().getAddrs().add(createUSRealmAddress()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityCoverageCoverageRoleUSRealmAddressState( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityCoverageCoverageRoleUSRealmAddressStateTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityCoverageCoverageRoleUSRealmAddressStreetAddressLine() { + OperationsTestCase validatePolicyActivityCoverageCoverageRoleUSRealmAddressStreetAddressLineTestCase = new OperationsTestCase( + "validatePolicyActivityCoverageCoverageRoleUSRealmAddressStreetAddressLine", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_COVERAGE_COVERAGE_ROLE_US_REALM_ADDRESS_STREET_ADDRESS_LINE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.getParticipants().clear(); + Participant2 coverage = createCoverage(); + target.getParticipants().add(coverage); + coverage.getParticipantRole().getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.getParticipants().clear(); + Participant2 coverage = createCoverage(); + target.getParticipants().add(coverage); + coverage.getParticipantRole().getAddrs().add(createUSRealmAddress()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityCoverageCoverageRoleUSRealmAddressStreetAddressLine( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityCoverageCoverageRoleUSRealmAddressStreetAddressLineTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityCoverageCoverageRoleUSRealmAddressUseP() { + OperationsTestCase validatePolicyActivityCoverageCoverageRoleUSRealmAddressUsePTestCase = new OperationsTestCase( + "validatePolicyActivityCoverageCoverageRoleUSRealmAddressUseP", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_COVERAGE_COVERAGE_ROLE_US_REALM_ADDRESS_USE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.getParticipants().clear(); + Participant2 coverage = createCoverage(); + target.getParticipants().add(coverage); + coverage.getParticipantRole().getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.getParticipants().clear(); + Participant2 coverage = createCoverage(); + target.getParticipants().add(coverage); + coverage.getParticipantRole().getAddrs().add(createUSRealmAddress()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityCoverageCoverageRoleUSRealmAddressUseP( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityCoverageCoverageRoleUSRealmAddressUsePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityCoverageCoverageRoleUSRealmAddressUse() { + OperationsTestCase validatePolicyActivityCoverageCoverageRoleUSRealmAddressUseTestCase = new OperationsTestCase( + "validatePolicyActivityCoverageCoverageRoleUSRealmAddressUse", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_COVERAGE_COVERAGE_ROLE_US_REALM_ADDRESS_USE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.getParticipants().clear(); + Participant2 coverage = createCoverage(); + target.getParticipants().add(coverage); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + ad.getUses().add(null); + coverage.getParticipantRole().getAddrs().add(ad); + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.getParticipants().clear(); + Participant2 coverage = createCoverage(); + target.getParticipants().add(coverage); + coverage.getParticipantRole().getAddrs().add(createUSRealmAddress()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityCoverageCoverageRoleUSRealmAddressUse( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityCoverageCoverageRoleUSRealmAddressUseTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePolicyActivityCoverageCoverageRoleCoveragePlayingEntityName() { + OperationsTestCase validatePolicyActivityCoverageCoverageRoleCoveragePlayingEntityNameTestCase = new OperationsTestCase( + "validatePolicyActivityCoverageCoverageRoleCoveragePlayingEntityName", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_COVERAGE_COVERAGE_ROLE_COVERAGE_PLAYING_ENTITY_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + target.getParticipants().clear(); + Participant2 coverage = createCoverage(); + target.getParticipants().add(coverage); + // coverage.getParticipantRole().getPlayingEntity().getNames().add(DatatypesFactory.eINSTANCE.createPN()); + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + target.getParticipants().clear(); + Participant2 coverage = createCoverage(); + target.getParticipants().add(coverage); + coverage.getParticipantRole().getPlayingEntity().getNames().add(DatatypesFactory.eINSTANCE.createPN()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityCoverageCoverageRoleCoveragePlayingEntityName( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityCoverageCoverageRoleCoveragePlayingEntityNameTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityCoverageCoverageRoleId() { + OperationsTestCase validatePolicyActivityCoverageCoverageRoleIdTestCase = new OperationsTestCase( + "validatePolicyActivityCoverageCoverageRoleId", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_COVERAGE_COVERAGE_ROLE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + target.getParticipants().clear(); + Participant2 coverage = createCoverage(); + target.getParticipants().add(coverage); + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.getParticipants().clear(); + Participant2 coverage = createCoverage(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + pr.getIds().add(DatatypesFactory.eINSTANCE.createII()); + coverage.setParticipantRole(pr); + + target.getParticipants().add(coverage); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityCoverageCoverageRoleId( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityCoverageCoverageRoleIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityCoverageCoverageRoleCode() { + OperationsTestCase validatePolicyActivityCoverageCoverageRoleCodeTestCase = new OperationsTestCase( + "validatePolicyActivityCoverageCoverageRoleCode", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_COVERAGE_COVERAGE_ROLE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + Participant2 coverage = createCoverage(); + target.getParticipants().add(coverage); + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.getParticipants().clear(); + Participant2 coverage = createCoverage(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + pr.getIds().add(DatatypesFactory.eINSTANCE.createII()); + pr.setCode(DatatypesFactory.eINSTANCE.createCE("FAMDEP", "2.16.840.1.113883.5.111")); + coverage.setParticipantRole(pr); + // 2.16.840.1.113883.5.111' and (value.code = 'FAMDEP' or + target.getParticipants().add(coverage); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityCoverageCoverageRoleCode( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityCoverageCoverageRoleCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityCoverageCoverageRoleCodeP() { + OperationsTestCase validatePolicyActivityCoverageCoverageRoleCodePTestCase = new OperationsTestCase( + "validatePolicyActivityCoverageCoverageRoleCodeP", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_COVERAGE_COVERAGE_ROLE_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + Participant2 coverage = createCoverage(); + target.getParticipants().add(coverage); + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.getParticipants().clear(); + Participant2 coverage = createCoverage(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + pr.getIds().add(DatatypesFactory.eINSTANCE.createII()); + pr.setCode(DatatypesFactory.eINSTANCE.createCE("FAMDEP", "2.16.840.1.113883.5.111")); + coverage.setParticipantRole(pr); + // 2.16.840.1.113883.5.111' and (value.code = 'FAMDEP' or + target.getParticipants().add(coverage); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityCoverageCoverageRoleCodeP( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityCoverageCoverageRoleCodePTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePolicyActivityCoverageCoverageRoleAddr() { + OperationsTestCase validatePolicyActivityCoverageCoverageRoleAddrTestCase = new OperationsTestCase( + "validatePolicyActivityCoverageCoverageRoleAddr", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_COVERAGE_COVERAGE_ROLE_ADDR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + target.getParticipants().clear(); + Participant2 coverage = createCoverage(); + target.getParticipants().add(coverage); + // coverage.getParticipantRole().getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + + } + + @Override + protected void updateToPass(PolicyActivity target) { + + target.getParticipants().clear(); + Participant2 coverage = createCoverage(); + target.getParticipants().add(coverage); + coverage.getParticipantRole().getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityCoverageCoverageRoleAddr( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityCoverageCoverageRoleAddrTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityCoverageCoverageRoleCoveragePlayingEntity() { + OperationsTestCase validatePolicyActivityCoverageCoverageRoleCoveragePlayingEntityTestCase = new OperationsTestCase( + "validatePolicyActivityCoverageCoverageRoleCoveragePlayingEntity", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_COVERAGE_COVERAGE_ROLE_COVERAGE_PLAYING_ENTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + Participant2 coverage = createCoverage(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + coverage.setParticipantRole(pr); + target.getParticipants().add(coverage); + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.getParticipants().clear(); + Participant2 coverage = createCoverage(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + pr.setPlayingEntity(pe); + coverage.setParticipantRole(pr); + target.getParticipants().add(coverage); + coverage.getParticipantRole().getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityCoverageCoverageRoleCoveragePlayingEntity( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityCoverageCoverageRoleCoveragePlayingEntityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityCoverageLowTime() { + OperationsTestCase validatePolicyActivityCoverageLowTimeTestCase = new OperationsTestCase( + "validatePolicyActivityCoverageLowTime", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_COVERAGE_LOW_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + + Participant2 coverage = CDAFactory.eINSTANCE.createParticipant2(); + coverage.setTime(DatatypesFactory.eINSTANCE.createIVL_TS()); + coverage.setTypeCode(ParticipationType.COV); + target.getParticipants().add(coverage); + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.getParticipants().clear(); + + Participant2 coverage = CDAFactory.eINSTANCE.createParticipant2(); + IVL_TS time = DatatypesFactory.eINSTANCE.createIVL_TS(); + time.setLow(DatatypesFactory.eINSTANCE.createIVXB_TS()); + coverage.setTime(time); + coverage.setTypeCode(ParticipationType.COV); + target.getParticipants().add(coverage); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityCoverageLowTime( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityCoverageLowTimeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityCoverageHighTime() { + OperationsTestCase validatePolicyActivityCoverageHighTimeTestCase = new OperationsTestCase( + "validatePolicyActivityCoverageHighTime", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_COVERAGE_HIGH_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + + Participant2 coverage = CDAFactory.eINSTANCE.createParticipant2(); + coverage.setTime(DatatypesFactory.eINSTANCE.createIVL_TS()); + coverage.setTypeCode(ParticipationType.COV); + target.getParticipants().add(coverage); + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.getParticipants().clear(); + + Participant2 coverage = CDAFactory.eINSTANCE.createParticipant2(); + IVL_TS time = DatatypesFactory.eINSTANCE.createIVL_TS(); + time.setHigh(DatatypesFactory.eINSTANCE.createIVXB_TS()); + coverage.setTime(time); + coverage.setTypeCode(ParticipationType.COV); + target.getParticipants().add(coverage); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityCoverageHighTime( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityCoverageHighTimeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityCoverageTemplateId() { + OperationsTestCase validatePolicyActivityCoverageTemplateIdTestCase = new OperationsTestCase( + "validatePolicyActivityCoverageTemplateId", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_COVERAGE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + + Participant2 coverage = CDAFactory.eINSTANCE.createParticipant2(); + coverage.setTime(DatatypesFactory.eINSTANCE.createIVL_TS()); + coverage.setTypeCode(ParticipationType.COV); + target.getParticipants().add(coverage); + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.getParticipants().clear(); + + Participant2 coverage = CDAFactory.eINSTANCE.createParticipant2(); + coverage.getTemplateIds().add(DatatypesFactory.eINSTANCE.createII("2.16.840.1.113883.10.20.22.4.89")); + coverage.setTypeCode(ParticipationType.COV); + target.getParticipants().add(coverage); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityCoverageTemplateId( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityCoverageTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityCoverageTypeCode() { + OperationsTestCase validatePolicyActivityCoverageTypeCodeTestCase = new OperationsTestCase( + "validatePolicyActivityCoverageTypeCode", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_COVERAGE_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + { + this.skipFailsTest(); + } + + @Override + protected void updateToFail(PolicyActivity target) { + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + Participant2 coverage = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole role = CDAFactory.eINSTANCE.createParticipantRole(); + PlayingEntity pEntity = CDAFactory.eINSTANCE.createPlayingEntity(); + role.setPlayingEntity(pEntity); + coverage.setParticipantRole(role); + coverage.setTypeCode(ParticipationType.COV); + target.getParticipants().add(coverage); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityCoverageTypeCode( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityCoverageTypeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityCoverageTime() { + OperationsTestCase validatePolicyActivityCoverageTimeTestCase = new OperationsTestCase( + "validatePolicyActivityCoverageTime", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_COVERAGE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + + Participant2 coverage = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole role = CDAFactory.eINSTANCE.createParticipantRole(); + PlayingEntity pEntity = CDAFactory.eINSTANCE.createPlayingEntity(); + role.setPlayingEntity(pEntity); + coverage.setParticipantRole(role); + coverage.setTypeCode(ParticipationType.COV); + target.getParticipants().add(coverage); + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.getParticipants().clear(); + Participant2 coverage = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole role = CDAFactory.eINSTANCE.createParticipantRole(); + PlayingEntity pEntity = CDAFactory.eINSTANCE.createPlayingEntity(); + role.setPlayingEntity(pEntity); + coverage.setTime(DatatypesFactory.eINSTANCE.createIVL_TS()); + coverage.setParticipantRole(role); + coverage.setTypeCode(ParticipationType.COV); + target.getParticipants().add(coverage); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityCoverageTime( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityCoverageTimeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityCoverageCoverageRole() { + OperationsTestCase validatePolicyActivityCoverageCoverageRoleTestCase = new OperationsTestCase( + "validatePolicyActivityCoverageCoverageRole", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_COVERAGE_COVERAGE_ROLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + Participant2 coverage = CDAFactory.eINSTANCE.createParticipant2(); + CDAFactory.eINSTANCE.createParticipantRole(); + CDAFactory.eINSTANCE.createPlayingEntity(); + // role.setPlayingEntity(pEntity); + // coverage.setParticipantRole(role); + coverage.setTypeCode(ParticipationType.COV); + target.getParticipants().add(coverage); + + } + + @Override + protected void updateToPass(PolicyActivity target) { + + target.getParticipants().clear(); + Participant2 coverage = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole role = CDAFactory.eINSTANCE.createParticipantRole(); + PlayingEntity pEntity = CDAFactory.eINSTANCE.createPlayingEntity(); + role.setPlayingEntity(pEntity); + coverage.setParticipantRole(role); + coverage.setTypeCode(ParticipationType.COV); + target.getParticipants().add(coverage); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityCoverageCoverageRole( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityCoverageCoverageRoleTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityHolderHolderRoleUSRealmAddressStreet() { + OperationsTestCase validatePolicyActivityHolderHolderRoleUSRealmAddressStreetTestCase = new OperationsTestCase( + "validatePolicyActivityHolderHolderRoleUSRealmAddressStreet", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_HOLDER_HOLDER_ROLE_US_REALM_ADDRESS_STREET__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + public void addFailTests() { + + addFailTest(new FailTest() { + + @Override + public void updateToFail(PolicyActivity target) { + target.getParticipants().clear(); + Participant2 holder = CDAFactory.eINSTANCE.createParticipant2(); + holder.setTypeCode(ParticipationType.HLD); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + ad.addStreetAddressLine("123"); + pr.getAddrs().add(ad); + holder.setParticipantRole(pr); + target.getParticipants().add(holder); + + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(PolicyActivity target) { + target.getParticipants().clear(); + Participant2 holder = CDAFactory.eINSTANCE.createParticipant2(); + holder.setTypeCode(ParticipationType.HLD); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + pr.getAddrs().add(ad); + holder.setParticipantRole(pr); + target.getParticipants().add(holder); + } + }); + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.getParticipants().clear(); + Participant2 holder = CDAFactory.eINSTANCE.createParticipant2(); + holder.setTypeCode(ParticipationType.HLD); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + + pr.getAddrs().add(createUSRealmAddress()); + holder.setParticipantRole(pr); + target.getParticipants().add(holder); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityHolderHolderRoleUSRealmAddressStreet( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityHolderHolderRoleUSRealmAddressStreetTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityHolderHolderRoleUSRealmAddressCity() { + OperationsTestCase validatePolicyActivityHolderHolderRoleUSRealmAddressCityTestCase = new OperationsTestCase( + "validatePolicyActivityHolderHolderRoleUSRealmAddressCity", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_HOLDER_HOLDER_ROLE_US_REALM_ADDRESS_CITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.getParticipants().clear(); + Participant2 holder = CDAFactory.eINSTANCE.createParticipant2(); + holder.setTypeCode(ParticipationType.HLD); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + pr.getAddrs().add(ad); + holder.setParticipantRole(pr); + target.getParticipants().add(holder); + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.getParticipants().clear(); + Participant2 holder = CDAFactory.eINSTANCE.createParticipant2(); + holder.setTypeCode(ParticipationType.HLD); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + + pr.getAddrs().add(createUSRealmAddress()); + holder.setParticipantRole(pr); + target.getParticipants().add(holder); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityHolderHolderRoleUSRealmAddressCity( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityHolderHolderRoleUSRealmAddressCityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityHolderHolderRoleUSRealmAddressCountry() { + OperationsTestCase validatePolicyActivityHolderHolderRoleUSRealmAddressCountryTestCase = new OperationsTestCase( + "validatePolicyActivityHolderHolderRoleUSRealmAddressCountry", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_HOLDER_HOLDER_ROLE_US_REALM_ADDRESS_COUNTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.getParticipants().clear(); + Participant2 holder = CDAFactory.eINSTANCE.createParticipant2(); + holder.setTypeCode(ParticipationType.HLD); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + pr.getAddrs().add(ad); + holder.setParticipantRole(pr); + target.getParticipants().add(holder); + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.getParticipants().clear(); + Participant2 holder = CDAFactory.eINSTANCE.createParticipant2(); + holder.setTypeCode(ParticipationType.HLD); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + + pr.getAddrs().add(createUSRealmAddress()); + holder.setParticipantRole(pr); + target.getParticipants().add(holder); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityHolderHolderRoleUSRealmAddressCountry( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityHolderHolderRoleUSRealmAddressCountryTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityHolderHolderRoleUSRealmAddressPostalCode() { + OperationsTestCase validatePolicyActivityHolderHolderRoleUSRealmAddressPostalCodeTestCase = new OperationsTestCase( + "validatePolicyActivityHolderHolderRoleUSRealmAddressPostalCode", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_HOLDER_HOLDER_ROLE_US_REALM_ADDRESS_POSTAL_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.getParticipants().clear(); + Participant2 holder = CDAFactory.eINSTANCE.createParticipant2(); + holder.setTypeCode(ParticipationType.HLD); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + pr.getAddrs().add(ad); + holder.setParticipantRole(pr); + target.getParticipants().add(holder); + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.getParticipants().clear(); + Participant2 holder = CDAFactory.eINSTANCE.createParticipant2(); + holder.setTypeCode(ParticipationType.HLD); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + + pr.getAddrs().add(createUSRealmAddress()); + holder.setParticipantRole(pr); + target.getParticipants().add(holder); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityHolderHolderRoleUSRealmAddressPostalCode( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityHolderHolderRoleUSRealmAddressPostalCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityHolderHolderRoleUSRealmAddressState() { + OperationsTestCase validatePolicyActivityHolderHolderRoleUSRealmAddressStateTestCase = new OperationsTestCase( + "validatePolicyActivityHolderHolderRoleUSRealmAddressState", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_HOLDER_HOLDER_ROLE_US_REALM_ADDRESS_STATE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.getParticipants().clear(); + Participant2 holder = CDAFactory.eINSTANCE.createParticipant2(); + holder.setTypeCode(ParticipationType.HLD); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + pr.getAddrs().add(ad); + holder.setParticipantRole(pr); + target.getParticipants().add(holder); + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.getParticipants().clear(); + Participant2 holder = CDAFactory.eINSTANCE.createParticipant2(); + holder.setTypeCode(ParticipationType.HLD); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + + pr.getAddrs().add(createUSRealmAddress()); + holder.setParticipantRole(pr); + target.getParticipants().add(holder); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityHolderHolderRoleUSRealmAddressState( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityHolderHolderRoleUSRealmAddressStateTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityHolderHolderRoleUSRealmAddressStreetAddressLine() { + OperationsTestCase validatePolicyActivityHolderHolderRoleUSRealmAddressStreetAddressLineTestCase = new OperationsTestCase( + "validatePolicyActivityHolderHolderRoleUSRealmAddressStreetAddressLine", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_HOLDER_HOLDER_ROLE_US_REALM_ADDRESS_STREET_ADDRESS_LINE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.getParticipants().clear(); + Participant2 holder = CDAFactory.eINSTANCE.createParticipant2(); + holder.setTypeCode(ParticipationType.HLD); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + pr.getAddrs().add(ad); + holder.setParticipantRole(pr); + target.getParticipants().add(holder); + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.getParticipants().clear(); + Participant2 holder = CDAFactory.eINSTANCE.createParticipant2(); + holder.setTypeCode(ParticipationType.HLD); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + + pr.getAddrs().add(createUSRealmAddress()); + holder.setParticipantRole(pr); + target.getParticipants().add(holder); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityHolderHolderRoleUSRealmAddressStreetAddressLine( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityHolderHolderRoleUSRealmAddressStreetAddressLineTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityHolderHolderRoleUSRealmAddressUseP() { + OperationsTestCase validatePolicyActivityHolderHolderRoleUSRealmAddressUsePTestCase = new OperationsTestCase( + "validatePolicyActivityHolderHolderRoleUSRealmAddressUseP", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_HOLDER_HOLDER_ROLE_US_REALM_ADDRESS_USE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.getParticipants().clear(); + Participant2 holder = CDAFactory.eINSTANCE.createParticipant2(); + holder.setTypeCode(ParticipationType.HLD); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + pr.getAddrs().add(ad); + holder.setParticipantRole(pr); + target.getParticipants().add(holder); + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.getParticipants().clear(); + Participant2 holder = CDAFactory.eINSTANCE.createParticipant2(); + holder.setTypeCode(ParticipationType.HLD); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + + pr.getAddrs().add(createUSRealmAddress()); + holder.setParticipantRole(pr); + target.getParticipants().add(holder); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityHolderHolderRoleUSRealmAddressUseP( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityHolderHolderRoleUSRealmAddressUsePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityHolderHolderRoleUSRealmAddressUse() { + OperationsTestCase validatePolicyActivityHolderHolderRoleUSRealmAddressUseTestCase = new OperationsTestCase( + "validatePolicyActivityHolderHolderRoleUSRealmAddressUse", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_HOLDER_HOLDER_ROLE_US_REALM_ADDRESS_USE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.getParticipants().clear(); + Participant2 holder = CDAFactory.eINSTANCE.createParticipant2(); + holder.setTypeCode(ParticipationType.HLD); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + ad.getUses().add(null); + pr.getAddrs().add(ad); + holder.setParticipantRole(pr); + target.getParticipants().add(holder); + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.getParticipants().clear(); + Participant2 holder = CDAFactory.eINSTANCE.createParticipant2(); + holder.setTypeCode(ParticipationType.HLD); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + + pr.getAddrs().add(createUSRealmAddress()); + holder.setParticipantRole(pr); + target.getParticipants().add(holder); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityHolderHolderRoleUSRealmAddressUse( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityHolderHolderRoleUSRealmAddressUseTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityHolderHolderRoleId() { + OperationsTestCase validatePolicyActivityHolderHolderRoleIdTestCase = new OperationsTestCase( + "validatePolicyActivityHolderHolderRoleId", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_HOLDER_HOLDER_ROLE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + Participant2 holder = CDAFactory.eINSTANCE.createParticipant2(); + holder.setTypeCode(ParticipationType.HLD); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + holder.setParticipantRole(pr); + target.getParticipants().add(holder); + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.getParticipants().clear(); + Participant2 holder = CDAFactory.eINSTANCE.createParticipant2(); + holder.setTypeCode(ParticipationType.HLD); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + pr.getIds().add(DatatypesFactory.eINSTANCE.createII()); + holder.setParticipantRole(pr); + target.getParticipants().add(holder); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityHolderHolderRoleId( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityHolderHolderRoleIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityHolderHolderRoleAddr() { + OperationsTestCase validatePolicyActivityHolderHolderRoleAddrTestCase = new OperationsTestCase( + "validatePolicyActivityHolderHolderRoleAddr", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_HOLDER_HOLDER_ROLE_ADDR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + Participant2 holder = CDAFactory.eINSTANCE.createParticipant2(); + holder.setTypeCode(ParticipationType.HLD); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + holder.setParticipantRole(pr); + target.getParticipants().add(holder); + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.getParticipants().clear(); + Participant2 holder = CDAFactory.eINSTANCE.createParticipant2(); + holder.setTypeCode(ParticipationType.HLD); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + pr.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + holder.setParticipantRole(pr); + target.getParticipants().add(holder); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityHolderHolderRoleAddr( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityHolderHolderRoleAddrTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityHolderTemplateId() { + OperationsTestCase validatePolicyActivityHolderTemplateIdTestCase = new OperationsTestCase( + "validatePolicyActivityHolderTemplateId", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_HOLDER_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + Participant2 holder = CDAFactory.eINSTANCE.createParticipant2(); + holder.setTypeCode(ParticipationType.HLD); + target.getParticipants().add(holder); + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.getParticipants().clear(); + Participant2 holder = CDAFactory.eINSTANCE.createParticipant2(); + holder.setTypeCode(ParticipationType.HLD); + holder.getTemplateIds().add(DatatypesFactory.eINSTANCE.createII("2.16.840.1.113883.10.20.22.4.90")); + target.getParticipants().add(holder); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityHolderTemplateId( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityHolderTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityHolderTypeCode() { + OperationsTestCase validatePolicyActivityHolderTypeCodeTestCase = new OperationsTestCase( + "validatePolicyActivityHolderTypeCode", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_HOLDER_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + { + this.skipFailsTest(); + } + + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + Participant2 holder = CDAFactory.eINSTANCE.createParticipant2(); + holder.setTypeCode(ParticipationType.HLD); + target.getParticipants().add(holder); + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.getParticipants().clear(); + Participant2 holder = CDAFactory.eINSTANCE.createParticipant2(); + holder.setTypeCode(ParticipationType.HLD); + + target.getParticipants().add(holder); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityHolderTypeCode( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityHolderTypeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityHolderTime() { + OperationsTestCase validatePolicyActivityHolderTimeTestCase = new OperationsTestCase( + "validatePolicyActivityHolderTime", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_HOLDER_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + Participant2 holder = CDAFactory.eINSTANCE.createParticipant2(); + holder.setTypeCode(ParticipationType.HLD); + target.getParticipants().add(holder); + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.getParticipants().clear(); + Participant2 holder = CDAFactory.eINSTANCE.createParticipant2(); + holder.setTypeCode(ParticipationType.HLD); + holder.setTime(DatatypesFactory.eINSTANCE.createIVL_TS()); + target.getParticipants().add(holder); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityHolderTime( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityHolderTimeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityHolderHolderRole() { + OperationsTestCase validatePolicyActivityHolderHolderRoleTestCase = new OperationsTestCase( + "validatePolicyActivityHolderHolderRole", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_HOLDER_HOLDER_ROLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + Participant2 holder = CDAFactory.eINSTANCE.createParticipant2(); + holder.setTypeCode(ParticipationType.HLD); + target.getParticipants().add(holder); + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.getParticipants().clear(); + Participant2 holder = CDAFactory.eINSTANCE.createParticipant2(); + holder.setTypeCode(ParticipationType.HLD); + holder.setParticipantRole(CDAFactory.eINSTANCE.createParticipantRole()); + target.getParticipants().add(holder); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityHolderHolderRole( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityHolderHolderRoleTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityEntryRelationshipTargetActActivity() { + OperationsTestCase validatePolicyActivityEntryRelationshipTargetActActivityTestCase = new OperationsTestCase( + "validatePolicyActivityEntryRelationshipTargetActActivity", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_ENTRY_RELATIONSHIP_TARGET_ACT_ACTIVITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.REFR); + target.getEntryRelationships().add(er); + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.getEntryRelationships().clear(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.REFR); + er.setAct(ConsolFactory.eINSTANCE.createAuthorizationActivity()); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityEntryRelationshipTargetActActivity( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityEntryRelationshipTargetActActivityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityEntryRelationshipDescriptionCoveragePlan() { + OperationsTestCase validatePolicyActivityEntryRelationshipDescriptionCoveragePlanTestCase = new OperationsTestCase( + "validatePolicyActivityEntryRelationshipDescriptionCoveragePlan", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_ENTRY_RELATIONSHIP_DESCRIPTION_COVERAGE_PLAN__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PolicyActivity target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.REFR); + Act act = CDAFactory.eINSTANCE.createAct(); + act.setClassCode(x_ActClassDocumentEntryAct.ACT); + act.setMoodCode(x_DocumentActMood.DEF); + + er.setAct(act); + target.getEntryRelationships().add(er); + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.getEntryRelationships().clear(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.REFR); + Act act = CDAFactory.eINSTANCE.createAct(); + act.setClassCode(x_ActClassDocumentEntryAct.ACT); + act.setMoodCode(x_DocumentActMood.DEF); + act.setText(DatatypesFactory.eINSTANCE.createED()); + act.getIds().add(DatatypesFactory.eINSTANCE.createII()); + er.setAct(act); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityEntryRelationshipDescriptionCoveragePlan( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityEntryRelationshipDescriptionCoveragePlanTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePolicyActivityEntryRelationshipTypeCode() { + OperationsTestCase validatePolicyActivityEntryRelationshipTypeCodeTestCase = new OperationsTestCase( + "validatePolicyActivityEntryRelationshipTypeCode", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_ENTRY_RELATIONSHIP_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + { + this.skipFailsTest(); + } + + @Override + protected void updateToFail(PolicyActivity target) { + + } + + @Override + protected void updateToPass(PolicyActivity target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.REFR); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PolicyActivityOperations.validatePolicyActivityEntryRelationshipTypeCode( + (PolicyActivity) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityEntryRelationshipTypeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PolicyActivityOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public PolicyActivity create() { + return ConsolFactory.eINSTANCE.createPolicyActivity(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PolicyActivityOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + + /** + * Convenience Method for creating AssignedEntity for Payer + */ + private static AssignedEntity createPayerAssignedEntity() { + AssignedEntity assignedEntity = CDAFactory.eINSTANCE.createAssignedEntity(); + assignedEntity.getIds().add(DatatypesFactory.eINSTANCE.createII("12345")); + assignedEntity.setCode(DatatypesFactory.eINSTANCE.createCE("EMP", "2.16.840.1.113883.5.110")); + assignedEntity.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + assignedEntity.getTelecoms().add(DatatypesFactory.eINSTANCE.createTEL()); + return assignedEntity; + } + + private static AssignedEntity createGuarantorAssignedEntity() { + AssignedEntity assignedEntity = CDAFactory.eINSTANCE.createAssignedEntity(); + assignedEntity.getIds().add(DatatypesFactory.eINSTANCE.createII("12345")); + assignedEntity.setCode(DatatypesFactory.eINSTANCE.createCE("GUAR", "2.16.840.1.113883.5.111")); + return assignedEntity; + } + + private static Performer2 createPerformer() { + Performer2 performer = CDAFactory.eINSTANCE.createPerformer2(); + return performer; + } + + private static Participant2 createCoverage() { + Participant2 coverage = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole role = CDAFactory.eINSTANCE.createParticipantRole(); + PlayingEntity pEntity = CDAFactory.eINSTANCE.createPlayingEntity(); + role.setPlayingEntity(pEntity); + coverage.setParticipantRole(role); + coverage.setTypeCode(ParticipationType.COV); + return coverage; + } + + private static Participant2 createHolder() { + Participant2 holder = CDAFactory.eINSTANCE.createParticipant2(); + return holder; + } + + private AD createUSRealmAddress() { + AD addr = DatatypesFactory.eINSTANCE.createAD(); + addr.getUses().add(PostalAddressUse.HP); + addr.addStreetAddressLine("123 Main Street"); + addr.addCity("Boston"); + addr.addState("MA"); + addr.addCountry("US"); + addr.addPostalCode("01001"); + + return addr; + + } + +} // PolicyActivityOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PostoperativeDiagnosisSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PostoperativeDiagnosisSectionTest.java new file mode 100644 index 000000000..79a2cbf4b --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PostoperativeDiagnosisSectionTest.java @@ -0,0 +1,290 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.PostoperativeDiagnosisSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.PostoperativeDiagnosisSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Postoperative Diagnosis Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PostoperativeDiagnosisSection#validatePostoperativeDiagnosisSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Postoperative Diagnosis Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PostoperativeDiagnosisSection#validatePostoperativeDiagnosisSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Postoperative Diagnosis Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PostoperativeDiagnosisSection#validatePostoperativeDiagnosisSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Postoperative Diagnosis Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PostoperativeDiagnosisSection#validatePostoperativeDiagnosisSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Postoperative Diagnosis Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PostoperativeDiagnosisSection#validatePostoperativeDiagnosisSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Postoperative Diagnosis Section Title}
  • + *
+ *

+ * + * @generated + */ + +public class PostoperativeDiagnosisSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidatePostoperativeDiagnosisSectionTemplateId() { + OperationsTestCase validatePostoperativeDiagnosisSectionTemplateIdTestCase = new OperationsTestCase( + "validatePostoperativeDiagnosisSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_POSTOPERATIVE_DIAGNOSIS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PostoperativeDiagnosisSection target) { + + } + + @Override + protected void updateToPass(PostoperativeDiagnosisSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PostoperativeDiagnosisSectionOperations.validatePostoperativeDiagnosisSectionTemplateId( + (PostoperativeDiagnosisSection) objectToTest, diagnostician, map); + } + + }; + + validatePostoperativeDiagnosisSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePostoperativeDiagnosisSectionCode() { + OperationsTestCase validatePostoperativeDiagnosisSectionCodeTestCase = new OperationsTestCase( + "validatePostoperativeDiagnosisSectionCode", + operationsForOCL.getOCLValue("VALIDATE_POSTOPERATIVE_DIAGNOSIS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PostoperativeDiagnosisSection target) { + + } + + @Override + protected void updateToPass(PostoperativeDiagnosisSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PostoperativeDiagnosisSectionOperations.validatePostoperativeDiagnosisSectionCode( + (PostoperativeDiagnosisSection) objectToTest, diagnostician, map); + } + + }; + + validatePostoperativeDiagnosisSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePostoperativeDiagnosisSectionCodeP() { + OperationsTestCase validatePostoperativeDiagnosisSectionCodePTestCase = new OperationsTestCase( + "validatePostoperativeDiagnosisSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_POSTOPERATIVE_DIAGNOSIS_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PostoperativeDiagnosisSection target) { + + } + + @Override + protected void updateToPass(PostoperativeDiagnosisSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PostoperativeDiagnosisSectionOperations.validatePostoperativeDiagnosisSectionCodeP( + (PostoperativeDiagnosisSection) objectToTest, diagnostician, map); + } + + }; + + validatePostoperativeDiagnosisSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePostoperativeDiagnosisSectionText() { + OperationsTestCase validatePostoperativeDiagnosisSectionTextTestCase = new OperationsTestCase( + "validatePostoperativeDiagnosisSectionText", + operationsForOCL.getOCLValue("VALIDATE_POSTOPERATIVE_DIAGNOSIS_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PostoperativeDiagnosisSection target) { + + } + + @Override + protected void updateToPass(PostoperativeDiagnosisSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PostoperativeDiagnosisSectionOperations.validatePostoperativeDiagnosisSectionText( + (PostoperativeDiagnosisSection) objectToTest, diagnostician, map); + } + + }; + + validatePostoperativeDiagnosisSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePostoperativeDiagnosisSectionTitle() { + OperationsTestCase validatePostoperativeDiagnosisSectionTitleTestCase = new OperationsTestCase( + "validatePostoperativeDiagnosisSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_POSTOPERATIVE_DIAGNOSIS_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PostoperativeDiagnosisSection target) { + + } + + @Override + protected void updateToPass(PostoperativeDiagnosisSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PostoperativeDiagnosisSectionOperations.validatePostoperativeDiagnosisSectionTitle( + (PostoperativeDiagnosisSection) objectToTest, diagnostician, map); + } + + }; + + validatePostoperativeDiagnosisSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PostoperativeDiagnosisSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public PostoperativeDiagnosisSection create() { + return ConsolFactory.eINSTANCE.createPostoperativeDiagnosisSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PostoperativeDiagnosisSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PostoperativeDiagnosisSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PostprocedureDiagnosisSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PostprocedureDiagnosisSectionTest.java new file mode 100644 index 000000000..cee2f9dfc --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PostprocedureDiagnosisSectionTest.java @@ -0,0 +1,339 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.PostprocedureDiagnosisSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.PostprocedureDiagnosisSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Postprocedure Diagnosis Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PostprocedureDiagnosisSection#validatePostprocedureDiagnosisSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Postprocedure Diagnosis Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PostprocedureDiagnosisSection#validatePostprocedureDiagnosisSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Postprocedure Diagnosis Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PostprocedureDiagnosisSection#validatePostprocedureDiagnosisSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Postprocedure Diagnosis Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PostprocedureDiagnosisSection#validatePostprocedureDiagnosisSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Postprocedure Diagnosis Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PostprocedureDiagnosisSection#validatePostprocedureDiagnosisSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Postprocedure Diagnosis Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PostprocedureDiagnosisSection#validatePostprocedureDiagnosisSectionPostprocedureDiagnosis(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Postprocedure Diagnosis Section Postprocedure Diagnosis}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PostprocedureDiagnosisSection#getPostprocedureDiagnosis() Get Postprocedure Diagnosis}
  • + *
+ *

+ * + * @generated + */ + +public class PostprocedureDiagnosisSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidatePostprocedureDiagnosisSectionTemplateId() { + OperationsTestCase validatePostprocedureDiagnosisSectionTemplateIdTestCase = new OperationsTestCase( + "validatePostprocedureDiagnosisSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_POSTPROCEDURE_DIAGNOSIS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PostprocedureDiagnosisSection target) { + + } + + @Override + protected void updateToPass(PostprocedureDiagnosisSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PostprocedureDiagnosisSectionOperations.validatePostprocedureDiagnosisSectionTemplateId( + (PostprocedureDiagnosisSection) objectToTest, diagnostician, map); + } + + }; + + validatePostprocedureDiagnosisSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePostprocedureDiagnosisSectionCodeP() { + OperationsTestCase validatePostprocedureDiagnosisSectionCodePTestCase = new OperationsTestCase( + "validatePostprocedureDiagnosisSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_POSTPROCEDURE_DIAGNOSIS_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PostprocedureDiagnosisSection target) { + + } + + @Override + protected void updateToPass(PostprocedureDiagnosisSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PostprocedureDiagnosisSectionOperations.validatePostprocedureDiagnosisSectionCodeP( + (PostprocedureDiagnosisSection) objectToTest, diagnostician, map); + } + + }; + + validatePostprocedureDiagnosisSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePostprocedureDiagnosisSectionCode() { + OperationsTestCase validatePostprocedureDiagnosisSectionCodeTestCase = new OperationsTestCase( + "validatePostprocedureDiagnosisSectionCode", + operationsForOCL.getOCLValue("VALIDATE_POSTPROCEDURE_DIAGNOSIS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PostprocedureDiagnosisSection target) { + + } + + @Override + protected void updateToPass(PostprocedureDiagnosisSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PostprocedureDiagnosisSectionOperations.validatePostprocedureDiagnosisSectionCode( + (PostprocedureDiagnosisSection) objectToTest, diagnostician, map); + } + + }; + + validatePostprocedureDiagnosisSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePostprocedureDiagnosisSectionText() { + OperationsTestCase validatePostprocedureDiagnosisSectionTextTestCase = new OperationsTestCase( + "validatePostprocedureDiagnosisSectionText", + operationsForOCL.getOCLValue("VALIDATE_POSTPROCEDURE_DIAGNOSIS_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PostprocedureDiagnosisSection target) { + + } + + @Override + protected void updateToPass(PostprocedureDiagnosisSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PostprocedureDiagnosisSectionOperations.validatePostprocedureDiagnosisSectionText( + (PostprocedureDiagnosisSection) objectToTest, diagnostician, map); + } + + }; + + validatePostprocedureDiagnosisSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePostprocedureDiagnosisSectionTitle() { + OperationsTestCase validatePostprocedureDiagnosisSectionTitleTestCase = new OperationsTestCase( + "validatePostprocedureDiagnosisSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_POSTPROCEDURE_DIAGNOSIS_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PostprocedureDiagnosisSection target) { + + } + + @Override + protected void updateToPass(PostprocedureDiagnosisSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PostprocedureDiagnosisSectionOperations.validatePostprocedureDiagnosisSectionTitle( + (PostprocedureDiagnosisSection) objectToTest, diagnostician, map); + } + + }; + + validatePostprocedureDiagnosisSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePostprocedureDiagnosisSectionPostprocedureDiagnosis() { + OperationsTestCase validatePostprocedureDiagnosisSectionPostprocedureDiagnosisTestCase = new OperationsTestCase( + "validatePostprocedureDiagnosisSectionPostprocedureDiagnosis", + operationsForOCL.getOCLValue("VALIDATE_POSTPROCEDURE_DIAGNOSIS_SECTION_POSTPROCEDURE_DIAGNOSIS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PostprocedureDiagnosisSection target) { + target.init(); + + } + + @Override + protected void updateToPass(PostprocedureDiagnosisSection target) { + target.addAct(ConsolFactory.eINSTANCE.createPostprocedureDiagnosis().init()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PostprocedureDiagnosisSectionOperations.validatePostprocedureDiagnosisSectionPostprocedureDiagnosis( + (PostprocedureDiagnosisSection) objectToTest, diagnostician, map); + } + + }; + + validatePostprocedureDiagnosisSectionPostprocedureDiagnosisTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetPostprocedureDiagnosis() { + + PostprocedureDiagnosisSection target = objectFactory.create(); + target.getPostprocedureDiagnosis(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PostprocedureDiagnosisSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public PostprocedureDiagnosisSection create() { + return ConsolFactory.eINSTANCE.createPostprocedureDiagnosisSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PostprocedureDiagnosisSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PostprocedureDiagnosisSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PostprocedureDiagnosisTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PostprocedureDiagnosisTest.java new file mode 100644 index 000000000..6e8d2c90c --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PostprocedureDiagnosisTest.java @@ -0,0 +1,301 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.PostprocedureDiagnosis; +import org.openhealthtools.mdht.uml.cda.consol.operations.PostprocedureDiagnosisOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * + * A static utility class that provides operations related to 'Postprocedure Diagnosis' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PostprocedureDiagnosis#validatePostprocedureDiagnosisTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Postprocedure Diagnosis Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PostprocedureDiagnosis#validatePostprocedureDiagnosisClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Postprocedure Diagnosis Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PostprocedureDiagnosis#validatePostprocedureDiagnosisMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Postprocedure Diagnosis Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PostprocedureDiagnosis#validatePostprocedureDiagnosisCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Postprocedure Diagnosis Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PostprocedureDiagnosis#validatePostprocedureDiagnosisProblemObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Postprocedure Diagnosis Problem Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PostprocedureDiagnosis#getProblemObservations() Get Problem Observations}
  • + *
+ *

+ * + * @generated + */ + +public class PostprocedureDiagnosisTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidatePostprocedureDiagnosisTemplateId() { + OperationsTestCase validatePostprocedureDiagnosisTemplateIdTestCase = new OperationsTestCase( + "validatePostprocedureDiagnosisTemplateId", + operationsForOCL.getOCLValue("VALIDATE_POSTPROCEDURE_DIAGNOSIS_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PostprocedureDiagnosis target) { + + } + + @Override + protected void updateToPass(PostprocedureDiagnosis target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PostprocedureDiagnosisOperations.validatePostprocedureDiagnosisTemplateId( + (PostprocedureDiagnosis) objectToTest, diagnostician, map); + } + + }; + + validatePostprocedureDiagnosisTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePostprocedureDiagnosisClassCode() { + OperationsTestCase validatePostprocedureDiagnosisClassCodeTestCase = new OperationsTestCase( + "validatePostprocedureDiagnosisClassCode", + operationsForOCL.getOCLValue("VALIDATE_POSTPROCEDURE_DIAGNOSIS_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PostprocedureDiagnosis target) { + + } + + @Override + protected void updateToPass(PostprocedureDiagnosis target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PostprocedureDiagnosisOperations.validatePostprocedureDiagnosisClassCode( + (PostprocedureDiagnosis) objectToTest, diagnostician, map); + } + + }; + + validatePostprocedureDiagnosisClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePostprocedureDiagnosisCode() { + OperationsTestCase validatePostprocedureDiagnosisCodeTestCase = new OperationsTestCase( + "validatePostprocedureDiagnosisCode", + operationsForOCL.getOCLValue("VALIDATE_POSTPROCEDURE_DIAGNOSIS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PostprocedureDiagnosis target) { + + } + + @Override + protected void updateToPass(PostprocedureDiagnosis target) { + target.init(); + target.setCode(DatatypesFactory.eINSTANCE.createCE("59769-0", "2.16.840.1.113883.6.1")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PostprocedureDiagnosisOperations.validatePostprocedureDiagnosisCode( + (PostprocedureDiagnosis) objectToTest, diagnostician, map); + } + + }; + + validatePostprocedureDiagnosisCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePostprocedureDiagnosisMoodCode() { + OperationsTestCase validatePostprocedureDiagnosisMoodCodeTestCase = new OperationsTestCase( + "validatePostprocedureDiagnosisMoodCode", + operationsForOCL.getOCLValue("VALIDATE_POSTPROCEDURE_DIAGNOSIS_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PostprocedureDiagnosis target) { + + } + + @Override + protected void updateToPass(PostprocedureDiagnosis target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PostprocedureDiagnosisOperations.validatePostprocedureDiagnosisMoodCode( + (PostprocedureDiagnosis) objectToTest, diagnostician, map); + } + + }; + + validatePostprocedureDiagnosisMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePostprocedureDiagnosisProblemObservation() { + OperationsTestCase validatePostprocedureDiagnosisProblemObservationTestCase = new OperationsTestCase( + "validatePostprocedureDiagnosisProblemObservation", + operationsForOCL.getOCLValue("VALIDATE_POSTPROCEDURE_DIAGNOSIS_PROBLEM_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PostprocedureDiagnosis target) { + + } + + @Override + protected void updateToPass(PostprocedureDiagnosis target) { + target.init(); + target.addObservation(ConsolFactory.eINSTANCE.createProblemObservation().init()); + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PostprocedureDiagnosisOperations.validatePostprocedureDiagnosisProblemObservation( + (PostprocedureDiagnosis) objectToTest, diagnostician, map); + } + + }; + + validatePostprocedureDiagnosisProblemObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemObservations() { + + PostprocedureDiagnosis target = objectFactory.create(); + target.getProblemObservations(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PostprocedureDiagnosisOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public PostprocedureDiagnosis create() { + return ConsolFactory.eINSTANCE.createPostprocedureDiagnosis(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PostprocedureDiagnosisOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PostprocedureDiagnosisOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PreconditionForSubstanceAdministrationTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PreconditionForSubstanceAdministrationTest.java new file mode 100644 index 000000000..79f0ef048 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PreconditionForSubstanceAdministrationTest.java @@ -0,0 +1,296 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Criterion; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.PreconditionForSubstanceAdministration; +import org.openhealthtools.mdht.uml.cda.consol.operations.PreconditionForSubstanceAdministrationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; + +/** + * + * A static utility class that provides operations related to 'Precondition For Substance Administration' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PreconditionForSubstanceAdministration#validatePreconditionForSubstanceAdministrationCriterionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Precondition For Substance Administration Criterion Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PreconditionForSubstanceAdministration#validatePreconditionForSubstanceAdministrationCriterionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Precondition For Substance Administration Criterion Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PreconditionForSubstanceAdministration#validatePreconditionForSubstanceAdministrationCriterionValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Precondition For Substance Administration Criterion Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PreconditionForSubstanceAdministration#validatePreconditionForSubstanceAdministrationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Precondition For Substance Administration Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PreconditionForSubstanceAdministration#validatePreconditionForSubstanceAdministrationCriterion(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Precondition For Substance Administration Criterion}
  • + *
+ *

+ * + * @generated + */ + +public class PreconditionForSubstanceAdministrationTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidatePreconditionForSubstanceAdministrationCriterionCode() { + OperationsTestCase validatePreconditionForSubstanceAdministrationCriterionCodeTestCase = new OperationsTestCase( + "validatePreconditionForSubstanceAdministrationCriterionCode", + operationsForOCL.getOCLValue("VALIDATE_PRECONDITION_FOR_SUBSTANCE_ADMINISTRATION_CRITERION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PreconditionForSubstanceAdministration target) { + target.init(); + Criterion criterion = CDAFactory.eINSTANCE.createCriterion(); + target.setCriterion(criterion); + } + + @Override + protected void updateToPass(PreconditionForSubstanceAdministration target) { + + CD cd = DatatypesFactory.eINSTANCE.createCD(); + target.getCriterion().setCode(cd); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PreconditionForSubstanceAdministrationOperations.validatePreconditionForSubstanceAdministrationCriterionCode( + (PreconditionForSubstanceAdministration) objectToTest, diagnostician, map); + } + + }; + + validatePreconditionForSubstanceAdministrationCriterionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePreconditionForSubstanceAdministrationCriterionText() { + OperationsTestCase validatePreconditionForSubstanceAdministrationCriterionTextTestCase = new OperationsTestCase( + "validatePreconditionForSubstanceAdministrationCriterionText", + operationsForOCL.getOCLValue("VALIDATE_PRECONDITION_FOR_SUBSTANCE_ADMINISTRATION_CRITERION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PreconditionForSubstanceAdministration target) { + + target.init(); + Criterion criterion = CDAFactory.eINSTANCE.createCriterion(); + target.setCriterion(criterion); + } + + @Override + protected void updateToPass(PreconditionForSubstanceAdministration target) { + ED text = DatatypesFactory.eINSTANCE.createED(); + target.getCriterion().setText(text); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PreconditionForSubstanceAdministrationOperations.validatePreconditionForSubstanceAdministrationCriterionText( + (PreconditionForSubstanceAdministration) objectToTest, diagnostician, map); + } + + }; + + validatePreconditionForSubstanceAdministrationCriterionTextTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePreconditionForSubstanceAdministrationCriterionValue() { + OperationsTestCase validatePreconditionForSubstanceAdministrationCriterionValueTestCase = new OperationsTestCase( + "validatePreconditionForSubstanceAdministrationCriterionValue", + operationsForOCL.getOCLValue("VALIDATE_PRECONDITION_FOR_SUBSTANCE_ADMINISTRATION_CRITERION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PreconditionForSubstanceAdministration target) { + target.init(); + Criterion criterion = CDAFactory.eINSTANCE.createCriterion(); + target.setCriterion(criterion); + + } + + @Override + protected void updateToPass(PreconditionForSubstanceAdministration target) { + + CD value = DatatypesFactory.eINSTANCE.createCD(); + target.getCriterion().setValue(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PreconditionForSubstanceAdministrationOperations.validatePreconditionForSubstanceAdministrationCriterionValue( + (PreconditionForSubstanceAdministration) objectToTest, diagnostician, map); + } + + }; + + validatePreconditionForSubstanceAdministrationCriterionValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePreconditionForSubstanceAdministrationTemplateId() { + OperationsTestCase validatePreconditionForSubstanceAdministrationTemplateIdTestCase = new OperationsTestCase( + "validatePreconditionForSubstanceAdministrationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PRECONDITION_FOR_SUBSTANCE_ADMINISTRATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PreconditionForSubstanceAdministration target) { + + } + + @Override + protected void updateToPass(PreconditionForSubstanceAdministration target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PreconditionForSubstanceAdministrationOperations.validatePreconditionForSubstanceAdministrationTemplateId( + (PreconditionForSubstanceAdministration) objectToTest, diagnostician, map); + } + + }; + + validatePreconditionForSubstanceAdministrationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePreconditionForSubstanceAdministrationCriterion() { + OperationsTestCase validatePreconditionForSubstanceAdministrationCriterionTestCase = new OperationsTestCase( + "validatePreconditionForSubstanceAdministrationCriterion", + operationsForOCL.getOCLValue("VALIDATE_PRECONDITION_FOR_SUBSTANCE_ADMINISTRATION_CRITERION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PreconditionForSubstanceAdministration target) { + + } + + @Override + protected void updateToPass(PreconditionForSubstanceAdministration target) { + target.init(); + target.setCriterion(CDAFactory.eINSTANCE.createCriterion()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PreconditionForSubstanceAdministrationOperations.validatePreconditionForSubstanceAdministrationCriterion( + (PreconditionForSubstanceAdministration) objectToTest, diagnostician, map); + } + + }; + + validatePreconditionForSubstanceAdministrationCriterionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PreconditionForSubstanceAdministrationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public PreconditionForSubstanceAdministration create() { + return ConsolFactory.eINSTANCE.createPreconditionForSubstanceAdministration(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PreconditionForSubstanceAdministrationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PreconditionForSubstanceAdministrationOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PregnancyObservationTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PregnancyObservationTest.java new file mode 100644 index 000000000..42780c33d --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PregnancyObservationTest.java @@ -0,0 +1,462 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.PregnancyObservation; +import org.openhealthtools.mdht.uml.cda.consol.operations.PregnancyObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * + * A static utility class that provides operations related to 'Pregnancy Observation' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PregnancyObservation#validatePregnancyObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pregnancy Observation Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PregnancyObservation#validatePregnancyObservationClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pregnancy Observation Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PregnancyObservation#validatePregnancyObservationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pregnancy Observation Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PregnancyObservation#validatePregnancyObservationCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pregnancy Observation Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PregnancyObservation#validatePregnancyObservationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pregnancy Observation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PregnancyObservation#validatePregnancyObservationStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pregnancy Observation Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PregnancyObservation#validatePregnancyObservationValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pregnancy Observation Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PregnancyObservation#validatePregnancyObservationEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pregnancy Observation Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PregnancyObservation#validatePregnancyObservationEstimatedDateOfDelivery(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pregnancy Observation Estimated Date Of Delivery}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PregnancyObservation#getEstimatedDateOfDelivery() Get Estimated Date Of Delivery}
  • + *
+ *

+ * + * @generated + */ + +public class PregnancyObservationTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidatePregnancyObservationTemplateId() { + OperationsTestCase validatePregnancyObservationTemplateIdTestCase = new OperationsTestCase( + "validatePregnancyObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PREGNANCY_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PregnancyObservation target) { + + } + + @Override + protected void updateToPass(PregnancyObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PregnancyObservationOperations.validatePregnancyObservationTemplateId( + (PregnancyObservation) objectToTest, diagnostician, map); + } + + }; + + validatePregnancyObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePregnancyObservationClassCode() { + OperationsTestCase validatePregnancyObservationClassCodeTestCase = new OperationsTestCase( + "validatePregnancyObservationClassCode", + operationsForOCL.getOCLValue("VALIDATE_PREGNANCY_OBSERVATION_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PregnancyObservation target) { + + } + + @Override + protected void updateToPass(PregnancyObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PregnancyObservationOperations.validatePregnancyObservationClassCode( + (PregnancyObservation) objectToTest, diagnostician, map); + } + + }; + + validatePregnancyObservationClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePregnancyObservationMoodCode() { + OperationsTestCase validatePregnancyObservationMoodCodeTestCase = new OperationsTestCase( + "validatePregnancyObservationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_PREGNANCY_OBSERVATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PregnancyObservation target) { + + } + + @Override + protected void updateToPass(PregnancyObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PregnancyObservationOperations.validatePregnancyObservationMoodCode( + (PregnancyObservation) objectToTest, diagnostician, map); + } + + }; + + validatePregnancyObservationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePregnancyObservationCode() { + OperationsTestCase validatePregnancyObservationCodeTestCase = new OperationsTestCase( + "validatePregnancyObservationCode", + operationsForOCL.getOCLValue("VALIDATE_PREGNANCY_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PregnancyObservation target) { + + } + + @Override + protected void updateToPass(PregnancyObservation target) { + target.init(); + + CE cd = DatatypesFactory.eINSTANCE.createCE(); + cd.setCode("ASSERTION"); + cd.setCodeSystem("2.16.840.1.113883.5.4"); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PregnancyObservationOperations.validatePregnancyObservationCode( + (PregnancyObservation) objectToTest, diagnostician, map); + } + + }; + + validatePregnancyObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePregnancyObservationCodeP() { + OperationsTestCase validatePregnancyObservationCodePTestCase = new OperationsTestCase( + "validatePregnancyObservationCodeP", + operationsForOCL.getOCLValue("VALIDATE_PREGNANCY_OBSERVATION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PregnancyObservation target) { + + } + + @Override + protected void updateToPass(PregnancyObservation target) { + target.init(); + target.setCode(DatatypesFactory.eINSTANCE.createCE()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PregnancyObservationOperations.validatePregnancyObservationCodeP( + (PregnancyObservation) objectToTest, diagnostician, map); + } + + }; + + validatePregnancyObservationCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePregnancyObservationStatusCode() { + OperationsTestCase validatePregnancyObservationStatusCodeTestCase = new OperationsTestCase( + "validatePregnancyObservationStatusCode", + operationsForOCL.getOCLValue("VALIDATE_PREGNANCY_OBSERVATION_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PregnancyObservation target) { + + } + + @Override + protected void updateToPass(PregnancyObservation target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PregnancyObservationOperations.validatePregnancyObservationStatusCode( + (PregnancyObservation) objectToTest, diagnostician, map); + } + + }; + + validatePregnancyObservationStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePregnancyObservationValue() { + OperationsTestCase validatePregnancyObservationValueTestCase = new OperationsTestCase( + "validatePregnancyObservationValue", + operationsForOCL.getOCLValue("VALIDATE_PREGNANCY_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PregnancyObservation target) { + + } + + @Override + protected void updateToPass(PregnancyObservation target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD(); + value.setCodeSystem("2.16.840.1.113883.6.96"); + value.setCode("77386006"); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PregnancyObservationOperations.validatePregnancyObservationValue( + (PregnancyObservation) objectToTest, diagnostician, map); + } + + }; + + validatePregnancyObservationValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePregnancyObservationEffectiveTime() { + OperationsTestCase validatePregnancyObservationEffectiveTimeTestCase = new OperationsTestCase( + "validatePregnancyObservationEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_PREGNANCY_OBSERVATION_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PregnancyObservation target) { + + } + + @Override + protected void updateToPass(PregnancyObservation target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PregnancyObservationOperations.validatePregnancyObservationEffectiveTime( + (PregnancyObservation) objectToTest, diagnostician, map); + } + + }; + + validatePregnancyObservationEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePregnancyObservationEstimatedDateOfDelivery() { + OperationsTestCase validatePregnancyObservationEstimatedDateOfDeliveryTestCase = new OperationsTestCase( + "validatePregnancyObservationEstimatedDateOfDelivery", + operationsForOCL.getOCLValue("VALIDATE_PREGNANCY_OBSERVATION_ESTIMATED_DATE_OF_DELIVERY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PregnancyObservation target) { + + } + + @Override + protected void updateToPass(PregnancyObservation target) { + target.init(); + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.REFR); + er.setObservation(ConsolFactory.eINSTANCE.createEstimatedDateOfDelivery()); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PregnancyObservationOperations.validatePregnancyObservationEstimatedDateOfDelivery( + (PregnancyObservation) objectToTest, diagnostician, map); + } + + }; + + validatePregnancyObservationEstimatedDateOfDeliveryTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetEstimatedDateOfDelivery() { + + PregnancyObservation target = objectFactory.create(); + target.getEstimatedDateOfDelivery(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PregnancyObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public PregnancyObservation create() { + return ConsolFactory.eINSTANCE.createPregnancyObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PregnancyObservationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PregnancyObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PreoperativeDiagnosisSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PreoperativeDiagnosisSectionTest.java new file mode 100644 index 000000000..db0e59bdf --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PreoperativeDiagnosisSectionTest.java @@ -0,0 +1,338 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.PreoperativeDiagnosisSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.PreoperativeDiagnosisSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Preoperative Diagnosis Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PreoperativeDiagnosisSection#validatePreoperativeDiagnosisSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Preoperative Diagnosis Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PreoperativeDiagnosisSection#validatePreoperativeDiagnosisSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Preoperative Diagnosis Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PreoperativeDiagnosisSection#validatePreoperativeDiagnosisSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Preoperative Diagnosis Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PreoperativeDiagnosisSection#validatePreoperativeDiagnosisSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Preoperative Diagnosis Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PreoperativeDiagnosisSection#validatePreoperativeDiagnosisSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Preoperative Diagnosis Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PreoperativeDiagnosisSection#validatePreoperativeDiagnosisSectionPreoperativeDiagnosis(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Preoperative Diagnosis Section Preoperative Diagnosis}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PreoperativeDiagnosisSection#getPreoperativeDiagnosis() Get Preoperative Diagnosis}
  • + *
+ *

+ * + * @generated + */ + +public class PreoperativeDiagnosisSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidatePreoperativeDiagnosisSectionTemplateId() { + OperationsTestCase validatePreoperativeDiagnosisSectionTemplateIdTestCase = new OperationsTestCase( + "validatePreoperativeDiagnosisSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PREOPERATIVE_DIAGNOSIS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PreoperativeDiagnosisSection target) { + + } + + @Override + protected void updateToPass(PreoperativeDiagnosisSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PreoperativeDiagnosisSectionOperations.validatePreoperativeDiagnosisSectionTemplateId( + (PreoperativeDiagnosisSection) objectToTest, diagnostician, map); + } + + }; + + validatePreoperativeDiagnosisSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePreoperativeDiagnosisSectionCode() { + OperationsTestCase validatePreoperativeDiagnosisSectionCodeTestCase = new OperationsTestCase( + "validatePreoperativeDiagnosisSectionCode", + operationsForOCL.getOCLValue("VALIDATE_PREOPERATIVE_DIAGNOSIS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PreoperativeDiagnosisSection target) { + + } + + @Override + protected void updateToPass(PreoperativeDiagnosisSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PreoperativeDiagnosisSectionOperations.validatePreoperativeDiagnosisSectionCode( + (PreoperativeDiagnosisSection) objectToTest, diagnostician, map); + } + + }; + + validatePreoperativeDiagnosisSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePreoperativeDiagnosisSectionCodeP() { + OperationsTestCase validatePreoperativeDiagnosisSectionCodePTestCase = new OperationsTestCase( + "validatePreoperativeDiagnosisSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_PREOPERATIVE_DIAGNOSIS_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PreoperativeDiagnosisSection target) { + + } + + @Override + protected void updateToPass(PreoperativeDiagnosisSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PreoperativeDiagnosisSectionOperations.validatePreoperativeDiagnosisSectionCodeP( + (PreoperativeDiagnosisSection) objectToTest, diagnostician, map); + } + + }; + + validatePreoperativeDiagnosisSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePreoperativeDiagnosisSectionText() { + OperationsTestCase validatePreoperativeDiagnosisSectionTextTestCase = new OperationsTestCase( + "validatePreoperativeDiagnosisSectionText", + operationsForOCL.getOCLValue("VALIDATE_PREOPERATIVE_DIAGNOSIS_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PreoperativeDiagnosisSection target) { + + } + + @Override + protected void updateToPass(PreoperativeDiagnosisSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PreoperativeDiagnosisSectionOperations.validatePreoperativeDiagnosisSectionText( + (PreoperativeDiagnosisSection) objectToTest, diagnostician, map); + } + + }; + + validatePreoperativeDiagnosisSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePreoperativeDiagnosisSectionTitle() { + OperationsTestCase validatePreoperativeDiagnosisSectionTitleTestCase = new OperationsTestCase( + "validatePreoperativeDiagnosisSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_PREOPERATIVE_DIAGNOSIS_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PreoperativeDiagnosisSection target) { + + } + + @Override + protected void updateToPass(PreoperativeDiagnosisSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PreoperativeDiagnosisSectionOperations.validatePreoperativeDiagnosisSectionTitle( + (PreoperativeDiagnosisSection) objectToTest, diagnostician, map); + } + + }; + + validatePreoperativeDiagnosisSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePreoperativeDiagnosisSectionPreoperativeDiagnosis() { + OperationsTestCase validatePreoperativeDiagnosisSectionPreoperativeDiagnosisTestCase = new OperationsTestCase( + "validatePreoperativeDiagnosisSectionPreoperativeDiagnosis", + operationsForOCL.getOCLValue("VALIDATE_PREOPERATIVE_DIAGNOSIS_SECTION_PREOPERATIVE_DIAGNOSIS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PreoperativeDiagnosisSection target) { + + } + + @Override + protected void updateToPass(PreoperativeDiagnosisSection target) { + target.init(); + target.addAct(ConsolFactory.eINSTANCE.createPreoperativeDiagnosis()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PreoperativeDiagnosisSectionOperations.validatePreoperativeDiagnosisSectionPreoperativeDiagnosis( + (PreoperativeDiagnosisSection) objectToTest, diagnostician, map); + } + + }; + + validatePreoperativeDiagnosisSectionPreoperativeDiagnosisTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetPreoperativeDiagnosis() { + + PreoperativeDiagnosisSection target = objectFactory.create(); + target.getPreoperativeDiagnosis(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PreoperativeDiagnosisSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public PreoperativeDiagnosisSection create() { + return ConsolFactory.eINSTANCE.createPreoperativeDiagnosisSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PreoperativeDiagnosisSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PreoperativeDiagnosisSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PreoperativeDiagnosisTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PreoperativeDiagnosisTest.java new file mode 100644 index 000000000..2e7a35644 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PreoperativeDiagnosisTest.java @@ -0,0 +1,300 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.PreoperativeDiagnosis; +import org.openhealthtools.mdht.uml.cda.consol.operations.PreoperativeDiagnosisOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * + * A static utility class that provides operations related to 'Preoperative Diagnosis' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PreoperativeDiagnosis#validatePreoperativeDiagnosisTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Preoperative Diagnosis Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PreoperativeDiagnosis#validatePreoperativeDiagnosisClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Preoperative Diagnosis Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PreoperativeDiagnosis#validatePreoperativeDiagnosisCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Preoperative Diagnosis Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PreoperativeDiagnosis#validatePreoperativeDiagnosisMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Preoperative Diagnosis Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PreoperativeDiagnosis#validatePreoperativeDiagnosisProblemObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Preoperative Diagnosis Problem Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PreoperativeDiagnosis#getProblemObservations() Get Problem Observations}
  • + *
+ *

+ * + * @generated + */ + +public class PreoperativeDiagnosisTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidatePreoperativeDiagnosisTemplateId() { + OperationsTestCase validatePreoperativeDiagnosisTemplateIdTestCase = new OperationsTestCase( + "validatePreoperativeDiagnosisTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PREOPERATIVE_DIAGNOSIS_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PreoperativeDiagnosis target) { + + } + + @Override + protected void updateToPass(PreoperativeDiagnosis target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PreoperativeDiagnosisOperations.validatePreoperativeDiagnosisTemplateId( + (PreoperativeDiagnosis) objectToTest, diagnostician, map); + } + + }; + + validatePreoperativeDiagnosisTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePreoperativeDiagnosisClassCode() { + OperationsTestCase validatePreoperativeDiagnosisClassCodeTestCase = new OperationsTestCase( + "validatePreoperativeDiagnosisClassCode", + operationsForOCL.getOCLValue("VALIDATE_PREOPERATIVE_DIAGNOSIS_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PreoperativeDiagnosis target) { + + } + + @Override + protected void updateToPass(PreoperativeDiagnosis target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PreoperativeDiagnosisOperations.validatePreoperativeDiagnosisClassCode( + (PreoperativeDiagnosis) objectToTest, diagnostician, map); + } + + }; + + validatePreoperativeDiagnosisClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePreoperativeDiagnosisCode() { + OperationsTestCase validatePreoperativeDiagnosisCodeTestCase = new OperationsTestCase( + "validatePreoperativeDiagnosisCode", + operationsForOCL.getOCLValue("VALIDATE_PREOPERATIVE_DIAGNOSIS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PreoperativeDiagnosis target) { + + } + + @Override + protected void updateToPass(PreoperativeDiagnosis target) { + target.init(); + target.setCode(DatatypesFactory.eINSTANCE.createCE("10219-4", "2.16.840.1.113883.6.1")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PreoperativeDiagnosisOperations.validatePreoperativeDiagnosisCode( + (PreoperativeDiagnosis) objectToTest, diagnostician, map); + } + + }; + + validatePreoperativeDiagnosisCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePreoperativeDiagnosisMoodCode() { + OperationsTestCase validatePreoperativeDiagnosisMoodCodeTestCase = new OperationsTestCase( + "validatePreoperativeDiagnosisMoodCode", + operationsForOCL.getOCLValue("VALIDATE_PREOPERATIVE_DIAGNOSIS_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PreoperativeDiagnosis target) { + + } + + @Override + protected void updateToPass(PreoperativeDiagnosis target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PreoperativeDiagnosisOperations.validatePreoperativeDiagnosisMoodCode( + (PreoperativeDiagnosis) objectToTest, diagnostician, map); + } + + }; + + validatePreoperativeDiagnosisMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePreoperativeDiagnosisProblemObservation() { + OperationsTestCase validatePreoperativeDiagnosisProblemObservationTestCase = new OperationsTestCase( + "validatePreoperativeDiagnosisProblemObservation", + operationsForOCL.getOCLValue("VALIDATE_PREOPERATIVE_DIAGNOSIS_PROBLEM_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PreoperativeDiagnosis target) { + target.init(); + } + + @Override + protected void updateToPass(PreoperativeDiagnosis target) { + target.addObservation(ConsolFactory.eINSTANCE.createProblemObservation().init()); + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PreoperativeDiagnosisOperations.validatePreoperativeDiagnosisProblemObservation( + (PreoperativeDiagnosis) objectToTest, diagnostician, map); + } + + }; + + validatePreoperativeDiagnosisProblemObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemObservations() { + + PreoperativeDiagnosis target = objectFactory.create(); + target.getProblemObservations(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PreoperativeDiagnosisOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public PreoperativeDiagnosis create() { + return ConsolFactory.eINSTANCE.createPreoperativeDiagnosis(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PreoperativeDiagnosisOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PreoperativeDiagnosisOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PressureUlcerObservationTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PressureUlcerObservationTest.java new file mode 100644 index 000000000..0b3e7902c --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PressureUlcerObservationTest.java @@ -0,0 +1,2096 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.Observation; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ConsolPackage; +import org.openhealthtools.mdht.uml.cda.consol.GeneralStatusSection; +import org.openhealthtools.mdht.uml.cda.consol.PressureUlcerObservation; +import org.openhealthtools.mdht.uml.cda.consol.operations.PressureUlcerObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CR; +import org.openhealthtools.mdht.uml.hl7.datatypes.CV; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.vocab.ActClassObservation; +import org.openhealthtools.mdht.uml.hl7.vocab.NullFlavor; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActMoodDocumentObservation; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * + * A static utility class that provides operations related to 'Pressure Ulcer Observation' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PressureUlcerObservation#validatePressureUlcerObservationHasTextReference(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pressure Ulcer Observation Has Text Reference}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PressureUlcerObservation#validatePressureUlcerObservationTextReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pressure Ulcer Observation Text Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PressureUlcerObservation#validatePressureUlcerObservationHasTextReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pressure Ulcer Observation Has Text Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PressureUlcerObservation#validatePressureUlcerObservationValueNullFlavor(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pressure Ulcer Observation Value Null Flavor}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PressureUlcerObservation#validatePressureUlcerObservationTargetSiteQualifier(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pressure Ulcer Observation Target Site Qualifier}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PressureUlcerObservation#validatePressureUlcerObservationTargetSiteQualifierName(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pressure Ulcer Observation Target Site Qualifier Name}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PressureUlcerObservation#validatePressureUlcerObservationTargetSiteQualifierNameCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pressure Ulcer Observation Target Site Qualifier Name Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PressureUlcerObservation#validatePressureUlcerObservationTargetSiteQualifierValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pressure Ulcer Observation Target Site Qualifier Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PressureUlcerObservation#validatePressureUlcerObservationTargetSiteQualifierValueCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pressure Ulcer Observation Target Site Qualifier Value Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PressureUlcerObservation#validatePressureUlcerObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pressure Ulcer Observation Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PressureUlcerObservation#validatePressureUlcerObservationClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pressure Ulcer Observation Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PressureUlcerObservation#validatePressureUlcerObservationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pressure Ulcer Observation Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PressureUlcerObservation#validatePressureUlcerObservationNegationInd(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pressure Ulcer Observation Negation Ind}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PressureUlcerObservation#validatePressureUlcerObservationId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pressure Ulcer Observation Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PressureUlcerObservation#validatePressureUlcerObservationCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pressure Ulcer Observation Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PressureUlcerObservation#validatePressureUlcerObservationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pressure Ulcer Observation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PressureUlcerObservation#validatePressureUlcerObservationText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pressure Ulcer Observation Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PressureUlcerObservation#validatePressureUlcerObservationValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pressure Ulcer Observation Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PressureUlcerObservation#validatePressureUlcerObservationValueP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pressure Ulcer Observation Value P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PressureUlcerObservation#validatePressureUlcerObservationTargetSiteCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pressure Ulcer Observation Target Site Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PressureUlcerObservation#validatePressureUlcerObservationTargetSiteCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pressure Ulcer Observation Target Site Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PressureUlcerObservation#validatePressureUlcerObservationEntryRelationship(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pressure Ulcer Observation Entry Relationship}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PressureUlcerObservation#validatePressureUlcerObservationEntryRelationship2(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pressure Ulcer Observation Entry Relationship2}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PressureUlcerObservation#validatePressureUlcerObservationEntryRelationship3(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pressure Ulcer Observation Entry Relationship3}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PressureUlcerObservation#validatePressureUlcerObservationEntryRelationship1Observation1ClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pressure Ulcer Observation Entry Relationship1 Observation1 Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PressureUlcerObservation#validatePressureUlcerObservationEntryRelationship1Observation1MoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pressure Ulcer Observation Entry Relationship1 Observation1 Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PressureUlcerObservation#validatePressureUlcerObservationEntryRelationship1Observation1CodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pressure Ulcer Observation Entry Relationship1 Observation1 Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PressureUlcerObservation#validatePressureUlcerObservationEntryRelationship1Observation1Code(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pressure Ulcer Observation Entry Relationship1 Observation1 Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PressureUlcerObservation#validatePressureUlcerObservationEntryRelationship1Observation1Value(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pressure Ulcer Observation Entry Relationship1 Observation1 Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PressureUlcerObservation#validatePressureUlcerObservationEntryRelationship1TypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pressure Ulcer Observation Entry Relationship1 Type Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PressureUlcerObservation#validatePressureUlcerObservationEntryRelationship1Observation1(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pressure Ulcer Observation Entry Relationship1 Observation1}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PressureUlcerObservation#validatePressureUlcerObservationEntryRelationship2Observation2ClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pressure Ulcer Observation Entry Relationship2 Observation2 Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PressureUlcerObservation#validatePressureUlcerObservationEntryRelationship2Observation2MoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pressure Ulcer Observation Entry Relationship2 Observation2 Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PressureUlcerObservation#validatePressureUlcerObservationEntryRelationship2Observation2CodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pressure Ulcer Observation Entry Relationship2 Observation2 Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PressureUlcerObservation#validatePressureUlcerObservationEntryRelationship2Observation2Code(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pressure Ulcer Observation Entry Relationship2 Observation2 Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PressureUlcerObservation#validatePressureUlcerObservationEntryRelationship2Observation2Value(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pressure Ulcer Observation Entry Relationship2 Observation2 Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PressureUlcerObservation#validatePressureUlcerObservationEntryRelationship2TypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pressure Ulcer Observation Entry Relationship2 Type Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PressureUlcerObservation#validatePressureUlcerObservationEntryRelationship2Observation2(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pressure Ulcer Observation Entry Relationship2 Observation2}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PressureUlcerObservation#validatePressureUlcerObservationEntryRelationship3Observation3ClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pressure Ulcer Observation Entry Relationship3 Observation3 Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PressureUlcerObservation#validatePressureUlcerObservationEntryRelationship3Observation3MoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pressure Ulcer Observation Entry Relationship3 Observation3 Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PressureUlcerObservation#validatePressureUlcerObservationEntryRelationship3Observation3CodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pressure Ulcer Observation Entry Relationship3 Observation3 Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PressureUlcerObservation#validatePressureUlcerObservationEntryRelationship3Observation3Code(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pressure Ulcer Observation Entry Relationship3 Observation3 Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PressureUlcerObservation#validatePressureUlcerObservationEntryRelationship3Observation3Value(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pressure Ulcer Observation Entry Relationship3 Observation3 Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PressureUlcerObservation#validatePressureUlcerObservationEntryRelationship3TypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pressure Ulcer Observation Entry Relationship3 Type Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PressureUlcerObservation#validatePressureUlcerObservationEntryRelationship3Observation3(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pressure Ulcer Observation Entry Relationship3 Observation3}
  • + *
+ *

+ * + * @generated + */ + +public class PressureUlcerObservationTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidatePressureUlcerObservationHasTextReference() { + OperationsTestCase validatePressureUlcerObservationHasTextReferenceTestCase = new OperationsTestCase( + "validatePressureUlcerObservationHasTextReference", + operationsForOCL.getOCLValue("VALIDATE_PRESSURE_ULCER_OBSERVATION_HAS_TEXT_REFERENCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PressureUlcerObservation target) { + target.init(); + ED txt = DatatypesFactory.eINSTANCE.createED(); + target.setText(txt); + } + + @Override + protected void updateToPass(PressureUlcerObservation target) { + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL()); + target.setText(txt); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PressureUlcerObservationOperations.validatePressureUlcerObservationHasTextReference( + (PressureUlcerObservation) objectToTest, diagnostician, map); + } + + }; + + validatePressureUlcerObservationHasTextReferenceTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePressureUlcerObservationTextReferenceValue() { + OperationsTestCase validatePressureUlcerObservationTextReferenceValueTestCase = new OperationsTestCase( + "validatePressureUlcerObservationTextReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_PRESSURE_ULCER_OBSERVATION_TEXT_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PressureUlcerObservation target) { + target.init(); + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL()); + target.setText(txt); + } + + @Override + protected void updateToPass(PressureUlcerObservation target) { + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL("test")); + target.setText(txt); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PressureUlcerObservationOperations.validatePressureUlcerObservationTextReferenceValue( + (PressureUlcerObservation) objectToTest, diagnostician, map); + } + + }; + + validatePressureUlcerObservationTextReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePressureUlcerObservationHasTextReferenceValue() { + OperationsTestCase validatePressureUlcerObservationHasTextReferenceValueTestCase = new NarrativeReferenceTestCase( + "validatePressureUlcerObservationHasTextReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_PRESSURE_ULCER_OBSERVATION_HAS_TEXT_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PressureUlcerObservation target) { + target.init(); + + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), "", + "No particular health status observed."); + + // add a reference to the section text + target.setText(createEDWithReference("Some sample text", "#1.2.3.4")); + } + + @Override + protected void updateToPass(PressureUlcerObservation target) { + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), + "1.2.3.4", "No particular health status observed."); + + // add a reference to the section text + target.setText(createEDWithReference("Some sample text", "#1.2.3.4")); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PressureUlcerObservationOperations.validatePressureUlcerObservationHasTextReferenceValue( + (PressureUlcerObservation) objectToTest, diagnostician, map); + } + + }; + + validatePressureUlcerObservationHasTextReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePressureUlcerObservationValueNullFlavor() { + OperationsTestCase validatePressureUlcerObservationValueNullFlavorTestCase = new OperationsTestCase( + "validatePressureUlcerObservationValueNullFlavor", + operationsForOCL.getOCLValue("VALIDATE_PRESSURE_ULCER_OBSERVATION_VALUE_NULL_FLAVOR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PressureUlcerObservation target) { + target.init(); + target.getValues().add(DatatypesFactory.eINSTANCE.createCD()); + } + + @Override + protected void updateToPass(PressureUlcerObservation target) { + target.getValues().get(0).setNullFlavor(NullFlavor.NA); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PressureUlcerObservationOperations.validatePressureUlcerObservationValueNullFlavor( + (PressureUlcerObservation) objectToTest, diagnostician, map); + } + + }; + + validatePressureUlcerObservationValueNullFlavorTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePressureUlcerObservationTargetSiteQualifier() { + OperationsTestCase validatePressureUlcerObservationTargetSiteQualifierTestCase = new OperationsTestCase( + "validatePressureUlcerObservationTargetSiteQualifier", + operationsForOCL.getOCLValue("VALIDATE_PRESSURE_ULCER_OBSERVATION_TARGET_SITE_QUALIFIER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PressureUlcerObservation target) { + target.init(); + } + + @Override + protected void updateToPass(PressureUlcerObservation target) { + target.getTargetSiteCodes().clear(); + + CD tc = DatatypesFactory.eINSTANCE.createCD(); + CR qual = DatatypesFactory.eINSTANCE.createCR(); + tc.getQualifiers().add(qual); + target.getTargetSiteCodes().add(tc); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PressureUlcerObservationOperations.validatePressureUlcerObservationTargetSiteQualifier( + (PressureUlcerObservation) objectToTest, diagnostician, map); + } + + }; + + validatePressureUlcerObservationTargetSiteQualifierTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePressureUlcerObservationTargetSiteQualifierName() { + OperationsTestCase validatePressureUlcerObservationTargetSiteQualifierNameTestCase = new OperationsTestCase( + "validatePressureUlcerObservationTargetSiteQualifierName", + operationsForOCL.getOCLValue("VALIDATE_PRESSURE_ULCER_OBSERVATION_TARGET_SITE_QUALIFIER_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PressureUlcerObservation target) { + target.init(); + CD tc = DatatypesFactory.eINSTANCE.createCD(); + CR qual = DatatypesFactory.eINSTANCE.createCR(); + tc.getQualifiers().add(qual); + target.getTargetSiteCodes().add(tc); + } + + @Override + protected void updateToPass(PressureUlcerObservation target) { + target.getTargetSiteCodes().clear(); + + CD tc = DatatypesFactory.eINSTANCE.createCD(); + CR qual = DatatypesFactory.eINSTANCE.createCR(); + qual.setName(DatatypesFactory.eINSTANCE.createCV()); + tc.getQualifiers().add(qual); + target.getTargetSiteCodes().add(tc); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PressureUlcerObservationOperations.validatePressureUlcerObservationTargetSiteQualifierName( + (PressureUlcerObservation) objectToTest, diagnostician, map); + } + + }; + + validatePressureUlcerObservationTargetSiteQualifierNameTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePressureUlcerObservationTargetSiteQualifierNameCode() { + OperationsTestCase validatePressureUlcerObservationTargetSiteQualifierNameCodeTestCase = new OperationsTestCase( + "validatePressureUlcerObservationTargetSiteQualifierNameCode", + operationsForOCL.getOCLValue("VALIDATE_PRESSURE_ULCER_OBSERVATION_TARGET_SITE_QUALIFIER_NAME_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PressureUlcerObservation target) { + target.init(); + CD tc = DatatypesFactory.eINSTANCE.createCD(); + CR qual = DatatypesFactory.eINSTANCE.createCR(); + tc.getQualifiers().add(qual); + target.getTargetSiteCodes().add(tc); + } + + @Override + protected void updateToPass(PressureUlcerObservation target) { + target.getTargetSiteCodes().clear(); + + CD tc = DatatypesFactory.eINSTANCE.createCD(); + CR qual = DatatypesFactory.eINSTANCE.createCR(); + CV name = DatatypesFactory.eINSTANCE.createCV(); + name.setCode("272741003"); + name.setCodeSystem("2.16.840.1.113883.6.96"); + qual.setName(name); + tc.getQualifiers().add(qual); + target.getTargetSiteCodes().add(tc); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PressureUlcerObservationOperations.validatePressureUlcerObservationTargetSiteQualifierNameCode( + (PressureUlcerObservation) objectToTest, diagnostician, map); + } + + }; + + validatePressureUlcerObservationTargetSiteQualifierNameCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePressureUlcerObservationTargetSiteQualifierValue() { + OperationsTestCase validatePressureUlcerObservationTargetSiteQualifierValueTestCase = new OperationsTestCase( + "validatePressureUlcerObservationTargetSiteQualifierValue", + operationsForOCL.getOCLValue("VALIDATE_PRESSURE_ULCER_OBSERVATION_TARGET_SITE_QUALIFIER_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PressureUlcerObservation target) { + target.init(); + CD tc = DatatypesFactory.eINSTANCE.createCD(); + CR qual = DatatypesFactory.eINSTANCE.createCR(); + tc.getQualifiers().add(qual); + target.getTargetSiteCodes().add(tc); + } + + @Override + protected void updateToPass(PressureUlcerObservation target) { + target.getTargetSiteCodes().clear(); + + CD tc = DatatypesFactory.eINSTANCE.createCD(); + CR qual = DatatypesFactory.eINSTANCE.createCR(); + CD value = DatatypesFactory.eINSTANCE.createCD("", "2.16.840.1.113883.6.96", "", ""); + qual.setValue(value); + tc.getQualifiers().add(qual); + target.getTargetSiteCodes().add(tc); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PressureUlcerObservationOperations.validatePressureUlcerObservationTargetSiteQualifierValue( + (PressureUlcerObservation) objectToTest, diagnostician, map); + } + + }; + + validatePressureUlcerObservationTargetSiteQualifierValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePressureUlcerObservationTargetSiteQualifierValueCode() { + OperationsTestCase validatePressureUlcerObservationTargetSiteQualifierValueCodeTestCase = new OperationsTestCase( + "validatePressureUlcerObservationTargetSiteQualifierValueCode", + operationsForOCL.getOCLValue("VALIDATE_PRESSURE_ULCER_OBSERVATION_TARGET_SITE_QUALIFIER_VALUE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PressureUlcerObservation target) { + target.init(); + CD tc = DatatypesFactory.eINSTANCE.createCD(); + CR qual = DatatypesFactory.eINSTANCE.createCR(); + tc.getQualifiers().add(qual); + target.getTargetSiteCodes().add(tc); + } + + @Override + protected void updateToPass(PressureUlcerObservation target) { + target.getTargetSiteCodes().clear(); + + CD tc = DatatypesFactory.eINSTANCE.createCD(); + CR qual = DatatypesFactory.eINSTANCE.createCR(); + CD value = DatatypesFactory.eINSTANCE.createCD("", "2.16.840.1.113883.6.96", "", ""); + qual.setValue(value); + tc.getQualifiers().add(qual); + target.getTargetSiteCodes().add(tc); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PressureUlcerObservationOperations.validatePressureUlcerObservationTargetSiteQualifierValueCode( + (PressureUlcerObservation) objectToTest, diagnostician, map); + } + + }; + + validatePressureUlcerObservationTargetSiteQualifierValueCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePressureUlcerObservationTemplateId() { + OperationsTestCase validatePressureUlcerObservationTemplateIdTestCase = new OperationsTestCase( + "validatePressureUlcerObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PRESSURE_ULCER_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PressureUlcerObservation target) { + + } + + @Override + protected void updateToPass(PressureUlcerObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PressureUlcerObservationOperations.validatePressureUlcerObservationTemplateId( + (PressureUlcerObservation) objectToTest, diagnostician, map); + } + + }; + + validatePressureUlcerObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePressureUlcerObservationClassCode() { + OperationsTestCase validatePressureUlcerObservationClassCodeTestCase = new OperationsTestCase( + "validatePressureUlcerObservationClassCode", + operationsForOCL.getOCLValue("VALIDATE_PRESSURE_ULCER_OBSERVATION_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PressureUlcerObservation target) { + + } + + @Override + protected void updateToPass(PressureUlcerObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PressureUlcerObservationOperations.validatePressureUlcerObservationClassCode( + (PressureUlcerObservation) objectToTest, diagnostician, map); + } + + }; + + validatePressureUlcerObservationClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePressureUlcerObservationMoodCode() { + OperationsTestCase validatePressureUlcerObservationMoodCodeTestCase = new OperationsTestCase( + "validatePressureUlcerObservationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_PRESSURE_ULCER_OBSERVATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PressureUlcerObservation target) { + + } + + @Override + protected void updateToPass(PressureUlcerObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PressureUlcerObservationOperations.validatePressureUlcerObservationMoodCode( + (PressureUlcerObservation) objectToTest, diagnostician, map); + } + + }; + + validatePressureUlcerObservationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePressureUlcerObservationNegationInd() { + OperationsTestCase validatePressureUlcerObservationNegationIndTestCase = new OperationsTestCase( + "validatePressureUlcerObservationNegationInd", + operationsForOCL.getOCLValue("VALIDATE_PRESSURE_ULCER_OBSERVATION_NEGATION_IND__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PressureUlcerObservation target) { + + } + + @Override + protected void updateToPass(PressureUlcerObservation target) { + target.init(); + target.setNegationInd(true); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PressureUlcerObservationOperations.validatePressureUlcerObservationNegationInd( + (PressureUlcerObservation) objectToTest, diagnostician, map); + } + + }; + + validatePressureUlcerObservationNegationIndTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePressureUlcerObservationId() { + OperationsTestCase validatePressureUlcerObservationIdTestCase = new OperationsTestCase( + "validatePressureUlcerObservationId", + operationsForOCL.getOCLValue("VALIDATE_PRESSURE_ULCER_OBSERVATION_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PressureUlcerObservation target) { + + } + + @Override + protected void updateToPass(PressureUlcerObservation target) { + target.init(); + + II ii = DatatypesFactory.eINSTANCE.createII(); + target.getIds().add(ii); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PressureUlcerObservationOperations.validatePressureUlcerObservationId( + (PressureUlcerObservation) objectToTest, diagnostician, map); + } + + }; + + validatePressureUlcerObservationIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePressureUlcerObservationCodeP() { + OperationsTestCase validatePressureUlcerObservationCodePTestCase = new OperationsTestCase( + "validatePressureUlcerObservationCodeP", + operationsForOCL.getOCLValue("VALIDATE_PRESSURE_ULCER_OBSERVATION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PressureUlcerObservation target) { + + } + + @Override + protected void updateToPass(PressureUlcerObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PressureUlcerObservationOperations.validatePressureUlcerObservationCodeP( + (PressureUlcerObservation) objectToTest, diagnostician, map); + } + + }; + + validatePressureUlcerObservationCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePressureUlcerObservationCode() { + OperationsTestCase validatePressureUlcerObservationCodeTestCase = new OperationsTestCase( + "validatePressureUlcerObservationCode", + operationsForOCL.getOCLValue("VALIDATE_PRESSURE_ULCER_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PressureUlcerObservation target) { + + } + + @Override + protected void updateToPass(PressureUlcerObservation target) { + target.init(); + + CD cd = DatatypesFactory.eINSTANCE.createCD("ASSERTION", "2.16.840.1.113883.5.4", "", ""); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PressureUlcerObservationOperations.validatePressureUlcerObservationCode( + (PressureUlcerObservation) objectToTest, diagnostician, map); + } + + }; + + validatePressureUlcerObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePressureUlcerObservationText() { + OperationsTestCase validatePressureUlcerObservationTextTestCase = new OperationsTestCase( + "validatePressureUlcerObservationText", + operationsForOCL.getOCLValue("VALIDATE_PRESSURE_ULCER_OBSERVATION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PressureUlcerObservation target) { + + } + + @Override + protected void updateToPass(PressureUlcerObservation target) { + target.init(); + + ED text = DatatypesFactory.eINSTANCE.createED(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PressureUlcerObservationOperations.validatePressureUlcerObservationText( + (PressureUlcerObservation) objectToTest, diagnostician, map); + } + + }; + + validatePressureUlcerObservationTextTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePressureUlcerObservationValue() { + OperationsTestCase validatePressureUlcerObservationValueTestCase = new OperationsTestCase( + "validatePressureUlcerObservationValue", + operationsForOCL.getOCLValue("VALIDATE_PRESSURE_ULCER_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PressureUlcerObservation target) { + + } + + @Override + protected void updateToPass(PressureUlcerObservation target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD("421076008", "2.16.840.1.113883.6.96", "", ""); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PressureUlcerObservationOperations.validatePressureUlcerObservationValue( + (PressureUlcerObservation) objectToTest, diagnostician, map); + } + + }; + + validatePressureUlcerObservationValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePressureUlcerObservationValueP() { + OperationsTestCase validatePressureUlcerObservationValuePTestCase = new OperationsTestCase( + "validatePressureUlcerObservationValueP", + operationsForOCL.getOCLValue("VALIDATE_PRESSURE_ULCER_OBSERVATION_VALUE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PressureUlcerObservation target) { + + } + + @Override + protected void updateToPass(PressureUlcerObservation target) { + target.init(); + target.getValues().add(DatatypesFactory.eINSTANCE.createCD("", "2.16.840.1.113883.6.96", "", "")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PressureUlcerObservationOperations.validatePressureUlcerObservationValueP( + (PressureUlcerObservation) objectToTest, diagnostician, map); + } + + }; + + validatePressureUlcerObservationValuePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePressureUlcerObservationTargetSiteCode() { + OperationsTestCase validatePressureUlcerObservationTargetSiteCodeTestCase = new OperationsTestCase( + "validatePressureUlcerObservationTargetSiteCode", + operationsForOCL.getOCLValue("VALIDATE_PRESSURE_ULCER_OBSERVATION_TARGET_SITE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PressureUlcerObservation target) { + + } + + @Override + protected void updateToPass(PressureUlcerObservation target) { + target.init(); + target.getTargetSiteCodes().clear(); + target.getTargetSiteCodes().add( + DatatypesFactory.eINSTANCE.createCD("79951008", "2.16.840.1.113883.6.96", "", "")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PressureUlcerObservationOperations.validatePressureUlcerObservationTargetSiteCode( + (PressureUlcerObservation) objectToTest, diagnostician, map); + } + + }; + + validatePressureUlcerObservationTargetSiteCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePressureUlcerObservationTargetSiteCodeP() { + OperationsTestCase validatePressureUlcerObservationTargetSiteCodePTestCase = new OperationsTestCase( + "validatePressureUlcerObservationTargetSiteCodeP", + operationsForOCL.getOCLValue("VALIDATE_PRESSURE_ULCER_OBSERVATION_TARGET_SITE_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PressureUlcerObservation target) { + + } + + @Override + protected void updateToPass(PressureUlcerObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PressureUlcerObservationOperations.validatePressureUlcerObservationTargetSiteCodeP( + (PressureUlcerObservation) objectToTest, diagnostician, map); + } + + }; + + validatePressureUlcerObservationTargetSiteCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePressureUlcerObservationEntryRelationship() { + OperationsTestCase validatePressureUlcerObservationEntryRelationshipTestCase = new OperationsTestCase( + "validatePressureUlcerObservationEntryRelationship", + operationsForOCL.getOCLValue("VALIDATE_PRESSURE_ULCER_OBSERVATION_ENTRY_RELATIONSHIP__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PressureUlcerObservation target) { + + } + + @Override + protected void updateToPass(PressureUlcerObservation target) { + target.init(); + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + Observation obs = CDAFactory.eINSTANCE.createObservation(); + obs.setCode(DatatypesFactory.eINSTANCE.createCD("401238003", "", "", "")); + obs.getValues().add(DatatypesFactory.eINSTANCE.createPQ()); + er.setObservation(obs); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PressureUlcerObservationOperations.validatePressureUlcerObservationEntryRelationship( + (PressureUlcerObservation) objectToTest, diagnostician, map); + } + + }; + + validatePressureUlcerObservationEntryRelationshipTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePressureUlcerObservationEntryRelationship2() { + OperationsTestCase validatePressureUlcerObservationEntryRelationship2TestCase = new OperationsTestCase( + "validatePressureUlcerObservationEntryRelationship2", + operationsForOCL.getOCLValue("VALIDATE_PRESSURE_ULCER_OBSERVATION_ENTRY_RELATIONSHIP2__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PressureUlcerObservation target) { + + } + + @Override + protected void updateToPass(PressureUlcerObservation target) { + target.init(); + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + Observation obs = CDAFactory.eINSTANCE.createObservation(); + obs.setCode(DatatypesFactory.eINSTANCE.createCD("401239006", "", "", "")); + obs.getValues().add(DatatypesFactory.eINSTANCE.createPQ()); + er.setObservation(obs); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PressureUlcerObservationOperations.validatePressureUlcerObservationEntryRelationship2( + (PressureUlcerObservation) objectToTest, diagnostician, map); + } + + }; + + validatePressureUlcerObservationEntryRelationship2TestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePressureUlcerObservationEntryRelationship3() { + OperationsTestCase validatePressureUlcerObservationEntryRelationship3TestCase = new OperationsTestCase( + "validatePressureUlcerObservationEntryRelationship3", + operationsForOCL.getOCLValue("VALIDATE_PRESSURE_ULCER_OBSERVATION_ENTRY_RELATIONSHIP3__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PressureUlcerObservation target) { + + } + + @Override + protected void updateToPass(PressureUlcerObservation target) { + target.init(); + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + Observation obs = CDAFactory.eINSTANCE.createObservation(); + obs.setCode(DatatypesFactory.eINSTANCE.createCD("425094009", "", "", "")); + obs.getValues().add(DatatypesFactory.eINSTANCE.createPQ()); + er.setObservation(obs); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PressureUlcerObservationOperations.validatePressureUlcerObservationEntryRelationship3( + (PressureUlcerObservation) objectToTest, diagnostician, map); + } + + }; + + validatePressureUlcerObservationEntryRelationship3TestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePressureUlcerObservationEntryRelationship1Observation1ClassCode() { + OperationsTestCase validatePressureUlcerObservationEntryRelationship1Observation1ClassCodeTestCase = new OperationsTestCase( + "validatePressureUlcerObservationEntryRelationship1Observation1ClassCode", + operationsForOCL.getOCLValue("VALIDATE_PRESSURE_ULCER_OBSERVATION_ENTRY_RELATIONSHIP1_OBSERVATION1_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PressureUlcerObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + Observation obs = CDAFactory.eINSTANCE.createObservation(); + obs.setCode(DatatypesFactory.eINSTANCE.createCD("401238003", "", "", "")); + er.setObservation(obs); + target.getEntryRelationships().add(er); + } + + @Override + protected void updateToPass(PressureUlcerObservation target) { + target.getEntryRelationships().clear(); + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + Observation obs = CDAFactory.eINSTANCE.createObservation(); + obs.setCode(DatatypesFactory.eINSTANCE.createCD("401238003", "", "", "")); + obs.setClassCode(ActClassObservation.OBS); + er.setObservation(obs); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PressureUlcerObservationOperations.validatePressureUlcerObservationEntryRelationship1Observation1ClassCode( + (PressureUlcerObservation) objectToTest, diagnostician, map); + } + + }; + + validatePressureUlcerObservationEntryRelationship1Observation1ClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePressureUlcerObservationEntryRelationship1Observation1MoodCode() { + OperationsTestCase validatePressureUlcerObservationEntryRelationship1Observation1MoodCodeTestCase = new OperationsTestCase( + "validatePressureUlcerObservationEntryRelationship1Observation1MoodCode", + operationsForOCL.getOCLValue("VALIDATE_PRESSURE_ULCER_OBSERVATION_ENTRY_RELATIONSHIP1_OBSERVATION1_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PressureUlcerObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + Observation obs = CDAFactory.eINSTANCE.createObservation(); + obs.setCode(DatatypesFactory.eINSTANCE.createCD("401238003", "", "", "")); + er.setObservation(obs); + target.getEntryRelationships().add(er); + } + + @Override + protected void updateToPass(PressureUlcerObservation target) { + target.getEntryRelationships().clear(); + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + Observation obs = CDAFactory.eINSTANCE.createObservation(); + obs.setCode(DatatypesFactory.eINSTANCE.createCD("401238003", "", "", "")); + obs.setMoodCode(x_ActMoodDocumentObservation.EVN); + er.setObservation(obs); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PressureUlcerObservationOperations.validatePressureUlcerObservationEntryRelationship1Observation1MoodCode( + (PressureUlcerObservation) objectToTest, diagnostician, map); + } + + }; + + validatePressureUlcerObservationEntryRelationship1Observation1MoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePressureUlcerObservationEntryRelationship1Observation1CodeP() { + OperationsTestCase validatePressureUlcerObservationEntryRelationship1Observation1CodePTestCase = new OperationsTestCase( + "validatePressureUlcerObservationEntryRelationship1Observation1CodeP", + operationsForOCL.getOCLValue("VALIDATE_PRESSURE_ULCER_OBSERVATION_ENTRY_RELATIONSHIP1_OBSERVATION1_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + { + this.skipFailsTest(); + } + + @Override + protected void updateToFail(PressureUlcerObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + Observation obs = CDAFactory.eINSTANCE.createObservation(); + obs.setCode(DatatypesFactory.eINSTANCE.createCD("401238003", "", "", "")); + er.setObservation(obs); + target.getEntryRelationships().add(er); + } + + @Override + protected void updateToPass(PressureUlcerObservation target) { + target.getEntryRelationships().clear(); + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + Observation obs = CDAFactory.eINSTANCE.createObservation(); + obs.setCode(DatatypesFactory.eINSTANCE.createCD("401238003", "", "", "")); + obs.setMoodCode(x_ActMoodDocumentObservation.EVN); + er.setObservation(obs); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PressureUlcerObservationOperations.validatePressureUlcerObservationEntryRelationship1Observation1CodeP( + (PressureUlcerObservation) objectToTest, diagnostician, map); + } + + }; + + validatePressureUlcerObservationEntryRelationship1Observation1CodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePressureUlcerObservationEntryRelationship1Observation1Code() { + OperationsTestCase validatePressureUlcerObservationEntryRelationship1Observation1CodeTestCase = new OperationsTestCase( + "validatePressureUlcerObservationEntryRelationship1Observation1Code", + operationsForOCL.getOCLValue("VALIDATE_PRESSURE_ULCER_OBSERVATION_ENTRY_RELATIONSHIP1_OBSERVATION1_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PressureUlcerObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + Observation obs = CDAFactory.eINSTANCE.createObservation(); + obs.setCode(DatatypesFactory.eINSTANCE.createCD("401238003", "", "", "")); + er.setObservation(obs); + target.getEntryRelationships().add(er); + } + + @Override + protected void updateToPass(PressureUlcerObservation target) { + target.getEntryRelationships().clear(); + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + Observation obs = CDAFactory.eINSTANCE.createObservation(); + obs.setCode(DatatypesFactory.eINSTANCE.createCD("401238003", "2.16.840.1.113883.6.96", "", "")); + obs.setMoodCode(x_ActMoodDocumentObservation.EVN); + er.setObservation(obs); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PressureUlcerObservationOperations.validatePressureUlcerObservationEntryRelationship1Observation1Code( + (PressureUlcerObservation) objectToTest, diagnostician, map); + } + + }; + + validatePressureUlcerObservationEntryRelationship1Observation1CodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePressureUlcerObservationEntryRelationship1Observation1Value() { + OperationsTestCase validatePressureUlcerObservationEntryRelationship1Observation1ValueTestCase = new OperationsTestCase( + "validatePressureUlcerObservationEntryRelationship1Observation1Value", + operationsForOCL.getOCLValue("VALIDATE_PRESSURE_ULCER_OBSERVATION_ENTRY_RELATIONSHIP1_OBSERVATION1_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PressureUlcerObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + Observation obs = CDAFactory.eINSTANCE.createObservation(); + obs.setCode(DatatypesFactory.eINSTANCE.createCD("401238003", "", "", "")); + er.setObservation(obs); + target.getEntryRelationships().add(er); + } + + @Override + protected void updateToPass(PressureUlcerObservation target) { + target.getEntryRelationships().clear(); + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + Observation obs = CDAFactory.eINSTANCE.createObservation(); + obs.setCode(DatatypesFactory.eINSTANCE.createCD("401238003", "", "", "")); + obs.getValues().add(DatatypesFactory.eINSTANCE.createPQ()); + er.setObservation(obs); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PressureUlcerObservationOperations.validatePressureUlcerObservationEntryRelationship1Observation1Value( + (PressureUlcerObservation) objectToTest, diagnostician, map); + } + + }; + + validatePressureUlcerObservationEntryRelationship1Observation1ValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePressureUlcerObservationEntryRelationship1TypeCode() { + OperationsTestCase validatePressureUlcerObservationEntryRelationship1TypeCodeTestCase = new OperationsTestCase( + "validatePressureUlcerObservationEntryRelationship1TypeCode", + operationsForOCL.getOCLValue("VALIDATE_PRESSURE_ULCER_OBSERVATION_ENTRY_RELATIONSHIP1_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + { + this.skipFailsTest(); + } + + @Override + protected void updateToFail(PressureUlcerObservation target) { + + } + + @Override + protected void updateToPass(PressureUlcerObservation target) { + target.init(); + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + Observation obs = CDAFactory.eINSTANCE.createObservation(); + obs.setCode(DatatypesFactory.eINSTANCE.createCD("401238003", "", "", "")); + obs.getValues().add(DatatypesFactory.eINSTANCE.createPQ()); + er.setObservation(obs); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PressureUlcerObservationOperations.validatePressureUlcerObservationEntryRelationship1TypeCode( + (PressureUlcerObservation) objectToTest, diagnostician, map); + } + + }; + + validatePressureUlcerObservationEntryRelationship1TypeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePressureUlcerObservationEntryRelationship1Observation1() { + OperationsTestCase validatePressureUlcerObservationEntryRelationship1Observation1TestCase = new OperationsTestCase( + "validatePressureUlcerObservationEntryRelationship1Observation1", + operationsForOCL.getOCLValue("VALIDATE_PRESSURE_ULCER_OBSERVATION_ENTRY_RELATIONSHIP1_OBSERVATION1__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + { + this.skipFailsTest(); + } + + @Override + protected void updateToFail(PressureUlcerObservation target) { + + } + + @Override + protected void updateToPass(PressureUlcerObservation target) { + target.init(); + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + Observation obs = CDAFactory.eINSTANCE.createObservation(); + obs.setCode(DatatypesFactory.eINSTANCE.createCD("401238003", "", "", "")); + obs.getValues().add(DatatypesFactory.eINSTANCE.createPQ()); + er.setObservation(obs); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PressureUlcerObservationOperations.validatePressureUlcerObservationEntryRelationship1Observation1( + (PressureUlcerObservation) objectToTest, diagnostician, map); + } + + }; + + validatePressureUlcerObservationEntryRelationship1Observation1TestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePressureUlcerObservationEntryRelationship2Observation2ClassCode() { + OperationsTestCase validatePressureUlcerObservationEntryRelationship2Observation2ClassCodeTestCase = new OperationsTestCase( + "validatePressureUlcerObservationEntryRelationship2Observation2ClassCode", + operationsForOCL.getOCLValue("VALIDATE_PRESSURE_ULCER_OBSERVATION_ENTRY_RELATIONSHIP2_OBSERVATION2_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PressureUlcerObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + Observation obs = CDAFactory.eINSTANCE.createObservation(); + obs.setCode(DatatypesFactory.eINSTANCE.createCD("401239006", "", "", "")); + er.setObservation(obs); + target.getEntryRelationships().add(er); + } + + @Override + protected void updateToPass(PressureUlcerObservation target) { + target.getEntryRelationships().clear(); + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + Observation obs = CDAFactory.eINSTANCE.createObservation(); + obs.setCode(DatatypesFactory.eINSTANCE.createCD("401239006", "", "", "")); + obs.setClassCode(ActClassObservation.OBS); + er.setObservation(obs); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PressureUlcerObservationOperations.validatePressureUlcerObservationEntryRelationship2Observation2ClassCode( + (PressureUlcerObservation) objectToTest, diagnostician, map); + } + + }; + + validatePressureUlcerObservationEntryRelationship2Observation2ClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePressureUlcerObservationEntryRelationship2Observation2MoodCode() { + OperationsTestCase validatePressureUlcerObservationEntryRelationship2Observation2MoodCodeTestCase = new OperationsTestCase( + "validatePressureUlcerObservationEntryRelationship2Observation2MoodCode", + operationsForOCL.getOCLValue("VALIDATE_PRESSURE_ULCER_OBSERVATION_ENTRY_RELATIONSHIP2_OBSERVATION2_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PressureUlcerObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + Observation obs = CDAFactory.eINSTANCE.createObservation(); + obs.setCode(DatatypesFactory.eINSTANCE.createCD("401239006", "", "", "")); + er.setObservation(obs); + target.getEntryRelationships().add(er); + } + + @Override + protected void updateToPass(PressureUlcerObservation target) { + target.getEntryRelationships().clear(); + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + Observation obs = CDAFactory.eINSTANCE.createObservation(); + obs.setCode(DatatypesFactory.eINSTANCE.createCD("401239006", "", "", "")); + obs.setMoodCode(x_ActMoodDocumentObservation.EVN); + er.setObservation(obs); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PressureUlcerObservationOperations.validatePressureUlcerObservationEntryRelationship2Observation2MoodCode( + (PressureUlcerObservation) objectToTest, diagnostician, map); + } + + }; + + validatePressureUlcerObservationEntryRelationship2Observation2MoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePressureUlcerObservationEntryRelationship2Observation2CodeP() { + OperationsTestCase validatePressureUlcerObservationEntryRelationship2Observation2CodePTestCase = new OperationsTestCase( + "validatePressureUlcerObservationEntryRelationship2Observation2CodeP", + operationsForOCL.getOCLValue("VALIDATE_PRESSURE_ULCER_OBSERVATION_ENTRY_RELATIONSHIP2_OBSERVATION2_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + { + this.skipFailsTest(); + } + + @Override + protected void updateToFail(PressureUlcerObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + Observation obs = CDAFactory.eINSTANCE.createObservation(); + obs.setCode(DatatypesFactory.eINSTANCE.createCD("401239006", "", "", "")); + er.setObservation(obs); + target.getEntryRelationships().add(er); + } + + @Override + protected void updateToPass(PressureUlcerObservation target) { + target.getEntryRelationships().clear(); + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + Observation obs = CDAFactory.eINSTANCE.createObservation(); + obs.setCode(DatatypesFactory.eINSTANCE.createCD("401239006", "", "", "")); + obs.setMoodCode(x_ActMoodDocumentObservation.EVN); + er.setObservation(obs); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PressureUlcerObservationOperations.validatePressureUlcerObservationEntryRelationship2Observation2CodeP( + (PressureUlcerObservation) objectToTest, diagnostician, map); + } + + }; + + validatePressureUlcerObservationEntryRelationship2Observation2CodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePressureUlcerObservationEntryRelationship2Observation2Code() { + OperationsTestCase validatePressureUlcerObservationEntryRelationship2Observation2CodeTestCase = new OperationsTestCase( + "validatePressureUlcerObservationEntryRelationship2Observation2Code", + operationsForOCL.getOCLValue("VALIDATE_PRESSURE_ULCER_OBSERVATION_ENTRY_RELATIONSHIP2_OBSERVATION2_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PressureUlcerObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + Observation obs = CDAFactory.eINSTANCE.createObservation(); + obs.setCode(DatatypesFactory.eINSTANCE.createCD("401239006", "", "", "")); + er.setObservation(obs); + target.getEntryRelationships().add(er); + } + + @Override + protected void updateToPass(PressureUlcerObservation target) { + target.getEntryRelationships().clear(); + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + Observation obs = CDAFactory.eINSTANCE.createObservation(); + obs.setCode(DatatypesFactory.eINSTANCE.createCD("401239006", "2.16.840.1.113883.6.96", "", "")); + obs.setMoodCode(x_ActMoodDocumentObservation.EVN); + er.setObservation(obs); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PressureUlcerObservationOperations.validatePressureUlcerObservationEntryRelationship2Observation2Code( + (PressureUlcerObservation) objectToTest, diagnostician, map); + } + + }; + + validatePressureUlcerObservationEntryRelationship2Observation2CodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePressureUlcerObservationEntryRelationship2Observation2Value() { + OperationsTestCase validatePressureUlcerObservationEntryRelationship2Observation2ValueTestCase = new OperationsTestCase( + "validatePressureUlcerObservationEntryRelationship2Observation2Value", + operationsForOCL.getOCLValue("VALIDATE_PRESSURE_ULCER_OBSERVATION_ENTRY_RELATIONSHIP2_OBSERVATION2_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PressureUlcerObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + Observation obs = CDAFactory.eINSTANCE.createObservation(); + obs.setCode(DatatypesFactory.eINSTANCE.createCD("401239006", "", "", "")); + er.setObservation(obs); + target.getEntryRelationships().add(er); + } + + @Override + protected void updateToPass(PressureUlcerObservation target) { + target.getEntryRelationships().clear(); + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + Observation obs = CDAFactory.eINSTANCE.createObservation(); + obs.setCode(DatatypesFactory.eINSTANCE.createCD("401239006", "", "", "")); + obs.getValues().add(DatatypesFactory.eINSTANCE.createPQ()); + er.setObservation(obs); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PressureUlcerObservationOperations.validatePressureUlcerObservationEntryRelationship2Observation2Value( + (PressureUlcerObservation) objectToTest, diagnostician, map); + } + + }; + + validatePressureUlcerObservationEntryRelationship2Observation2ValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePressureUlcerObservationEntryRelationship2TypeCode() { + OperationsTestCase validatePressureUlcerObservationEntryRelationship2TypeCodeTestCase = new OperationsTestCase( + "validatePressureUlcerObservationEntryRelationship2TypeCode", + operationsForOCL.getOCLValue("VALIDATE_PRESSURE_ULCER_OBSERVATION_ENTRY_RELATIONSHIP2_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + { + this.skipFailsTest(); + } + + @Override + protected void updateToFail(PressureUlcerObservation target) { + + } + + @Override + protected void updateToPass(PressureUlcerObservation target) { + target.init(); + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + Observation obs = CDAFactory.eINSTANCE.createObservation(); + obs.setCode(DatatypesFactory.eINSTANCE.createCD("401239006", "", "", "")); + obs.getValues().add(DatatypesFactory.eINSTANCE.createPQ()); + er.setObservation(obs); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PressureUlcerObservationOperations.validatePressureUlcerObservationEntryRelationship2TypeCode( + (PressureUlcerObservation) objectToTest, diagnostician, map); + } + + }; + + validatePressureUlcerObservationEntryRelationship2TypeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePressureUlcerObservationEntryRelationship2Observation2() { + OperationsTestCase validatePressureUlcerObservationEntryRelationship2Observation2TestCase = new OperationsTestCase( + "validatePressureUlcerObservationEntryRelationship2Observation2", + operationsForOCL.getOCLValue("VALIDATE_PRESSURE_ULCER_OBSERVATION_ENTRY_RELATIONSHIP2_OBSERVATION2__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + { + this.skipFailsTest(); + } + + @Override + protected void updateToFail(PressureUlcerObservation target) { + + } + + @Override + protected void updateToPass(PressureUlcerObservation target) { + target.init(); + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + Observation obs = CDAFactory.eINSTANCE.createObservation(); + obs.setCode(DatatypesFactory.eINSTANCE.createCD("401239006", "", "", "")); + obs.getValues().add(DatatypesFactory.eINSTANCE.createPQ()); + er.setObservation(obs); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PressureUlcerObservationOperations.validatePressureUlcerObservationEntryRelationship2Observation2( + (PressureUlcerObservation) objectToTest, diagnostician, map); + } + + }; + + validatePressureUlcerObservationEntryRelationship2Observation2TestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePressureUlcerObservationEntryRelationship3Observation3ClassCode() { + OperationsTestCase validatePressureUlcerObservationEntryRelationship3Observation3ClassCodeTestCase = new OperationsTestCase( + "validatePressureUlcerObservationEntryRelationship3Observation3ClassCode", + operationsForOCL.getOCLValue("VALIDATE_PRESSURE_ULCER_OBSERVATION_ENTRY_RELATIONSHIP3_OBSERVATION3_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PressureUlcerObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + Observation obs = CDAFactory.eINSTANCE.createObservation(); + obs.setCode(DatatypesFactory.eINSTANCE.createCD("425094009", "", "", "")); + er.setObservation(obs); + target.getEntryRelationships().add(er); + } + + @Override + protected void updateToPass(PressureUlcerObservation target) { + target.getEntryRelationships().clear(); + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + Observation obs = CDAFactory.eINSTANCE.createObservation(); + obs.setCode(DatatypesFactory.eINSTANCE.createCD("425094009", "", "", "")); + obs.setClassCode(ActClassObservation.OBS); + er.setObservation(obs); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PressureUlcerObservationOperations.validatePressureUlcerObservationEntryRelationship3Observation3ClassCode( + (PressureUlcerObservation) objectToTest, diagnostician, map); + } + + }; + + validatePressureUlcerObservationEntryRelationship3Observation3ClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePressureUlcerObservationEntryRelationship3Observation3MoodCode() { + OperationsTestCase validatePressureUlcerObservationEntryRelationship3Observation3MoodCodeTestCase = new OperationsTestCase( + "validatePressureUlcerObservationEntryRelationship3Observation3MoodCode", + operationsForOCL.getOCLValue("VALIDATE_PRESSURE_ULCER_OBSERVATION_ENTRY_RELATIONSHIP3_OBSERVATION3_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PressureUlcerObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + Observation obs = CDAFactory.eINSTANCE.createObservation(); + obs.setCode(DatatypesFactory.eINSTANCE.createCD("425094009", "", "", "")); + er.setObservation(obs); + target.getEntryRelationships().add(er); + } + + @Override + protected void updateToPass(PressureUlcerObservation target) { + target.getEntryRelationships().clear(); + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + Observation obs = CDAFactory.eINSTANCE.createObservation(); + obs.setCode(DatatypesFactory.eINSTANCE.createCD("425094009", "", "", "")); + obs.setMoodCode(x_ActMoodDocumentObservation.EVN); + er.setObservation(obs); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PressureUlcerObservationOperations.validatePressureUlcerObservationEntryRelationship3Observation3MoodCode( + (PressureUlcerObservation) objectToTest, diagnostician, map); + } + + }; + + validatePressureUlcerObservationEntryRelationship3Observation3MoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePressureUlcerObservationEntryRelationship3Observation3CodeP() { + OperationsTestCase validatePressureUlcerObservationEntryRelationship3Observation3CodePTestCase = new OperationsTestCase( + "validatePressureUlcerObservationEntryRelationship3Observation3CodeP", + operationsForOCL.getOCLValue("VALIDATE_PRESSURE_ULCER_OBSERVATION_ENTRY_RELATIONSHIP3_OBSERVATION3_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + { + this.skipFailsTest(); + } + + @Override + protected void updateToFail(PressureUlcerObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + Observation obs = CDAFactory.eINSTANCE.createObservation(); + obs.setCode(DatatypesFactory.eINSTANCE.createCD("425094009", "", "", "")); + er.setObservation(obs); + target.getEntryRelationships().add(er); + } + + @Override + protected void updateToPass(PressureUlcerObservation target) { + target.getEntryRelationships().clear(); + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + Observation obs = CDAFactory.eINSTANCE.createObservation(); + obs.setCode(DatatypesFactory.eINSTANCE.createCD("425094009", "", "", "")); + obs.setMoodCode(x_ActMoodDocumentObservation.EVN); + er.setObservation(obs); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PressureUlcerObservationOperations.validatePressureUlcerObservationEntryRelationship3Observation3CodeP( + (PressureUlcerObservation) objectToTest, diagnostician, map); + } + + }; + + validatePressureUlcerObservationEntryRelationship3Observation3CodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePressureUlcerObservationEntryRelationship3Observation3Code() { + OperationsTestCase validatePressureUlcerObservationEntryRelationship3Observation3CodeTestCase = new OperationsTestCase( + "validatePressureUlcerObservationEntryRelationship3Observation3Code", + operationsForOCL.getOCLValue("VALIDATE_PRESSURE_ULCER_OBSERVATION_ENTRY_RELATIONSHIP3_OBSERVATION3_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PressureUlcerObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + Observation obs = CDAFactory.eINSTANCE.createObservation(); + obs.setCode(DatatypesFactory.eINSTANCE.createCD("425094009", "", "", "")); + er.setObservation(obs); + target.getEntryRelationships().add(er); + } + + @Override + protected void updateToPass(PressureUlcerObservation target) { + target.getEntryRelationships().clear(); + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + Observation obs = CDAFactory.eINSTANCE.createObservation(); + obs.setCode(DatatypesFactory.eINSTANCE.createCD("425094009", "2.16.840.1.113883.6.96", "", "")); + obs.setMoodCode(x_ActMoodDocumentObservation.EVN); + er.setObservation(obs); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PressureUlcerObservationOperations.validatePressureUlcerObservationEntryRelationship3Observation3Code( + (PressureUlcerObservation) objectToTest, diagnostician, map); + } + + }; + + validatePressureUlcerObservationEntryRelationship3Observation3CodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePressureUlcerObservationEntryRelationship3Observation3Value() { + OperationsTestCase validatePressureUlcerObservationEntryRelationship3Observation3ValueTestCase = new OperationsTestCase( + "validatePressureUlcerObservationEntryRelationship3Observation3Value", + operationsForOCL.getOCLValue("VALIDATE_PRESSURE_ULCER_OBSERVATION_ENTRY_RELATIONSHIP3_OBSERVATION3_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PressureUlcerObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + Observation obs = CDAFactory.eINSTANCE.createObservation(); + obs.setCode(DatatypesFactory.eINSTANCE.createCD("425094009", "", "", "")); + er.setObservation(obs); + target.getEntryRelationships().add(er); + } + + @Override + protected void updateToPass(PressureUlcerObservation target) { + target.getEntryRelationships().clear(); + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + Observation obs = CDAFactory.eINSTANCE.createObservation(); + obs.setCode(DatatypesFactory.eINSTANCE.createCD("425094009", "", "", "")); + obs.getValues().add(DatatypesFactory.eINSTANCE.createPQ()); + er.setObservation(obs); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PressureUlcerObservationOperations.validatePressureUlcerObservationEntryRelationship3Observation3Value( + (PressureUlcerObservation) objectToTest, diagnostician, map); + } + + }; + + validatePressureUlcerObservationEntryRelationship3Observation3ValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePressureUlcerObservationEntryRelationship3TypeCode() { + OperationsTestCase validatePressureUlcerObservationEntryRelationship3TypeCodeTestCase = new OperationsTestCase( + "validatePressureUlcerObservationEntryRelationship3TypeCode", + operationsForOCL.getOCLValue("VALIDATE_PRESSURE_ULCER_OBSERVATION_ENTRY_RELATIONSHIP3_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + { + this.skipFailsTest(); + } + + @Override + protected void updateToFail(PressureUlcerObservation target) { + + } + + @Override + protected void updateToPass(PressureUlcerObservation target) { + target.init(); + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + Observation obs = CDAFactory.eINSTANCE.createObservation(); + obs.setCode(DatatypesFactory.eINSTANCE.createCD("425094009", "", "", "")); + obs.getValues().add(DatatypesFactory.eINSTANCE.createPQ()); + er.setObservation(obs); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PressureUlcerObservationOperations.validatePressureUlcerObservationEntryRelationship3TypeCode( + (PressureUlcerObservation) objectToTest, diagnostician, map); + } + + }; + + validatePressureUlcerObservationEntryRelationship3TypeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePressureUlcerObservationEntryRelationship3Observation3() { + OperationsTestCase validatePressureUlcerObservationEntryRelationship3Observation3TestCase = new OperationsTestCase( + "validatePressureUlcerObservationEntryRelationship3Observation3", + operationsForOCL.getOCLValue("VALIDATE_PRESSURE_ULCER_OBSERVATION_ENTRY_RELATIONSHIP3_OBSERVATION3__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + { + this.skipFailsTest(); + } + + @Override + protected void updateToFail(PressureUlcerObservation target) { + + } + + @Override + protected void updateToPass(PressureUlcerObservation target) { + target.init(); + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + Observation obs = CDAFactory.eINSTANCE.createObservation(); + obs.setCode(DatatypesFactory.eINSTANCE.createCD("425094009", "", "", "")); + obs.getValues().add(DatatypesFactory.eINSTANCE.createPQ()); + er.setObservation(obs); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PressureUlcerObservationOperations.validatePressureUlcerObservationEntryRelationship3Observation3( + (PressureUlcerObservation) objectToTest, diagnostician, map); + } + + }; + + validatePressureUlcerObservationEntryRelationship3Observation3TestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PressureUlcerObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public PressureUlcerObservation create() { + return ConsolFactory.eINSTANCE.createPressureUlcerObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PressureUlcerObservationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PressureUlcerObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProblemConcernActTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProblemConcernActTest.java new file mode 100644 index 000000000..18e1fcfc0 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProblemConcernActTest.java @@ -0,0 +1,527 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ProblemConcernAct; +import org.openhealthtools.mdht.uml.cda.consol.operations.ProblemConcernActOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVXB_TS; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * + * A static utility class that provides operations related to 'Problem Concern Act' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemConcernAct#validateProblemConcernActEffectiveTimeLow(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Concern Act Effective Time Low}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemConcernAct#validateProblemConcernActEffectiveTimeHigh(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Concern Act Effective Time High}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemConcernAct#validateProblemConcernActTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Concern Act Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemConcernAct#validateProblemConcernActClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Concern Act Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemConcernAct#validateProblemConcernActMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Concern Act Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemConcernAct#validateProblemConcernActId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Concern Act Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemConcernAct#validateProblemConcernActCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Concern Act Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemConcernAct#validateProblemConcernActCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Concern Act Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemConcernAct#validateProblemConcernActStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Concern Act Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemConcernAct#validateProblemConcernActEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Concern Act Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemConcernAct#validateProblemConcernActProblemObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Concern Act Problem Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemConcernAct#getProblemObservations() Get Problem Observations}
  • + *
+ *

+ * + * @generated + */ + +public class ProblemConcernActTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateProblemConcernActEffectiveTimeLow() { + OperationsTestCase validateProblemConcernActEffectiveTimeLowTestCase = new OperationsTestCase( + "validateProblemConcernActEffectiveTimeLow", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_CONCERN_ACT_EFFECTIVE_TIME_LOW__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemConcernAct target) { + + } + + @Override + protected void updateToPass(ProblemConcernAct target) { + target.init(); + IVL_TS value = DatatypesFactory.eINSTANCE.createIVL_TS(); + + IVXB_TS low = DatatypesFactory.eINSTANCE.createIVXB_TS(); + value.setLow(low); + target.setEffectiveTime(value); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemConcernActOperations.validateProblemConcernActEffectiveTimeLow( + (ProblemConcernAct) objectToTest, diagnostician, map); + } + + }; + + validateProblemConcernActEffectiveTimeLowTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProblemConcernActEffectiveTimeHigh() { + OperationsTestCase validateProblemConcernActEffectiveTimeHighTestCase = new OperationsTestCase( + "validateProblemConcernActEffectiveTimeHigh", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_CONCERN_ACT_EFFECTIVE_TIME_HIGH__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemConcernAct target) { + + } + + @Override + protected void updateToPass(ProblemConcernAct target) { + target.init(); + IVL_TS value = DatatypesFactory.eINSTANCE.createIVL_TS(); + + IVXB_TS high = DatatypesFactory.eINSTANCE.createIVXB_TS(); + value.setHigh(high); + target.setEffectiveTime(value); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemConcernActOperations.validateProblemConcernActEffectiveTimeHigh( + (ProblemConcernAct) objectToTest, diagnostician, map); + } + + }; + + validateProblemConcernActEffectiveTimeHighTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProblemConcernActTemplateId() { + OperationsTestCase validateProblemConcernActTemplateIdTestCase = new OperationsTestCase( + "validateProblemConcernActTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_CONCERN_ACT_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemConcernAct target) { + + } + + @Override + protected void updateToPass(ProblemConcernAct target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemConcernActOperations.validateProblemConcernActTemplateId( + (ProblemConcernAct) objectToTest, diagnostician, map); + } + + }; + + validateProblemConcernActTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProblemConcernActClassCode() { + OperationsTestCase validateProblemConcernActClassCodeTestCase = new OperationsTestCase( + "validateProblemConcernActClassCode", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_CONCERN_ACT_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemConcernAct target) { + + } + + @Override + protected void updateToPass(ProblemConcernAct target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemConcernActOperations.validateProblemConcernActClassCode( + (ProblemConcernAct) objectToTest, diagnostician, map); + } + + }; + + validateProblemConcernActClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProblemConcernActMoodCode() { + OperationsTestCase validateProblemConcernActMoodCodeTestCase = new OperationsTestCase( + "validateProblemConcernActMoodCode", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_CONCERN_ACT_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemConcernAct target) { + + } + + @Override + protected void updateToPass(ProblemConcernAct target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemConcernActOperations.validateProblemConcernActMoodCode( + (ProblemConcernAct) objectToTest, diagnostician, map); + } + + }; + + validateProblemConcernActMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProblemConcernActId() { + OperationsTestCase validateProblemConcernActIdTestCase = new OperationsTestCase( + "validateProblemConcernActId", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_CONCERN_ACT_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemConcernAct target) { + + } + + @Override + protected void updateToPass(ProblemConcernAct target) { + target.init(); + target.getIds().add(DatatypesFactory.eINSTANCE.createII()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemConcernActOperations.validateProblemConcernActId( + (ProblemConcernAct) objectToTest, diagnostician, map); + } + + }; + + validateProblemConcernActIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProblemConcernActCodeP() { + OperationsTestCase validateProblemConcernActCodePTestCase = new OperationsTestCase( + "validateProblemConcernActCodeP", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_CONCERN_ACT_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemConcernAct target) { + + } + + @Override + protected void updateToPass(ProblemConcernAct target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemConcernActOperations.validateProblemConcernActCodeP( + (ProblemConcernAct) objectToTest, diagnostician, map); + } + + }; + + validateProblemConcernActCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProblemConcernActCode() { + OperationsTestCase validateProblemConcernActCodeTestCase = new OperationsTestCase( + "validateProblemConcernActCode", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_CONCERN_ACT_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemConcernAct target) { + + } + + @Override + protected void updateToPass(ProblemConcernAct target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemConcernActOperations.validateProblemConcernActCode( + (ProblemConcernAct) objectToTest, diagnostician, map); + } + + }; + + validateProblemConcernActCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProblemConcernActStatusCode() { + OperationsTestCase validateProblemConcernActStatusCodeTestCase = new OperationsTestCase( + "validateProblemConcernActStatusCode", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_CONCERN_ACT_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemConcernAct target) { + + } + + @Override + protected void updateToPass(ProblemConcernAct target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemConcernActOperations.validateProblemConcernActStatusCode( + (ProblemConcernAct) objectToTest, diagnostician, map); + } + + }; + + validateProblemConcernActStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProblemConcernActEffectiveTime() { + OperationsTestCase validateProblemConcernActEffectiveTimeTestCase = new OperationsTestCase( + "validateProblemConcernActEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_CONCERN_ACT_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemConcernAct target) { + + } + + @Override + protected void updateToPass(ProblemConcernAct target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemConcernActOperations.validateProblemConcernActEffectiveTime( + (ProblemConcernAct) objectToTest, diagnostician, map); + } + + }; + + validateProblemConcernActEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProblemConcernActProblemObservation() { + OperationsTestCase validateProblemConcernActProblemObservationTestCase = new OperationsTestCase( + "validateProblemConcernActProblemObservation", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_CONCERN_ACT_PROBLEM_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemConcernAct target) { + + } + + @Override + protected void updateToPass(ProblemConcernAct target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + er.setObservation(ConsolFactory.eINSTANCE.createProblemObservation()); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemConcernActOperations.validateProblemConcernActProblemObservation( + (ProblemConcernAct) objectToTest, diagnostician, map); + } + + }; + + validateProblemConcernActProblemObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemObservations() { + + ProblemConcernAct target = objectFactory.create(); + target.getProblemObservations(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ProblemConcernActOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ProblemConcernAct create() { + return ConsolFactory.eINSTANCE.createProblemConcernAct(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ProblemConcernActOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ProblemConcernActOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProblemObservationTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProblemObservationTest.java new file mode 100644 index 000000000..ccfe04ff8 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProblemObservationTest.java @@ -0,0 +1,1097 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ConsolPackage; +import org.openhealthtools.mdht.uml.cda.consol.GeneralStatusSection; +import org.openhealthtools.mdht.uml.cda.consol.ProblemObservation; +import org.openhealthtools.mdht.uml.cda.consol.operations.ProblemObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.vocab.ActClassObservation; +import org.openhealthtools.mdht.uml.hl7.vocab.NullFlavor; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * + * A static utility class that provides operations related to 'Problem Observation' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemObservation#validateProblemObservationHasTextReference(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Observation Has Text Reference}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemObservation#validateProblemObservationTextReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Observation Text Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemObservation#validateProblemObservationHasTextReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Observation Has Text Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemObservation#validateProblemObservationHasOnsetDate(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Observation Has Onset Date}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemObservation#validateProblemObservationHasResolutionDate(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Observation Has Resolution Date}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemObservation#validateProblemObservationValueNullFlavor(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Observation Value Null Flavor}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemObservation#validateProblemObservationAgeObservationInversion(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Observation Age Observation Inversion}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemObservation#validateProblemObservationValueTranslation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Observation Value Translation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemObservation#validateProblemObservationValueTranslationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Observation Value Translation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemObservation#validateProblemObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Observation Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemObservation#validateProblemObservationClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Observation Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemObservation#validateProblemObservationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Observation Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemObservation#validateProblemObservationNegationInd(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Observation Negation Ind}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemObservation#validateProblemObservationId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Observation Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemObservation#validateProblemObservationCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Observation Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemObservation#validateProblemObservationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Observation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemObservation#validateProblemObservationText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Observation Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemObservation#validateProblemObservationStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Observation Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemObservation#validateProblemObservationEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Observation Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemObservation#validateProblemObservationValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Observation Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemObservation#validateProblemObservationValueP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Observation Value P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemObservation#validateProblemObservationAgeObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Observation Age Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemObservation#validateProblemObservationHealthStatusObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Observation Health Status Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemObservation#validateProblemObservationProblemStatus(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Observation Problem Status}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemObservation#getAgeObservation() Get Age Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemObservation#getHealthStatusObservation() Get Health Status Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemObservation#getProblemStatus() Get Problem Status}
  • + *
+ *

+ * + * @generated + */ + +public class ProblemObservationTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateProblemObservationHasTextReference() { + OperationsTestCase validateProblemObservationHasTextReferenceTestCase = new OperationsTestCase( + "validateProblemObservationHasTextReference", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_OBSERVATION_HAS_TEXT_REFERENCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemObservation target) { + target.init(); + ED txt = DatatypesFactory.eINSTANCE.createED(); + target.setText(txt); + } + + @Override + protected void updateToPass(ProblemObservation target) { + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL("test")); + target.setText(txt); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemObservationOperations.validateProblemObservationHasTextReference( + (ProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateProblemObservationHasTextReferenceTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProblemObservationTextReferenceValue() { + OperationsTestCase validateProblemObservationTextReferenceValueTestCase = new OperationsTestCase( + "validateProblemObservationTextReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_OBSERVATION_TEXT_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemObservation target) { + target.init(); + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL()); + target.setText(txt); + } + + @Override + protected void updateToPass(ProblemObservation target) { + target.init(); + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL("test")); + target.setText(txt); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemObservationOperations.validateProblemObservationTextReferenceValue( + (ProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateProblemObservationTextReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProblemObservationHasTextReferenceValue() { + OperationsTestCase validateProblemObservationHasTextReferenceValueTestCase = new NarrativeReferenceTestCase( + "validateProblemObservationHasTextReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_OBSERVATION_HAS_TEXT_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemObservation target) { + target.init(); + + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), "", + "No particular problem observed."); + + // add a reference to the section text + target.setText(createEDWithReference("Some sample text", "#1.2.3.4")); + + } + + @Override + protected void updateToPass(ProblemObservation target) { + + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), + "1.2.3.4", "No particular problem observed."); + + // add a reference to the section text + target.setText(createEDWithReference("Some sample text", "#1.2.3.4")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemObservationOperations.validateProblemObservationHasTextReferenceValue( + (ProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateProblemObservationHasTextReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProblemObservationHasOnsetDate() { + OperationsTestCase validateProblemObservationHasOnsetDateTestCase = new OperationsTestCase( + "validateProblemObservationHasOnsetDate", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_OBSERVATION_HAS_ONSET_DATE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemObservation target) { + + } + + @Override + protected void updateToPass(ProblemObservation target) { + target.init(); + IVL_TS ef = DatatypesFactory.eINSTANCE.createIVL_TS(); + ef.setLow(DatatypesFactory.eINSTANCE.createIVXB_TS()); + target.setEffectiveTime(ef); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemObservationOperations.validateProblemObservationHasOnsetDate( + (ProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateProblemObservationHasOnsetDateTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProblemObservationHasResolutionDate() { + OperationsTestCase validateProblemObservationHasResolutionDateTestCase = new OperationsTestCase( + "validateProblemObservationHasResolutionDate", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_OBSERVATION_HAS_RESOLUTION_DATE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemObservation target) { + + } + + @Override + protected void updateToPass(ProblemObservation target) { + target.init(); + IVL_TS ef = DatatypesFactory.eINSTANCE.createIVL_TS(); + ef.setHigh(DatatypesFactory.eINSTANCE.createIVXB_TS()); + target.setEffectiveTime(ef); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemObservationOperations.validateProblemObservationHasResolutionDate( + (ProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateProblemObservationHasResolutionDateTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProblemObservationValueNullFlavor() { + OperationsTestCase validateProblemObservationValueNullFlavorTestCase = new OperationsTestCase( + "validateProblemObservationValueNullFlavor", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_OBSERVATION_VALUE_NULL_FLAVOR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemObservation target) { + target.init(); + target.getValues().add(DatatypesFactory.eINSTANCE.createCD()); + } + + @Override + protected void updateToPass(ProblemObservation target) { + target.getValues().clear(); + + CD val = DatatypesFactory.eINSTANCE.createCD(); + val.setNullFlavor(NullFlavor.UNK); + target.getValues().add(val); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemObservationOperations.validateProblemObservationValueNullFlavor( + (ProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateProblemObservationValueNullFlavorTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProblemObservationAgeObservationInversion() { + OperationsTestCase validateProblemObservationAgeObservationInversionTestCase = new OperationsTestCase( + "validateProblemObservationAgeObservationInversion", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_OBSERVATION_AGE_OBSERVATION_INVERSION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setObservation(ConsolFactory.eINSTANCE.createAgeObservation()); + target.getEntryRelationships().add(er); + } + + @Override + public void addPassTests() { + + addPassTest(new PassTest() { + + @Override + public void updateToPass(ProblemObservation target) { + // Test case with multiple entryRelationships.. Should check for inversion Indicator only if AgeObservation is present + target.getEntryRelationships().clear(); + target.getEntryRelationships().add(CDAFactory.eINSTANCE.createEntryRelationship()); + target.getEntryRelationships().add(CDAFactory.eINSTANCE.createEntryRelationship()); + } + + }); + } + + @Override + protected void updateToPass(ProblemObservation target) { + target.getEntryRelationships().clear(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setObservation(ConsolFactory.eINSTANCE.createAgeObservation()); + er.setInversionInd(true); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemObservationOperations.validateProblemObservationAgeObservationInversion( + (ProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateProblemObservationAgeObservationInversionTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProblemObservationValueTranslation() { + OperationsTestCase validateProblemObservationValueTranslationTestCase = new OperationsTestCase( + "validateProblemObservationValueTranslation", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_OBSERVATION_VALUE_TRANSLATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemObservation target) { + + } + + @Override + protected void updateToPass(ProblemObservation target) { + target.init(); + CD val = DatatypesFactory.eINSTANCE.createCD(); + val.getTranslations().add(DatatypesFactory.eINSTANCE.createCD("", "2.16.840.1.113883.6.3", "", "")); + target.getValues().add(val); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemObservationOperations.validateProblemObservationValueTranslation( + (ProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateProblemObservationValueTranslationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProblemObservationValueTranslationCode() { + OperationsTestCase validateProblemObservationValueTranslationCodeTestCase = new OperationsTestCase( + "validateProblemObservationValueTranslationCode", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_OBSERVATION_VALUE_TRANSLATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemObservation target) { + target.init(); + CD val = DatatypesFactory.eINSTANCE.createCD(); + val.getTranslations().add(DatatypesFactory.eINSTANCE.createCD()); + target.getValues().add(val); + } + + @Override + protected void updateToPass(ProblemObservation target) { + target.getValues().clear(); + CD val = DatatypesFactory.eINSTANCE.createCD(); + val.getTranslations().add(DatatypesFactory.eINSTANCE.createCD("", "2.16.840.1.113883.6.3", "", "")); + target.getValues().add(val); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemObservationOperations.validateProblemObservationValueTranslationCode( + (ProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateProblemObservationValueTranslationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProblemObservationTemplateId() { + OperationsTestCase validateProblemObservationTemplateIdTestCase = new OperationsTestCase( + "validateProblemObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemObservation target) { + + } + + @Override + protected void updateToPass(ProblemObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemObservationOperations.validateProblemObservationTemplateId( + (ProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateProblemObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProblemObservationClassCode() { + OperationsTestCase validateProblemObservationClassCodeTestCase = new OperationsTestCase( + "validateProblemObservationClassCode", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_OBSERVATION_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemObservation target) { + + } + + @Override + protected void updateToPass(ProblemObservation target) { + target.init(); + target.setClassCode(ActClassObservation.OBS); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemObservationOperations.validateProblemObservationClassCode( + (ProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateProblemObservationClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProblemObservationMoodCode() { + OperationsTestCase validateProblemObservationMoodCodeTestCase = new OperationsTestCase( + "validateProblemObservationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_OBSERVATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemObservation target) { + + } + + @Override + protected void updateToPass(ProblemObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemObservationOperations.validateProblemObservationMoodCode( + (ProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateProblemObservationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProblemObservationNegationInd() { + OperationsTestCase validateProblemObservationNegationIndTestCase = new OperationsTestCase( + "validateProblemObservationNegationInd", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_OBSERVATION_NEGATION_IND__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemObservation target) { + + } + + @Override + protected void updateToPass(ProblemObservation target) { + target.init(); + target.setNegationInd(true); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemObservationOperations.validateProblemObservationNegationInd( + (ProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateProblemObservationNegationIndTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProblemObservationId() { + OperationsTestCase validateProblemObservationIdTestCase = new OperationsTestCase( + "validateProblemObservationId", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_OBSERVATION_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemObservation target) { + + } + + @Override + protected void updateToPass(ProblemObservation target) { + target.init(); + + II ii = DatatypesFactory.eINSTANCE.createII(); + target.getIds().add(ii); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemObservationOperations.validateProblemObservationId( + (ProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateProblemObservationIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProblemObservationCodeP() { + OperationsTestCase validateProblemObservationCodePTestCase = new OperationsTestCase( + "validateProblemObservationCodeP", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_OBSERVATION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemObservation target) { + + } + + @Override + protected void updateToPass(ProblemObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemObservationOperations.validateProblemObservationCodeP( + (ProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateProblemObservationCodePTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProblemObservationCode() { + OperationsTestCase validateProblemObservationCodeTestCase = new OperationsTestCase( + "validateProblemObservationCode", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemObservation target) { + + } + + @Override + protected void updateToPass(ProblemObservation target) { + target.init(); + + CD cd = DatatypesFactory.eINSTANCE.createCD(); + cd.setCodeSystem("2.16.840.1.113883.6.96"); + cd.setCode("404684003"); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemObservationOperations.validateProblemObservationCode( + (ProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateProblemObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProblemObservationText() { + OperationsTestCase validateProblemObservationTextTestCase = new OperationsTestCase( + "validateProblemObservationText", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_OBSERVATION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemObservation target) { + + } + + @Override + protected void updateToPass(ProblemObservation target) { + target.init(); + + ED text = DatatypesFactory.eINSTANCE.createED(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemObservationOperations.validateProblemObservationText( + (ProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateProblemObservationTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProblemObservationStatusCode() { + OperationsTestCase validateProblemObservationStatusCodeTestCase = new OperationsTestCase( + "validateProblemObservationStatusCode", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_OBSERVATION_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemObservation target) { + + } + + @Override + protected void updateToPass(ProblemObservation target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemObservationOperations.validateProblemObservationStatusCode( + (ProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateProblemObservationStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProblemObservationEffectiveTime() { + OperationsTestCase validateProblemObservationEffectiveTimeTestCase = new OperationsTestCase( + "validateProblemObservationEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_OBSERVATION_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemObservation target) { + + } + + @Override + protected void updateToPass(ProblemObservation target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemObservationOperations.validateProblemObservationEffectiveTime( + (ProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateProblemObservationEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProblemObservationValue() { + OperationsTestCase validateProblemObservationValueTestCase = new OperationsTestCase( + "validateProblemObservationValue", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemObservation target) { + + } + + @Override + protected void updateToPass(ProblemObservation target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD(); + value.setCodeSystem("2.16.840.1.113883.6.96"); + value.setCode("234422006"); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemObservationOperations.validateProblemObservationValue( + (ProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateProblemObservationValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProblemObservationValueP() { + OperationsTestCase validateProblemObservationValuePTestCase = new OperationsTestCase( + "validateProblemObservationValueP", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_OBSERVATION_VALUE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemObservation target) { + + } + + @Override + protected void updateToPass(ProblemObservation target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD(); + value.setCodeSystem("2.16.840.1.113883.6.96"); + value.setCode("234422006"); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemObservationOperations.validateProblemObservationValueP( + (ProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateProblemObservationValuePTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProblemObservationAgeObservation() { + OperationsTestCase validateProblemObservationAgeObservationTestCase = new OperationsTestCase( + "validateProblemObservationAgeObservation", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_OBSERVATION_AGE_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemObservation target) { + + } + + @Override + protected void updateToPass(ProblemObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + er.setObservation(ConsolFactory.eINSTANCE.createAgeObservation()); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemObservationOperations.validateProblemObservationAgeObservation( + (ProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateProblemObservationAgeObservationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProblemObservationHealthStatusObservation() { + OperationsTestCase validateProblemObservationHealthStatusObservationTestCase = new OperationsTestCase( + "validateProblemObservationHealthStatusObservation", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_OBSERVATION_HEALTH_STATUS_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemObservation target) { + + } + + @Override + protected void updateToPass(ProblemObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.REFR); + er.setObservation(ConsolFactory.eINSTANCE.createHealthStatusObservation()); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemObservationOperations.validateProblemObservationHealthStatusObservation( + (ProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateProblemObservationHealthStatusObservationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProblemObservationProblemStatus() { + OperationsTestCase validateProblemObservationProblemStatusTestCase = new OperationsTestCase( + "validateProblemObservationProblemStatus", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_OBSERVATION_PROBLEM_STATUS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemObservation target) { + + } + + @Override + protected void updateToPass(ProblemObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.REFR); + er.setObservation(ConsolFactory.eINSTANCE.createProblemStatus()); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemObservationOperations.validateProblemObservationProblemStatus( + (ProblemObservation) objectToTest, diagnostician, map); + } + + }; + + validateProblemObservationProblemStatusTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetAgeObservation() { + + ProblemObservation target = objectFactory.create(); + target.getAgeObservation(); + + } + + /** + * + * @generated + */ + @Test + public void testGetHealthStatusObservation() { + + ProblemObservation target = objectFactory.create(); + target.getHealthStatusObservation(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProblemStatus() { + + ProblemObservation target = objectFactory.create(); + target.getProblemStatus(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ProblemObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ProblemObservation create() { + return ConsolFactory.eINSTANCE.createProblemObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ProblemObservationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ProblemObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProblemSectionEntriesOptionalTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProblemSectionEntriesOptionalTest.java new file mode 100644 index 000000000..c45ce2736 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProblemSectionEntriesOptionalTest.java @@ -0,0 +1,338 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ProblemSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.operations.ProblemSectionEntriesOptionalOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Problem Section Entries Optional' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemSectionEntriesOptional#validateProblemSectionEntriesOptionalTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Section Entries Optional Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemSectionEntriesOptional#validateProblemSectionEntriesOptionalCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Section Entries Optional Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemSectionEntriesOptional#validateProblemSectionEntriesOptionalCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Section Entries Optional Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemSectionEntriesOptional#validateProblemSectionEntriesOptionalTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Section Entries Optional Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemSectionEntriesOptional#validateProblemSectionEntriesOptionalText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Section Entries Optional Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemSectionEntriesOptional#validateProblemSectionEntriesOptionalProblemConcern(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Section Entries Optional Problem Concern}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemSectionEntriesOptional#getProblemConcerns() Get Problem Concerns}
  • + *
+ *

+ * + * @generated + */ + +public class ProblemSectionEntriesOptionalTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateProblemSectionEntriesOptionalTemplateId() { + OperationsTestCase validateProblemSectionEntriesOptionalTemplateIdTestCase = new OperationsTestCase( + "validateProblemSectionEntriesOptionalTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_SECTION_ENTRIES_OPTIONAL_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(ProblemSectionEntriesOptional target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemSectionEntriesOptionalOperations.validateProblemSectionEntriesOptionalTemplateId( + (ProblemSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateProblemSectionEntriesOptionalTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProblemSectionEntriesOptionalCode() { + OperationsTestCase validateProblemSectionEntriesOptionalCodeTestCase = new OperationsTestCase( + "validateProblemSectionEntriesOptionalCode", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_SECTION_ENTRIES_OPTIONAL_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(ProblemSectionEntriesOptional target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemSectionEntriesOptionalOperations.validateProblemSectionEntriesOptionalCode( + (ProblemSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateProblemSectionEntriesOptionalCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProblemSectionEntriesOptionalCodeP() { + OperationsTestCase validateProblemSectionEntriesOptionalCodePTestCase = new OperationsTestCase( + "validateProblemSectionEntriesOptionalCodeP", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_SECTION_ENTRIES_OPTIONAL_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(ProblemSectionEntriesOptional target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemSectionEntriesOptionalOperations.validateProblemSectionEntriesOptionalCodeP( + (ProblemSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateProblemSectionEntriesOptionalCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProblemSectionEntriesOptionalTitle() { + OperationsTestCase validateProblemSectionEntriesOptionalTitleTestCase = new OperationsTestCase( + "validateProblemSectionEntriesOptionalTitle", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_SECTION_ENTRIES_OPTIONAL_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(ProblemSectionEntriesOptional target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemSectionEntriesOptionalOperations.validateProblemSectionEntriesOptionalTitle( + (ProblemSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateProblemSectionEntriesOptionalTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProblemSectionEntriesOptionalText() { + OperationsTestCase validateProblemSectionEntriesOptionalTextTestCase = new OperationsTestCase( + "validateProblemSectionEntriesOptionalText", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_SECTION_ENTRIES_OPTIONAL_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(ProblemSectionEntriesOptional target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemSectionEntriesOptionalOperations.validateProblemSectionEntriesOptionalText( + (ProblemSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateProblemSectionEntriesOptionalTextTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProblemSectionEntriesOptionalProblemConcern() { + OperationsTestCase validateProblemSectionEntriesOptionalProblemConcernTestCase = new OperationsTestCase( + "validateProblemSectionEntriesOptionalProblemConcern", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_SECTION_ENTRIES_OPTIONAL_PROBLEM_CONCERN__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(ProblemSectionEntriesOptional target) { + target.init(); + target.addAct(ConsolFactory.eINSTANCE.createProblemConcernAct()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemSectionEntriesOptionalOperations.validateProblemSectionEntriesOptionalProblemConcern( + (ProblemSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateProblemSectionEntriesOptionalProblemConcernTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemConcerns() { + + ProblemSectionEntriesOptional target = objectFactory.create(); + target.getProblemConcerns(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ProblemSectionEntriesOptionalOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ProblemSectionEntriesOptional create() { + return ConsolFactory.eINSTANCE.createProblemSectionEntriesOptional(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ProblemSectionEntriesOptionalOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ProblemSectionEntriesOptionalOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProblemSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProblemSectionTest.java new file mode 100644 index 000000000..ad2534f8a --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProblemSectionTest.java @@ -0,0 +1,338 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ProblemSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.ProblemSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Problem Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemSection#validateProblemSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemSection#validateProblemSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemSection#validateProblemSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemSection#validateProblemSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemSection#validateProblemSectionProblemConcern(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Section Problem Concern}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemSection#getConsolProblemConcerns() Get Consol Problem Concerns}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemSection#validateProblemSectionEntriesOptionalTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Section Entries Optional Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class ProblemSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateProblemSectionCodeP() { + OperationsTestCase validateProblemSectionCodePTestCase = new OperationsTestCase( + "validateProblemSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemSection target) { + + } + + @Override + protected void updateToPass(ProblemSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemSectionOperations.validateProblemSectionCodeP( + (ProblemSection) objectToTest, diagnostician, map); + } + + }; + + validateProblemSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProblemSectionCode() { + OperationsTestCase validateProblemSectionCodeTestCase = new OperationsTestCase( + "validateProblemSectionCode", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemSection target) { + + } + + @Override + protected void updateToPass(ProblemSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemSectionOperations.validateProblemSectionCode( + (ProblemSection) objectToTest, diagnostician, map); + } + + }; + + validateProblemSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProblemSectionText() { + OperationsTestCase validateProblemSectionTextTestCase = new OperationsTestCase( + "validateProblemSectionText", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemSection target) { + + } + + @Override + protected void updateToPass(ProblemSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemSectionOperations.validateProblemSectionText( + (ProblemSection) objectToTest, diagnostician, map); + } + + }; + + validateProblemSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProblemSectionTitle() { + OperationsTestCase validateProblemSectionTitleTestCase = new OperationsTestCase( + "validateProblemSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemSection target) { + + } + + @Override + protected void updateToPass(ProblemSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemSectionOperations.validateProblemSectionTitle( + (ProblemSection) objectToTest, diagnostician, map); + } + + }; + + validateProblemSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProblemSectionProblemConcern() { + OperationsTestCase validateProblemSectionProblemConcernTestCase = new OperationsTestCase( + "validateProblemSectionProblemConcern", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_SECTION_PROBLEM_CONCERN__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemSection target) { + + } + + @Override + protected void updateToPass(ProblemSection target) { + target.init(); + target.addAct(ConsolFactory.eINSTANCE.createProblemConcernAct()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemSectionOperations.validateProblemSectionProblemConcern( + (ProblemSection) objectToTest, diagnostician, map); + } + + }; + + validateProblemSectionProblemConcernTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetConsolProblemConcerns() { + + ProblemSection target = objectFactory.create(); + target.getConsolProblemConcerns(); + + } + + /** + * + * @generated + */ + @Test + public void testValidateProblemSectionEntriesOptionalTemplateId() { + OperationsTestCase validateProblemSectionEntriesOptionalTemplateIdTestCase = new OperationsTestCase( + "validateProblemSectionEntriesOptionalTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_SECTION_ENTRIES_OPTIONAL_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemSection target) { + + } + + @Override + protected void updateToPass(ProblemSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemSectionOperations.validateProblemSectionEntriesOptionalTemplateId( + (ProblemSection) objectToTest, diagnostician, map); + } + + }; + + validateProblemSectionEntriesOptionalTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ProblemSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ProblemSection create() { + return ConsolFactory.eINSTANCE.createProblemSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ProblemSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ProblemSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProblemStatusTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProblemStatusTest.java new file mode 100644 index 000000000..2b92c6639 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProblemStatusTest.java @@ -0,0 +1,498 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ConsolPackage; +import org.openhealthtools.mdht.uml.cda.consol.GeneralStatusSection; +import org.openhealthtools.mdht.uml.cda.consol.ProblemStatus; +import org.openhealthtools.mdht.uml.cda.consol.operations.ProblemStatusOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; + +/** + * + * A static utility class that provides operations related to 'Problem Status' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemStatus#validateProblemStatusTextReference(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Status Text Reference}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemStatus#validateProblemStatusReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Status Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemStatus#validateProblemStatusTextReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Status Text Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemStatus#validateProblemStatusTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Status Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemStatus#validateProblemStatusClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Status Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemStatus#validateProblemStatusMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Status Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemStatus#validateProblemStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemStatus#validateProblemStatusText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Status Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemStatus#validateProblemStatusStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Status Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProblemStatus#validateProblemStatusValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Status Value}
  • + *
+ *

+ * + * @generated + */ + +public class ProblemStatusTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateProblemStatusTextReference() { + OperationsTestCase validateProblemStatusTextReferenceTestCase = new OperationsTestCase( + "validateProblemStatusTextReference", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_STATUS_TEXT_REFERENCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemStatus target) { + target.init(); + ED txt = DatatypesFactory.eINSTANCE.createED(); + + target.setText(txt); + } + + @Override + protected void updateToPass(ProblemStatus target) { + + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL("test")); + target.setText(txt); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemStatusOperations.validateProblemStatusTextReference( + (ProblemStatus) objectToTest, diagnostician, map); + } + + }; + + validateProblemStatusTextReferenceTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProblemStatusReferenceValue() { + OperationsTestCase validateProblemStatusReferenceValueTestCase = new OperationsTestCase( + "validateProblemStatusReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_STATUS_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemStatus target) { + target.init(); + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL()); + target.setText(txt); + } + + @Override + protected void updateToPass(ProblemStatus target) { + target.init(); + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL("test")); + target.setText(txt); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemStatusOperations.validateProblemStatusReferenceValue( + (ProblemStatus) objectToTest, diagnostician, map); + } + + }; + + validateProblemStatusReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProblemStatusTextReferenceValue() { + OperationsTestCase validateProblemStatusTextReferenceValueTestCase = new NarrativeReferenceTestCase( + "validateProblemStatusTextReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_STATUS_TEXT_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemStatus target) { + target.init(); + + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), "", + "No particular problem status."); + + // add a reference to the section text + target.setText(createEDWithReference("Some sample text", "#1.2.3.4")); + + } + + @Override + protected void updateToPass(ProblemStatus target) { + + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), + "1.2.3.4", "No particular problem status."); + + // add a reference to the section text + target.setText(createEDWithReference("Some sample text", "#1.2.3.4")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemStatusOperations.validateProblemStatusTextReferenceValue( + (ProblemStatus) objectToTest, diagnostician, map); + } + + }; + + validateProblemStatusTextReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProblemStatusTemplateId() { + OperationsTestCase validateProblemStatusTemplateIdTestCase = new OperationsTestCase( + "validateProblemStatusTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_STATUS_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemStatus target) { + + } + + @Override + protected void updateToPass(ProblemStatus target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemStatusOperations.validateProblemStatusTemplateId( + (ProblemStatus) objectToTest, diagnostician, map); + } + + }; + + validateProblemStatusTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProblemStatusClassCode() { + OperationsTestCase validateProblemStatusClassCodeTestCase = new OperationsTestCase( + "validateProblemStatusClassCode", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_STATUS_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemStatus target) { + + } + + @Override + protected void updateToPass(ProblemStatus target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemStatusOperations.validateProblemStatusClassCode( + (ProblemStatus) objectToTest, diagnostician, map); + } + + }; + + validateProblemStatusClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProblemStatusMoodCode() { + OperationsTestCase validateProblemStatusMoodCodeTestCase = new OperationsTestCase( + "validateProblemStatusMoodCode", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_STATUS_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemStatus target) { + + } + + @Override + protected void updateToPass(ProblemStatus target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemStatusOperations.validateProblemStatusMoodCode( + (ProblemStatus) objectToTest, diagnostician, map); + } + + }; + + validateProblemStatusMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProblemStatusCode() { + OperationsTestCase validateProblemStatusCodeTestCase = new OperationsTestCase( + "validateProblemStatusCode", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(ProblemStatus target) { + + } + + @Override + protected void updateToPass(ProblemStatus target) { + target.init(); + + target.setCode(DatatypesFactory.eINSTANCE.createCE("33999-4", "2.16.840.1.113883.6.1")); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemStatusOperations.validateProblemStatusCode( + (ProblemStatus) objectToTest, diagnostician, map); + } + + }; + + validateProblemStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProblemStatusStatusCode() { + OperationsTestCase validateProblemStatusStatusCodeTestCase = new OperationsTestCase( + "validateProblemStatusStatusCode", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_STATUS_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemStatus target) { + + } + + @Override + protected void updateToPass(ProblemStatus target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemStatusOperations.validateProblemStatusStatusCode( + (ProblemStatus) objectToTest, diagnostician, map); + } + + }; + + validateProblemStatusStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProblemStatusText() { + OperationsTestCase validateProblemStatusTextTestCase = new OperationsTestCase( + "validateProblemStatusText", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_STATUS_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(ProblemStatus target) { + + } + + @Override + protected void updateToPass(ProblemStatus target) { + target.init(); + + ED text = DatatypesFactory.eINSTANCE.createED(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemStatusOperations.validateProblemStatusText( + (ProblemStatus) objectToTest, diagnostician, map); + } + + }; + + validateProblemStatusTextTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProblemStatusValue() { + OperationsTestCase validateProblemStatusValueTestCase = new OperationsTestCase( + "validateProblemStatusValue", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_STATUS_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemStatus target) { + + } + + @Override + protected void updateToPass(ProblemStatus target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD(); + value.setCodeSystem("2.16.840.1.113883.6.96"); + value.setCode("55561003"); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemStatusOperations.validateProblemStatusValue( + (ProblemStatus) objectToTest, diagnostician, map); + } + + }; + + validateProblemStatusValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ProblemStatusOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ProblemStatus create() { + return ConsolFactory.eINSTANCE.createProblemStatus(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ProblemStatusOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ProblemStatusOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProcedureActivityActTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProcedureActivityActTest.java new file mode 100644 index 000000000..d95f6f631 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProcedureActivityActTest.java @@ -0,0 +1,1774 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.AssignedEntity; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Encounter; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.Organization; +import org.openhealthtools.mdht.uml.cda.Participant2; +import org.openhealthtools.mdht.uml.cda.Performer2; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ConsolPackage; +import org.openhealthtools.mdht.uml.cda.consol.GeneralStatusSection; +import org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityAct; +import org.openhealthtools.mdht.uml.cda.consol.operations.ProcedureActivityActOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.datatypes.TEL; +import org.openhealthtools.mdht.uml.hl7.vocab.ActClass; +import org.openhealthtools.mdht.uml.hl7.vocab.ParticipationType; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; +import org.openhealthtools.mdht.uml.hl7.vocab.x_DocumentActMood; +import org.openhealthtools.mdht.uml.hl7.vocab.x_DocumentEncounterMood; + +/** + * + * A static utility class that provides operations related to 'Procedure Activity Act' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityAct#validateProcedureActivityActCodeCodeSystems(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Code Code Systems}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityAct#validateProcedureActivityActCodeOriginalText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Code Original Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityAct#validateProcedureActivityActOriginalTextReference(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Original Text Reference}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityAct#validateProcedureActivityActOriginalTextReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Original Text Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityAct#validateProcedureActivityActReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityAct#validateProcedureActivityActEncounterInversion(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Encounter Inversion}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityAct#validateProcedureActivityActServiceDeliveryLocationTypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Service Delivery Location Type Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityAct#validateProcedureActivityActInstructionsInversion(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Instructions Inversion}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityAct#validateProcedureActivityActTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityAct#validateProcedureActivityActClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityAct#validateProcedureActivityActMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityAct#validateProcedureActivityActId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityAct#validateProcedureActivityActCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityAct#validateProcedureActivityActStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityAct#validateProcedureActivityActEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityAct#validateProcedureActivityActPriorityCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Priority Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityAct#validateProcedureActivityActPriorityCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Priority Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityAct#validateProcedureActivityActPerformer(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Performer}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityAct#validateProcedureActivityActServiceDeliveryLocation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Service Delivery Location}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityAct#validateProcedureActivityActInstructions(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Instructions}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityAct#validateProcedureActivityActIndication(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Indication}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityAct#validateProcedureActivityActMedicationActivity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Medication Activity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityAct#validateProcedureActivityActEntryRelationship(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Entry Relationship}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityAct#validateProcedureActivityActProcedureActPerformerAssignedEntity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Procedure Act Performer Assigned Entity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityAct#validateProcedureActivityActProcedureActPerformerAssignedEntityId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Procedure Act Performer Assigned Entity Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityAct#validateProcedureActivityActProcedureActPerformerAssignedEntityAddr(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Procedure Act Performer Assigned Entity Addr}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityAct#validateProcedureActivityActProcedureActPerformerAssignedEntityTelecom(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Procedure Act Performer Assigned Entity Telecom}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityAct#validateProcedureActivityActProcedureActPerformerAssignedEntityRepOrg(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Procedure Act Performer Assigned Entity Rep Org}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityAct#validateProcedureActivityActProcedureActPerformerAssignedEntityRepOrgId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Procedure Act Performer Assigned Entity Rep Org Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityAct#validateProcedureActivityActProcedureActPerformerAssignedEntityRepOrgName(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Procedure Act Performer Assigned Entity Rep Org Name}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityAct#validateProcedureActivityActProcedureActPerformerAssignedEntityRepOrgAddr(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Procedure Act Performer Assigned Entity Rep Org Addr}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityAct#validateProcedureActivityActProcedureActPerformerAssignedEntityRepOrgTelecom(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Procedure Act Performer Assigned Entity Rep Org Telecom}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityAct#validateProcedureActivityActEntryRelationshipProcedureActEncounterClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Entry Relationship Procedure Act Encounter Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityAct#validateProcedureActivityActEntryRelationshipProcedureActEncounterMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Entry Relationship Procedure Act Encounter Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityAct#validateProcedureActivityActEntryRelationshipProcedureActEncounterId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Entry Relationship Procedure Act Encounter Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityAct#validateProcedureActivityActEntryRelationshipInversionInd(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Entry Relationship Inversion Ind}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityAct#validateProcedureActivityActEntryRelationshipTypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Entry Relationship Type Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityAct#validateProcedureActivityActEntryRelationshipProcedureActEncounter(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Act Entry Relationship Procedure Act Encounter}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityAct#getServiceDeliveryLocations() Get Service Delivery Locations}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityAct#getInstructions() Get Instructions}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityAct#getIndications() Get Indications}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityAct#getMedicationActivity() Get Medication Activity}
  • + *
+ *

+ * + * @generated + */ + +public class ProcedureActivityActTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateProcedureActivityActCodeCodeSystems() { + OperationsTestCase validateProcedureActivityActCodeCodeSystemsTestCase = new OperationsTestCase( + "validateProcedureActivityActCodeCodeSystems", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_CODE_CODE_SYSTEMS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityAct target) { + + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + target.init(); + CD code = DatatypesFactory.eINSTANCE.createCD(); + code.setCodeSystem("2.16.840.1.113883.6.96"); + target.setCode(code); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActCodeCodeSystems( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActCodeCodeSystemsTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProcedureActivityActCodeOriginalText() { + OperationsTestCase validateProcedureActivityActCodeOriginalTextTestCase = new OperationsTestCase( + "validateProcedureActivityActCodeOriginalText", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_CODE_ORIGINAL_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityAct target) { + target.init(); + CD code = DatatypesFactory.eINSTANCE.createCD(); + + target.setCode(code); + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + + CD code = DatatypesFactory.eINSTANCE.createCD(); + code.setOriginalText(DatatypesFactory.eINSTANCE.createED()); + target.setCode(code); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActCodeOriginalText( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActCodeOriginalTextTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityActOriginalTextReference() { + OperationsTestCase validateProcedureActivityActOriginalTextReferenceTestCase = new OperationsTestCase( + "validateProcedureActivityActOriginalTextReference", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_ORIGINAL_TEXT_REFERENCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityAct target) { + target.init(); + CD code = DatatypesFactory.eINSTANCE.createCD(); + ED ot = DatatypesFactory.eINSTANCE.createED(); + code.setOriginalText(ot); + target.setCode(code); + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + CD code = DatatypesFactory.eINSTANCE.createCD(); + ED ot = DatatypesFactory.eINSTANCE.createED(); + TEL ref = DatatypesFactory.eINSTANCE.createTEL(); + ref.setValue("test"); + ot.setReference(ref); + code.setOriginalText(ot); + target.setCode(code); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActOriginalTextReference( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActOriginalTextReferenceTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProcedureActivityActOriginalTextReferenceValue() { + OperationsTestCase validateProcedureActivityActOriginalTextReferenceValueTestCase = new OperationsTestCase( + "validateProcedureActivityActOriginalTextReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_ORIGINAL_TEXT_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityAct target) { + target.init(); + CD code = DatatypesFactory.eINSTANCE.createCD(); + ED ot = DatatypesFactory.eINSTANCE.createED(); + TEL ref = DatatypesFactory.eINSTANCE.createTEL(); + ot.setReference(ref); + code.setOriginalText(ot); + target.setCode(code); + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + CD code = DatatypesFactory.eINSTANCE.createCD(); + ED ot = DatatypesFactory.eINSTANCE.createED(); + TEL ref = DatatypesFactory.eINSTANCE.createTEL(); + ref.setValue("test"); + ot.setReference(ref); + code.setOriginalText(ot); + target.setCode(code); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActOriginalTextReferenceValue( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActOriginalTextReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProcedureActivityActReferenceValue() { + OperationsTestCase validateProcedureActivityActReferenceValueTestCase = new NarrativeReferenceTestCase( + "validateProcedureActivityActReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityAct target) { + target.init(); + + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), "", + "No particular procedure enacted."); + + // add a reference to the section text + target.setCode(createCDWithOriginalTextReference("Some sample text", "#1.2.3.4")); + + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), + "1.2.3.4", "No particular procedure enacted."); + + // add a reference to the section text + target.setCode(createCDWithOriginalTextReference("Some sample text", "#1.2.3.4")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActReferenceValue( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProcedureActivityActEncounterInversion() { + OperationsTestCase validateProcedureActivityActEncounterInversionTestCase = new OperationsTestCase( + "validateProcedureActivityActEncounterInversion", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_ENCOUNTER_INVERSION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityAct target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + + er.setEncounter(CDAFactory.eINSTANCE.createEncounter()); + target.getEntryRelationships().add(er); + } + + @Override + public void addPassTests() { + + addPassTest(new PassTest() { + + @Override + public void updateToPass(ProcedureActivityAct target) { + // Test case with only entry Relationship + // Should pass + target.getEntryRelationships().clear(); + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + target.getEntryRelationships().add(er); + } + + }); + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + target.getEntryRelationships().clear(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setInversionInd(true); + er.setEncounter(CDAFactory.eINSTANCE.createEncounter()); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActEncounterInversion( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActEncounterInversionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProcedureActivityActServiceDeliveryLocationTypeCode() { + OperationsTestCase validateProcedureActivityActServiceDeliveryLocationTypeCodeTestCase = new OperationsTestCase( + "validateProcedureActivityActServiceDeliveryLocationTypeCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_SERVICE_DELIVERY_LOCATION_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityAct target) { + target.init(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setParticipantRole(ConsolFactory.eINSTANCE.createServiceDeliveryLocation()); + target.getParticipants().add(par); + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + target.getParticipants().clear(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setParticipantRole(ConsolFactory.eINSTANCE.createServiceDeliveryLocation()); + par.setTypeCode(ParticipationType.LOC); + target.getParticipants().add(par); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActServiceDeliveryLocationTypeCode( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActServiceDeliveryLocationTypeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProcedureActivityActInstructionsInversion() { + OperationsTestCase validateProcedureActivityActInstructionsInversionTestCase = new OperationsTestCase( + "validateProcedureActivityActInstructionsInversion", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_INSTRUCTIONS_INVERSION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityAct target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setAct(ConsolFactory.eINSTANCE.createInstructions()); + target.getEntryRelationships().add(er); + } + + @Override + public void addPassTests() { + + addPassTest(new PassTest() { + + @Override + public void updateToPass(ProcedureActivityAct target) { + // Test case with only entry Relationship + // Should pass + target.getEntryRelationships().clear(); + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + target.getEntryRelationships().add(er); + } + + }); + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + + target.getEntryRelationships().clear(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setInversionInd(true); + er.setAct(ConsolFactory.eINSTANCE.createInstructions()); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActInstructionsInversion( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActInstructionsInversionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureActivityActTemplateId() { + OperationsTestCase validateProcedureActivityActTemplateIdTestCase = new OperationsTestCase( + "validateProcedureActivityActTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityAct target) { + + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActTemplateId( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureActivityActClassCode() { + OperationsTestCase validateProcedureActivityActClassCodeTestCase = new OperationsTestCase( + "validateProcedureActivityActClassCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityAct target) { + + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActClassCode( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityActMoodCode() { + OperationsTestCase validateProcedureActivityActMoodCodeTestCase = new OperationsTestCase( + "validateProcedureActivityActMoodCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityAct target) { + + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + target.setMoodCode(x_DocumentActMood.EVN); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActMoodCode( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProcedureActivityActId() { + OperationsTestCase validateProcedureActivityActIdTestCase = new OperationsTestCase( + "validateProcedureActivityActId", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityAct target) { + + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + target.init(); + target.getIds().add(DatatypesFactory.eINSTANCE.createII()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActId( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProcedureActivityActCode() { + OperationsTestCase validateProcedureActivityActCodeTestCase = new OperationsTestCase( + "validateProcedureActivityActCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityAct target) { + + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + target.init(); + target.setCode(DatatypesFactory.eINSTANCE.createCE()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActCode( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProcedureActivityActStatusCode() { + OperationsTestCase validateProcedureActivityActStatusCodeTestCase = new OperationsTestCase( + "validateProcedureActivityActStatusCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityAct target) { + + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + target.init(); + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + cs.setCodeSystem("2.16.840.1.113883.5.14"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActStatusCode( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureActivityActEffectiveTime() { + OperationsTestCase validateProcedureActivityActEffectiveTimeTestCase = new OperationsTestCase( + "validateProcedureActivityActEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityAct target) { + + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActEffectiveTime( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProcedureActivityActPriorityCode() { + OperationsTestCase validateProcedureActivityActPriorityCodeTestCase = new OperationsTestCase( + "validateProcedureActivityActPriorityCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_PRIORITY_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityAct target) { + + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + target.init(); + CE pc = DatatypesFactory.eINSTANCE.createCE("A", "2.16.840.1.113883.5.7"); + target.setPriorityCode(pc); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActPriorityCode( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActPriorityCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityActPriorityCodeP() { + OperationsTestCase validateProcedureActivityActPriorityCodePTestCase = new OperationsTestCase( + "validateProcedureActivityActPriorityCodeP", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_PRIORITY_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityAct target) { + + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + target.init(); + CE pc = DatatypesFactory.eINSTANCE.createCE("aaa", "bbb"); + target.setPriorityCode(pc); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActPriorityCodeP( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActPriorityCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityActPerformer() { + OperationsTestCase validateProcedureActivityActPerformerTestCase = new OperationsTestCase( + "validateProcedureActivityActPerformer", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_PERFORMER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityAct target) { + target.init(); + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + target.getPerformers().add(CDAFactory.eINSTANCE.createPerformer2()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActPerformer( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActPerformerTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProcedureActivityActServiceDeliveryLocation() { + OperationsTestCase validateProcedureActivityActServiceDeliveryLocationTestCase = new OperationsTestCase( + "validateProcedureActivityActServiceDeliveryLocation", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_SERVICE_DELIVERY_LOCATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityAct target) { + + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + target.init(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setParticipantRole(ConsolFactory.eINSTANCE.createServiceDeliveryLocation()); + target.getParticipants().add(par); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActServiceDeliveryLocation( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActServiceDeliveryLocationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProcedureActivityActInstructions() { + OperationsTestCase validateProcedureActivityActInstructionsTestCase = new OperationsTestCase( + "validateProcedureActivityActInstructions", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_INSTRUCTIONS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityAct target) { + + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + er.setAct(ConsolFactory.eINSTANCE.createInstructions()); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActInstructions( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActInstructionsTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProcedureActivityActIndication() { + OperationsTestCase validateProcedureActivityActIndicationTestCase = new OperationsTestCase( + "validateProcedureActivityActIndication", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_INDICATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityAct target) { + + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.RSON); + er.setObservation(ConsolFactory.eINSTANCE.createIndication()); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActIndication( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActIndicationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProcedureActivityActMedicationActivity() { + OperationsTestCase validateProcedureActivityActMedicationActivityTestCase = new OperationsTestCase( + "validateProcedureActivityActMedicationActivity", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_MEDICATION_ACTIVITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityAct target) { + + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + er.setSubstanceAdministration(ConsolFactory.eINSTANCE.createMedicationActivity()); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActMedicationActivity( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActMedicationActivityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityActEntryRelationship() { + OperationsTestCase validateProcedureActivityActEntryRelationshipTestCase = new OperationsTestCase( + "validateProcedureActivityActEntryRelationship", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_ENTRY_RELATIONSHIP__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityAct target) { + + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + er.setEncounter(CDAFactory.eINSTANCE.createEncounter()); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActEntryRelationship( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActEntryRelationshipTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityActProcedureActPerformerAssignedEntity() { + OperationsTestCase validateProcedureActivityActProcedureActPerformerAssignedEntityTestCase = new OperationsTestCase( + "validateProcedureActivityActProcedureActPerformerAssignedEntity", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_PROCEDURE_ACT_PERFORMER_ASSIGNED_ENTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityAct target) { + target.init(); + target.getPerformers().add(CDAFactory.eINSTANCE.createPerformer2()); + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + target.getPerformers().clear(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + per.setAssignedEntity(CDAFactory.eINSTANCE.createAssignedEntity()); + target.getPerformers().add(per); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActProcedureActPerformerAssignedEntity( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActProcedureActPerformerAssignedEntityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityActProcedureActPerformerAssignedEntityId() { + OperationsTestCase validateProcedureActivityActProcedureActPerformerAssignedEntityIdTestCase = new OperationsTestCase( + "validateProcedureActivityActProcedureActPerformerAssignedEntityId", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_PROCEDURE_ACT_PERFORMER_ASSIGNED_ENTITY_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityAct target) { + target.init(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + per.setAssignedEntity(CDAFactory.eINSTANCE.createAssignedEntity()); + target.getPerformers().add(per); + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + target.getPerformers().clear(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getIds().add(DatatypesFactory.eINSTANCE.createII()); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActProcedureActPerformerAssignedEntityId( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActProcedureActPerformerAssignedEntityIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityActProcedureActPerformerAssignedEntityAddr() { + OperationsTestCase validateProcedureActivityActProcedureActPerformerAssignedEntityAddrTestCase = new OperationsTestCase( + "validateProcedureActivityActProcedureActPerformerAssignedEntityAddr", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_PROCEDURE_ACT_PERFORMER_ASSIGNED_ENTITY_ADDR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityAct target) { + target.init(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + per.setAssignedEntity(CDAFactory.eINSTANCE.createAssignedEntity()); + target.getPerformers().add(per); + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + target.getPerformers().clear(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActProcedureActPerformerAssignedEntityAddr( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActProcedureActPerformerAssignedEntityAddrTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityActProcedureActPerformerAssignedEntityTelecom() { + OperationsTestCase validateProcedureActivityActProcedureActPerformerAssignedEntityTelecomTestCase = new OperationsTestCase( + "validateProcedureActivityActProcedureActPerformerAssignedEntityTelecom", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_PROCEDURE_ACT_PERFORMER_ASSIGNED_ENTITY_TELECOM__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityAct target) { + target.init(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + per.setAssignedEntity(CDAFactory.eINSTANCE.createAssignedEntity()); + target.getPerformers().add(per); + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + target.getPerformers().clear(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getTelecoms().add(DatatypesFactory.eINSTANCE.createTEL()); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActProcedureActPerformerAssignedEntityTelecom( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActProcedureActPerformerAssignedEntityTelecomTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityActProcedureActPerformerAssignedEntityRepOrg() { + OperationsTestCase validateProcedureActivityActProcedureActPerformerAssignedEntityRepOrgTestCase = new OperationsTestCase( + "validateProcedureActivityActProcedureActPerformerAssignedEntityRepOrg", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_PROCEDURE_ACT_PERFORMER_ASSIGNED_ENTITY_REP_ORG__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityAct target) { + target.init(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + per.setAssignedEntity(CDAFactory.eINSTANCE.createAssignedEntity()); + target.getPerformers().add(per); + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + target.getPerformers().clear(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getRepresentedOrganizations().add(CDAFactory.eINSTANCE.createOrganization()); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActProcedureActPerformerAssignedEntityRepOrg( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActProcedureActPerformerAssignedEntityRepOrgTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityActProcedureActPerformerAssignedEntityRepOrgId() { + OperationsTestCase validateProcedureActivityActProcedureActPerformerAssignedEntityRepOrgIdTestCase = new OperationsTestCase( + "validateProcedureActivityActProcedureActPerformerAssignedEntityRepOrgId", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_PROCEDURE_ACT_PERFORMER_ASSIGNED_ENTITY_REP_ORG_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityAct target) { + target.init(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getRepresentedOrganizations().add(CDAFactory.eINSTANCE.createOrganization()); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + target.getPerformers().clear(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + Organization org = CDAFactory.eINSTANCE.createOrganization(); + org.getIds().add(DatatypesFactory.eINSTANCE.createII()); + ae.getRepresentedOrganizations().add(org); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActProcedureActPerformerAssignedEntityRepOrgId( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActProcedureActPerformerAssignedEntityRepOrgIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityActProcedureActPerformerAssignedEntityRepOrgName() { + OperationsTestCase validateProcedureActivityActProcedureActPerformerAssignedEntityRepOrgNameTestCase = new OperationsTestCase( + "validateProcedureActivityActProcedureActPerformerAssignedEntityRepOrgName", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_PROCEDURE_ACT_PERFORMER_ASSIGNED_ENTITY_REP_ORG_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityAct target) { + target.init(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getRepresentedOrganizations().add(CDAFactory.eINSTANCE.createOrganization()); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + target.getPerformers().clear(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + Organization org = CDAFactory.eINSTANCE.createOrganization(); + org.getNames().add(DatatypesFactory.eINSTANCE.createON()); + ae.getRepresentedOrganizations().add(org); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActProcedureActPerformerAssignedEntityRepOrgName( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActProcedureActPerformerAssignedEntityRepOrgNameTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityActProcedureActPerformerAssignedEntityRepOrgAddr() { + OperationsTestCase validateProcedureActivityActProcedureActPerformerAssignedEntityRepOrgAddrTestCase = new OperationsTestCase( + "validateProcedureActivityActProcedureActPerformerAssignedEntityRepOrgAddr", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_PROCEDURE_ACT_PERFORMER_ASSIGNED_ENTITY_REP_ORG_ADDR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityAct target) { + target.init(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getRepresentedOrganizations().add(CDAFactory.eINSTANCE.createOrganization()); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + target.getPerformers().clear(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + Organization org = CDAFactory.eINSTANCE.createOrganization(); + org.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + ae.getRepresentedOrganizations().add(org); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActProcedureActPerformerAssignedEntityRepOrgAddr( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActProcedureActPerformerAssignedEntityRepOrgAddrTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityActProcedureActPerformerAssignedEntityRepOrgTelecom() { + OperationsTestCase validateProcedureActivityActProcedureActPerformerAssignedEntityRepOrgTelecomTestCase = new OperationsTestCase( + "validateProcedureActivityActProcedureActPerformerAssignedEntityRepOrgTelecom", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_PROCEDURE_ACT_PERFORMER_ASSIGNED_ENTITY_REP_ORG_TELECOM__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityAct target) { + target.init(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getRepresentedOrganizations().add(CDAFactory.eINSTANCE.createOrganization()); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + target.getPerformers().clear(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + Organization org = CDAFactory.eINSTANCE.createOrganization(); + org.getTelecoms().add(DatatypesFactory.eINSTANCE.createTEL()); + ae.getRepresentedOrganizations().add(org); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActProcedureActPerformerAssignedEntityRepOrgTelecom( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActProcedureActPerformerAssignedEntityRepOrgTelecomTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityActEntryRelationshipProcedureActEncounterClassCode() { + OperationsTestCase validateProcedureActivityActEntryRelationshipProcedureActEncounterClassCodeTestCase = new OperationsTestCase( + "validateProcedureActivityActEntryRelationshipProcedureActEncounterClassCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_ENTRY_RELATIONSHIP_PROCEDURE_ACT_ENCOUNTER_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityAct target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + er.setEncounter(CDAFactory.eINSTANCE.createEncounter()); + target.getEntryRelationships().add(er); + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + target.getEntryRelationships().clear(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + Encounter enc = CDAFactory.eINSTANCE.createEncounter(); + enc.setClassCode(ActClass.ENC); + er.setEncounter(enc); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActEntryRelationshipProcedureActEncounterClassCode( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActEntryRelationshipProcedureActEncounterClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityActEntryRelationshipProcedureActEncounterMoodCode() { + OperationsTestCase validateProcedureActivityActEntryRelationshipProcedureActEncounterMoodCodeTestCase = new OperationsTestCase( + "validateProcedureActivityActEntryRelationshipProcedureActEncounterMoodCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_ENTRY_RELATIONSHIP_PROCEDURE_ACT_ENCOUNTER_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityAct target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + er.setEncounter(CDAFactory.eINSTANCE.createEncounter()); + target.getEntryRelationships().add(er); + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + target.getEntryRelationships().clear(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + Encounter enc = CDAFactory.eINSTANCE.createEncounter(); + enc.setMoodCode(x_DocumentEncounterMood.EVN); + er.setEncounter(enc); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActEntryRelationshipProcedureActEncounterMoodCode( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActEntryRelationshipProcedureActEncounterMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityActEntryRelationshipProcedureActEncounterId() { + OperationsTestCase validateProcedureActivityActEntryRelationshipProcedureActEncounterIdTestCase = new OperationsTestCase( + "validateProcedureActivityActEntryRelationshipProcedureActEncounterId", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_ENTRY_RELATIONSHIP_PROCEDURE_ACT_ENCOUNTER_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityAct target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + er.setEncounter(CDAFactory.eINSTANCE.createEncounter()); + target.getEntryRelationships().add(er); + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + target.getEntryRelationships().clear(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + Encounter enc = CDAFactory.eINSTANCE.createEncounter(); + enc.getIds().add(DatatypesFactory.eINSTANCE.createII()); + er.setEncounter(enc); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActEntryRelationshipProcedureActEncounterId( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActEntryRelationshipProcedureActEncounterIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityActEntryRelationshipInversionInd() { + OperationsTestCase validateProcedureActivityActEntryRelationshipInversionIndTestCase = new OperationsTestCase( + "validateProcedureActivityActEntryRelationshipInversionInd", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_ENTRY_RELATIONSHIP_INVERSION_IND__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityAct target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + er.setEncounter(CDAFactory.eINSTANCE.createEncounter()); + target.getEntryRelationships().add(er); + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + target.getEntryRelationships().clear(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + er.setInversionInd(true); + Encounter enc = CDAFactory.eINSTANCE.createEncounter(); + enc.setMoodCode(x_DocumentEncounterMood.EVN); + er.setEncounter(enc); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActEntryRelationshipInversionInd( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActEntryRelationshipInversionIndTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityActEntryRelationshipTypeCode() { + OperationsTestCase validateProcedureActivityActEntryRelationshipTypeCodeTestCase = new OperationsTestCase( + "validateProcedureActivityActEntryRelationshipTypeCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_ENTRY_RELATIONSHIP_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + { + this.skipFailsTest(); + } + + @Override + protected void updateToFail(ProcedureActivityAct target) { + + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + target.init(); + target.getEntryRelationships().clear(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + er.setEncounter(CDAFactory.eINSTANCE.createEncounter()); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActEntryRelationshipTypeCode( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActEntryRelationshipTypeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityActEntryRelationshipProcedureActEncounter() { + OperationsTestCase validateProcedureActivityActEntryRelationshipProcedureActEncounterTestCase = new OperationsTestCase( + "validateProcedureActivityActEntryRelationshipProcedureActEncounter", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_ACT_ENTRY_RELATIONSHIP_PROCEDURE_ACT_ENCOUNTER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + { + this.skipFailsTest(); + } + + @Override + protected void updateToFail(ProcedureActivityAct target) { + + } + + @Override + protected void updateToPass(ProcedureActivityAct target) { + target.init(); + target.getEntryRelationships().clear(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + er.setEncounter(CDAFactory.eINSTANCE.createEncounter()); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityActOperations.validateProcedureActivityActEntryRelationshipProcedureActEncounter( + (ProcedureActivityAct) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityActEntryRelationshipProcedureActEncounterTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetServiceDeliveryLocations() { + + ProcedureActivityAct target = objectFactory.create(); + target.getServiceDeliveryLocations(); + + } + + /** + * + * @generated + */ + @Test + public void testGetInstructions() { + + ProcedureActivityAct target = objectFactory.create(); + target.getInstructions(); + + } + + /** + * + * @generated + */ + @Test + public void testGetIndications() { + + ProcedureActivityAct target = objectFactory.create(); + target.getIndications(); + + } + + /** + * + * @generated + */ + @Test + public void testGetMedicationActivity() { + + ProcedureActivityAct target = objectFactory.create(); + target.getMedicationActivity(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ProcedureActivityActOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ProcedureActivityAct create() { + return ConsolFactory.eINSTANCE.createProcedureActivityAct(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ProcedureActivityActOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ProcedureActivityActOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProcedureActivityObservationTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProcedureActivityObservationTest.java new file mode 100644 index 000000000..c74cb393e --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProcedureActivityObservationTest.java @@ -0,0 +1,1931 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.AssignedEntity; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Encounter; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.Organization; +import org.openhealthtools.mdht.uml.cda.Participant2; +import org.openhealthtools.mdht.uml.cda.Performer2; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ConsolPackage; +import org.openhealthtools.mdht.uml.cda.consol.GeneralStatusSection; +import org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityObservation; +import org.openhealthtools.mdht.uml.cda.consol.operations.ProcedureActivityObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.datatypes.TEL; +import org.openhealthtools.mdht.uml.hl7.vocab.ActClass; +import org.openhealthtools.mdht.uml.hl7.vocab.ParticipationType; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActMoodDocumentObservation; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; +import org.openhealthtools.mdht.uml.hl7.vocab.x_DocumentEncounterMood; + +/** + * + * A static utility class that provides operations related to 'Procedure Activity Observation' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityObservation#validateProcedureActivityObservationCodeCodeSystems(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Code Code Systems}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityObservation#validateProcedureActivityObservationCodeOriginalText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Code Original Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityObservation#validateProcedureActivityObservationOriginalTextReference(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Original Text Reference}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityObservation#validateProcedureActivityObservationOriginalTextReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Original Text Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityObservation#validateProcedureActivityObservationReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityObservation#validateProcedureActivityObservationEncounterInversion(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Encounter Inversion}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityObservation#validateProcedureActivityObservationServiceDeliveryLocationTypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Service Delivery Location Type Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityObservation#validateProcedureActivityObservationInstructionsInversion(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Instructions Inversion}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityObservation#validateProcedureActivityObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityObservation#validateProcedureActivityObservationClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityObservation#validateProcedureActivityObservationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityObservation#validateProcedureActivityObservationId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityObservation#validateProcedureActivityObservationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityObservation#validateProcedureActivityObservationStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityObservation#validateProcedureActivityObservationValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityObservation#validateProcedureActivityObservationEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityObservation#validateProcedureActivityObservationPriorityCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Priority Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityObservation#validateProcedureActivityObservationPriorityCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Priority Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityObservation#validateProcedureActivityObservationMethodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Method Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityObservation#validateProcedureActivityObservationTargetSiteCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Target Site Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityObservation#validateProcedureActivityObservationTargetSiteCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Target Site Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityObservation#validateProcedureActivityObservationPerformer(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Performer}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityObservation#validateProcedureActivityObservationServiceDeliveryLocation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Service Delivery Location}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityObservation#validateProcedureActivityObservationInstructions(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Instructions}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityObservation#validateProcedureActivityObservationIndication(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Indication}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityObservation#validateProcedureActivityObservationMedicationActivity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Medication Activity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityObservation#validateProcedureActivityObservationEntryRelationship(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Entry Relationship}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityObservation#validateProcedureActivityObservationProcedureObservationPerformerAssignedEntity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Procedure Observation Performer Assigned Entity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityObservation#validateProcedureActivityObservationProcedureObservationPerformerAssignedEntityId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Procedure Observation Performer Assigned Entity Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityObservation#validateProcedureActivityObservationProcedureObservationPerformerAssignedEntityAddr(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Procedure Observation Performer Assigned Entity Addr}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityObservation#validateProcedureActivityObservationProcedureObservationPerformerAssignedEntityTelecom(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Procedure Observation Performer Assigned Entity Telecom}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityObservation#validateProcedureActivityObservationProcedureObservationPerformerAssignedEntityRepOrg(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Procedure Observation Performer Assigned Entity Rep Org}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityObservation#validateProcedureActivityObservationProcedureObservationPerformerAssignedEntityRepOrgId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Procedure Observation Performer Assigned Entity Rep Org Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityObservation#validateProcedureActivityObservationProcedureObservationPerformerAssignedEntityRepOrgName(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Procedure Observation Performer Assigned Entity Rep Org Name}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityObservation#validateProcedureActivityObservationProcedureObservationPerformerAssignedEntityRepOrgAddr(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Procedure Observation Performer Assigned Entity Rep Org Addr}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityObservation#validateProcedureActivityObservationProcedureObservationPerformerAssignedEntityRepOrgTelecom(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Procedure Observation Performer Assigned Entity Rep Org Telecom}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityObservation#validateProcedureActivityObservationEntryRelationshipProcedureObservationEncounterClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Entry Relationship Procedure Observation Encounter Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityObservation#validateProcedureActivityObservationEntryRelationshipProcedureObservationEncounterMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Entry Relationship Procedure Observation Encounter Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityObservation#validateProcedureActivityObservationEntryRelationshipProcedureObservationEncounterId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Entry Relationship Procedure Observation Encounter Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityObservation#validateProcedureActivityObservationEntryRelationshipInversionInd(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Entry Relationship Inversion Ind}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityObservation#validateProcedureActivityObservationEntryRelationshipTypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Entry Relationship Type Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityObservation#validateProcedureActivityObservationEntryRelationshipProcedureObservationEncounter(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Observation Entry Relationship Procedure Observation Encounter}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityObservation#getServiceDeliveryLocations() Get Service Delivery Locations}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityObservation#getInstructions() Get Instructions}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityObservation#getIndications() Get Indications}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityObservation#getMedicationActivity() Get Medication Activity}
  • + *
+ *

+ * + * @generated + */ + +public class ProcedureActivityObservationTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateProcedureActivityObservationCodeCodeSystems() { + OperationsTestCase validateProcedureActivityObservationCodeCodeSystemsTestCase = new OperationsTestCase( + "validateProcedureActivityObservationCodeCodeSystems", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_CODE_CODE_SYSTEMS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + target.init(); + CD code = DatatypesFactory.eINSTANCE.createCD(); + code.setCodeSystem("2.16.840.1.113883.6.96"); + target.setCode(code); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationCodeCodeSystems( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationCodeCodeSystemsTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProcedureActivityObservationCodeOriginalText() { + OperationsTestCase validateProcedureActivityObservationCodeOriginalTextTestCase = new OperationsTestCase( + "validateProcedureActivityObservationCodeOriginalText", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_CODE_ORIGINAL_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + target.init(); + CD code = DatatypesFactory.eINSTANCE.createCD(); + + target.setCode(code); + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + + CD code = DatatypesFactory.eINSTANCE.createCD(); + code.setOriginalText(DatatypesFactory.eINSTANCE.createED()); + target.setCode(code); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationCodeOriginalText( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationCodeOriginalTextTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityObservationOriginalTextReference() { + OperationsTestCase validateProcedureActivityObservationOriginalTextReferenceTestCase = new OperationsTestCase( + "validateProcedureActivityObservationOriginalTextReference", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_ORIGINAL_TEXT_REFERENCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + target.init(); + CD code = DatatypesFactory.eINSTANCE.createCD(); + ED ot = DatatypesFactory.eINSTANCE.createED(); + + code.setOriginalText(ot); + target.setCode(code); + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + CD code = DatatypesFactory.eINSTANCE.createCD(); + ED ot = DatatypesFactory.eINSTANCE.createED(); + TEL ref = DatatypesFactory.eINSTANCE.createTEL(); + ref.setValue("test"); + ot.setReference(ref); + code.setOriginalText(ot); + target.setCode(code); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationOriginalTextReference( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationOriginalTextReferenceTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProcedureActivityObservationOriginalTextReferenceValue() { + OperationsTestCase validateProcedureActivityObservationOriginalTextReferenceValueTestCase = new OperationsTestCase( + "validateProcedureActivityObservationOriginalTextReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_ORIGINAL_TEXT_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + target.init(); + CD code = DatatypesFactory.eINSTANCE.createCD(); + ED ot = DatatypesFactory.eINSTANCE.createED(); + TEL ref = DatatypesFactory.eINSTANCE.createTEL(); + ot.setReference(ref); + code.setOriginalText(ot); + target.setCode(code); + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + CD code = DatatypesFactory.eINSTANCE.createCD(); + ED ot = DatatypesFactory.eINSTANCE.createED(); + TEL ref = DatatypesFactory.eINSTANCE.createTEL(); + ref.setValue("test"); + ot.setReference(ref); + code.setOriginalText(ot); + target.setCode(code); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationOriginalTextReferenceValue( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationOriginalTextReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityObservationReferenceValue() { + OperationsTestCase validateProcedureActivityObservationReferenceValueTestCase = new NarrativeReferenceTestCase( + "validateProcedureActivityObservationReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + target.init(); + + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), "", + "No particular procedure observed."); + + // add a reference to the section text + target.setCode(createCDWithOriginalTextReference("Some sample text", "#1.2.3.4")); + + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), + "1.2.3.4", "No particular procedure observed."); + + // add a reference to the section text + target.setCode(createCDWithOriginalTextReference("Some sample text", "#1.2.3.4")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationReferenceValue( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProcedureActivityObservationEncounterInversion() { + OperationsTestCase validateProcedureActivityObservationEncounterInversionTestCase = new OperationsTestCase( + "validateProcedureActivityObservationEncounterInversion", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_ENCOUNTER_INVERSION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + + er.setEncounter(CDAFactory.eINSTANCE.createEncounter()); + target.getEntryRelationships().add(er); + } + + @Override + public void addPassTests() { + + addPassTest(new PassTest() { + + @Override + public void updateToPass(ProcedureActivityObservation target) { + // Test case with only entry Relationship + // Should pass + target.getEntryRelationships().clear(); + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + target.getEntryRelationships().add(er); + } + + }); + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + target.getEntryRelationships().clear(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setInversionInd(true); + er.setEncounter(CDAFactory.eINSTANCE.createEncounter()); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationEncounterInversion( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationEncounterInversionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProcedureActivityObservationServiceDeliveryLocationTypeCode() { + OperationsTestCase validateProcedureActivityObservationServiceDeliveryLocationTypeCodeTestCase = new OperationsTestCase( + "validateProcedureActivityObservationServiceDeliveryLocationTypeCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_SERVICE_DELIVERY_LOCATION_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + target.init(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setParticipantRole(ConsolFactory.eINSTANCE.createServiceDeliveryLocation()); + target.getParticipants().add(par); + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + target.getParticipants().clear(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setParticipantRole(ConsolFactory.eINSTANCE.createServiceDeliveryLocation()); + par.setTypeCode(ParticipationType.LOC); + target.getParticipants().add(par); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationServiceDeliveryLocationTypeCode( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationServiceDeliveryLocationTypeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProcedureActivityObservationInstructionsInversion() { + OperationsTestCase validateProcedureActivityObservationInstructionsInversionTestCase = new OperationsTestCase( + "validateProcedureActivityObservationInstructionsInversion", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_INSTRUCTIONS_INVERSION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setAct(ConsolFactory.eINSTANCE.createInstructions()); + target.getEntryRelationships().add(er); + } + + @Override + public void addPassTests() { + + addPassTest(new PassTest() { + + @Override + public void updateToPass(ProcedureActivityObservation target) { + // Test case with only entry Relationship + // Should pass + target.getEntryRelationships().clear(); + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + target.getEntryRelationships().add(er); + } + + }); + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + target.getEntryRelationships().clear(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setInversionInd(true); + er.setAct(ConsolFactory.eINSTANCE.createInstructions()); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationInstructionsInversion( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationInstructionsInversionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureActivityObservationTemplateId() { + OperationsTestCase validateProcedureActivityObservationTemplateIdTestCase = new OperationsTestCase( + "validateProcedureActivityObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationTemplateId( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureActivityObservationClassCode() { + OperationsTestCase validateProcedureActivityObservationClassCodeTestCase = new OperationsTestCase( + "validateProcedureActivityObservationClassCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationClassCode( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityObservationMoodCode() { + OperationsTestCase validateProcedureActivityObservationMoodCodeTestCase = new OperationsTestCase( + "validateProcedureActivityObservationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + target.init(); + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + + target.setMoodCode(x_ActMoodDocumentObservation.EVN); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationMoodCode( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureActivityObservationId() { + OperationsTestCase validateProcedureActivityObservationIdTestCase = new OperationsTestCase( + "validateProcedureActivityObservationId", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + target.init(); + + II ii = DatatypesFactory.eINSTANCE.createII(); + target.getIds().add(ii); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationId( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityObservationCode() { + OperationsTestCase validateProcedureActivityObservationCodeTestCase = new OperationsTestCase( + "validateProcedureActivityObservationCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + target.init(); + + CE cd = DatatypesFactory.eINSTANCE.createCE(); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationCode( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProcedureActivityObservationStatusCode() { + OperationsTestCase validateProcedureActivityObservationStatusCodeTestCase = new OperationsTestCase( + "validateProcedureActivityObservationStatusCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + cs.setCodeSystem("2.16.840.1.113883.5.14"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationStatusCode( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureActivityObservationValue() { + OperationsTestCase validateProcedureActivityObservationValueTestCase = new OperationsTestCase( + "validateProcedureActivityObservationValue", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD(); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationValue( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureActivityObservationEffectiveTime() { + OperationsTestCase validateProcedureActivityObservationEffectiveTimeTestCase = new OperationsTestCase( + "validateProcedureActivityObservationEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationEffectiveTime( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProcedureActivityObservationPriorityCode() { + OperationsTestCase validateProcedureActivityObservationPriorityCodeTestCase = new OperationsTestCase( + "validateProcedureActivityObservationPriorityCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_PRIORITY_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + target.init(); + CE pc = DatatypesFactory.eINSTANCE.createCE("A", "2.16.840.1.113883.5.7"); + target.setPriorityCode(pc); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationPriorityCode( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationPriorityCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityObservationPriorityCodeP() { + OperationsTestCase validateProcedureActivityObservationPriorityCodePTestCase = new OperationsTestCase( + "validateProcedureActivityObservationPriorityCodeP", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_PRIORITY_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + target.init(); + CE pc = DatatypesFactory.eINSTANCE.createCE("aaa", "bbb"); + target.setPriorityCode(pc); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationPriorityCodeP( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationPriorityCodePTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProcedureActivityObservationMethodCode() { + OperationsTestCase validateProcedureActivityObservationMethodCodeTestCase = new OperationsTestCase( + "validateProcedureActivityObservationMethodCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_METHOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + target.init(); + target.getMethodCodes().add(DatatypesFactory.eINSTANCE.createCE()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationMethodCode( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationMethodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProcedureActivityObservationTargetSiteCode() { + OperationsTestCase validateProcedureActivityObservationTargetSiteCodeTestCase = new OperationsTestCase( + "validateProcedureActivityObservationTargetSiteCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_TARGET_SITE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + target.init(); + target.getTargetSiteCodes().add(DatatypesFactory.eINSTANCE.createCD()); + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + target.getTargetSiteCodes().clear(); + CD tsc = DatatypesFactory.eINSTANCE.createCD(); + tsc.setCodeSystem("2.16.840.1.113883.6.96"); + tsc.setCode("test"); + target.getTargetSiteCodes().add(tsc); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationTargetSiteCode( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationTargetSiteCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureActivityObservationTargetSiteCodeP() { + OperationsTestCase validateProcedureActivityObservationTargetSiteCodePTestCase = new OperationsTestCase( + "validateProcedureActivityObservationTargetSiteCodeP", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_TARGET_SITE_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationTargetSiteCodeP( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationTargetSiteCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityObservationPerformer() { + OperationsTestCase validateProcedureActivityObservationPerformerTestCase = new OperationsTestCase( + "validateProcedureActivityObservationPerformer", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_PERFORMER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + target.init(); + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + target.getPerformers().add(CDAFactory.eINSTANCE.createPerformer2()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationPerformer( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationPerformerTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProcedureActivityObservationServiceDeliveryLocation() { + OperationsTestCase validateProcedureActivityObservationServiceDeliveryLocationTestCase = new OperationsTestCase( + "validateProcedureActivityObservationServiceDeliveryLocation", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_SERVICE_DELIVERY_LOCATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + target.init(); + + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setParticipantRole(ConsolFactory.eINSTANCE.createServiceDeliveryLocation()); + target.getParticipants().add(par); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationServiceDeliveryLocation( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationServiceDeliveryLocationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProcedureActivityObservationInstructions() { + OperationsTestCase validateProcedureActivityObservationInstructionsTestCase = new OperationsTestCase( + "validateProcedureActivityObservationInstructions", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_INSTRUCTIONS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + er.setAct(ConsolFactory.eINSTANCE.createInstructions()); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationInstructions( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationInstructionsTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProcedureActivityObservationIndication() { + OperationsTestCase validateProcedureActivityObservationIndicationTestCase = new OperationsTestCase( + "validateProcedureActivityObservationIndication", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_INDICATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.RSON); + er.setObservation(ConsolFactory.eINSTANCE.createIndication()); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationIndication( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationIndicationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProcedureActivityObservationMedicationActivity() { + OperationsTestCase validateProcedureActivityObservationMedicationActivityTestCase = new OperationsTestCase( + "validateProcedureActivityObservationMedicationActivity", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_MEDICATION_ACTIVITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + er.setSubstanceAdministration(ConsolFactory.eINSTANCE.createMedicationActivity()); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationMedicationActivity( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationMedicationActivityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityObservationEntryRelationship() { + OperationsTestCase validateProcedureActivityObservationEntryRelationshipTestCase = new OperationsTestCase( + "validateProcedureActivityObservationEntryRelationship", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_ENTRY_RELATIONSHIP__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + er.setEncounter(CDAFactory.eINSTANCE.createEncounter()); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationEntryRelationship( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationEntryRelationshipTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityObservationProcedureObservationPerformerAssignedEntity() { + OperationsTestCase validateProcedureActivityObservationProcedureObservationPerformerAssignedEntityTestCase = new OperationsTestCase( + "validateProcedureActivityObservationProcedureObservationPerformerAssignedEntity", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_PROCEDURE_OBSERVATION_PERFORMER_ASSIGNED_ENTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + target.init(); + target.getPerformers().add(CDAFactory.eINSTANCE.createPerformer2()); + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + target.getPerformers().clear(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + per.setAssignedEntity(CDAFactory.eINSTANCE.createAssignedEntity()); + target.getPerformers().add(per); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationProcedureObservationPerformerAssignedEntity( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationProcedureObservationPerformerAssignedEntityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityObservationProcedureObservationPerformerAssignedEntityId() { + OperationsTestCase validateProcedureActivityObservationProcedureObservationPerformerAssignedEntityIdTestCase = new OperationsTestCase( + "validateProcedureActivityObservationProcedureObservationPerformerAssignedEntityId", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_PROCEDURE_OBSERVATION_PERFORMER_ASSIGNED_ENTITY_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + target.init(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + per.setAssignedEntity(CDAFactory.eINSTANCE.createAssignedEntity()); + target.getPerformers().add(per); + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + target.getPerformers().clear(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getIds().add(DatatypesFactory.eINSTANCE.createII()); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationProcedureObservationPerformerAssignedEntityId( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationProcedureObservationPerformerAssignedEntityIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityObservationProcedureObservationPerformerAssignedEntityAddr() { + OperationsTestCase validateProcedureActivityObservationProcedureObservationPerformerAssignedEntityAddrTestCase = new OperationsTestCase( + "validateProcedureActivityObservationProcedureObservationPerformerAssignedEntityAddr", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_PROCEDURE_OBSERVATION_PERFORMER_ASSIGNED_ENTITY_ADDR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + target.init(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + per.setAssignedEntity(CDAFactory.eINSTANCE.createAssignedEntity()); + target.getPerformers().add(per); + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + target.getPerformers().clear(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationProcedureObservationPerformerAssignedEntityAddr( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationProcedureObservationPerformerAssignedEntityAddrTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityObservationProcedureObservationPerformerAssignedEntityTelecom() { + OperationsTestCase validateProcedureActivityObservationProcedureObservationPerformerAssignedEntityTelecomTestCase = new OperationsTestCase( + "validateProcedureActivityObservationProcedureObservationPerformerAssignedEntityTelecom", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_PROCEDURE_OBSERVATION_PERFORMER_ASSIGNED_ENTITY_TELECOM__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + target.init(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + per.setAssignedEntity(CDAFactory.eINSTANCE.createAssignedEntity()); + target.getPerformers().add(per); + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + target.getPerformers().clear(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getTelecoms().add(DatatypesFactory.eINSTANCE.createTEL()); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationProcedureObservationPerformerAssignedEntityTelecom( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationProcedureObservationPerformerAssignedEntityTelecomTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityObservationProcedureObservationPerformerAssignedEntityRepOrg() { + OperationsTestCase validateProcedureActivityObservationProcedureObservationPerformerAssignedEntityRepOrgTestCase = new OperationsTestCase( + "validateProcedureActivityObservationProcedureObservationPerformerAssignedEntityRepOrg", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_PROCEDURE_OBSERVATION_PERFORMER_ASSIGNED_ENTITY_REP_ORG__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + target.init(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + per.setAssignedEntity(CDAFactory.eINSTANCE.createAssignedEntity()); + target.getPerformers().add(per); + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + target.getPerformers().clear(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getRepresentedOrganizations().add(CDAFactory.eINSTANCE.createOrganization()); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationProcedureObservationPerformerAssignedEntityRepOrg( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationProcedureObservationPerformerAssignedEntityRepOrgTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityObservationProcedureObservationPerformerAssignedEntityRepOrgId() { + OperationsTestCase validateProcedureActivityObservationProcedureObservationPerformerAssignedEntityRepOrgIdTestCase = new OperationsTestCase( + "validateProcedureActivityObservationProcedureObservationPerformerAssignedEntityRepOrgId", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_PROCEDURE_OBSERVATION_PERFORMER_ASSIGNED_ENTITY_REP_ORG_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + target.init(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getRepresentedOrganizations().add(CDAFactory.eINSTANCE.createOrganization()); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + target.getPerformers().clear(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + Organization org = CDAFactory.eINSTANCE.createOrganization(); + org.getIds().add(DatatypesFactory.eINSTANCE.createII()); + ae.getRepresentedOrganizations().add(org); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationProcedureObservationPerformerAssignedEntityRepOrgId( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationProcedureObservationPerformerAssignedEntityRepOrgIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityObservationProcedureObservationPerformerAssignedEntityRepOrgName() { + OperationsTestCase validateProcedureActivityObservationProcedureObservationPerformerAssignedEntityRepOrgNameTestCase = new OperationsTestCase( + "validateProcedureActivityObservationProcedureObservationPerformerAssignedEntityRepOrgName", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_PROCEDURE_OBSERVATION_PERFORMER_ASSIGNED_ENTITY_REP_ORG_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + target.init(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getRepresentedOrganizations().add(CDAFactory.eINSTANCE.createOrganization()); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + target.getPerformers().clear(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + Organization org = CDAFactory.eINSTANCE.createOrganization(); + org.getNames().add(DatatypesFactory.eINSTANCE.createON()); + ae.getRepresentedOrganizations().add(org); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationProcedureObservationPerformerAssignedEntityRepOrgName( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationProcedureObservationPerformerAssignedEntityRepOrgNameTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityObservationProcedureObservationPerformerAssignedEntityRepOrgAddr() { + OperationsTestCase validateProcedureActivityObservationProcedureObservationPerformerAssignedEntityRepOrgAddrTestCase = new OperationsTestCase( + "validateProcedureActivityObservationProcedureObservationPerformerAssignedEntityRepOrgAddr", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_PROCEDURE_OBSERVATION_PERFORMER_ASSIGNED_ENTITY_REP_ORG_ADDR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + target.init(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getRepresentedOrganizations().add(CDAFactory.eINSTANCE.createOrganization()); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + target.getPerformers().clear(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + Organization org = CDAFactory.eINSTANCE.createOrganization(); + org.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + ae.getRepresentedOrganizations().add(org); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationProcedureObservationPerformerAssignedEntityRepOrgAddr( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationProcedureObservationPerformerAssignedEntityRepOrgAddrTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityObservationProcedureObservationPerformerAssignedEntityRepOrgTelecom() { + OperationsTestCase validateProcedureActivityObservationProcedureObservationPerformerAssignedEntityRepOrgTelecomTestCase = new OperationsTestCase( + "validateProcedureActivityObservationProcedureObservationPerformerAssignedEntityRepOrgTelecom", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_PROCEDURE_OBSERVATION_PERFORMER_ASSIGNED_ENTITY_REP_ORG_TELECOM__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + target.init(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getRepresentedOrganizations().add(CDAFactory.eINSTANCE.createOrganization()); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + target.getPerformers().clear(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + Organization org = CDAFactory.eINSTANCE.createOrganization(); + org.getTelecoms().add(DatatypesFactory.eINSTANCE.createTEL()); + ae.getRepresentedOrganizations().add(org); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationProcedureObservationPerformerAssignedEntityRepOrgTelecom( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationProcedureObservationPerformerAssignedEntityRepOrgTelecomTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityObservationEntryRelationshipProcedureObservationEncounterClassCode() { + OperationsTestCase validateProcedureActivityObservationEntryRelationshipProcedureObservationEncounterClassCodeTestCase = new OperationsTestCase( + "validateProcedureActivityObservationEntryRelationshipProcedureObservationEncounterClassCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_ENTRY_RELATIONSHIP_PROCEDURE_OBSERVATION_ENCOUNTER_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + er.setEncounter(CDAFactory.eINSTANCE.createEncounter()); + target.getEntryRelationships().add(er); + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + target.getEntryRelationships().clear(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + Encounter enc = CDAFactory.eINSTANCE.createEncounter(); + enc.setClassCode(ActClass.ENC); + er.setEncounter(enc); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationEntryRelationshipProcedureObservationEncounterClassCode( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationEntryRelationshipProcedureObservationEncounterClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityObservationEntryRelationshipProcedureObservationEncounterMoodCode() { + OperationsTestCase validateProcedureActivityObservationEntryRelationshipProcedureObservationEncounterMoodCodeTestCase = new OperationsTestCase( + "validateProcedureActivityObservationEntryRelationshipProcedureObservationEncounterMoodCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_ENTRY_RELATIONSHIP_PROCEDURE_OBSERVATION_ENCOUNTER_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + er.setEncounter(CDAFactory.eINSTANCE.createEncounter()); + target.getEntryRelationships().add(er); + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + target.getEntryRelationships().clear(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + Encounter enc = CDAFactory.eINSTANCE.createEncounter(); + enc.setMoodCode(x_DocumentEncounterMood.EVN); + er.setEncounter(enc); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationEntryRelationshipProcedureObservationEncounterMoodCode( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationEntryRelationshipProcedureObservationEncounterMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityObservationEntryRelationshipProcedureObservationEncounterId() { + OperationsTestCase validateProcedureActivityObservationEntryRelationshipProcedureObservationEncounterIdTestCase = new OperationsTestCase( + "validateProcedureActivityObservationEntryRelationshipProcedureObservationEncounterId", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_ENTRY_RELATIONSHIP_PROCEDURE_OBSERVATION_ENCOUNTER_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + er.setEncounter(CDAFactory.eINSTANCE.createEncounter()); + target.getEntryRelationships().add(er); + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + target.getEntryRelationships().clear(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + Encounter enc = CDAFactory.eINSTANCE.createEncounter(); + enc.getIds().add(DatatypesFactory.eINSTANCE.createII()); + er.setEncounter(enc); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationEntryRelationshipProcedureObservationEncounterId( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationEntryRelationshipProcedureObservationEncounterIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityObservationEntryRelationshipInversionInd() { + OperationsTestCase validateProcedureActivityObservationEntryRelationshipInversionIndTestCase = new OperationsTestCase( + "validateProcedureActivityObservationEntryRelationshipInversionInd", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_ENTRY_RELATIONSHIP_INVERSION_IND__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + er.setEncounter(CDAFactory.eINSTANCE.createEncounter()); + target.getEntryRelationships().add(er); + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + target.getEntryRelationships().clear(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + er.setInversionInd(true); + Encounter enc = CDAFactory.eINSTANCE.createEncounter(); + enc.setMoodCode(x_DocumentEncounterMood.EVN); + er.setEncounter(enc); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationEntryRelationshipInversionInd( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationEntryRelationshipInversionIndTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityObservationEntryRelationshipTypeCode() { + OperationsTestCase validateProcedureActivityObservationEntryRelationshipTypeCodeTestCase = new OperationsTestCase( + "validateProcedureActivityObservationEntryRelationshipTypeCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_ENTRY_RELATIONSHIP_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + { + this.skipFailsTest(); + } + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + target.init(); + target.getEntryRelationships().clear(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + er.setEncounter(CDAFactory.eINSTANCE.createEncounter()); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationEntryRelationshipTypeCode( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationEntryRelationshipTypeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityObservationEntryRelationshipProcedureObservationEncounter() { + OperationsTestCase validateProcedureActivityObservationEntryRelationshipProcedureObservationEncounterTestCase = new OperationsTestCase( + "validateProcedureActivityObservationEntryRelationshipProcedureObservationEncounter", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_OBSERVATION_ENTRY_RELATIONSHIP_PROCEDURE_OBSERVATION_ENCOUNTER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + { + this.skipFailsTest(); + } + + @Override + protected void updateToFail(ProcedureActivityObservation target) { + + } + + @Override + protected void updateToPass(ProcedureActivityObservation target) { + target.init(); + target.getEntryRelationships().clear(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + er.setEncounter(CDAFactory.eINSTANCE.createEncounter()); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityObservationOperations.validateProcedureActivityObservationEntryRelationshipProcedureObservationEncounter( + (ProcedureActivityObservation) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityObservationEntryRelationshipProcedureObservationEncounterTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetServiceDeliveryLocations() { + + ProcedureActivityObservation target = objectFactory.create(); + target.getServiceDeliveryLocations(); + + } + + /** + * + * @generated + */ + @Test + public void testGetInstructions() { + + ProcedureActivityObservation target = objectFactory.create(); + target.getInstructions(); + + } + + /** + * + * @generated + */ + @Test + public void testGetIndications() { + + ProcedureActivityObservation target = objectFactory.create(); + target.getIndications(); + + } + + /** + * + * @generated + */ + @Test + public void testGetMedicationActivity() { + + ProcedureActivityObservation target = objectFactory.create(); + target.getMedicationActivity(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ProcedureActivityObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ProcedureActivityObservation create() { + return ConsolFactory.eINSTANCE.createProcedureActivityObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ProcedureActivityObservationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ProcedureActivityObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProcedureActivityProcedureTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProcedureActivityProcedureTest.java new file mode 100644 index 000000000..83388384b --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProcedureActivityProcedureTest.java @@ -0,0 +1,2090 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.AssignedEntity; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Encounter; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.Organization; +import org.openhealthtools.mdht.uml.cda.Participant2; +import org.openhealthtools.mdht.uml.cda.Performer2; +import org.openhealthtools.mdht.uml.cda.Specimen; +import org.openhealthtools.mdht.uml.cda.SpecimenRole; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ConsolPackage; +import org.openhealthtools.mdht.uml.cda.consol.GeneralStatusSection; +import org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure; +import org.openhealthtools.mdht.uml.cda.consol.operations.ProcedureActivityProcedureOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.datatypes.TEL; +import org.openhealthtools.mdht.uml.hl7.vocab.ActClass; +import org.openhealthtools.mdht.uml.hl7.vocab.ParticipationType; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; +import org.openhealthtools.mdht.uml.hl7.vocab.x_DocumentEncounterMood; +import org.openhealthtools.mdht.uml.hl7.vocab.x_DocumentProcedureMood; + +/** + * + * A static utility class that provides operations related to 'Procedure Activity Procedure' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#validateProcedureActivityProcedureCodeCodeSystems(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Code Code Systems}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#validateProcedureActivityProcedureCodeOriginalText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Code Original Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#validateProcedureActivityProcedureOriginalTextReference(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Original Text Reference}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#validateProcedureActivityProcedureOriginalTextReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Original Text Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#validateProcedureActivityProcedureReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#validateProcedureActivityProcedureEncounterInversion(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Encounter Inversion}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#validateProcedureActivityProcedureProductInstanceTypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Product Instance Type Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#validateProcedureActivityProcedureServiceDeliveryLocationTypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Service Delivery Location Type Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#validateProcedureActivityProcedureInstructionsInversion(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Instructions Inversion}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#validateProcedureActivityProcedureTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#validateProcedureActivityProcedureClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#validateProcedureActivityProcedureMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#validateProcedureActivityProcedureId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#validateProcedureActivityProcedureCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#validateProcedureActivityProcedureStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#validateProcedureActivityProcedureEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#validateProcedureActivityProcedurePriorityCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Priority Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#validateProcedureActivityProcedurePriorityCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Priority Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#validateProcedureActivityProcedureMethodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Method Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#validateProcedureActivityProcedureTargetSiteCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Target Site Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#validateProcedureActivityProcedureTargetSiteCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Target Site Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#validateProcedureActivityProcedureIndication(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Indication}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#validateProcedureActivityProcedureSpecimen(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Specimen}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#validateProcedureActivityProcedureServiceDeliveryLocation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Service Delivery Location}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#validateProcedureActivityProcedurePerformer(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Performer}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#validateProcedureActivityProcedureMedicationActivity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Medication Activity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#validateProcedureActivityProcedurePatientInstruction(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Patient Instruction}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#validateProcedureActivityProcedureProductInstance(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Product Instance}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#validateProcedureActivityProcedureEntryRelationship(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Entry Relationship}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#validateProcedureActivityProcedureProcedureSpecimenSpecimenRole(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Procedure Specimen Specimen Role}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#validateProcedureActivityProcedureProcedureSpecimenSpecimentRoleId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Procedure Specimen Speciment Role Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#validateProcedureActivityProcedureProcedureActivityPerformerAssignedEntity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Procedure Activity Performer Assigned Entity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#validateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Procedure Activity Performer Assigned Entity Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#validateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityAddr(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Procedure Activity Performer Assigned Entity Addr}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#validateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityTelecom(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Procedure Activity Performer Assigned Entity Telecom}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#validateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityRepOrg(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Procedure Activity Performer Assigned Entity Rep Org}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#validateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityRepOrgId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Procedure Activity Performer Assigned Entity Rep Org Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#validateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityRepOrgName(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Procedure Activity Performer Assigned Entity Rep Org Name}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#validateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityRepOrgAddr(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Procedure Activity Performer Assigned Entity Rep Org Addr}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#validateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityRepOrgTelecom(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Procedure Activity Performer Assigned Entity Rep Org Telecom}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#validateProcedureActivityProcedureEntryRelationshipProcedureActivityEncounterClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Entry Relationship Procedure Activity Encounter Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#validateProcedureActivityProcedureEntryRelationshipProcedureActivityEncounterMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Entry Relationship Procedure Activity Encounter Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#validateProcedureActivityProcedureEntryRelationshipProcedureActivityEncounterId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Entry Relationship Procedure Activity Encounter Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#validateProcedureActivityProcedureEntryRelationshipInversionInd(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Entry Relationship Inversion Ind}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#validateProcedureActivityProcedureEntryRelationshipTypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Entry Relationship Type Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#validateProcedureActivityProcedureEntryRelationshipProcedureActivityEncounter(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Entry Relationship Procedure Activity Encounter}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#getIndications() Get Indications}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#getServiceDeliveryLocations() Get Service Delivery Locations}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#getMedicationActivity() Get Medication Activity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#getPatientInstruction() Get Patient Instruction}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure#getProductInstances() Get Product Instances}
  • + *
+ *

+ * + * @generated + */ + +public class ProcedureActivityProcedureTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateProcedureActivityProcedureCodeCodeSystems() { + OperationsTestCase validateProcedureActivityProcedureCodeCodeSystemsTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureCodeCodeSystems", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_CODE_CODE_SYSTEMS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + target.init(); + CD code = DatatypesFactory.eINSTANCE.createCD(); + code.setCodeSystem("2.16.840.1.113883.6.96"); + target.setCode(code); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureCodeCodeSystems( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureCodeCodeSystemsTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProcedureActivityProcedureCodeOriginalText() { + OperationsTestCase validateProcedureActivityProcedureCodeOriginalTextTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureCodeOriginalText", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_CODE_ORIGINAL_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + target.init(); + CD code = DatatypesFactory.eINSTANCE.createCD(); + + target.setCode(code); + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + + CD code = DatatypesFactory.eINSTANCE.createCD(); + code.setOriginalText(DatatypesFactory.eINSTANCE.createED()); + target.setCode(code); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureCodeOriginalText( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureCodeOriginalTextTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityProcedureOriginalTextReference() { + OperationsTestCase validateProcedureActivityProcedureOriginalTextReferenceTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureOriginalTextReference", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_ORIGINAL_TEXT_REFERENCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + target.init(); + CD code = DatatypesFactory.eINSTANCE.createCD(); + ED ot = DatatypesFactory.eINSTANCE.createED(); + code.setOriginalText(ot); + target.setCode(code); + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + + CD code = DatatypesFactory.eINSTANCE.createCD(); + ED ot = DatatypesFactory.eINSTANCE.createED(); + TEL ref = DatatypesFactory.eINSTANCE.createTEL(); + ot.setReference(ref); + code.setOriginalText(ot); + target.setCode(code); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureOriginalTextReference( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureOriginalTextReferenceTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProcedureActivityProcedureOriginalTextReferenceValue() { + OperationsTestCase validateProcedureActivityProcedureOriginalTextReferenceValueTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureOriginalTextReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_ORIGINAL_TEXT_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + target.init(); + CD code = DatatypesFactory.eINSTANCE.createCD(); + ED ot = DatatypesFactory.eINSTANCE.createED(); + TEL ref = DatatypesFactory.eINSTANCE.createTEL(); + ot.setReference(ref); + code.setOriginalText(ot); + target.setCode(code); + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + + CD code = DatatypesFactory.eINSTANCE.createCD(); + ED ot = DatatypesFactory.eINSTANCE.createED(); + TEL ref = DatatypesFactory.eINSTANCE.createTEL(); + ref.setValue("test"); + ot.setReference(ref); + code.setOriginalText(ot); + target.setCode(code); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureOriginalTextReferenceValue( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureOriginalTextReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProcedureActivityProcedureReferenceValue() { + OperationsTestCase validateProcedureActivityProcedureReferenceValueTestCase = new NarrativeReferenceTestCase( + "validateProcedureActivityProcedureReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + target.init(); + + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), "", + "No particular procedure to document."); + + // add a reference to the section text + target.setCode(createCDWithOriginalTextReference("Some sample text", "#1.2.3.4")); + + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), + "1.2.3.4", "No particular procedure to document."); + + // add a reference to the section text + target.setCode(createCDWithOriginalTextReference("Some sample text", "#1.2.3.4")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureReferenceValue( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProcedureActivityProcedureEncounterInversion() { + OperationsTestCase validateProcedureActivityProcedureEncounterInversionTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureEncounterInversion", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_ENCOUNTER_INVERSION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + + er.setEncounter(CDAFactory.eINSTANCE.createEncounter()); + target.getEntryRelationships().add(er); + } + + @Override + public void addPassTests() { + + addPassTest(new PassTest() { + + @Override + public void updateToPass(ProcedureActivityProcedure target) { + // Test case with only entry Relationship + // Should pass + target.getEntryRelationships().clear(); + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + target.getEntryRelationships().add(er); + } + + }); + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + target.getEntryRelationships().clear(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setInversionInd(true); + er.setEncounter(CDAFactory.eINSTANCE.createEncounter()); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureEncounterInversion( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureEncounterInversionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProcedureActivityProcedureProductInstanceTypeCode() { + OperationsTestCase validateProcedureActivityProcedureProductInstanceTypeCodeTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureProductInstanceTypeCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_PRODUCT_INSTANCE_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + target.init(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setParticipantRole(ConsolFactory.eINSTANCE.createProductInstance()); + target.getParticipants().add(par); + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + target.getParticipants().clear(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setParticipantRole(ConsolFactory.eINSTANCE.createProductInstance()); + par.setTypeCode(ParticipationType.DEV); + target.getParticipants().add(par); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureProductInstanceTypeCode( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureProductInstanceTypeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProcedureActivityProcedureServiceDeliveryLocationTypeCode() { + OperationsTestCase validateProcedureActivityProcedureServiceDeliveryLocationTypeCodeTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureServiceDeliveryLocationTypeCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_SERVICE_DELIVERY_LOCATION_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + target.init(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setParticipantRole(ConsolFactory.eINSTANCE.createServiceDeliveryLocation()); + target.getParticipants().add(par); + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + target.getParticipants().clear(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setParticipantRole(ConsolFactory.eINSTANCE.createServiceDeliveryLocation()); + par.setTypeCode(ParticipationType.LOC); + target.getParticipants().add(par); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureServiceDeliveryLocationTypeCode( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureServiceDeliveryLocationTypeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProcedureActivityProcedureInstructionsInversion() { + OperationsTestCase validateProcedureActivityProcedureInstructionsInversionTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureInstructionsInversion", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_INSTRUCTIONS_INVERSION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setAct(ConsolFactory.eINSTANCE.createInstructions()); + target.getEntryRelationships().add(er); + } + + @Override + public void addPassTests() { + + addPassTest(new PassTest() { + + @Override + public void updateToPass(ProcedureActivityProcedure target) { + // Test case with only entry Relationship + // Should pass + target.getEntryRelationships().clear(); + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + target.getEntryRelationships().add(er); + } + + }); + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + + target.getEntryRelationships().clear(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setInversionInd(true); + er.setAct(ConsolFactory.eINSTANCE.createInstructions()); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureInstructionsInversion( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureInstructionsInversionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureActivityProcedureTemplateId() { + OperationsTestCase validateProcedureActivityProcedureTemplateIdTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureTemplateId( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureActivityProcedureClassCode() { + OperationsTestCase validateProcedureActivityProcedureClassCodeTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureClassCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureClassCode( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityProcedureMoodCode() { + OperationsTestCase validateProcedureActivityProcedureMoodCodeTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureMoodCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + target.init(); + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + + target.setMoodCode(x_DocumentProcedureMood.EVN); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureMoodCode( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProcedureActivityProcedureId() { + OperationsTestCase validateProcedureActivityProcedureIdTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureId", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + target.init(); + target.getIds().add(DatatypesFactory.eINSTANCE.createII()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureId( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProcedureActivityProcedureCode() { + OperationsTestCase validateProcedureActivityProcedureCodeTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + target.init(); + target.setCode(DatatypesFactory.eINSTANCE.createCE()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureCode( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProcedureActivityProcedureStatusCode() { + OperationsTestCase validateProcedureActivityProcedureStatusCodeTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureStatusCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + cs.setCodeSystem("2.16.840.1.113883.5.14"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureStatusCode( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureActivityProcedureEffectiveTime() { + OperationsTestCase validateProcedureActivityProcedureEffectiveTimeTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureEffectiveTime( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProcedureActivityProcedurePriorityCode() { + OperationsTestCase validateProcedureActivityProcedurePriorityCodeTestCase = new OperationsTestCase( + "validateProcedureActivityProcedurePriorityCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_PRIORITY_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + target.init(); + CE pc = DatatypesFactory.eINSTANCE.createCE(); + pc.setCode("A"); + pc.setCodeSystem("2.16.840.1.113883.5.7"); + target.setPriorityCode(pc); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedurePriorityCode( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedurePriorityCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityProcedurePriorityCodeP() { + OperationsTestCase validateProcedureActivityProcedurePriorityCodePTestCase = new OperationsTestCase( + "validateProcedureActivityProcedurePriorityCodeP", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_PRIORITY_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + target.init(); + CE pc = DatatypesFactory.eINSTANCE.createCE(); + pc.setCodeSystem("2.16.840.1.113883.1.11.16866"); + target.setPriorityCode(pc); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedurePriorityCodeP( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedurePriorityCodePTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProcedureActivityProcedureMethodCode() { + OperationsTestCase validateProcedureActivityProcedureMethodCodeTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureMethodCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_METHOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + target.init(); + target.getMethodCodes().add(DatatypesFactory.eINSTANCE.createCE()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureMethodCode( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureMethodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProcedureActivityProcedureTargetSiteCode() { + OperationsTestCase validateProcedureActivityProcedureTargetSiteCodeTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureTargetSiteCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_TARGET_SITE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + target.init(); + target.getTargetSiteCodes().add(DatatypesFactory.eINSTANCE.createCD()); + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + target.getTargetSiteCodes().clear(); + CD tsc = DatatypesFactory.eINSTANCE.createCD(); + tsc.setCodeSystem("2.16.840.1.113883.6.96"); + tsc.setCode("test"); + target.getTargetSiteCodes().add(tsc); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureTargetSiteCode( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureTargetSiteCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureActivityProcedureTargetSiteCodeP() { + OperationsTestCase validateProcedureActivityProcedureTargetSiteCodePTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureTargetSiteCodeP", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_TARGET_SITE_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureTargetSiteCodeP( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureTargetSiteCodePTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProcedureActivityProcedureIndication() { + OperationsTestCase validateProcedureActivityProcedureIndicationTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureIndication", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_INDICATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.RSON); + er.setObservation(ConsolFactory.eINSTANCE.createIndication()); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureIndication( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureIndicationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityProcedureSpecimen() { + OperationsTestCase validateProcedureActivityProcedureSpecimenTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureSpecimen", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_SPECIMEN__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + target.init(); + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + target.getSpecimens().add(CDAFactory.eINSTANCE.createSpecimen()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureSpecimen( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureSpecimenTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProcedureActivityProcedureServiceDeliveryLocation() { + OperationsTestCase validateProcedureActivityProcedureServiceDeliveryLocationTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureServiceDeliveryLocation", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_SERVICE_DELIVERY_LOCATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + target.init(); + + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setParticipantRole(ConsolFactory.eINSTANCE.createServiceDeliveryLocation()); + target.getParticipants().add(par); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureServiceDeliveryLocation( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureServiceDeliveryLocationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityProcedurePerformer() { + OperationsTestCase validateProcedureActivityProcedurePerformerTestCase = new OperationsTestCase( + "validateProcedureActivityProcedurePerformer", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_PERFORMER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + target.init(); + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + target.getPerformers().add(CDAFactory.eINSTANCE.createPerformer2()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedurePerformer( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedurePerformerTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProcedureActivityProcedureMedicationActivity() { + OperationsTestCase validateProcedureActivityProcedureMedicationActivityTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureMedicationActivity", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_MEDICATION_ACTIVITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + er.setSubstanceAdministration(ConsolFactory.eINSTANCE.createMedicationActivity()); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureMedicationActivity( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureMedicationActivityTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProcedureActivityProcedurePatientInstruction() { + OperationsTestCase validateProcedureActivityProcedurePatientInstructionTestCase = new OperationsTestCase( + "validateProcedureActivityProcedurePatientInstruction", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_PATIENT_INSTRUCTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + er.setAct(ConsolFactory.eINSTANCE.createInstructions()); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedurePatientInstruction( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedurePatientInstructionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProcedureActivityProcedureProductInstance() { + OperationsTestCase validateProcedureActivityProcedureProductInstanceTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureProductInstance", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_PRODUCT_INSTANCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + target.init(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setParticipantRole(ConsolFactory.eINSTANCE.createProductInstance()); + target.getParticipants().add(par); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureProductInstance( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureProductInstanceTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityProcedureEntryRelationship() { + OperationsTestCase validateProcedureActivityProcedureEntryRelationshipTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureEntryRelationship", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_ENTRY_RELATIONSHIP__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + er.setEncounter(CDAFactory.eINSTANCE.createEncounter()); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureEntryRelationship( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureEntryRelationshipTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityProcedureProcedureSpecimenSpecimenRole() { + OperationsTestCase validateProcedureActivityProcedureProcedureSpecimenSpecimenRoleTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureProcedureSpecimenSpecimenRole", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_PROCEDURE_SPECIMEN_SPECIMEN_ROLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + target.init(); + Specimen spec = CDAFactory.eINSTANCE.createSpecimen(); + target.getSpecimens().add(spec); + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + target.getSpecimens().clear(); + Specimen spec = CDAFactory.eINSTANCE.createSpecimen(); + SpecimenRole sr = CDAFactory.eINSTANCE.createSpecimenRole(); + sr.getIds().add(DatatypesFactory.eINSTANCE.createII()); + spec.setSpecimenRole(sr); + target.getSpecimens().add(spec); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureProcedureSpecimenSpecimenRole( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureProcedureSpecimenSpecimenRoleTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityProcedureProcedureSpecimenSpecimentRoleId() { + OperationsTestCase validateProcedureActivityProcedureProcedureSpecimenSpecimentRoleIdTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureProcedureSpecimenSpecimentRoleId", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_PROCEDURE_SPECIMEN_SPECIMENT_ROLE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + target.init(); + Specimen spec = CDAFactory.eINSTANCE.createSpecimen(); + spec.setSpecimenRole(CDAFactory.eINSTANCE.createSpecimenRole()); + target.getSpecimens().add(spec); + + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + target.getSpecimens().clear(); + Specimen spec = CDAFactory.eINSTANCE.createSpecimen(); + SpecimenRole sr = CDAFactory.eINSTANCE.createSpecimenRole(); + sr.getIds().add(DatatypesFactory.eINSTANCE.createII()); + spec.setSpecimenRole(sr); + target.getSpecimens().add(spec); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureProcedureSpecimenSpecimentRoleId( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureProcedureSpecimenSpecimentRoleIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityProcedureProcedureActivityPerformerAssignedEntity() { + OperationsTestCase validateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureProcedureActivityPerformerAssignedEntity", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_PROCEDURE_ACTIVITY_PERFORMER_ASSIGNED_ENTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + target.init(); + target.getPerformers().add(CDAFactory.eINSTANCE.createPerformer2()); + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + target.getPerformers().clear(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + per.setAssignedEntity(CDAFactory.eINSTANCE.createAssignedEntity()); + target.getPerformers().add(per); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureProcedureActivityPerformerAssignedEntity( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityId() { + OperationsTestCase validateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityIdTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityId", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_PROCEDURE_ACTIVITY_PERFORMER_ASSIGNED_ENTITY_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + target.init(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + per.setAssignedEntity(CDAFactory.eINSTANCE.createAssignedEntity()); + target.getPerformers().add(per); + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + target.getPerformers().clear(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getIds().add(DatatypesFactory.eINSTANCE.createII()); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityId( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityAddr() { + OperationsTestCase validateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityAddrTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityAddr", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_PROCEDURE_ACTIVITY_PERFORMER_ASSIGNED_ENTITY_ADDR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + target.init(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + per.setAssignedEntity(CDAFactory.eINSTANCE.createAssignedEntity()); + target.getPerformers().add(per); + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + target.getPerformers().clear(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityAddr( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityAddrTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityTelecom() { + OperationsTestCase validateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityTelecomTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityTelecom", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_PROCEDURE_ACTIVITY_PERFORMER_ASSIGNED_ENTITY_TELECOM__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + target.init(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + per.setAssignedEntity(CDAFactory.eINSTANCE.createAssignedEntity()); + target.getPerformers().add(per); + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + target.getPerformers().clear(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getTelecoms().add(DatatypesFactory.eINSTANCE.createTEL()); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityTelecom( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityTelecomTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityRepOrg() { + OperationsTestCase validateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityRepOrgTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityRepOrg", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_PROCEDURE_ACTIVITY_PERFORMER_ASSIGNED_ENTITY_REP_ORG__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + target.init(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + per.setAssignedEntity(CDAFactory.eINSTANCE.createAssignedEntity()); + target.getPerformers().add(per); + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + target.getPerformers().clear(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getRepresentedOrganizations().add(CDAFactory.eINSTANCE.createOrganization()); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityRepOrg( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityRepOrgTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityRepOrgId() { + OperationsTestCase validateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityRepOrgIdTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityRepOrgId", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_PROCEDURE_ACTIVITY_PERFORMER_ASSIGNED_ENTITY_REP_ORG_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + target.init(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getRepresentedOrganizations().add(CDAFactory.eINSTANCE.createOrganization()); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + target.getPerformers().clear(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + Organization org = CDAFactory.eINSTANCE.createOrganization(); + org.getIds().add(DatatypesFactory.eINSTANCE.createII()); + ae.getRepresentedOrganizations().add(org); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityRepOrgId( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityRepOrgIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityRepOrgName() { + OperationsTestCase validateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityRepOrgNameTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityRepOrgName", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_PROCEDURE_ACTIVITY_PERFORMER_ASSIGNED_ENTITY_REP_ORG_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + target.init(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getRepresentedOrganizations().add(CDAFactory.eINSTANCE.createOrganization()); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + target.getPerformers().clear(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + Organization org = CDAFactory.eINSTANCE.createOrganization(); + org.getNames().add(DatatypesFactory.eINSTANCE.createON()); + ae.getRepresentedOrganizations().add(org); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityRepOrgName( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityRepOrgNameTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityRepOrgAddr() { + OperationsTestCase validateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityRepOrgAddrTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityRepOrgAddr", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_PROCEDURE_ACTIVITY_PERFORMER_ASSIGNED_ENTITY_REP_ORG_ADDR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + target.init(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getRepresentedOrganizations().add(CDAFactory.eINSTANCE.createOrganization()); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + target.getPerformers().clear(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + Organization org = CDAFactory.eINSTANCE.createOrganization(); + org.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + ae.getRepresentedOrganizations().add(org); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityRepOrgAddr( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityRepOrgAddrTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityRepOrgTelecom() { + OperationsTestCase validateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityRepOrgTelecomTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityRepOrgTelecom", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_PROCEDURE_ACTIVITY_PERFORMER_ASSIGNED_ENTITY_REP_ORG_TELECOM__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + target.init(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getRepresentedOrganizations().add(CDAFactory.eINSTANCE.createOrganization()); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + target.getPerformers().clear(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + Organization org = CDAFactory.eINSTANCE.createOrganization(); + org.getTelecoms().add(DatatypesFactory.eINSTANCE.createTEL()); + ae.getRepresentedOrganizations().add(org); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityRepOrgTelecom( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureProcedureActivityPerformerAssignedEntityRepOrgTelecomTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityProcedureEntryRelationshipProcedureActivityEncounterClassCode() { + OperationsTestCase validateProcedureActivityProcedureEntryRelationshipProcedureActivityEncounterClassCodeTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureEntryRelationshipProcedureActivityEncounterClassCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_ENTRY_RELATIONSHIP_PROCEDURE_ACTIVITY_ENCOUNTER_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + er.setEncounter(CDAFactory.eINSTANCE.createEncounter()); + target.getEntryRelationships().add(er); + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + target.getEntryRelationships().clear(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + Encounter enc = CDAFactory.eINSTANCE.createEncounter(); + enc.setClassCode(ActClass.ENC); + er.setEncounter(enc); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureEntryRelationshipProcedureActivityEncounterClassCode( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureEntryRelationshipProcedureActivityEncounterClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityProcedureEntryRelationshipProcedureActivityEncounterMoodCode() { + OperationsTestCase validateProcedureActivityProcedureEntryRelationshipProcedureActivityEncounterMoodCodeTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureEntryRelationshipProcedureActivityEncounterMoodCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_ENTRY_RELATIONSHIP_PROCEDURE_ACTIVITY_ENCOUNTER_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + er.setEncounter(CDAFactory.eINSTANCE.createEncounter()); + target.getEntryRelationships().add(er); + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + target.getEntryRelationships().clear(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + Encounter enc = CDAFactory.eINSTANCE.createEncounter(); + enc.setMoodCode(x_DocumentEncounterMood.EVN); + er.setEncounter(enc); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureEntryRelationshipProcedureActivityEncounterMoodCode( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureEntryRelationshipProcedureActivityEncounterMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityProcedureEntryRelationshipProcedureActivityEncounterId() { + OperationsTestCase validateProcedureActivityProcedureEntryRelationshipProcedureActivityEncounterIdTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureEntryRelationshipProcedureActivityEncounterId", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_ENTRY_RELATIONSHIP_PROCEDURE_ACTIVITY_ENCOUNTER_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + er.setEncounter(CDAFactory.eINSTANCE.createEncounter()); + target.getEntryRelationships().add(er); + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + target.getEntryRelationships().clear(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + Encounter enc = CDAFactory.eINSTANCE.createEncounter(); + enc.getIds().add(DatatypesFactory.eINSTANCE.createII()); + er.setEncounter(enc); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureEntryRelationshipProcedureActivityEncounterId( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureEntryRelationshipProcedureActivityEncounterIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityProcedureEntryRelationshipInversionInd() { + OperationsTestCase validateProcedureActivityProcedureEntryRelationshipInversionIndTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureEntryRelationshipInversionInd", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_ENTRY_RELATIONSHIP_INVERSION_IND__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + er.setEncounter(CDAFactory.eINSTANCE.createEncounter()); + target.getEntryRelationships().add(er); + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + target.getEntryRelationships().clear(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + er.setInversionInd(true); + Encounter enc = CDAFactory.eINSTANCE.createEncounter(); + enc.setMoodCode(x_DocumentEncounterMood.EVN); + er.setEncounter(enc); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureEntryRelationshipInversionInd( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureEntryRelationshipInversionIndTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityProcedureEntryRelationshipTypeCode() { + OperationsTestCase validateProcedureActivityProcedureEntryRelationshipTypeCodeTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureEntryRelationshipTypeCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_ENTRY_RELATIONSHIP_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + { + this.skipFailsTest(); + } + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + target.init(); + target.getEntryRelationships().clear(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + er.setEncounter(CDAFactory.eINSTANCE.createEncounter()); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureEntryRelationshipTypeCode( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureEntryRelationshipTypeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureActivityProcedureEntryRelationshipProcedureActivityEncounter() { + OperationsTestCase validateProcedureActivityProcedureEntryRelationshipProcedureActivityEncounterTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureEntryRelationshipProcedureActivityEncounter", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_ENTRY_RELATIONSHIP_PROCEDURE_ACTIVITY_ENCOUNTER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + { + this.skipFailsTest(); + } + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + target.init(); + target.getEntryRelationships().clear(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + er.setEncounter(CDAFactory.eINSTANCE.createEncounter()); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureEntryRelationshipProcedureActivityEncounter( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureEntryRelationshipProcedureActivityEncounterTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetIndications() { + + ProcedureActivityProcedure target = objectFactory.create(); + target.getIndications(); + + } + + /** + * + * @generated + */ + @Test + public void testGetServiceDeliveryLocations() { + + ProcedureActivityProcedure target = objectFactory.create(); + target.getServiceDeliveryLocations(); + + } + + /** + * + * @generated + */ + @Test + public void testGetMedicationActivity() { + + ProcedureActivityProcedure target = objectFactory.create(); + target.getMedicationActivity(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPatientInstruction() { + + ProcedureActivityProcedure target = objectFactory.create(); + target.getPatientInstruction(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProductInstances() { + + ProcedureActivityProcedure target = objectFactory.create(); + target.getProductInstances(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ProcedureActivityProcedureOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ProcedureActivityProcedure create() { + return ConsolFactory.eINSTANCE.createProcedureActivityProcedure(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ProcedureActivityProcedureOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ProcedureActivityProcedureOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProcedureContextTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProcedureContextTest.java new file mode 100644 index 000000000..00f1d6213 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProcedureContextTest.java @@ -0,0 +1,251 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ProcedureContext; +import org.openhealthtools.mdht.uml.cda.consol.operations.ProcedureContextOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; + +/** + * + * A static utility class that provides operations related to 'Procedure Context' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureContext#validateProcedureContextEffectiveTimeValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Context Effective Time Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureContext#validateProcedureContextTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Context Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureContext#validateProcedureContextCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Context Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureContext#validateProcedureContextEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Context Effective Time}
  • + *
+ *

+ * + * @generated + */ + +public class ProcedureContextTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureContextEffectiveTimeValue() { + OperationsTestCase validateProcedureContextEffectiveTimeValueTestCase = new OperationsTestCase( + "validateProcedureContextEffectiveTimeValue", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_CONTEXT_EFFECTIVE_TIME_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureContext target) { + target.init(); + target.setEffectiveTime(DatatypesFactory.eINSTANCE.createIVL_TS()); + } + + @Override + protected void updateToPass(ProcedureContext target) { + target.setEffectiveTime(DatatypesFactory.eINSTANCE.createIVL_TS("test")); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureContextOperations.validateProcedureContextEffectiveTimeValue( + (ProcedureContext) objectToTest, diagnostician, map); + } + + }; + + validateProcedureContextEffectiveTimeValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureContextTemplateId() { + OperationsTestCase validateProcedureContextTemplateIdTestCase = new OperationsTestCase( + "validateProcedureContextTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_CONTEXT_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureContext target) { + + } + + @Override + protected void updateToPass(ProcedureContext target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureContextOperations.validateProcedureContextTemplateId( + (ProcedureContext) objectToTest, diagnostician, map); + } + + }; + + validateProcedureContextTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureContextCode() { + OperationsTestCase validateProcedureContextCodeTestCase = new OperationsTestCase( + "validateProcedureContextCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_CONTEXT_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureContext target) { + + } + + @Override + protected void updateToPass(ProcedureContext target) { + target.init(); + target.setCode(DatatypesFactory.eINSTANCE.createCD()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureContextOperations.validateProcedureContextCode( + (ProcedureContext) objectToTest, diagnostician, map); + } + + }; + + validateProcedureContextCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureContextEffectiveTime() { + OperationsTestCase validateProcedureContextEffectiveTimeTestCase = new OperationsTestCase( + "validateProcedureContextEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_CONTEXT_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureContext target) { + + } + + @Override + protected void updateToPass(ProcedureContext target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureContextOperations.validateProcedureContextEffectiveTime( + (ProcedureContext) objectToTest, diagnostician, map); + } + + }; + + validateProcedureContextEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ProcedureContextOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ProcedureContext create() { + return ConsolFactory.eINSTANCE.createProcedureContext(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ProcedureContextOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ProcedureContextOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProcedureDescriptionSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProcedureDescriptionSectionTest.java new file mode 100644 index 000000000..148c964de --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProcedureDescriptionSectionTest.java @@ -0,0 +1,290 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ProcedureDescriptionSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.ProcedureDescriptionSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Procedure Description Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureDescriptionSection#validateProcedureDescriptionSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Description Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureDescriptionSection#validateProcedureDescriptionSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Description Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureDescriptionSection#validateProcedureDescriptionSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Description Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureDescriptionSection#validateProcedureDescriptionSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Description Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureDescriptionSection#validateProcedureDescriptionSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Description Section Title}
  • + *
+ *

+ * + * @generated + */ + +public class ProcedureDescriptionSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateProcedureDescriptionSectionTemplateId() { + OperationsTestCase validateProcedureDescriptionSectionTemplateIdTestCase = new OperationsTestCase( + "validateProcedureDescriptionSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_DESCRIPTION_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureDescriptionSection target) { + + } + + @Override + protected void updateToPass(ProcedureDescriptionSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureDescriptionSectionOperations.validateProcedureDescriptionSectionTemplateId( + (ProcedureDescriptionSection) objectToTest, diagnostician, map); + } + + }; + + validateProcedureDescriptionSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureDescriptionSectionCode() { + OperationsTestCase validateProcedureDescriptionSectionCodeTestCase = new OperationsTestCase( + "validateProcedureDescriptionSectionCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_DESCRIPTION_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureDescriptionSection target) { + + } + + @Override + protected void updateToPass(ProcedureDescriptionSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureDescriptionSectionOperations.validateProcedureDescriptionSectionCode( + (ProcedureDescriptionSection) objectToTest, diagnostician, map); + } + + }; + + validateProcedureDescriptionSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureDescriptionSectionCodeP() { + OperationsTestCase validateProcedureDescriptionSectionCodePTestCase = new OperationsTestCase( + "validateProcedureDescriptionSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_DESCRIPTION_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureDescriptionSection target) { + + } + + @Override + protected void updateToPass(ProcedureDescriptionSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureDescriptionSectionOperations.validateProcedureDescriptionSectionCodeP( + (ProcedureDescriptionSection) objectToTest, diagnostician, map); + } + + }; + + validateProcedureDescriptionSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureDescriptionSectionText() { + OperationsTestCase validateProcedureDescriptionSectionTextTestCase = new OperationsTestCase( + "validateProcedureDescriptionSectionText", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_DESCRIPTION_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureDescriptionSection target) { + + } + + @Override + protected void updateToPass(ProcedureDescriptionSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureDescriptionSectionOperations.validateProcedureDescriptionSectionText( + (ProcedureDescriptionSection) objectToTest, diagnostician, map); + } + + }; + + validateProcedureDescriptionSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureDescriptionSectionTitle() { + OperationsTestCase validateProcedureDescriptionSectionTitleTestCase = new OperationsTestCase( + "validateProcedureDescriptionSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_DESCRIPTION_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureDescriptionSection target) { + + } + + @Override + protected void updateToPass(ProcedureDescriptionSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureDescriptionSectionOperations.validateProcedureDescriptionSectionTitle( + (ProcedureDescriptionSection) objectToTest, diagnostician, map); + } + + }; + + validateProcedureDescriptionSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ProcedureDescriptionSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ProcedureDescriptionSection create() { + return ConsolFactory.eINSTANCE.createProcedureDescriptionSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ProcedureDescriptionSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ProcedureDescriptionSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProcedureDispositionSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProcedureDispositionSectionTest.java new file mode 100644 index 000000000..5f5ae0dcd --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProcedureDispositionSectionTest.java @@ -0,0 +1,290 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ProcedureDispositionSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.ProcedureDispositionSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Procedure Disposition Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureDispositionSection#validateProcedureDispositionSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Disposition Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureDispositionSection#validateProcedureDispositionSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Disposition Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureDispositionSection#validateProcedureDispositionSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Disposition Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureDispositionSection#validateProcedureDispositionSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Disposition Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureDispositionSection#validateProcedureDispositionSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Disposition Section Title}
  • + *
+ *

+ * + * @generated + */ + +public class ProcedureDispositionSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateProcedureDispositionSectionTemplateId() { + OperationsTestCase validateProcedureDispositionSectionTemplateIdTestCase = new OperationsTestCase( + "validateProcedureDispositionSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_DISPOSITION_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureDispositionSection target) { + + } + + @Override + protected void updateToPass(ProcedureDispositionSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureDispositionSectionOperations.validateProcedureDispositionSectionTemplateId( + (ProcedureDispositionSection) objectToTest, diagnostician, map); + } + + }; + + validateProcedureDispositionSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureDispositionSectionCode() { + OperationsTestCase validateProcedureDispositionSectionCodeTestCase = new OperationsTestCase( + "validateProcedureDispositionSectionCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_DISPOSITION_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureDispositionSection target) { + + } + + @Override + protected void updateToPass(ProcedureDispositionSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureDispositionSectionOperations.validateProcedureDispositionSectionCode( + (ProcedureDispositionSection) objectToTest, diagnostician, map); + } + + }; + + validateProcedureDispositionSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureDispositionSectionCodeP() { + OperationsTestCase validateProcedureDispositionSectionCodePTestCase = new OperationsTestCase( + "validateProcedureDispositionSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_DISPOSITION_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureDispositionSection target) { + + } + + @Override + protected void updateToPass(ProcedureDispositionSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureDispositionSectionOperations.validateProcedureDispositionSectionCodeP( + (ProcedureDispositionSection) objectToTest, diagnostician, map); + } + + }; + + validateProcedureDispositionSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureDispositionSectionText() { + OperationsTestCase validateProcedureDispositionSectionTextTestCase = new OperationsTestCase( + "validateProcedureDispositionSectionText", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_DISPOSITION_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureDispositionSection target) { + + } + + @Override + protected void updateToPass(ProcedureDispositionSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureDispositionSectionOperations.validateProcedureDispositionSectionText( + (ProcedureDispositionSection) objectToTest, diagnostician, map); + } + + }; + + validateProcedureDispositionSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureDispositionSectionTitle() { + OperationsTestCase validateProcedureDispositionSectionTitleTestCase = new OperationsTestCase( + "validateProcedureDispositionSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_DISPOSITION_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureDispositionSection target) { + + } + + @Override + protected void updateToPass(ProcedureDispositionSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureDispositionSectionOperations.validateProcedureDispositionSectionTitle( + (ProcedureDispositionSection) objectToTest, diagnostician, map); + } + + }; + + validateProcedureDispositionSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ProcedureDispositionSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ProcedureDispositionSection create() { + return ConsolFactory.eINSTANCE.createProcedureDispositionSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ProcedureDispositionSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ProcedureDispositionSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProcedureEstimatedBloodLossSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProcedureEstimatedBloodLossSectionTest.java new file mode 100644 index 000000000..b86aaff60 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProcedureEstimatedBloodLossSectionTest.java @@ -0,0 +1,290 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ProcedureEstimatedBloodLossSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.ProcedureEstimatedBloodLossSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Procedure Estimated Blood Loss Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureEstimatedBloodLossSection#validateProcedureEstimatedBloodLossSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Estimated Blood Loss Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureEstimatedBloodLossSection#validateProcedureEstimatedBloodLossSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Estimated Blood Loss Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureEstimatedBloodLossSection#validateProcedureEstimatedBloodLossSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Estimated Blood Loss Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureEstimatedBloodLossSection#validateProcedureEstimatedBloodLossSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Estimated Blood Loss Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureEstimatedBloodLossSection#validateProcedureEstimatedBloodLossSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Estimated Blood Loss Section Title}
  • + *
+ *

+ * + * @generated + */ + +public class ProcedureEstimatedBloodLossSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateProcedureEstimatedBloodLossSectionTemplateId() { + OperationsTestCase validateProcedureEstimatedBloodLossSectionTemplateIdTestCase = new OperationsTestCase( + "validateProcedureEstimatedBloodLossSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ESTIMATED_BLOOD_LOSS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureEstimatedBloodLossSection target) { + + } + + @Override + protected void updateToPass(ProcedureEstimatedBloodLossSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureEstimatedBloodLossSectionOperations.validateProcedureEstimatedBloodLossSectionTemplateId( + (ProcedureEstimatedBloodLossSection) objectToTest, diagnostician, map); + } + + }; + + validateProcedureEstimatedBloodLossSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureEstimatedBloodLossSectionCode() { + OperationsTestCase validateProcedureEstimatedBloodLossSectionCodeTestCase = new OperationsTestCase( + "validateProcedureEstimatedBloodLossSectionCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ESTIMATED_BLOOD_LOSS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureEstimatedBloodLossSection target) { + + } + + @Override + protected void updateToPass(ProcedureEstimatedBloodLossSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureEstimatedBloodLossSectionOperations.validateProcedureEstimatedBloodLossSectionCode( + (ProcedureEstimatedBloodLossSection) objectToTest, diagnostician, map); + } + + }; + + validateProcedureEstimatedBloodLossSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureEstimatedBloodLossSectionCodeP() { + OperationsTestCase validateProcedureEstimatedBloodLossSectionCodePTestCase = new OperationsTestCase( + "validateProcedureEstimatedBloodLossSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ESTIMATED_BLOOD_LOSS_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureEstimatedBloodLossSection target) { + + } + + @Override + protected void updateToPass(ProcedureEstimatedBloodLossSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureEstimatedBloodLossSectionOperations.validateProcedureEstimatedBloodLossSectionCodeP( + (ProcedureEstimatedBloodLossSection) objectToTest, diagnostician, map); + } + + }; + + validateProcedureEstimatedBloodLossSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureEstimatedBloodLossSectionText() { + OperationsTestCase validateProcedureEstimatedBloodLossSectionTextTestCase = new OperationsTestCase( + "validateProcedureEstimatedBloodLossSectionText", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ESTIMATED_BLOOD_LOSS_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureEstimatedBloodLossSection target) { + + } + + @Override + protected void updateToPass(ProcedureEstimatedBloodLossSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureEstimatedBloodLossSectionOperations.validateProcedureEstimatedBloodLossSectionText( + (ProcedureEstimatedBloodLossSection) objectToTest, diagnostician, map); + } + + }; + + validateProcedureEstimatedBloodLossSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureEstimatedBloodLossSectionTitle() { + OperationsTestCase validateProcedureEstimatedBloodLossSectionTitleTestCase = new OperationsTestCase( + "validateProcedureEstimatedBloodLossSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ESTIMATED_BLOOD_LOSS_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureEstimatedBloodLossSection target) { + + } + + @Override + protected void updateToPass(ProcedureEstimatedBloodLossSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureEstimatedBloodLossSectionOperations.validateProcedureEstimatedBloodLossSectionTitle( + (ProcedureEstimatedBloodLossSection) objectToTest, diagnostician, map); + } + + }; + + validateProcedureEstimatedBloodLossSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ProcedureEstimatedBloodLossSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ProcedureEstimatedBloodLossSection create() { + return ConsolFactory.eINSTANCE.createProcedureEstimatedBloodLossSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ProcedureEstimatedBloodLossSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ProcedureEstimatedBloodLossSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProcedureFindingsSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProcedureFindingsSectionTest.java new file mode 100644 index 000000000..a4199e041 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProcedureFindingsSectionTest.java @@ -0,0 +1,339 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ProcedureFindingsSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.ProcedureFindingsSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Procedure Findings Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureFindingsSection#validateProcedureFindingsSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Findings Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureFindingsSection#validateProcedureFindingsSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Findings Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureFindingsSection#validateProcedureFindingsSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Findings Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureFindingsSection#validateProcedureFindingsSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Findings Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureFindingsSection#validateProcedureFindingsSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Findings Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureFindingsSection#validateProcedureFindingsSectionProblemObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Findings Section Problem Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureFindingsSection#getProblemObservations() Get Problem Observations}
  • + *
+ *

+ * + * @generated + */ + +public class ProcedureFindingsSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateProcedureFindingsSectionTemplateId() { + OperationsTestCase validateProcedureFindingsSectionTemplateIdTestCase = new OperationsTestCase( + "validateProcedureFindingsSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_FINDINGS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureFindingsSection target) { + + } + + @Override + protected void updateToPass(ProcedureFindingsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureFindingsSectionOperations.validateProcedureFindingsSectionTemplateId( + (ProcedureFindingsSection) objectToTest, diagnostician, map); + } + + }; + + validateProcedureFindingsSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureFindingsSectionCode() { + OperationsTestCase validateProcedureFindingsSectionCodeTestCase = new OperationsTestCase( + "validateProcedureFindingsSectionCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_FINDINGS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureFindingsSection target) { + + } + + @Override + protected void updateToPass(ProcedureFindingsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureFindingsSectionOperations.validateProcedureFindingsSectionCode( + (ProcedureFindingsSection) objectToTest, diagnostician, map); + } + + }; + + validateProcedureFindingsSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureFindingsSectionCodeP() { + OperationsTestCase validateProcedureFindingsSectionCodePTestCase = new OperationsTestCase( + "validateProcedureFindingsSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_FINDINGS_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureFindingsSection target) { + + } + + @Override + protected void updateToPass(ProcedureFindingsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureFindingsSectionOperations.validateProcedureFindingsSectionCodeP( + (ProcedureFindingsSection) objectToTest, diagnostician, map); + } + + }; + + validateProcedureFindingsSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureFindingsSectionText() { + OperationsTestCase validateProcedureFindingsSectionTextTestCase = new OperationsTestCase( + "validateProcedureFindingsSectionText", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_FINDINGS_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureFindingsSection target) { + + } + + @Override + protected void updateToPass(ProcedureFindingsSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureFindingsSectionOperations.validateProcedureFindingsSectionText( + (ProcedureFindingsSection) objectToTest, diagnostician, map); + } + + }; + + validateProcedureFindingsSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureFindingsSectionTitle() { + OperationsTestCase validateProcedureFindingsSectionTitleTestCase = new OperationsTestCase( + "validateProcedureFindingsSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_FINDINGS_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureFindingsSection target) { + + } + + @Override + protected void updateToPass(ProcedureFindingsSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureFindingsSectionOperations.validateProcedureFindingsSectionTitle( + (ProcedureFindingsSection) objectToTest, diagnostician, map); + } + + }; + + validateProcedureFindingsSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureFindingsSectionProblemObservation() { + OperationsTestCase validateProcedureFindingsSectionProblemObservationTestCase = new OperationsTestCase( + "validateProcedureFindingsSectionProblemObservation", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_FINDINGS_SECTION_PROBLEM_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureFindingsSection target) { + target.init(); + + } + + @Override + protected void updateToPass(ProcedureFindingsSection target) { + target.addObservation(ConsolFactory.eINSTANCE.createProblemObservation().init()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureFindingsSectionOperations.validateProcedureFindingsSectionProblemObservation( + (ProcedureFindingsSection) objectToTest, diagnostician, map); + } + + }; + + validateProcedureFindingsSectionProblemObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemObservations() { + + ProcedureFindingsSection target = objectFactory.create(); + target.getProblemObservations(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ProcedureFindingsSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ProcedureFindingsSection create() { + return ConsolFactory.eINSTANCE.createProcedureFindingsSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ProcedureFindingsSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ProcedureFindingsSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProcedureImplantsSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProcedureImplantsSectionTest.java new file mode 100644 index 000000000..7f51b76a4 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProcedureImplantsSectionTest.java @@ -0,0 +1,290 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ProcedureImplantsSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.ProcedureImplantsSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Procedure Implants Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureImplantsSection#validateProcedureImplantsSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Implants Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureImplantsSection#validateProcedureImplantsSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Implants Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureImplantsSection#validateProcedureImplantsSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Implants Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureImplantsSection#validateProcedureImplantsSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Implants Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureImplantsSection#validateProcedureImplantsSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Implants Section Title}
  • + *
+ *

+ * + * @generated + */ + +public class ProcedureImplantsSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateProcedureImplantsSectionTemplateId() { + OperationsTestCase validateProcedureImplantsSectionTemplateIdTestCase = new OperationsTestCase( + "validateProcedureImplantsSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_IMPLANTS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureImplantsSection target) { + + } + + @Override + protected void updateToPass(ProcedureImplantsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureImplantsSectionOperations.validateProcedureImplantsSectionTemplateId( + (ProcedureImplantsSection) objectToTest, diagnostician, map); + } + + }; + + validateProcedureImplantsSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureImplantsSectionCode() { + OperationsTestCase validateProcedureImplantsSectionCodeTestCase = new OperationsTestCase( + "validateProcedureImplantsSectionCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_IMPLANTS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureImplantsSection target) { + + } + + @Override + protected void updateToPass(ProcedureImplantsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureImplantsSectionOperations.validateProcedureImplantsSectionCode( + (ProcedureImplantsSection) objectToTest, diagnostician, map); + } + + }; + + validateProcedureImplantsSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureImplantsSectionCodeP() { + OperationsTestCase validateProcedureImplantsSectionCodePTestCase = new OperationsTestCase( + "validateProcedureImplantsSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_IMPLANTS_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureImplantsSection target) { + + } + + @Override + protected void updateToPass(ProcedureImplantsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureImplantsSectionOperations.validateProcedureImplantsSectionCodeP( + (ProcedureImplantsSection) objectToTest, diagnostician, map); + } + + }; + + validateProcedureImplantsSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureImplantsSectionText() { + OperationsTestCase validateProcedureImplantsSectionTextTestCase = new OperationsTestCase( + "validateProcedureImplantsSectionText", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_IMPLANTS_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureImplantsSection target) { + + } + + @Override + protected void updateToPass(ProcedureImplantsSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureImplantsSectionOperations.validateProcedureImplantsSectionText( + (ProcedureImplantsSection) objectToTest, diagnostician, map); + } + + }; + + validateProcedureImplantsSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureImplantsSectionTitle() { + OperationsTestCase validateProcedureImplantsSectionTitleTestCase = new OperationsTestCase( + "validateProcedureImplantsSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_IMPLANTS_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureImplantsSection target) { + + } + + @Override + protected void updateToPass(ProcedureImplantsSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureImplantsSectionOperations.validateProcedureImplantsSectionTitle( + (ProcedureImplantsSection) objectToTest, diagnostician, map); + } + + }; + + validateProcedureImplantsSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ProcedureImplantsSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ProcedureImplantsSection create() { + return ConsolFactory.eINSTANCE.createProcedureImplantsSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ProcedureImplantsSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ProcedureImplantsSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProcedureIndicationsSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProcedureIndicationsSectionTest.java new file mode 100644 index 000000000..4c3660d90 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProcedureIndicationsSectionTest.java @@ -0,0 +1,338 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ProcedureIndicationsSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.ProcedureIndicationsSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Procedure Indications Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureIndicationsSection#validateProcedureIndicationsSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Indications Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureIndicationsSection#validateProcedureIndicationsSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Indications Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureIndicationsSection#validateProcedureIndicationsSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Indications Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureIndicationsSection#validateProcedureIndicationsSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Indications Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureIndicationsSection#validateProcedureIndicationsSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Indications Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureIndicationsSection#validateProcedureIndicationsSectionIndication(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Indications Section Indication}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureIndicationsSection#getIndications() Get Indications}
  • + *
+ *

+ * + * @generated + */ + +public class ProcedureIndicationsSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateProcedureIndicationsSectionTemplateId() { + OperationsTestCase validateProcedureIndicationsSectionTemplateIdTestCase = new OperationsTestCase( + "validateProcedureIndicationsSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_INDICATIONS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureIndicationsSection target) { + + } + + @Override + protected void updateToPass(ProcedureIndicationsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureIndicationsSectionOperations.validateProcedureIndicationsSectionTemplateId( + (ProcedureIndicationsSection) objectToTest, diagnostician, map); + } + + }; + + validateProcedureIndicationsSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureIndicationsSectionCode() { + OperationsTestCase validateProcedureIndicationsSectionCodeTestCase = new OperationsTestCase( + "validateProcedureIndicationsSectionCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_INDICATIONS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureIndicationsSection target) { + + } + + @Override + protected void updateToPass(ProcedureIndicationsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureIndicationsSectionOperations.validateProcedureIndicationsSectionCode( + (ProcedureIndicationsSection) objectToTest, diagnostician, map); + } + + }; + + validateProcedureIndicationsSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureIndicationsSectionCodeP() { + OperationsTestCase validateProcedureIndicationsSectionCodePTestCase = new OperationsTestCase( + "validateProcedureIndicationsSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_INDICATIONS_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureIndicationsSection target) { + + } + + @Override + protected void updateToPass(ProcedureIndicationsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureIndicationsSectionOperations.validateProcedureIndicationsSectionCodeP( + (ProcedureIndicationsSection) objectToTest, diagnostician, map); + } + + }; + + validateProcedureIndicationsSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureIndicationsSectionText() { + OperationsTestCase validateProcedureIndicationsSectionTextTestCase = new OperationsTestCase( + "validateProcedureIndicationsSectionText", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_INDICATIONS_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureIndicationsSection target) { + + } + + @Override + protected void updateToPass(ProcedureIndicationsSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureIndicationsSectionOperations.validateProcedureIndicationsSectionText( + (ProcedureIndicationsSection) objectToTest, diagnostician, map); + } + + }; + + validateProcedureIndicationsSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureIndicationsSectionTitle() { + OperationsTestCase validateProcedureIndicationsSectionTitleTestCase = new OperationsTestCase( + "validateProcedureIndicationsSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_INDICATIONS_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureIndicationsSection target) { + + } + + @Override + protected void updateToPass(ProcedureIndicationsSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureIndicationsSectionOperations.validateProcedureIndicationsSectionTitle( + (ProcedureIndicationsSection) objectToTest, diagnostician, map); + } + + }; + + validateProcedureIndicationsSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureIndicationsSectionIndication() { + OperationsTestCase validateProcedureIndicationsSectionIndicationTestCase = new OperationsTestCase( + "validateProcedureIndicationsSectionIndication", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_INDICATIONS_SECTION_INDICATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureIndicationsSection target) { + target.init(); + } + + @Override + protected void updateToPass(ProcedureIndicationsSection target) { + + target.addObservation(ConsolFactory.eINSTANCE.createIndication().init()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureIndicationsSectionOperations.validateProcedureIndicationsSectionIndication( + (ProcedureIndicationsSection) objectToTest, diagnostician, map); + } + + }; + + validateProcedureIndicationsSectionIndicationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetIndications() { + + ProcedureIndicationsSection target = objectFactory.create(); + target.getIndications(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ProcedureIndicationsSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ProcedureIndicationsSection create() { + return ConsolFactory.eINSTANCE.createProcedureIndicationsSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ProcedureIndicationsSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ProcedureIndicationsSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProcedureNoteTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProcedureNoteTest.java new file mode 100644 index 000000000..04fb7fa4e --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProcedureNoteTest.java @@ -0,0 +1,3452 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.AssignedEntity; +import org.openhealthtools.mdht.uml.cda.AssociatedEntity; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Component1; +import org.openhealthtools.mdht.uml.cda.DocumentationOf; +import org.openhealthtools.mdht.uml.cda.EncompassingEncounter; +import org.openhealthtools.mdht.uml.cda.EncounterParticipant; +import org.openhealthtools.mdht.uml.cda.HealthCareFacility; +import org.openhealthtools.mdht.uml.cda.Participant1; +import org.openhealthtools.mdht.uml.cda.Performer1; +import org.openhealthtools.mdht.uml.cda.Person; +import org.openhealthtools.mdht.uml.cda.Section; +import org.openhealthtools.mdht.uml.cda.ServiceEvent; +import org.openhealthtools.mdht.uml.cda.consol.AllergiesSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.AnesthesiaSection; +import org.openhealthtools.mdht.uml.cda.consol.AssessmentAndPlanSection; +import org.openhealthtools.mdht.uml.cda.consol.AssessmentSection; +import org.openhealthtools.mdht.uml.cda.consol.ChiefComplaintAndReasonForVisitSection; +import org.openhealthtools.mdht.uml.cda.consol.ChiefComplaintSection; +import org.openhealthtools.mdht.uml.cda.consol.ComplicationsSection; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.FamilyHistorySection; +import org.openhealthtools.mdht.uml.cda.consol.HistoryOfPastIllnessSection; +import org.openhealthtools.mdht.uml.cda.consol.HistoryOfPresentIllnessSection; +import org.openhealthtools.mdht.uml.cda.consol.MedicalHistorySection; +import org.openhealthtools.mdht.uml.cda.consol.MedicationsAdministeredSection; +import org.openhealthtools.mdht.uml.cda.consol.MedicationsSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.PhysicalExamSection; +import org.openhealthtools.mdht.uml.cda.consol.PlanOfCareSection; +import org.openhealthtools.mdht.uml.cda.consol.PlannedProcedureSection; +import org.openhealthtools.mdht.uml.cda.consol.PostprocedureDiagnosisSection; +import org.openhealthtools.mdht.uml.cda.consol.ProcedureDescriptionSection; +import org.openhealthtools.mdht.uml.cda.consol.ProcedureDispositionSection; +import org.openhealthtools.mdht.uml.cda.consol.ProcedureEstimatedBloodLossSection; +import org.openhealthtools.mdht.uml.cda.consol.ProcedureFindingsSection; +import org.openhealthtools.mdht.uml.cda.consol.ProcedureImplantsSection; +import org.openhealthtools.mdht.uml.cda.consol.ProcedureIndicationsSection; +import org.openhealthtools.mdht.uml.cda.consol.ProcedureNote; +import org.openhealthtools.mdht.uml.cda.consol.ProcedureSpecimensTakenSection; +import org.openhealthtools.mdht.uml.cda.consol.ProceduresSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.ReasonForVisitSection; +import org.openhealthtools.mdht.uml.cda.consol.ReviewOfSystemsSection; +import org.openhealthtools.mdht.uml.cda.consol.SocialHistorySection; +import org.openhealthtools.mdht.uml.cda.consol.operations.GeneralHeaderConstraintsOperations; +import org.openhealthtools.mdht.uml.cda.consol.operations.ProcedureNoteOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVXB_TS; +import org.openhealthtools.mdht.uml.hl7.vocab.ParticipationType; +import org.openhealthtools.mdht.uml.hl7.vocab.RoleClassAssociative; +import org.openhealthtools.mdht.uml.hl7.vocab.x_EncounterParticipant; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ServiceEventPerformer; + +/** + * + * A static utility class that provides operations related to 'Procedure Note' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteHasAnAssementAndPlanSectionOrIndividualAssementAndPlanSections(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Has An Assement And Plan Section Or Individual Assement And Plan Sections}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteDoesNotHaveIndividualAssementAndPlanSectionsWhenAssementAndPlanSectionPresent(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Does Not Have Individual Assement And Plan Sections When Assement And Plan Section Present}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteDoesNotHaveChiefComplaintAndReasonForVisitWithChiefComplaintSectionOrReasonSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Does Not Have Chief Complaint And Reason For Visit With Chief Complaint Section Or Reason Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteSectionTitles(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Section Titles}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteComponentOf(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Component Of}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNotePrimaryCarePhysician(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Primary Care Physician}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteAssessmentSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Assessment Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNotePlanOfCareSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Plan Of Care Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteAssessmentAndPlanSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Assessment And Plan Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteComplicationsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Complications Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNotePostprocedureDiagnosisSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Postprocedure Diagnosis Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteProcedureDescriptionSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Procedure Description Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteProcedureIndicationsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Procedure Indications Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteAllergiesSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Allergies Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteAnesthesiaSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Anesthesia Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteChiefComplaintSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Chief Complaint Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteChiefComplaintAndReasonForVisitSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Chief Complaint And Reason For Visit Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteFamilyHistorySection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Family History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteHistoryOfPastIllnessSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note History Of Past Illness Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteHistoryOfPresentIllnessSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note History Of Present Illness Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteMedicalHistorySection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Medical History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteMedicationsSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Medications Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteMedicationsAdministeredSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Medications Administered Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNotePhysicalExamSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Physical Exam Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNotePlannedProcedureSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Planned Procedure Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteProcedureDispositionSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Procedure Disposition Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteProcedureEstimatedBloodLossSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Procedure Estimated Blood Loss Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteProcedureFindingsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Procedure Findings Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteProcedureImplantsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Procedure Implants Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteProcedureSpecimensTakenSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Procedure Specimens Taken Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteProceduresSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Procedures Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteReasonForVisitSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Reason For Visit Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteReviewOfSystemsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Review Of Systems Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteSocialHistorySection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Social History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteParticipant1(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Participant1}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteDocumentationOf(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Documentation Of}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteComponentOfEncompassingEncounter5LocationHealthCareFacilityId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Component Of Encompassing Encounter5 Location Health Care Facility Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteComponentOfEncompassingEncounter5LocationHealthCareFacility(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Component Of Encompassing Encounter5 Location Health Care Facility}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteComponentOfEncompassingEncounter5EncounterParticipantTypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Component Of Encompassing Encounter5 Encounter Participant Type Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteComponentOfEncompassingEncounter5Code(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Component Of Encompassing Encounter5 Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteComponentOfEncompassingEncounter5Location(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Component Of Encompassing Encounter5 Location}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteComponentOfEncompassingEncounter5EncounterParticipant(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Component Of Encompassing Encounter5 Encounter Participant}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteComponentOfEncompassingEncounter5(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Component Of Encompassing Encounter5}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNotePrimaryCarePhysicianAssociatedEntityClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Primary Care Physician Associated Entity Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNotePrimaryCarePhysicianAssociatedEntityAssociatedPerson(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Primary Care Physician Associated Entity Associated Person}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNotePrimaryCarePhysicianFunctionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Primary Care Physician Function Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNotePrimaryCarePhysicianFunctionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Primary Care Physician Function Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNotePrimaryCarePhysicianTypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Primary Care Physician Type Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNotePrimaryCarePhysicianAssociatedEntity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Primary Care Physician Associated Entity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteDocumentationOfServiceEvent1PrimaryPerformerAssignedEntityCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Documentation Of Service Event1 Primary Performer Assigned Entity Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteDocumentationOfServiceEvent1PrimaryPerformerAssignedEntityCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Documentation Of Service Event1 Primary Performer Assigned Entity Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteDocumentationOfServiceEvent1PrimaryPerformerTypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Documentation Of Service Event1 Primary Performer Type Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteDocumentationOfServiceEvent1PrimaryPerformerAssignedEntity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Documentation Of Service Event1 Primary Performer Assigned Entity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteDocumentationOfServiceEvent1ProcedureCodes(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Documentation Of Service Event1 Procedure Codes}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteDocumentationOfServiceEvent1EffectiveTimeHasLow(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Documentation Of Service Event1 Effective Time Has Low}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteDocumentationOfServiceEvent1EffectiveTimeHasHighWhenNoWidth(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Documentation Of Service Event1 Effective Time Has High When No Width}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteDocumentationOfServiceEvent1EffectiveTimeNoHighIfWidth(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Documentation Of Service Event1 Effective Time No High If Width}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteDocumentationOfServiceEvent1Code(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Documentation Of Service Event1 Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteDocumentationOfServiceEvent1EffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Documentation Of Service Event1 Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteDocumentationOfServiceEvent1PrimaryPerformer(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Documentation Of Service Event1 Primary Performer}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#validateProcedureNoteDocumentationOfServiceEvent1(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Note Documentation Of Service Event1}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#getAssessmentSection() Get Assessment Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#getPlanOfCareSection() Get Plan Of Care Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#getAssessmentAndPlanSection() Get Assessment And Plan Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#getComplicationsSection() Get Complications Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#getPostprocedureDiagnosisSection() Get Postprocedure Diagnosis Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#getProcedureDescriptionSection() Get Procedure Description Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#getProcedureIndicationsSection() Get Procedure Indications Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#getAllergiesSectionEntriesOptional() Get Allergies Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#getAnesthesiaSection() Get Anesthesia Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#getChiefComplaintSection() Get Chief Complaint Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#getChiefComplaintAndReasonForVisitSection() Get Chief Complaint And Reason For Visit Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#getFamilyHistorySection() Get Family History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#getHistoryOfPastIllnessSection() Get History Of Past Illness Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#getHistoryOfPresentIllnessSection() Get History Of Present Illness Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#getMedicalHistorySection() Get Medical History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#getMedicationsSectionEntriesOptional() Get Medications Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#getMedicationsAdministeredSection() Get Medications Administered Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#getPhysicalExamSection() Get Physical Exam Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#getPlannedProcedureSection() Get Planned Procedure Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#getProcedureDispositionSection() Get Procedure Disposition Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#getProcedureEstimatedBloodLossSection() Get Procedure Estimated Blood Loss Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#getProcedureFindingsSection() Get Procedure Findings Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#getProcedureImplantsSection() Get Procedure Implants Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#getProcedureSpecimensTakenSection() Get Procedure Specimens Taken Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#getProceduresSectionEntriesOptional() Get Procedures Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#getReasonForVisitSection() Get Reason For Visit Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#getReviewOfSystemsSection() Get Review Of Systems Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureNote#getSocialHistorySection() Get Social History Section}
  • + *
+ *

+ * + * @generated + */ + +public class ProcedureNoteTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureNoteHasAnAssementAndPlanSectionOrIndividualAssementAndPlanSections() { + OperationsTestCase validateProcedureNoteHasAnAssementAndPlanSectionOrIndividualAssementAndPlanSectionsTestCase = new OperationsTestCase( + "validateProcedureNoteHasAnAssementAndPlanSectionOrIndividualAssementAndPlanSections", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_HAS_AN_ASSEMENT_AND_PLAN_SECTION_OR_INDIVIDUAL_ASSEMENT_AND_PLAN_SECTIONS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + public void addFailTests() { + + addFailTest(new FailTest() { + @Override + public void updateToFail(ProcedureNote target) { + target.init(); + } + + }); + + addFailTest(new FailTest() { + @Override + public void updateToFail(ProcedureNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createAssessmentSection().init()); + } + + }); + + addFailTest(new FailTest() { + @Override + public void updateToFail(ProcedureNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createPlanOfCareSection().init()); + } + + }); + + } + + /* + * (non-Javadoc) + * + * @see org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest.OperationsTestCase#addPassTests() + */ + @Override + public void addPassTests() { + addPassTest(new PassTest() { + @Override + public void updateToPass(ProcedureNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createAssessmentAndPlanSection().init()); + + } + }); + + addPassTest(new PassTest() { + @Override + public void updateToPass(ProcedureNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createAssessmentSection().init()); + target.addSection(ConsolFactory.eINSTANCE.createPlanOfCareSection().init()); + } + }); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteHasAnAssementAndPlanSectionOrIndividualAssementAndPlanSections( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteHasAnAssementAndPlanSectionOrIndividualAssementAndPlanSectionsTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureNoteDoesNotHaveIndividualAssementAndPlanSectionsWhenAssementAndPlanSectionPresent() { + OperationsTestCase validateProcedureNoteDoesNotHaveIndividualAssementAndPlanSectionsWhenAssementAndPlanSectionPresentTestCase = new OperationsTestCase( + "validateProcedureNoteDoesNotHaveIndividualAssementAndPlanSectionsWhenAssementAndPlanSectionPresent", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_DOES_NOT_HAVE_INDIVIDUAL_ASSEMENT_AND_PLAN_SECTIONS_WHEN_ASSEMENT_AND_PLAN_SECTION_PRESENT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + /* + * (non-Javadoc) + * + * @see org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest.OperationsTestCase#addFailTests() + */ + @Override + public void addFailTests() { + + addFailTest(new FailTest() { + @Override + public void updateToFail(ProcedureNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createAssessmentAndPlanSection().init()); + target.addSection(ConsolFactory.eINSTANCE.createPlanOfCareSection().init()); + } + + }); + + addFailTest(new FailTest() { + @Override + public void updateToFail(ProcedureNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createAssessmentAndPlanSection().init()); + target.addSection(ConsolFactory.eINSTANCE.createAssessmentSection().init()); + } + + }); + + addFailTest(new FailTest() { + @Override + public void updateToFail(ProcedureNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createAssessmentAndPlanSection().init()); + target.addSection(ConsolFactory.eINSTANCE.createAssessmentSection().init()); + target.addSection(ConsolFactory.eINSTANCE.createPlanOfCareSection().init()); + } + + }); + + } + + @Override + public void addPassTests() { + addPassTest(new PassTest() { + @Override + public void updateToPass(ProcedureNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createAssessmentAndPlanSection().init()); + + } + }); + + addPassTest(new PassTest() { + @Override + public void updateToPass(ProcedureNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createAssessmentSection().init()); + target.addSection(ConsolFactory.eINSTANCE.createPlanOfCareSection().init()); + } + }); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteDoesNotHaveIndividualAssementAndPlanSectionsWhenAssementAndPlanSectionPresent( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteDoesNotHaveIndividualAssementAndPlanSectionsWhenAssementAndPlanSectionPresentTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureNoteDoesNotHaveChiefComplaintAndReasonForVisitWithChiefComplaintSectionOrReasonSection() { + OperationsTestCase validateProcedureNoteDoesNotHaveChiefComplaintAndReasonForVisitWithChiefComplaintSectionOrReasonSectionTestCase = new OperationsTestCase( + "validateProcedureNoteDoesNotHaveChiefComplaintAndReasonForVisitWithChiefComplaintSectionOrReasonSection", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_DOES_NOT_HAVE_CHIEF_COMPLAINT_AND_REASON_FOR_VISIT_WITH_CHIEF_COMPLAINT_SECTION_OR_REASON_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + public void addFailTests() { + + addFailTest(new FailTest() { + @Override + public void updateToFail(ProcedureNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createChiefComplaintAndReasonForVisitSection().init()); + target.addSection(ConsolFactory.eINSTANCE.createChiefComplaintSection().init()); + } + + }); + + addFailTest(new FailTest() { + @Override + public void updateToFail(ProcedureNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createChiefComplaintAndReasonForVisitSection().init()); + target.addSection(ConsolFactory.eINSTANCE.createReasonForVisitSection().init()); + } + + }); + + addFailTest(new FailTest() { + @Override + public void updateToFail(ProcedureNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createChiefComplaintAndReasonForVisitSection().init()); + target.addSection(ConsolFactory.eINSTANCE.createChiefComplaintSection().init()); + target.addSection(ConsolFactory.eINSTANCE.createReasonForVisitSection().init()); + } + + }); + + } + + @Override + public void addPassTests() { + addPassTest(new PassTest() { + @Override + public void updateToPass(ProcedureNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createChiefComplaintAndReasonForVisitSection().init()); + + } + }); + + addPassTest(new PassTest() { + @Override + public void updateToPass(ProcedureNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createChiefComplaintSection().init()); + target.addSection(ConsolFactory.eINSTANCE.createReasonForVisitSection().init()); + } + }); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteDoesNotHaveChiefComplaintAndReasonForVisitWithChiefComplaintSectionOrReasonSection( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteDoesNotHaveChiefComplaintAndReasonForVisitWithChiefComplaintSectionOrReasonSectionTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureNoteSectionTitles() { + OperationsTestCase validateProcedureNoteSectionTitlesTestCase = new OperationsTestCase( + "validateProcedureNoteSectionTitles", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_SECTION_TITLES__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + target.addSection(ConsolFactory.eINSTANCE.createAdvanceDirectivesSection()); + } + + @Override + protected void updateToPass(ProcedureNote target) { + for (Section s : target.getAllSections()) { + s.setTitle(DatatypesFactory.eINSTANCE.createST("title")); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteSectionTitles( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteSectionTitlesTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureNoteTemplateId() { + OperationsTestCase validateProcedureNoteTemplateIdTestCase = new OperationsTestCase( + "validateProcedureNoteTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteTemplateId( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureNoteCodeP() { + OperationsTestCase validateProcedureNoteCodePTestCase = new OperationsTestCase( + "validateProcedureNoteCodeP", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteCodeP( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureNoteCode() { + OperationsTestCase validateProcedureNoteCodeTestCase = new OperationsTestCase( + "validateProcedureNoteCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.init(); + target.setCode(DatatypesFactory.eINSTANCE.createCE("28577-5", "2.16.840.1.113883.6.1")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteCode( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureNoteComponentOf() { + OperationsTestCase validateProcedureNoteComponentOfTestCase = new OperationsTestCase( + "validateProcedureNoteComponentOf", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_COMPONENT_OF__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + target.init(); + } + + @Override + protected void updateToPass(ProcedureNote target) { + Component1 cof = CDAFactory.eINSTANCE.createComponent1(); + target.setComponentOf(cof); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteComponentOf( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteComponentOfTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureNotePrimaryCarePhysician() { + OperationsTestCase validateProcedureNotePrimaryCarePhysicianTestCase = new OperationsTestCase( + "validateProcedureNotePrimaryCarePhysician", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_PRIMARY_CARE_PHYSICIAN__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + target.init(); + } + + @Override + protected void updateToPass(ProcedureNote target) { + + Participant1 par = CDAFactory.eINSTANCE.createParticipant1(); + par.setTypeCode(ParticipationType.IND); + target.getParticipants().add(par); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNotePrimaryCarePhysician( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNotePrimaryCarePhysicianTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureNoteAssessmentSection() { + OperationsTestCase validateProcedureNoteAssessmentSectionTestCase = new OperationsTestCase( + "validateProcedureNoteAssessmentSection", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_ASSESSMENT_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.init(); + + /* AssessmentSection */ + AssessmentSection section = + + ConsolFactory.eINSTANCE.createAssessmentSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteAssessmentSection( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteAssessmentSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureNotePlanOfCareSection() { + OperationsTestCase validateProcedureNotePlanOfCareSectionTestCase = new OperationsTestCase( + "validateProcedureNotePlanOfCareSection", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_PLAN_OF_CARE_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.init(); + + /* PlanOfCareSection */ + PlanOfCareSection section = + + ConsolFactory.eINSTANCE.createPlanOfCareSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNotePlanOfCareSection( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNotePlanOfCareSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureNoteAssessmentAndPlanSection() { + OperationsTestCase validateProcedureNoteAssessmentAndPlanSectionTestCase = new OperationsTestCase( + "validateProcedureNoteAssessmentAndPlanSection", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_ASSESSMENT_AND_PLAN_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.init(); + + /* AssessmentAndPlanSection */ + AssessmentAndPlanSection section = + + ConsolFactory.eINSTANCE.createAssessmentAndPlanSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteAssessmentAndPlanSection( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteAssessmentAndPlanSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureNoteComplicationsSection() { + OperationsTestCase validateProcedureNoteComplicationsSectionTestCase = new OperationsTestCase( + "validateProcedureNoteComplicationsSection", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_COMPLICATIONS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.init(); + + /* ComplicationsSection */ + ComplicationsSection section = + + ConsolFactory.eINSTANCE.createComplicationsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteComplicationsSection( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteComplicationsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureNotePostprocedureDiagnosisSection() { + OperationsTestCase validateProcedureNotePostprocedureDiagnosisSectionTestCase = new OperationsTestCase( + "validateProcedureNotePostprocedureDiagnosisSection", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_POSTPROCEDURE_DIAGNOSIS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.init(); + + /* PostprocedureDiagnosisSection */ + PostprocedureDiagnosisSection section = + + ConsolFactory.eINSTANCE.createPostprocedureDiagnosisSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNotePostprocedureDiagnosisSection( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNotePostprocedureDiagnosisSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureNoteProcedureDescriptionSection() { + OperationsTestCase validateProcedureNoteProcedureDescriptionSectionTestCase = new OperationsTestCase( + "validateProcedureNoteProcedureDescriptionSection", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_PROCEDURE_DESCRIPTION_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.init(); + + /* ProcedureDescriptionSection */ + ProcedureDescriptionSection section = + + ConsolFactory.eINSTANCE.createProcedureDescriptionSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteProcedureDescriptionSection( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteProcedureDescriptionSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureNoteProcedureIndicationsSection() { + OperationsTestCase validateProcedureNoteProcedureIndicationsSectionTestCase = new OperationsTestCase( + "validateProcedureNoteProcedureIndicationsSection", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_PROCEDURE_INDICATIONS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.init(); + + /* ProcedureIndicationsSection */ + ProcedureIndicationsSection section = + + ConsolFactory.eINSTANCE.createProcedureIndicationsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteProcedureIndicationsSection( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteProcedureIndicationsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureNoteAllergiesSectionEntriesOptional() { + OperationsTestCase validateProcedureNoteAllergiesSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateProcedureNoteAllergiesSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_ALLERGIES_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.init(); + + /* AllergiesSectionEntriesOptional */ + AllergiesSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createAllergiesSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteAllergiesSectionEntriesOptional( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteAllergiesSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureNoteAnesthesiaSection() { + OperationsTestCase validateProcedureNoteAnesthesiaSectionTestCase = new OperationsTestCase( + "validateProcedureNoteAnesthesiaSection", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_ANESTHESIA_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.init(); + + /* AnesthesiaSection */ + AnesthesiaSection section = + + ConsolFactory.eINSTANCE.createAnesthesiaSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteAnesthesiaSection( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteAnesthesiaSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureNoteChiefComplaintSection() { + OperationsTestCase validateProcedureNoteChiefComplaintSectionTestCase = new OperationsTestCase( + "validateProcedureNoteChiefComplaintSection", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_CHIEF_COMPLAINT_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.init(); + + /* ChiefComplaintSection */ + ChiefComplaintSection section = + + ConsolFactory.eINSTANCE.createChiefComplaintSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteChiefComplaintSection( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteChiefComplaintSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureNoteChiefComplaintAndReasonForVisitSection() { + OperationsTestCase validateProcedureNoteChiefComplaintAndReasonForVisitSectionTestCase = new OperationsTestCase( + "validateProcedureNoteChiefComplaintAndReasonForVisitSection", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_CHIEF_COMPLAINT_AND_REASON_FOR_VISIT_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.init(); + + /* ChiefComplaintAndReasonForVisitSection */ + ChiefComplaintAndReasonForVisitSection section = + + ConsolFactory.eINSTANCE.createChiefComplaintAndReasonForVisitSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteChiefComplaintAndReasonForVisitSection( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteChiefComplaintAndReasonForVisitSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureNoteFamilyHistorySection() { + OperationsTestCase validateProcedureNoteFamilyHistorySectionTestCase = new OperationsTestCase( + "validateProcedureNoteFamilyHistorySection", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_FAMILY_HISTORY_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.init(); + + /* FamilyHistorySection */ + FamilyHistorySection section = + + ConsolFactory.eINSTANCE.createFamilyHistorySection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteFamilyHistorySection( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteFamilyHistorySectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureNoteHistoryOfPastIllnessSection() { + OperationsTestCase validateProcedureNoteHistoryOfPastIllnessSectionTestCase = new OperationsTestCase( + "validateProcedureNoteHistoryOfPastIllnessSection", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_HISTORY_OF_PAST_ILLNESS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.init(); + + /* HistoryOfPastIllnessSection */ + HistoryOfPastIllnessSection section = + + ConsolFactory.eINSTANCE.createHistoryOfPastIllnessSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteHistoryOfPastIllnessSection( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteHistoryOfPastIllnessSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureNoteHistoryOfPresentIllnessSection() { + OperationsTestCase validateProcedureNoteHistoryOfPresentIllnessSectionTestCase = new OperationsTestCase( + "validateProcedureNoteHistoryOfPresentIllnessSection", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_HISTORY_OF_PRESENT_ILLNESS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.init(); + + /* HistoryOfPresentIllnessSection */ + HistoryOfPresentIllnessSection section = + + ConsolFactory.eINSTANCE.createHistoryOfPresentIllnessSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteHistoryOfPresentIllnessSection( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteHistoryOfPresentIllnessSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureNoteMedicalHistorySection() { + OperationsTestCase validateProcedureNoteMedicalHistorySectionTestCase = new OperationsTestCase( + "validateProcedureNoteMedicalHistorySection", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_MEDICAL_HISTORY_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.init(); + + /* MedicalHistorySection */ + MedicalHistorySection section = + + ConsolFactory.eINSTANCE.createMedicalHistorySection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteMedicalHistorySection( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteMedicalHistorySectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureNoteMedicationsSectionEntriesOptional() { + OperationsTestCase validateProcedureNoteMedicationsSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateProcedureNoteMedicationsSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_MEDICATIONS_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.init(); + + /* MedicationsSectionEntriesOptional */ + MedicationsSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createMedicationsSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteMedicationsSectionEntriesOptional( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteMedicationsSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureNoteMedicationsAdministeredSection() { + OperationsTestCase validateProcedureNoteMedicationsAdministeredSectionTestCase = new OperationsTestCase( + "validateProcedureNoteMedicationsAdministeredSection", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_MEDICATIONS_ADMINISTERED_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.init(); + + /* MedicationsAdministeredSection */ + MedicationsAdministeredSection section = + + ConsolFactory.eINSTANCE.createMedicationsAdministeredSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteMedicationsAdministeredSection( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteMedicationsAdministeredSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureNotePhysicalExamSection() { + OperationsTestCase validateProcedureNotePhysicalExamSectionTestCase = new OperationsTestCase( + "validateProcedureNotePhysicalExamSection", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_PHYSICAL_EXAM_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.init(); + + /* PhysicalExamSection */ + PhysicalExamSection section = + + ConsolFactory.eINSTANCE.createPhysicalExamSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNotePhysicalExamSection( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNotePhysicalExamSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureNotePlannedProcedureSection() { + OperationsTestCase validateProcedureNotePlannedProcedureSectionTestCase = new OperationsTestCase( + "validateProcedureNotePlannedProcedureSection", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_PLANNED_PROCEDURE_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.init(); + + /* PlannedProcedureSection */ + PlannedProcedureSection section = + + ConsolFactory.eINSTANCE.createPlannedProcedureSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNotePlannedProcedureSection( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNotePlannedProcedureSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureNoteProcedureDispositionSection() { + OperationsTestCase validateProcedureNoteProcedureDispositionSectionTestCase = new OperationsTestCase( + "validateProcedureNoteProcedureDispositionSection", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_PROCEDURE_DISPOSITION_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.init(); + + /* ProcedureDispositionSection */ + ProcedureDispositionSection section = + + ConsolFactory.eINSTANCE.createProcedureDispositionSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteProcedureDispositionSection( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteProcedureDispositionSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureNoteProcedureEstimatedBloodLossSection() { + OperationsTestCase validateProcedureNoteProcedureEstimatedBloodLossSectionTestCase = new OperationsTestCase( + "validateProcedureNoteProcedureEstimatedBloodLossSection", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_PROCEDURE_ESTIMATED_BLOOD_LOSS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.init(); + + /* ProcedureEstimatedBloodLossSection */ + ProcedureEstimatedBloodLossSection section = + + ConsolFactory.eINSTANCE.createProcedureEstimatedBloodLossSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteProcedureEstimatedBloodLossSection( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteProcedureEstimatedBloodLossSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureNoteProcedureFindingsSection() { + OperationsTestCase validateProcedureNoteProcedureFindingsSectionTestCase = new OperationsTestCase( + "validateProcedureNoteProcedureFindingsSection", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_PROCEDURE_FINDINGS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.init(); + + /* ProcedureFindingsSection */ + ProcedureFindingsSection section = + + ConsolFactory.eINSTANCE.createProcedureFindingsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteProcedureFindingsSection( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteProcedureFindingsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureNoteProcedureImplantsSection() { + OperationsTestCase validateProcedureNoteProcedureImplantsSectionTestCase = new OperationsTestCase( + "validateProcedureNoteProcedureImplantsSection", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_PROCEDURE_IMPLANTS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.init(); + + /* ProcedureImplantsSection */ + ProcedureImplantsSection section = + + ConsolFactory.eINSTANCE.createProcedureImplantsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteProcedureImplantsSection( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteProcedureImplantsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureNoteProcedureSpecimensTakenSection() { + OperationsTestCase validateProcedureNoteProcedureSpecimensTakenSectionTestCase = new OperationsTestCase( + "validateProcedureNoteProcedureSpecimensTakenSection", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_PROCEDURE_SPECIMENS_TAKEN_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.init(); + + /* ProcedureSpecimensTakenSection */ + ProcedureSpecimensTakenSection section = + + ConsolFactory.eINSTANCE.createProcedureSpecimensTakenSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteProcedureSpecimensTakenSection( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteProcedureSpecimensTakenSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureNoteProceduresSectionEntriesOptional() { + OperationsTestCase validateProcedureNoteProceduresSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateProcedureNoteProceduresSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_PROCEDURES_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.init(); + + /* ProceduresSectionEntriesOptional */ + ProceduresSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createProceduresSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteProceduresSectionEntriesOptional( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteProceduresSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureNoteReasonForVisitSection() { + OperationsTestCase validateProcedureNoteReasonForVisitSectionTestCase = new OperationsTestCase( + "validateProcedureNoteReasonForVisitSection", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_REASON_FOR_VISIT_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.init(); + + /* ReasonForVisitSection */ + ReasonForVisitSection section = + + ConsolFactory.eINSTANCE.createReasonForVisitSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteReasonForVisitSection( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteReasonForVisitSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureNoteReviewOfSystemsSection() { + OperationsTestCase validateProcedureNoteReviewOfSystemsSectionTestCase = new OperationsTestCase( + "validateProcedureNoteReviewOfSystemsSection", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_REVIEW_OF_SYSTEMS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.init(); + + /* ReviewOfSystemsSection */ + ReviewOfSystemsSection section = + + ConsolFactory.eINSTANCE.createReviewOfSystemsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteReviewOfSystemsSection( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteReviewOfSystemsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureNoteSocialHistorySection() { + OperationsTestCase validateProcedureNoteSocialHistorySectionTestCase = new OperationsTestCase( + "validateProcedureNoteSocialHistorySection", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_SOCIAL_HISTORY_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.init(); + + /* SocialHistorySection */ + SocialHistorySection section = + + ConsolFactory.eINSTANCE.createSocialHistorySection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteSocialHistorySection( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteSocialHistorySectionTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureNoteParticipant1() { + OperationsTestCase validateProcedureNoteParticipant1TestCase = new OperationsTestCase( + "validateProcedureNoteParticipant1", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_PARTICIPANT1__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.init(); + target.getParticipants().add(CDAFactory.eINSTANCE.createParticipant1()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteParticipant1( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteParticipant1TestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureNoteDocumentationOf() { + OperationsTestCase validateProcedureNoteDocumentationOfTestCase = new OperationsTestCase( + "validateProcedureNoteDocumentationOf", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_DOCUMENTATION_OF__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.init(); + target.getDocumentationOfs().add(CDAFactory.eINSTANCE.createDocumentationOf()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteDocumentationOf( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteDocumentationOfTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureNoteComponentOfEncompassingEncounter5LocationHealthCareFacilityId() { + OperationsTestCase validateProcedureNoteComponentOfEncompassingEncounter5LocationHealthCareFacilityIdTestCase = new OperationsTestCase( + "validateProcedureNoteComponentOfEncompassingEncounter5LocationHealthCareFacilityId", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_COMPONENT_OF_ENCOMPASSING_ENCOUNTER5_LOCATION_HEALTH_CARE_FACILITY_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + target.init(); + Component1 cof = CDAFactory.eINSTANCE.createComponent1(); + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + cof.setEncompassingEncounter(ee); + target.setComponentOf(cof); + target.getComponentOf().getEncompassingEncounter().setLocation(CDAFactory.eINSTANCE.createLocation()); + HealthCareFacility hcf = CDAFactory.eINSTANCE.createHealthCareFacility(); + target.getComponentOf().getEncompassingEncounter().getLocation().setHealthCareFacility(hcf); + + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.getComponentOf().getEncompassingEncounter().getLocation().getHealthCareFacility().getIds().add( + DatatypesFactory.eINSTANCE.createII()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteComponentOfEncompassingEncounter5LocationHealthCareFacilityId( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteComponentOfEncompassingEncounter5LocationHealthCareFacilityIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureNoteComponentOfEncompassingEncounter5LocationHealthCareFacility() { + OperationsTestCase validateProcedureNoteComponentOfEncompassingEncounter5LocationHealthCareFacilityTestCase = new OperationsTestCase( + "validateProcedureNoteComponentOfEncompassingEncounter5LocationHealthCareFacility", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_COMPONENT_OF_ENCOMPASSING_ENCOUNTER5_LOCATION_HEALTH_CARE_FACILITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + target.init(); + Component1 cof = CDAFactory.eINSTANCE.createComponent1(); + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + ee.setLocation(CDAFactory.eINSTANCE.createLocation()); + + cof.setEncompassingEncounter(ee); + target.setComponentOf(cof); + + } + + @Override + protected void updateToPass(ProcedureNote target) { + HealthCareFacility hcf = CDAFactory.eINSTANCE.createHealthCareFacility(); + target.getComponentOf().getEncompassingEncounter().getLocation().setHealthCareFacility(hcf); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteComponentOfEncompassingEncounter5LocationHealthCareFacility( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteComponentOfEncompassingEncounter5LocationHealthCareFacilityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureNoteComponentOfEncompassingEncounter5EncounterParticipantTypeCode() { + OperationsTestCase validateProcedureNoteComponentOfEncompassingEncounter5EncounterParticipantTypeCodeTestCase = new OperationsTestCase( + "validateProcedureNoteComponentOfEncompassingEncounter5EncounterParticipantTypeCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_COMPONENT_OF_ENCOMPASSING_ENCOUNTER5_ENCOUNTER_PARTICIPANT_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + { + skipFailsTest(); + } + + @Override + protected void updateToFail(ProcedureNote target) { + target.init(); + Component1 cof = CDAFactory.eINSTANCE.createComponent1(); + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + cof.setEncompassingEncounter(ee); + target.setComponentOf(cof); + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.init(); + Component1 cof = CDAFactory.eINSTANCE.createComponent1(); + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + cof.setEncompassingEncounter(ee); + target.setComponentOf(cof); + EncounterParticipant ep = CDAFactory.eINSTANCE.createEncounterParticipant(); + ep.setTypeCode(x_EncounterParticipant.REF); + target.getComponentOf().getEncompassingEncounter().getEncounterParticipants().add(ep); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteComponentOfEncompassingEncounter5EncounterParticipantTypeCode( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteComponentOfEncompassingEncounter5EncounterParticipantTypeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureNoteComponentOfEncompassingEncounter5Code() { + OperationsTestCase validateProcedureNoteComponentOfEncompassingEncounter5CodeTestCase = new OperationsTestCase( + "validateProcedureNoteComponentOfEncompassingEncounter5Code", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_COMPONENT_OF_ENCOMPASSING_ENCOUNTER5_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + target.init(); + Component1 cof = CDAFactory.eINSTANCE.createComponent1(); + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + cof.setEncompassingEncounter(ee); + target.setComponentOf(cof); + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.getComponentOf().getEncompassingEncounter().setCode(DatatypesFactory.eINSTANCE.createCE()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteComponentOfEncompassingEncounter5Code( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteComponentOfEncompassingEncounter5CodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureNoteComponentOfEncompassingEncounter5Location() { + OperationsTestCase validateProcedureNoteComponentOfEncompassingEncounter5LocationTestCase = new OperationsTestCase( + "validateProcedureNoteComponentOfEncompassingEncounter5Location", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_COMPONENT_OF_ENCOMPASSING_ENCOUNTER5_LOCATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + target.init(); + Component1 cof = CDAFactory.eINSTANCE.createComponent1(); + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + cof.setEncompassingEncounter(ee); + target.setComponentOf(cof); + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.getComponentOf().getEncompassingEncounter().setLocation(CDAFactory.eINSTANCE.createLocation()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteComponentOfEncompassingEncounter5Location( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteComponentOfEncompassingEncounter5LocationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureNoteComponentOfEncompassingEncounter5EncounterParticipant() { + OperationsTestCase validateProcedureNoteComponentOfEncompassingEncounter5EncounterParticipantTestCase = new OperationsTestCase( + "validateProcedureNoteComponentOfEncompassingEncounter5EncounterParticipant", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_COMPONENT_OF_ENCOMPASSING_ENCOUNTER5_ENCOUNTER_PARTICIPANT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + target.init(); + Component1 cof = CDAFactory.eINSTANCE.createComponent1(); + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + cof.setEncompassingEncounter(ee); + target.setComponentOf(cof); + } + + @Override + protected void updateToPass(ProcedureNote target) { + EncounterParticipant ep = CDAFactory.eINSTANCE.createEncounterParticipant(); + target.getComponentOf().getEncompassingEncounter().getEncounterParticipants().add(ep); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteComponentOfEncompassingEncounter5EncounterParticipant( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteComponentOfEncompassingEncounter5EncounterParticipantTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureNoteComponentOfEncompassingEncounter5() { + OperationsTestCase validateProcedureNoteComponentOfEncompassingEncounter5TestCase = new OperationsTestCase( + "validateProcedureNoteComponentOfEncompassingEncounter5", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_COMPONENT_OF_ENCOMPASSING_ENCOUNTER5__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + target.init(); + Component1 cof = CDAFactory.eINSTANCE.createComponent1(); + target.setComponentOf(cof); + + } + + @Override + protected void updateToPass(ProcedureNote target) { + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + target.getComponentOf().setEncompassingEncounter(ee); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteComponentOfEncompassingEncounter5( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteComponentOfEncompassingEncounter5TestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureNotePrimaryCarePhysicianAssociatedEntityClassCode() { + OperationsTestCase validateProcedureNotePrimaryCarePhysicianAssociatedEntityClassCodeTestCase = new OperationsTestCase( + "validateProcedureNotePrimaryCarePhysicianAssociatedEntityClassCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_PRIMARY_CARE_PHYSICIAN_ASSOCIATED_ENTITY_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + target.init(); + Participant1 par = CDAFactory.eINSTANCE.createParticipant1(); + par.setTypeCode(ParticipationType.IND); + AssociatedEntity ae = CDAFactory.eINSTANCE.createAssociatedEntity(); + par.setAssociatedEntity(ae); + target.getParticipants().add(par); + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.getParticipants().clear(); + Participant1 par = CDAFactory.eINSTANCE.createParticipant1(); + par.setTypeCode(ParticipationType.IND); + + AssociatedEntity ae = CDAFactory.eINSTANCE.createAssociatedEntity(); + ae.setClassCode(RoleClassAssociative.PROV); + Person ap = CDAFactory.eINSTANCE.createPerson(); + ae.setAssociatedPerson(ap); + par.setAssociatedEntity(ae); + target.getParticipants().add(par); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNotePrimaryCarePhysicianAssociatedEntityClassCode( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNotePrimaryCarePhysicianAssociatedEntityClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureNotePrimaryCarePhysicianAssociatedEntityAssociatedPerson() { + OperationsTestCase validateProcedureNotePrimaryCarePhysicianAssociatedEntityAssociatedPersonTestCase = new OperationsTestCase( + "validateProcedureNotePrimaryCarePhysicianAssociatedEntityAssociatedPerson", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_PRIMARY_CARE_PHYSICIAN_ASSOCIATED_ENTITY_ASSOCIATED_PERSON__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + target.init(); + Participant1 par = CDAFactory.eINSTANCE.createParticipant1(); + par.setTypeCode(ParticipationType.IND); + AssociatedEntity ae = CDAFactory.eINSTANCE.createAssociatedEntity(); + par.setAssociatedEntity(ae); + target.getParticipants().add(par); + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.getParticipants().clear(); + Participant1 par = CDAFactory.eINSTANCE.createParticipant1(); + par.setTypeCode(ParticipationType.IND); + + AssociatedEntity ae = CDAFactory.eINSTANCE.createAssociatedEntity(); + ae.setClassCode(RoleClassAssociative.PROV); + Person ap = CDAFactory.eINSTANCE.createPerson(); + ae.setAssociatedPerson(ap); + par.setAssociatedEntity(ae); + target.getParticipants().add(par); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNotePrimaryCarePhysicianAssociatedEntityAssociatedPerson( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNotePrimaryCarePhysicianAssociatedEntityAssociatedPersonTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureNotePrimaryCarePhysicianFunctionCode() { + OperationsTestCase validateProcedureNotePrimaryCarePhysicianFunctionCodeTestCase = new OperationsTestCase( + "validateProcedureNotePrimaryCarePhysicianFunctionCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_PRIMARY_CARE_PHYSICIAN_FUNCTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + target.init(); + Participant1 par = CDAFactory.eINSTANCE.createParticipant1(); + par.setTypeCode(ParticipationType.IND); + target.getParticipants().add(par); + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.getParticipants().clear(); + Participant1 par = CDAFactory.eINSTANCE.createParticipant1(); + par.setTypeCode(ParticipationType.IND); + par.setFunctionCode(DatatypesFactory.eINSTANCE.createCE("PCP", "2.16.840.1.113883.5.88")); + target.getParticipants().add(par); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNotePrimaryCarePhysicianFunctionCode( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNotePrimaryCarePhysicianFunctionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureNotePrimaryCarePhysicianFunctionCodeP() { + OperationsTestCase validateProcedureNotePrimaryCarePhysicianFunctionCodePTestCase = new OperationsTestCase( + "validateProcedureNotePrimaryCarePhysicianFunctionCodeP", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_PRIMARY_CARE_PHYSICIAN_FUNCTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + target.init(); + Participant1 par = CDAFactory.eINSTANCE.createParticipant1(); + par.setTypeCode(ParticipationType.IND); + target.getParticipants().add(par); + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.getParticipants().clear(); + Participant1 par = CDAFactory.eINSTANCE.createParticipant1(); + par.setTypeCode(ParticipationType.IND); + par.setFunctionCode(DatatypesFactory.eINSTANCE.createCE("PCP", "2.16.840.1.113883.5.88")); + target.getParticipants().add(par); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNotePrimaryCarePhysicianFunctionCodeP( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNotePrimaryCarePhysicianFunctionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureNotePrimaryCarePhysicianTypeCode() { + OperationsTestCase validateProcedureNotePrimaryCarePhysicianTypeCodeTestCase = new OperationsTestCase( + "validateProcedureNotePrimaryCarePhysicianTypeCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_PRIMARY_CARE_PHYSICIAN_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + { + this.skipFailsTest(); + } + + @Override + protected void updateToFail(ProcedureNote target) { + target.init(); + } + + @Override + protected void updateToPass(ProcedureNote target) { + + Participant1 par = CDAFactory.eINSTANCE.createParticipant1(); + par.setTypeCode(ParticipationType.IND); + target.getParticipants().add(par); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNotePrimaryCarePhysicianTypeCode( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNotePrimaryCarePhysicianTypeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureNotePrimaryCarePhysicianAssociatedEntity() { + OperationsTestCase validateProcedureNotePrimaryCarePhysicianAssociatedEntityTestCase = new OperationsTestCase( + "validateProcedureNotePrimaryCarePhysicianAssociatedEntity", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_PRIMARY_CARE_PHYSICIAN_ASSOCIATED_ENTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + target.init(); + Participant1 par = CDAFactory.eINSTANCE.createParticipant1(); + par.setTypeCode(ParticipationType.IND); + target.getParticipants().add(par); + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.getParticipants().clear(); + Participant1 par = CDAFactory.eINSTANCE.createParticipant1(); + par.setTypeCode(ParticipationType.IND); + + AssociatedEntity ae = CDAFactory.eINSTANCE.createAssociatedEntity(); + par.setAssociatedEntity(ae); + target.getParticipants().add(par); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNotePrimaryCarePhysicianAssociatedEntity( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNotePrimaryCarePhysicianAssociatedEntityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureNoteDocumentationOfServiceEvent1PrimaryPerformerAssignedEntityCodeP() { + OperationsTestCase validateProcedureNoteDocumentationOfServiceEvent1PrimaryPerformerAssignedEntityCodePTestCase = new OperationsTestCase( + "validateProcedureNoteDocumentationOfServiceEvent1PrimaryPerformerAssignedEntityCodeP", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_DOCUMENTATION_OF_SERVICE_EVENT1_PRIMARY_PERFORMER_ASSIGNED_ENTITY_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + Performer1 perf = CDAFactory.eINSTANCE.createPerformer1(); + perf.setTypeCode(x_ServiceEventPerformer.PPRF); + perf.setAssignedEntity(CDAFactory.eINSTANCE.createAssignedEntity()); + se.getPerformers().add(perf); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + Performer1 perf = CDAFactory.eINSTANCE.createPerformer1(); + perf.setTypeCode(x_ServiceEventPerformer.PPRF); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.setCode(DatatypesFactory.eINSTANCE.createCE("test", "2.16.840.1.113883.6.101")); + perf.setAssignedEntity(ae); + se.getPerformers().add(perf); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteDocumentationOfServiceEvent1PrimaryPerformerAssignedEntityCodeP( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteDocumentationOfServiceEvent1PrimaryPerformerAssignedEntityCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureNoteDocumentationOfServiceEvent1PrimaryPerformerAssignedEntityCode() { + OperationsTestCase validateProcedureNoteDocumentationOfServiceEvent1PrimaryPerformerAssignedEntityCodeTestCase = new OperationsTestCase( + "validateProcedureNoteDocumentationOfServiceEvent1PrimaryPerformerAssignedEntityCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_DOCUMENTATION_OF_SERVICE_EVENT1_PRIMARY_PERFORMER_ASSIGNED_ENTITY_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + Performer1 perf = CDAFactory.eINSTANCE.createPerformer1(); + perf.setTypeCode(x_ServiceEventPerformer.PPRF); + perf.setAssignedEntity(CDAFactory.eINSTANCE.createAssignedEntity()); + se.getPerformers().add(perf); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + Performer1 perf = CDAFactory.eINSTANCE.createPerformer1(); + perf.setTypeCode(x_ServiceEventPerformer.PPRF); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.setCode(DatatypesFactory.eINSTANCE.createCE("test", "2.16.840.1.113883.6.101")); + perf.setAssignedEntity(ae); + se.getPerformers().add(perf); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteDocumentationOfServiceEvent1PrimaryPerformerAssignedEntityCode( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteDocumentationOfServiceEvent1PrimaryPerformerAssignedEntityCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureNoteDocumentationOfServiceEvent1PrimaryPerformerTypeCode() { + OperationsTestCase validateProcedureNoteDocumentationOfServiceEvent1PrimaryPerformerTypeCodeTestCase = new OperationsTestCase( + "validateProcedureNoteDocumentationOfServiceEvent1PrimaryPerformerTypeCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_DOCUMENTATION_OF_SERVICE_EVENT1_PRIMARY_PERFORMER_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + { + this.skipFailsTest(); + } + + @Override + protected void updateToFail(ProcedureNote target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + Performer1 perf = CDAFactory.eINSTANCE.createPerformer1(); + + perf.setTypeCode(x_ServiceEventPerformer.SPRF); + se.getPerformers().add(perf); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + Performer1 perf = CDAFactory.eINSTANCE.createPerformer1(); + perf.setTypeCode(x_ServiceEventPerformer.PPRF); + se.getPerformers().add(perf); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteDocumentationOfServiceEvent1PrimaryPerformerTypeCode( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteDocumentationOfServiceEvent1PrimaryPerformerTypeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureNoteDocumentationOfServiceEvent1PrimaryPerformerAssignedEntity() { + OperationsTestCase validateProcedureNoteDocumentationOfServiceEvent1PrimaryPerformerAssignedEntityTestCase = new OperationsTestCase( + "validateProcedureNoteDocumentationOfServiceEvent1PrimaryPerformerAssignedEntity", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_DOCUMENTATION_OF_SERVICE_EVENT1_PRIMARY_PERFORMER_ASSIGNED_ENTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + Performer1 perf = CDAFactory.eINSTANCE.createPerformer1(); + perf.setTypeCode(x_ServiceEventPerformer.PPRF); + se.getPerformers().add(perf); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + Performer1 perf = CDAFactory.eINSTANCE.createPerformer1(); + perf.setTypeCode(x_ServiceEventPerformer.PPRF); + perf.setAssignedEntity(CDAFactory.eINSTANCE.createAssignedEntity()); + se.getPerformers().add(perf); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteDocumentationOfServiceEvent1PrimaryPerformerAssignedEntity( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteDocumentationOfServiceEvent1PrimaryPerformerAssignedEntityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureNoteDocumentationOfServiceEvent1ProcedureCodes() { + OperationsTestCase validateProcedureNoteDocumentationOfServiceEvent1ProcedureCodesTestCase = new OperationsTestCase( + "validateProcedureNoteDocumentationOfServiceEvent1ProcedureCodes", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_DOCUMENTATION_OF_SERVICE_EVENT1_PROCEDURE_CODES__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + se.setCode(DatatypesFactory.eINSTANCE.createCE("code", "NOT2.16.840.1.113883.6.104")); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + /* + * (non-Javadoc) + * + * @see org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest.OperationsTestCase#addPassTests() + */ + @Override + public void addPassTests() { + + addPassTest(new PassTest() { + + @Override + public void updateToPass(ProcedureNote target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + se.setCode(DatatypesFactory.eINSTANCE.createCE("code", "2.16.840.1.113883.6.104")); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + }); + + addPassTest(new PassTest() { + + @Override + public void updateToPass(ProcedureNote target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + se.setCode(DatatypesFactory.eINSTANCE.createCE("code", "2.16.840.1.113883.6.12")); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + }); + + addPassTest(new PassTest() { + + @Override + public void updateToPass(ProcedureNote target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + se.setCode(DatatypesFactory.eINSTANCE.createCE("code", "2.16.840.1.113883.6.96")); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + }); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteDocumentationOfServiceEvent1ProcedureCodes( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteDocumentationOfServiceEvent1ProcedureCodesTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureNoteDocumentationOfServiceEvent1EffectiveTimeHasLow() { + OperationsTestCase validateProcedureNoteDocumentationOfServiceEvent1EffectiveTimeHasLowTestCase = new OperationsTestCase( + "validateProcedureNoteDocumentationOfServiceEvent1EffectiveTimeHasLow", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_DOCUMENTATION_OF_SERVICE_EVENT1_EFFECTIVE_TIME_HAS_LOW__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + se.setEffectiveTime(ts); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + IVXB_TS low = DatatypesFactory.eINSTANCE.createIVXB_TS(); + + low.setValue("12345"); + ts.setLow(low); + se.setEffectiveTime(ts); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteDocumentationOfServiceEvent1EffectiveTimeHasLow( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteDocumentationOfServiceEvent1EffectiveTimeHasLowTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureNoteDocumentationOfServiceEvent1EffectiveTimeHasHighWhenNoWidth() { + OperationsTestCase validateProcedureNoteDocumentationOfServiceEvent1EffectiveTimeHasHighWhenNoWidthTestCase = new OperationsTestCase( + "validateProcedureNoteDocumentationOfServiceEvent1EffectiveTimeHasHighWhenNoWidth", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_DOCUMENTATION_OF_SERVICE_EVENT1_EFFECTIVE_TIME_HAS_HIGH_WHEN_NO_WIDTH__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + ts.setHigh(DatatypesFactory.eINSTANCE.createIVXB_TS()); + ts.setWidth(DatatypesFactory.eINSTANCE.createPQ()); + target.setEffectiveTime(ts); + se.setEffectiveTime(ts); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + ts.setHigh(DatatypesFactory.eINSTANCE.createIVXB_TS()); + target.setEffectiveTime(ts); + se.setEffectiveTime(ts); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteDocumentationOfServiceEvent1EffectiveTimeHasHighWhenNoWidth( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteDocumentationOfServiceEvent1EffectiveTimeHasHighWhenNoWidthTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureNoteDocumentationOfServiceEvent1EffectiveTimeNoHighIfWidth() { + OperationsTestCase validateProcedureNoteDocumentationOfServiceEvent1EffectiveTimeNoHighIfWidthTestCase = new OperationsTestCase( + "validateProcedureNoteDocumentationOfServiceEvent1EffectiveTimeNoHighIfWidth", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_DOCUMENTATION_OF_SERVICE_EVENT1_EFFECTIVE_TIME_NO_HIGH_IF_WIDTH__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + ts.setHigh(DatatypesFactory.eINSTANCE.createIVXB_TS()); + ts.setWidth(DatatypesFactory.eINSTANCE.createPQ()); + target.setEffectiveTime(ts); + se.setEffectiveTime(ts); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + + ts.setWidth(DatatypesFactory.eINSTANCE.createPQ()); + target.setEffectiveTime(ts); + se.setEffectiveTime(ts); + + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteDocumentationOfServiceEvent1EffectiveTimeNoHighIfWidth( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteDocumentationOfServiceEvent1EffectiveTimeNoHighIfWidthTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureNoteDocumentationOfServiceEvent1Code() { + OperationsTestCase validateProcedureNoteDocumentationOfServiceEvent1CodeTestCase = new OperationsTestCase( + "validateProcedureNoteDocumentationOfServiceEvent1Code", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_DOCUMENTATION_OF_SERVICE_EVENT1_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + CE ce = DatatypesFactory.eINSTANCE.createCE(); + se.setCode(ce); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteDocumentationOfServiceEvent1Code( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteDocumentationOfServiceEvent1CodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureNoteDocumentationOfServiceEvent1EffectiveTime() { + OperationsTestCase validateProcedureNoteDocumentationOfServiceEvent1EffectiveTimeTestCase = new OperationsTestCase( + "validateProcedureNoteDocumentationOfServiceEvent1EffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_DOCUMENTATION_OF_SERVICE_EVENT1_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + se.setEffectiveTime(ts); + + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteDocumentationOfServiceEvent1EffectiveTime( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteDocumentationOfServiceEvent1EffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureNoteDocumentationOfServiceEvent1PrimaryPerformer() { + OperationsTestCase validateProcedureNoteDocumentationOfServiceEvent1PrimaryPerformerTestCase = new OperationsTestCase( + "validateProcedureNoteDocumentationOfServiceEvent1PrimaryPerformer", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_DOCUMENTATION_OF_SERVICE_EVENT1_PRIMARY_PERFORMER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + Performer1 perf = CDAFactory.eINSTANCE.createPerformer1(); + se.getPerformers().add(perf); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + Performer1 perf = CDAFactory.eINSTANCE.createPerformer1(); + perf.setTypeCode(x_ServiceEventPerformer.PPRF); + se.getPerformers().add(perf); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteDocumentationOfServiceEvent1PrimaryPerformer( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteDocumentationOfServiceEvent1PrimaryPerformerTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureNoteDocumentationOfServiceEvent1() { + OperationsTestCase validateProcedureNoteDocumentationOfServiceEvent1TestCase = new OperationsTestCase( + "validateProcedureNoteDocumentationOfServiceEvent1", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_NOTE_DOCUMENTATION_OF_SERVICE_EVENT1__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + + target.getDocumentationOfs().add(dof); + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureNoteOperations.validateProcedureNoteDocumentationOfServiceEvent1( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateProcedureNoteDocumentationOfServiceEvent1TestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetAssessmentSection() { + + ProcedureNote target = objectFactory.create(); + target.getAssessmentSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPlanOfCareSection() { + + ProcedureNote target = objectFactory.create(); + target.getPlanOfCareSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetAssessmentAndPlanSection() { + + ProcedureNote target = objectFactory.create(); + target.getAssessmentAndPlanSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetComplicationsSection() { + + ProcedureNote target = objectFactory.create(); + target.getComplicationsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPostprocedureDiagnosisSection() { + + ProcedureNote target = objectFactory.create(); + target.getPostprocedureDiagnosisSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProcedureDescriptionSection() { + + ProcedureNote target = objectFactory.create(); + target.getProcedureDescriptionSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProcedureIndicationsSection() { + + ProcedureNote target = objectFactory.create(); + target.getProcedureIndicationsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetAllergiesSectionEntriesOptional() { + + ProcedureNote target = objectFactory.create(); + target.getAllergiesSectionEntriesOptional(); + + } + + /** + * + * @generated + */ + @Test + public void testGetAnesthesiaSection() { + + ProcedureNote target = objectFactory.create(); + target.getAnesthesiaSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetChiefComplaintSection() { + + ProcedureNote target = objectFactory.create(); + target.getChiefComplaintSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetChiefComplaintAndReasonForVisitSection() { + + ProcedureNote target = objectFactory.create(); + target.getChiefComplaintAndReasonForVisitSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetFamilyHistorySection() { + + ProcedureNote target = objectFactory.create(); + target.getFamilyHistorySection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetHistoryOfPastIllnessSection() { + + ProcedureNote target = objectFactory.create(); + target.getHistoryOfPastIllnessSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetHistoryOfPresentIllnessSection() { + + ProcedureNote target = objectFactory.create(); + target.getHistoryOfPresentIllnessSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetMedicalHistorySection() { + + ProcedureNote target = objectFactory.create(); + target.getMedicalHistorySection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetMedicationsSectionEntriesOptional() { + + ProcedureNote target = objectFactory.create(); + target.getMedicationsSectionEntriesOptional(); + + } + + /** + * + * @generated + */ + @Test + public void testGetMedicationsAdministeredSection() { + + ProcedureNote target = objectFactory.create(); + target.getMedicationsAdministeredSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPhysicalExamSection() { + + ProcedureNote target = objectFactory.create(); + target.getPhysicalExamSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPlannedProcedureSection() { + + ProcedureNote target = objectFactory.create(); + target.getPlannedProcedureSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProcedureDispositionSection() { + + ProcedureNote target = objectFactory.create(); + target.getProcedureDispositionSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProcedureEstimatedBloodLossSection() { + + ProcedureNote target = objectFactory.create(); + target.getProcedureEstimatedBloodLossSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProcedureFindingsSection() { + + ProcedureNote target = objectFactory.create(); + target.getProcedureFindingsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProcedureImplantsSection() { + + ProcedureNote target = objectFactory.create(); + target.getProcedureImplantsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProcedureSpecimensTakenSection() { + + ProcedureNote target = objectFactory.create(); + target.getProcedureSpecimensTakenSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProceduresSectionEntriesOptional() { + + ProcedureNote target = objectFactory.create(); + target.getProceduresSectionEntriesOptional(); + + } + + /** + * + * @generated + */ + @Test + public void testGetReasonForVisitSection() { + + ProcedureNote target = objectFactory.create(); + target.getReasonForVisitSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetReviewOfSystemsSection() { + + ProcedureNote target = objectFactory.create(); + target.getReviewOfSystemsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetSocialHistorySection() { + + ProcedureNote target = objectFactory.create(); + target.getSocialHistorySection(); + + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsCode() { + OperationsTestCase validateGeneralHeaderConstraintsCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureNote target) { + + } + + @Override + protected void updateToPass(ProcedureNote target) { + target.init(); + target.getCode().setCode("code"); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsCode( + (ProcedureNote) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ProcedureNoteOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ProcedureNote create() { + return ConsolFactory.eINSTANCE.createProcedureNote(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ProcedureNoteOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ProcedureNoteOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProcedureSpecimensTakenSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProcedureSpecimensTakenSectionTest.java new file mode 100644 index 000000000..ed499b64e --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProcedureSpecimensTakenSectionTest.java @@ -0,0 +1,290 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ProcedureSpecimensTakenSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.ProcedureSpecimensTakenSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Procedure Specimens Taken Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureSpecimensTakenSection#validateProcedureSpecimensTakenSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Specimens Taken Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureSpecimensTakenSection#validateProcedureSpecimensTakenSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Specimens Taken Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureSpecimensTakenSection#validateProcedureSpecimensTakenSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Specimens Taken Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureSpecimensTakenSection#validateProcedureSpecimensTakenSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Specimens Taken Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProcedureSpecimensTakenSection#validateProcedureSpecimensTakenSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Specimens Taken Section Title}
  • + *
+ *

+ * + * @generated + */ + +public class ProcedureSpecimensTakenSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateProcedureSpecimensTakenSectionTemplateId() { + OperationsTestCase validateProcedureSpecimensTakenSectionTemplateIdTestCase = new OperationsTestCase( + "validateProcedureSpecimensTakenSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_SPECIMENS_TAKEN_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureSpecimensTakenSection target) { + + } + + @Override + protected void updateToPass(ProcedureSpecimensTakenSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureSpecimensTakenSectionOperations.validateProcedureSpecimensTakenSectionTemplateId( + (ProcedureSpecimensTakenSection) objectToTest, diagnostician, map); + } + + }; + + validateProcedureSpecimensTakenSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureSpecimensTakenSectionCode() { + OperationsTestCase validateProcedureSpecimensTakenSectionCodeTestCase = new OperationsTestCase( + "validateProcedureSpecimensTakenSectionCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_SPECIMENS_TAKEN_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureSpecimensTakenSection target) { + + } + + @Override + protected void updateToPass(ProcedureSpecimensTakenSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureSpecimensTakenSectionOperations.validateProcedureSpecimensTakenSectionCode( + (ProcedureSpecimensTakenSection) objectToTest, diagnostician, map); + } + + }; + + validateProcedureSpecimensTakenSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureSpecimensTakenSectionCodeP() { + OperationsTestCase validateProcedureSpecimensTakenSectionCodePTestCase = new OperationsTestCase( + "validateProcedureSpecimensTakenSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_SPECIMENS_TAKEN_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureSpecimensTakenSection target) { + + } + + @Override + protected void updateToPass(ProcedureSpecimensTakenSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureSpecimensTakenSectionOperations.validateProcedureSpecimensTakenSectionCodeP( + (ProcedureSpecimensTakenSection) objectToTest, diagnostician, map); + } + + }; + + validateProcedureSpecimensTakenSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureSpecimensTakenSectionText() { + OperationsTestCase validateProcedureSpecimensTakenSectionTextTestCase = new OperationsTestCase( + "validateProcedureSpecimensTakenSectionText", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_SPECIMENS_TAKEN_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureSpecimensTakenSection target) { + + } + + @Override + protected void updateToPass(ProcedureSpecimensTakenSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureSpecimensTakenSectionOperations.validateProcedureSpecimensTakenSectionText( + (ProcedureSpecimensTakenSection) objectToTest, diagnostician, map); + } + + }; + + validateProcedureSpecimensTakenSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureSpecimensTakenSectionTitle() { + OperationsTestCase validateProcedureSpecimensTakenSectionTitleTestCase = new OperationsTestCase( + "validateProcedureSpecimensTakenSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_SPECIMENS_TAKEN_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureSpecimensTakenSection target) { + + } + + @Override + protected void updateToPass(ProcedureSpecimensTakenSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureSpecimensTakenSectionOperations.validateProcedureSpecimensTakenSectionTitle( + (ProcedureSpecimensTakenSection) objectToTest, diagnostician, map); + } + + }; + + validateProcedureSpecimensTakenSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ProcedureSpecimensTakenSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ProcedureSpecimensTakenSection create() { + return ConsolFactory.eINSTANCE.createProcedureSpecimensTakenSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ProcedureSpecimensTakenSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ProcedureSpecimensTakenSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProceduresSectionEntriesOptionalTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProceduresSectionEntriesOptionalTest.java new file mode 100644 index 000000000..c21287400 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProceduresSectionEntriesOptionalTest.java @@ -0,0 +1,433 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ProceduresSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.operations.ProceduresSectionEntriesOptionalOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Procedures Section Entries Optional' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProceduresSectionEntriesOptional#validateProceduresSectionEntriesOptionalTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedures Section Entries Optional Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProceduresSectionEntriesOptional#validateProceduresSectionEntriesOptionalCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedures Section Entries Optional Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProceduresSectionEntriesOptional#validateProceduresSectionEntriesOptionalCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedures Section Entries Optional Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProceduresSectionEntriesOptional#validateProceduresSectionEntriesOptionalTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedures Section Entries Optional Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProceduresSectionEntriesOptional#validateProceduresSectionEntriesOptionalText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedures Section Entries Optional Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProceduresSectionEntriesOptional#validateProceduresSectionEntriesOptionalProcedureActivityProcedure(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedures Section Entries Optional Procedure Activity Procedure}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProceduresSectionEntriesOptional#validateProceduresSectionEntriesOptionalProcedureAcivityObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedures Section Entries Optional Procedure Acivity Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProceduresSectionEntriesOptional#validateProceduresSectionEntriesOptionalProcedureActivityAct(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedures Section Entries Optional Procedure Activity Act}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProceduresSectionEntriesOptional#getProcedureActivityProcedures() Get Procedure Activity Procedures}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProceduresSectionEntriesOptional#getProcedureAcivityObservations() Get Procedure Acivity Observations}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProceduresSectionEntriesOptional#getProcedureActivityActs() Get Procedure Activity Acts}
  • + *
+ *

+ * + * @generated + */ + +public class ProceduresSectionEntriesOptionalTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateProceduresSectionEntriesOptionalTemplateId() { + OperationsTestCase validateProceduresSectionEntriesOptionalTemplateIdTestCase = new OperationsTestCase( + "validateProceduresSectionEntriesOptionalTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURES_SECTION_ENTRIES_OPTIONAL_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProceduresSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(ProceduresSectionEntriesOptional target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProceduresSectionEntriesOptionalOperations.validateProceduresSectionEntriesOptionalTemplateId( + (ProceduresSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateProceduresSectionEntriesOptionalTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProceduresSectionEntriesOptionalCode() { + OperationsTestCase validateProceduresSectionEntriesOptionalCodeTestCase = new OperationsTestCase( + "validateProceduresSectionEntriesOptionalCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURES_SECTION_ENTRIES_OPTIONAL_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProceduresSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(ProceduresSectionEntriesOptional target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProceduresSectionEntriesOptionalOperations.validateProceduresSectionEntriesOptionalCode( + (ProceduresSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateProceduresSectionEntriesOptionalCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProceduresSectionEntriesOptionalCodeP() { + OperationsTestCase validateProceduresSectionEntriesOptionalCodePTestCase = new OperationsTestCase( + "validateProceduresSectionEntriesOptionalCodeP", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURES_SECTION_ENTRIES_OPTIONAL_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProceduresSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(ProceduresSectionEntriesOptional target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProceduresSectionEntriesOptionalOperations.validateProceduresSectionEntriesOptionalCodeP( + (ProceduresSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateProceduresSectionEntriesOptionalCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProceduresSectionEntriesOptionalTitle() { + OperationsTestCase validateProceduresSectionEntriesOptionalTitleTestCase = new OperationsTestCase( + "validateProceduresSectionEntriesOptionalTitle", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURES_SECTION_ENTRIES_OPTIONAL_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProceduresSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(ProceduresSectionEntriesOptional target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProceduresSectionEntriesOptionalOperations.validateProceduresSectionEntriesOptionalTitle( + (ProceduresSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateProceduresSectionEntriesOptionalTitleTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProceduresSectionEntriesOptionalText() { + OperationsTestCase validateProceduresSectionEntriesOptionalTextTestCase = new OperationsTestCase( + "validateProceduresSectionEntriesOptionalText", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURES_SECTION_ENTRIES_OPTIONAL_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProceduresSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(ProceduresSectionEntriesOptional target) { + target.init(); + + StrucDocText value = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(value); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProceduresSectionEntriesOptionalOperations.validateProceduresSectionEntriesOptionalText( + (ProceduresSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateProceduresSectionEntriesOptionalTextTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProceduresSectionEntriesOptionalProcedureActivityProcedure() { + OperationsTestCase validateProceduresSectionEntriesOptionalProcedureActivityProcedureTestCase = new OperationsTestCase( + "validateProceduresSectionEntriesOptionalProcedureActivityProcedure", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURES_SECTION_ENTRIES_OPTIONAL_PROCEDURE_ACTIVITY_PROCEDURE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProceduresSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(ProceduresSectionEntriesOptional target) { + target.init(); + target.addProcedure(ConsolFactory.eINSTANCE.createProcedureActivityProcedure()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProceduresSectionEntriesOptionalOperations.validateProceduresSectionEntriesOptionalProcedureActivityProcedure( + (ProceduresSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateProceduresSectionEntriesOptionalProcedureActivityProcedureTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProceduresSectionEntriesOptionalProcedureAcivityObservation() { + OperationsTestCase validateProceduresSectionEntriesOptionalProcedureAcivityObservationTestCase = new OperationsTestCase( + "validateProceduresSectionEntriesOptionalProcedureAcivityObservation", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURES_SECTION_ENTRIES_OPTIONAL_PROCEDURE_ACIVITY_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProceduresSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(ProceduresSectionEntriesOptional target) { + target.init(); + target.addObservation(ConsolFactory.eINSTANCE.createProcedureActivityObservation()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProceduresSectionEntriesOptionalOperations.validateProceduresSectionEntriesOptionalProcedureAcivityObservation( + (ProceduresSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateProceduresSectionEntriesOptionalProcedureAcivityObservationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProceduresSectionEntriesOptionalProcedureActivityAct() { + OperationsTestCase validateProceduresSectionEntriesOptionalProcedureActivityActTestCase = new OperationsTestCase( + "validateProceduresSectionEntriesOptionalProcedureActivityAct", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURES_SECTION_ENTRIES_OPTIONAL_PROCEDURE_ACTIVITY_ACT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProceduresSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(ProceduresSectionEntriesOptional target) { + target.init(); + target.addAct(ConsolFactory.eINSTANCE.createProcedureActivityAct()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProceduresSectionEntriesOptionalOperations.validateProceduresSectionEntriesOptionalProcedureActivityAct( + (ProceduresSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateProceduresSectionEntriesOptionalProcedureActivityActTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProcedureActivityProcedures() { + + ProceduresSectionEntriesOptional target = objectFactory.create(); + target.getProcedureActivityProcedures(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProcedureAcivityObservations() { + + ProceduresSectionEntriesOptional target = objectFactory.create(); + target.getProcedureAcivityObservations(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProcedureActivityActs() { + + ProceduresSectionEntriesOptional target = objectFactory.create(); + target.getProcedureActivityActs(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ProceduresSectionEntriesOptionalOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ProceduresSectionEntriesOptional create() { + return ConsolFactory.eINSTANCE.createProceduresSectionEntriesOptional(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ProceduresSectionEntriesOptionalOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ProceduresSectionEntriesOptionalOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProceduresSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProceduresSectionTest.java new file mode 100644 index 000000000..b83d0a581 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProceduresSectionTest.java @@ -0,0 +1,470 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ProceduresSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.ProceduresSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Procedures Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProceduresSection#validateProceduresSectionHasProcedureActivity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedures Section Has Procedure Activity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProceduresSection#validateProceduresSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedures Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProceduresSection#validateProceduresSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedures Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProceduresSection#validateProceduresSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedures Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProceduresSection#validateProceduresSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedures Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProceduresSection#validateProceduresSectionProcedureActivityProcedure(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedures Section Procedure Activity Procedure}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProceduresSection#validateProceduresSectionProcedureActivityObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedures Section Procedure Activity Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProceduresSection#validateProceduresSectionProcedureActivityAct(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedures Section Procedure Activity Act}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProceduresSection#getConsolProcedureActivityProcedures() Get Consol Procedure Activity Procedures}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProceduresSection#getProcedureActivityObservations() Get Procedure Activity Observations}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProceduresSection#getConsolProcedureActivityActs() Get Consol Procedure Activity Acts}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProceduresSection#validateProceduresSectionEntriesOptionalTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedures Section Entries Optional Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class ProceduresSectionTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateProceduresSectionHasProcedureActivity() { + OperationsTestCase validateProceduresSectionHasProcedureActivityTestCase = new OperationsTestCase( + "validateProceduresSectionHasProcedureActivity", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURES_SECTION_HAS_PROCEDURE_ACTIVITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProceduresSection target) { + + } + + @Override + protected void updateToPass(ProceduresSection target) { + target.init(); + target.addProcedure(ConsolFactory.eINSTANCE.createProcedureActivityProcedure()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProceduresSectionOperations.validateProceduresSectionHasProcedureActivity( + (ProceduresSection) objectToTest, diagnostician, map); + } + + }; + + validateProceduresSectionHasProcedureActivityTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProceduresSectionTitle() { + OperationsTestCase validateProceduresSectionTitleTestCase = new OperationsTestCase( + "validateProceduresSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURES_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProceduresSection target) { + + } + + @Override + protected void updateToPass(ProceduresSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("Procedures"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProceduresSectionOperations.validateProceduresSectionTitle( + (ProceduresSection) objectToTest, diagnostician, map); + } + + }; + + validateProceduresSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProceduresSectionCodeP() { + OperationsTestCase validateProceduresSectionCodePTestCase = new OperationsTestCase( + "validateProceduresSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURES_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProceduresSection target) { + + } + + @Override + protected void updateToPass(ProceduresSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProceduresSectionOperations.validateProceduresSectionCodeP( + (ProceduresSection) objectToTest, diagnostician, map); + } + + }; + + validateProceduresSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProceduresSectionCode() { + OperationsTestCase validateProceduresSectionCodeTestCase = new OperationsTestCase( + "validateProceduresSectionCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURES_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProceduresSection target) { + + } + + @Override + protected void updateToPass(ProceduresSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProceduresSectionOperations.validateProceduresSectionCode( + (ProceduresSection) objectToTest, diagnostician, map); + } + + }; + + validateProceduresSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProceduresSectionText() { + OperationsTestCase validateProceduresSectionTextTestCase = new OperationsTestCase( + "validateProceduresSectionText", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURES_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProceduresSection target) { + + } + + @Override + protected void updateToPass(ProceduresSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProceduresSectionOperations.validateProceduresSectionText( + (ProceduresSection) objectToTest, diagnostician, map); + } + + }; + + validateProceduresSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProceduresSectionProcedureActivityProcedure() { + OperationsTestCase validateProceduresSectionProcedureActivityProcedureTestCase = new OperationsTestCase( + "validateProceduresSectionProcedureActivityProcedure", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURES_SECTION_PROCEDURE_ACTIVITY_PROCEDURE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProceduresSection target) { + + } + + @Override + protected void updateToPass(ProceduresSection target) { + target.init(); + target.addProcedure(ConsolFactory.eINSTANCE.createProcedureActivityProcedure()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProceduresSectionOperations.validateProceduresSectionProcedureActivityProcedure( + (ProceduresSection) objectToTest, diagnostician, map); + } + + }; + + validateProceduresSectionProcedureActivityProcedureTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProceduresSectionProcedureActivityObservation() { + OperationsTestCase validateProceduresSectionProcedureActivityObservationTestCase = new OperationsTestCase( + "validateProceduresSectionProcedureActivityObservation", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURES_SECTION_PROCEDURE_ACTIVITY_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProceduresSection target) { + + } + + @Override + protected void updateToPass(ProceduresSection target) { + target.init(); + target.addObservation(ConsolFactory.eINSTANCE.createProcedureActivityObservation()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProceduresSectionOperations.validateProceduresSectionProcedureActivityObservation( + (ProceduresSection) objectToTest, diagnostician, map); + } + + }; + + validateProceduresSectionProcedureActivityObservationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProceduresSectionProcedureActivityAct() { + OperationsTestCase validateProceduresSectionProcedureActivityActTestCase = new OperationsTestCase( + "validateProceduresSectionProcedureActivityAct", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURES_SECTION_PROCEDURE_ACTIVITY_ACT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProceduresSection target) { + + } + + @Override + protected void updateToPass(ProceduresSection target) { + target.init(); + target.addAct(ConsolFactory.eINSTANCE.createProcedureActivityAct()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProceduresSectionOperations.validateProceduresSectionProcedureActivityAct( + (ProceduresSection) objectToTest, diagnostician, map); + } + + }; + + validateProceduresSectionProcedureActivityActTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetConsolProcedureActivityProcedures() { + + ProceduresSection target = objectFactory.create(); + target.getConsolProcedureActivityProcedures(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProcedureActivityObservations() { + + ProceduresSection target = objectFactory.create(); + target.getProcedureActivityObservations(); + + } + + /** + * + * @generated + */ + @Test + public void testGetConsolProcedureActivityActs() { + + ProceduresSection target = objectFactory.create(); + target.getConsolProcedureActivityActs(); + + } + + /** + * + * @generated + */ + @Test + public void testValidateProceduresSectionEntriesOptionalTemplateId() { + OperationsTestCase validateProceduresSectionEntriesOptionalTemplateIdTestCase = new OperationsTestCase( + "validateProceduresSectionEntriesOptionalTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURES_SECTION_ENTRIES_OPTIONAL_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProceduresSection target) { + + } + + @Override + protected void updateToPass(ProceduresSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProceduresSectionOperations.validateProceduresSectionEntriesOptionalTemplateId( + (ProceduresSection) objectToTest, diagnostician, map); + } + + }; + + validateProceduresSectionEntriesOptionalTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ProceduresSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ProceduresSection create() { + return ConsolFactory.eINSTANCE.createProceduresSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ProceduresSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ProceduresSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProductInstanceTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProductInstanceTest.java new file mode 100644 index 000000000..0c2781e32 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProductInstanceTest.java @@ -0,0 +1,361 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Device; +import org.openhealthtools.mdht.uml.cda.Entity; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ProductInstance; +import org.openhealthtools.mdht.uml.cda.consol.operations.ProductInstanceOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; + +/** + * + * A static utility class that provides operations related to 'Product Instance' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProductInstance#validateProductInstanceTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Product Instance Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProductInstance#validateProductInstanceClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Product Instance Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProductInstance#validateProductInstanceId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Product Instance Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProductInstance#validateProductInstanceScopingEntity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Product Instance Scoping Entity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProductInstance#validateProductInstancePlayingDevice(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Product Instance Playing Device}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProductInstance#validateProductInstanceScopingEntityId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Product Instance Scoping Entity Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProductInstance#validateProductInstancePlayingDeviceCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Product Instance Playing Device Code}
  • + *
+ *

+ * + * @generated + */ + +public class ProductInstanceTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateProductInstanceTemplateId() { + OperationsTestCase validateProductInstanceTemplateIdTestCase = new OperationsTestCase( + "validateProductInstanceTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PRODUCT_INSTANCE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProductInstance target) { + + } + + @Override + protected void updateToPass(ProductInstance target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProductInstanceOperations.validateProductInstanceTemplateId( + (ProductInstance) objectToTest, diagnostician, map); + } + + }; + + validateProductInstanceTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProductInstanceClassCode() { + OperationsTestCase validateProductInstanceClassCodeTestCase = new OperationsTestCase( + "validateProductInstanceClassCode", + operationsForOCL.getOCLValue("VALIDATE_PRODUCT_INSTANCE_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProductInstance target) { + + } + + @Override + protected void updateToPass(ProductInstance target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProductInstanceOperations.validateProductInstanceClassCode( + (ProductInstance) objectToTest, diagnostician, map); + } + + }; + + validateProductInstanceClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProductInstanceId() { + OperationsTestCase validateProductInstanceIdTestCase = new OperationsTestCase( + "validateProductInstanceId", + operationsForOCL.getOCLValue("VALIDATE_PRODUCT_INSTANCE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(ProductInstance target) { + + } + + @Override + protected void updateToPass(ProductInstance target) { + target.init(); + target.getIds().add(DatatypesFactory.eINSTANCE.createII()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProductInstanceOperations.validateProductInstanceId( + (ProductInstance) objectToTest, diagnostician, map); + } + + }; + + validateProductInstanceIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProductInstanceScopingEntity() { + OperationsTestCase validateProductInstanceScopingEntityTestCase = new OperationsTestCase( + "validateProductInstanceScopingEntity", + operationsForOCL.getOCLValue("VALIDATE_PRODUCT_INSTANCE_SCOPING_ENTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProductInstance target) { + + } + + @Override + protected void updateToPass(ProductInstance target) { + target.init(); + target.setScopingEntity(CDAFactory.eINSTANCE.createEntity()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProductInstanceOperations.validateProductInstanceScopingEntity( + (ProductInstance) objectToTest, diagnostician, map); + } + + }; + + validateProductInstanceScopingEntityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProductInstancePlayingDevice() { + OperationsTestCase validateProductInstancePlayingDeviceTestCase = new OperationsTestCase( + "validateProductInstancePlayingDevice", + operationsForOCL.getOCLValue("VALIDATE_PRODUCT_INSTANCE_PLAYING_DEVICE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProductInstance target) { + + } + + @Override + protected void updateToPass(ProductInstance target) { + target.init(); + target.setPlayingDevice(CDAFactory.eINSTANCE.createDevice()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProductInstanceOperations.validateProductInstancePlayingDevice( + (ProductInstance) objectToTest, diagnostician, map); + } + + }; + + validateProductInstancePlayingDeviceTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProductInstanceScopingEntityId() { + OperationsTestCase validateProductInstanceScopingEntityIdTestCase = new OperationsTestCase( + "validateProductInstanceScopingEntityId", + operationsForOCL.getOCLValue("VALIDATE_PRODUCT_INSTANCE_SCOPING_ENTITY_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProductInstance target) { + target.init(); + Entity ent = CDAFactory.eINSTANCE.createEntity(); + + target.setScopingEntity(ent); + } + + @Override + protected void updateToPass(ProductInstance target) { + Entity ent = CDAFactory.eINSTANCE.createEntity(); + ent.getIds().add(DatatypesFactory.eINSTANCE.createII()); + target.setScopingEntity(ent); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProductInstanceOperations.validateProductInstanceScopingEntityId( + (ProductInstance) objectToTest, diagnostician, map); + } + + }; + + validateProductInstanceScopingEntityIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProductInstancePlayingDeviceCode() { + OperationsTestCase validateProductInstancePlayingDeviceCodeTestCase = new OperationsTestCase( + "validateProductInstancePlayingDeviceCode", + operationsForOCL.getOCLValue("VALIDATE_PRODUCT_INSTANCE_PLAYING_DEVICE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProductInstance target) { + target.init(); + Device pd = CDAFactory.eINSTANCE.createDevice(); + target.setPlayingDevice(pd); + } + + @Override + protected void updateToPass(ProductInstance target) { + Device pd = CDAFactory.eINSTANCE.createDevice(); + pd.setCode(DatatypesFactory.eINSTANCE.createCE()); + target.setPlayingDevice(pd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProductInstanceOperations.validateProductInstancePlayingDeviceCode( + (ProductInstance) objectToTest, diagnostician, map); + } + + }; + + validateProductInstancePlayingDeviceCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ProductInstanceOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ProductInstance create() { + return ConsolFactory.eINSTANCE.createProductInstance(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ProductInstanceOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ProductInstanceOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProgressNoteTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProgressNoteTest.java new file mode 100644 index 000000000..0d9d8d9f6 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ProgressNoteTest.java @@ -0,0 +1,1852 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Component1; +import org.openhealthtools.mdht.uml.cda.DocumentationOf; +import org.openhealthtools.mdht.uml.cda.EncompassingEncounter; +import org.openhealthtools.mdht.uml.cda.Location; +import org.openhealthtools.mdht.uml.cda.ServiceEvent; +import org.openhealthtools.mdht.uml.cda.consol.AllergiesSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.AssessmentAndPlanSection; +import org.openhealthtools.mdht.uml.cda.consol.AssessmentSection; +import org.openhealthtools.mdht.uml.cda.consol.ChiefComplaintSection; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.InstructionsSection; +import org.openhealthtools.mdht.uml.cda.consol.InterventionsSection; +import org.openhealthtools.mdht.uml.cda.consol.MedicationsSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.ObjectiveSection; +import org.openhealthtools.mdht.uml.cda.consol.PhysicalExamSection; +import org.openhealthtools.mdht.uml.cda.consol.PlanOfCareSection; +import org.openhealthtools.mdht.uml.cda.consol.ProblemSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.ProgressNote; +import org.openhealthtools.mdht.uml.cda.consol.ResultsSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.ReviewOfSystemsSection; +import org.openhealthtools.mdht.uml.cda.consol.SubjectiveSection; +import org.openhealthtools.mdht.uml.cda.consol.VitalSignsSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.operations.GeneralHeaderConstraintsOperations; +import org.openhealthtools.mdht.uml.cda.consol.operations.ProgressNoteOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVXB_TS; +import org.openhealthtools.mdht.uml.hl7.vocab.ActClassRoot; + +/** + * + * A static utility class that provides operations related to 'Progress Note' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProgressNote#validateProgressNoteHasAnAssementAndPlanSectionOrIndividualAssementAndPlanSections(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Progress Note Has An Assement And Plan Section Or Individual Assement And Plan Sections}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProgressNote#validateProgressNoteDoesNotHaveIndividualAssementAndPlanSectionsWhenAssementAndPlanSectionPresent(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Progress Note Does Not Have Individual Assement And Plan Sections When Assement And Plan Section Present}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProgressNote#validateProgressNoteTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Progress Note Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProgressNote#validateProgressNoteCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Progress Note Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProgressNote#validateProgressNoteCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Progress Note Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProgressNote#validateProgressNoteDocumentationOf(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Progress Note Documentation Of}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProgressNote#validateProgressNoteComponentOf(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Progress Note Component Of}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProgressNote#validateProgressNoteAssessmentSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Progress Note Assessment Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProgressNote#validateProgressNotePlanOfCareSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Progress Note Plan Of Care Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProgressNote#validateProgressNoteAssessmentAndPlanSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Progress Note Assessment And Plan Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProgressNote#validateProgressNoteAllergiesSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Progress Note Allergies Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProgressNote#validateProgressNoteChiefComplaintSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Progress Note Chief Complaint Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProgressNote#validateProgressNoteInterventionsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Progress Note Interventions Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProgressNote#validateProgressNoteMedicationsSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Progress Note Medications Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProgressNote#validateProgressNoteObjectiveSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Progress Note Objective Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProgressNote#validateProgressNotePhysicalExamSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Progress Note Physical Exam Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProgressNote#validateProgressNoteProblemSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Progress Note Problem Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProgressNote#validateProgressNoteResultsSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Progress Note Results Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProgressNote#validateProgressNoteReviewOfSystemsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Progress Note Review Of Systems Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProgressNote#validateProgressNoteSubjectiveSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Progress Note Subjective Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProgressNote#validateProgressNoteVitalSignsSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Progress Note Vital Signs Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProgressNote#validateProgressNoteInstructionsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Progress Note Instructions Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProgressNote#validateProgressNoteDocumentationOfServiceEvent2EffectiveTimeLow(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Progress Note Documentation Of Service Event2 Effective Time Low}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProgressNote#validateProgressNoteDocumentationOfServiceEvent2EffectiveTimeHigh(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Progress Note Documentation Of Service Event2 Effective Time High}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProgressNote#validateProgressNoteDocumentationOfServiceEvent2TemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Progress Note Documentation Of Service Event2 Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProgressNote#validateProgressNoteDocumentationOfServiceEvent2ClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Progress Note Documentation Of Service Event2 Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProgressNote#validateProgressNoteDocumentationOfServiceEvent2EffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Progress Note Documentation Of Service Event2 Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProgressNote#validateProgressNoteDocumentationOfServiceEvent2(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Progress Note Documentation Of Service Event2}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProgressNote#validateProgressNoteComponentOfEncompassingEncounter6LocationHealthCareFacility1Id(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Progress Note Component Of Encompassing Encounter6 Location Health Care Facility1 Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProgressNote#validateProgressNoteComponentOfEncompassingEncounter6LocationHealthCareFacility(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Progress Note Component Of Encompassing Encounter6 Location Health Care Facility}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProgressNote#validateProgressNoteComponentOfEncompassingEncounter6EffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Progress Note Component Of Encompassing Encounter6 Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProgressNote#validateProgressNoteComponentOfEncompassingEncounter6Id(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Progress Note Component Of Encompassing Encounter6 Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProgressNote#validateProgressNoteComponentOfEncompassingEncounter6Location(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Progress Note Component Of Encompassing Encounter6 Location}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProgressNote#validateProgressNoteComponentOfEncompassingEncounter6(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Progress Note Component Of Encompassing Encounter6}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProgressNote#getAssessmentSection() Get Assessment Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProgressNote#getPlanOfCareSection() Get Plan Of Care Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProgressNote#getAssessmentAndPlanSection() Get Assessment And Plan Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProgressNote#getAllergiesSectionEntriesOptional() Get Allergies Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProgressNote#getChiefComplaintSection() Get Chief Complaint Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProgressNote#getInterventionsSection() Get Interventions Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProgressNote#getMedicationsSectionEntriesOptional() Get Medications Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProgressNote#getObjectiveSection() Get Objective Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProgressNote#getPhysicalExamSection() Get Physical Exam Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProgressNote#getProblemSectionEntriesOptional() Get Problem Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProgressNote#getResultsSectionEntriesOptional() Get Results Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProgressNote#getReviewOfSystemsSection() Get Review Of Systems Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProgressNote#getSubjectiveSection() Get Subjective Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProgressNote#getVitalSignsSectionEntriesOptional() Get Vital Signs Section Entries Optional}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ProgressNote#getInstructionsSection() Get Instructions Section}
  • + *
+ *

+ * + * @generated + */ + +public class ProgressNoteTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateProgressNoteHasAnAssementAndPlanSectionOrIndividualAssementAndPlanSections() { + OperationsTestCase validateProgressNoteHasAnAssementAndPlanSectionOrIndividualAssementAndPlanSectionsTestCase = new OperationsTestCase( + "validateProgressNoteHasAnAssementAndPlanSectionOrIndividualAssementAndPlanSections", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_HAS_AN_ASSEMENT_AND_PLAN_SECTION_OR_INDIVIDUAL_ASSEMENT_AND_PLAN_SECTIONS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + public void addFailTests() { + + addFailTest(new FailTest() { + @Override + public void updateToFail(ProgressNote target) { + target.init(); + } + + }); + + addFailTest(new FailTest() { + @Override + public void updateToFail(ProgressNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createAssessmentSection().init()); + } + + }); + + addFailTest(new FailTest() { + @Override + public void updateToFail(ProgressNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createPlanOfCareSection().init()); + } + + }); + + } + + /* + * (non-Javadoc) + * + * @see org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest.OperationsTestCase#addPassTests() + */ + @Override + public void addPassTests() { + addPassTest(new PassTest() { + @Override + public void updateToPass(ProgressNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createAssessmentAndPlanSection().init()); + + } + }); + + addPassTest(new PassTest() { + @Override + public void updateToPass(ProgressNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createAssessmentSection().init()); + target.addSection(ConsolFactory.eINSTANCE.createPlanOfCareSection().init()); + } + }); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteHasAnAssementAndPlanSectionOrIndividualAssementAndPlanSections( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteHasAnAssementAndPlanSectionOrIndividualAssementAndPlanSectionsTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProgressNoteDoesNotHaveIndividualAssementAndPlanSectionsWhenAssementAndPlanSectionPresent() { + OperationsTestCase validateProgressNoteDoesNotHaveIndividualAssementAndPlanSectionsWhenAssementAndPlanSectionPresentTestCase = new OperationsTestCase( + "validateProgressNoteDoesNotHaveIndividualAssementAndPlanSectionsWhenAssementAndPlanSectionPresent", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_DOES_NOT_HAVE_INDIVIDUAL_ASSEMENT_AND_PLAN_SECTIONS_WHEN_ASSEMENT_AND_PLAN_SECTION_PRESENT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + public void addFailTests() { + + addFailTest(new FailTest() { + @Override + public void updateToFail(ProgressNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createAssessmentAndPlanSection().init()); + target.addSection(ConsolFactory.eINSTANCE.createPlanOfCareSection().init()); + } + + }); + + addFailTest(new FailTest() { + @Override + public void updateToFail(ProgressNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createAssessmentAndPlanSection().init()); + target.addSection(ConsolFactory.eINSTANCE.createAssessmentSection().init()); + } + + }); + + addFailTest(new FailTest() { + @Override + public void updateToFail(ProgressNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createAssessmentAndPlanSection().init()); + target.addSection(ConsolFactory.eINSTANCE.createAssessmentSection().init()); + target.addSection(ConsolFactory.eINSTANCE.createPlanOfCareSection().init()); + } + + }); + + } + + @Override + public void addPassTests() { + addPassTest(new PassTest() { + @Override + public void updateToPass(ProgressNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createAssessmentAndPlanSection().init()); + + } + }); + + addPassTest(new PassTest() { + @Override + public void updateToPass(ProgressNote target) { + target.init(); + target.addSection(ConsolFactory.eINSTANCE.createAssessmentSection().init()); + target.addSection(ConsolFactory.eINSTANCE.createPlanOfCareSection().init()); + } + }); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteDoesNotHaveIndividualAssementAndPlanSectionsWhenAssementAndPlanSectionPresent( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteDoesNotHaveIndividualAssementAndPlanSectionsWhenAssementAndPlanSectionPresentTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProgressNoteTemplateId() { + OperationsTestCase validateProgressNoteTemplateIdTestCase = new OperationsTestCase( + "validateProgressNoteTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + + } + + @Override + protected void updateToPass(ProgressNote target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteTemplateId( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProgressNoteCodeP() { + OperationsTestCase validateProgressNoteCodePTestCase = new OperationsTestCase( + "validateProgressNoteCodeP", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + + } + + @Override + protected void updateToPass(ProgressNote target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteCodeP((ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProgressNoteCode() { + OperationsTestCase validateProgressNoteCodeTestCase = new OperationsTestCase( + "validateProgressNoteCode", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + + } + + @Override + protected void updateToPass(ProgressNote target) { + target.init(); + target.setCode(DatatypesFactory.eINSTANCE.createCE("11506-3", "2.16.840.1.113883.6.1")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteCode((ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProgressNoteDocumentationOf() { + OperationsTestCase validateProgressNoteDocumentationOfTestCase = new OperationsTestCase( + "validateProgressNoteDocumentationOf", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_DOCUMENTATION_OF__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + target.init(); + + } + + @Override + protected void updateToPass(ProgressNote target) { + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + target.getDocumentationOfs().add(dof); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteDocumentationOf( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteDocumentationOfTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProgressNoteComponentOf() { + OperationsTestCase validateProgressNoteComponentOfTestCase = new OperationsTestCase( + "validateProgressNoteComponentOf", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_COMPONENT_OF__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + target.init(); + } + + @Override + protected void updateToPass(ProgressNote target) { + Component1 cof = CDAFactory.eINSTANCE.createComponent1(); + target.setComponentOf(cof); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteComponentOf( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteComponentOfTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProgressNoteAssessmentSection() { + OperationsTestCase validateProgressNoteAssessmentSectionTestCase = new OperationsTestCase( + "validateProgressNoteAssessmentSection", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_ASSESSMENT_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + + } + + @Override + protected void updateToPass(ProgressNote target) { + target.init(); + + /* AssessmentSection */ + AssessmentSection section = + + ConsolFactory.eINSTANCE.createAssessmentSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteAssessmentSection( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteAssessmentSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProgressNotePlanOfCareSection() { + OperationsTestCase validateProgressNotePlanOfCareSectionTestCase = new OperationsTestCase( + "validateProgressNotePlanOfCareSection", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_PLAN_OF_CARE_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + + } + + @Override + protected void updateToPass(ProgressNote target) { + target.init(); + + /* PlanOfCareSection */ + PlanOfCareSection section = + + ConsolFactory.eINSTANCE.createPlanOfCareSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNotePlanOfCareSection( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNotePlanOfCareSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProgressNoteAssessmentAndPlanSection() { + OperationsTestCase validateProgressNoteAssessmentAndPlanSectionTestCase = new OperationsTestCase( + "validateProgressNoteAssessmentAndPlanSection", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_ASSESSMENT_AND_PLAN_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + + } + + @Override + protected void updateToPass(ProgressNote target) { + target.init(); + + /* AssessmentAndPlanSection */ + AssessmentAndPlanSection section = + + ConsolFactory.eINSTANCE.createAssessmentAndPlanSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteAssessmentAndPlanSection( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteAssessmentAndPlanSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProgressNoteAllergiesSectionEntriesOptional() { + OperationsTestCase validateProgressNoteAllergiesSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateProgressNoteAllergiesSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_ALLERGIES_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + + } + + @Override + protected void updateToPass(ProgressNote target) { + target.init(); + + /* AllergiesSectionEntriesOptional */ + AllergiesSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createAllergiesSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteAllergiesSectionEntriesOptional( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteAllergiesSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProgressNoteChiefComplaintSection() { + OperationsTestCase validateProgressNoteChiefComplaintSectionTestCase = new OperationsTestCase( + "validateProgressNoteChiefComplaintSection", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_CHIEF_COMPLAINT_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + + } + + @Override + protected void updateToPass(ProgressNote target) { + target.init(); + + /* ChiefComplaintSection */ + ChiefComplaintSection section = + + ConsolFactory.eINSTANCE.createChiefComplaintSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteChiefComplaintSection( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteChiefComplaintSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProgressNoteInterventionsSection() { + OperationsTestCase validateProgressNoteInterventionsSectionTestCase = new OperationsTestCase( + "validateProgressNoteInterventionsSection", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_INTERVENTIONS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + + } + + @Override + protected void updateToPass(ProgressNote target) { + target.init(); + + /* InterventionsSection */ + InterventionsSection section = + + ConsolFactory.eINSTANCE.createInterventionsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteInterventionsSection( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteInterventionsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProgressNoteMedicationsSectionEntriesOptional() { + OperationsTestCase validateProgressNoteMedicationsSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateProgressNoteMedicationsSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_MEDICATIONS_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + + } + + @Override + protected void updateToPass(ProgressNote target) { + target.init(); + + /* MedicationsSectionEntriesOptional */ + MedicationsSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createMedicationsSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteMedicationsSectionEntriesOptional( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteMedicationsSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProgressNoteObjectiveSection() { + OperationsTestCase validateProgressNoteObjectiveSectionTestCase = new OperationsTestCase( + "validateProgressNoteObjectiveSection", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_OBJECTIVE_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + + } + + @Override + protected void updateToPass(ProgressNote target) { + target.init(); + + /* ObjectiveSection */ + ObjectiveSection section = + + ConsolFactory.eINSTANCE.createObjectiveSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteObjectiveSection( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteObjectiveSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProgressNotePhysicalExamSection() { + OperationsTestCase validateProgressNotePhysicalExamSectionTestCase = new OperationsTestCase( + "validateProgressNotePhysicalExamSection", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_PHYSICAL_EXAM_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + + } + + @Override + protected void updateToPass(ProgressNote target) { + target.init(); + + /* PhysicalExamSection */ + PhysicalExamSection section = + + ConsolFactory.eINSTANCE.createPhysicalExamSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNotePhysicalExamSection( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNotePhysicalExamSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProgressNoteProblemSectionEntriesOptional() { + OperationsTestCase validateProgressNoteProblemSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateProgressNoteProblemSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_PROBLEM_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + + } + + @Override + protected void updateToPass(ProgressNote target) { + target.init(); + + /* ProblemSectionEntriesOptional */ + ProblemSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createProblemSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteProblemSectionEntriesOptional( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteProblemSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProgressNoteResultsSectionEntriesOptional() { + OperationsTestCase validateProgressNoteResultsSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateProgressNoteResultsSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_RESULTS_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + + } + + @Override + protected void updateToPass(ProgressNote target) { + target.init(); + + /* ResultsSectionEntriesOptional */ + ResultsSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createResultsSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteResultsSectionEntriesOptional( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteResultsSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProgressNoteReviewOfSystemsSection() { + OperationsTestCase validateProgressNoteReviewOfSystemsSectionTestCase = new OperationsTestCase( + "validateProgressNoteReviewOfSystemsSection", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_REVIEW_OF_SYSTEMS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + + } + + @Override + protected void updateToPass(ProgressNote target) { + target.init(); + + /* ReviewOfSystemsSection */ + ReviewOfSystemsSection section = + + ConsolFactory.eINSTANCE.createReviewOfSystemsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteReviewOfSystemsSection( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteReviewOfSystemsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProgressNoteSubjectiveSection() { + OperationsTestCase validateProgressNoteSubjectiveSectionTestCase = new OperationsTestCase( + "validateProgressNoteSubjectiveSection", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_SUBJECTIVE_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + + } + + @Override + protected void updateToPass(ProgressNote target) { + target.init(); + + /* SubjectiveSection */ + SubjectiveSection section = + + ConsolFactory.eINSTANCE.createSubjectiveSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteSubjectiveSection( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteSubjectiveSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProgressNoteVitalSignsSectionEntriesOptional() { + OperationsTestCase validateProgressNoteVitalSignsSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateProgressNoteVitalSignsSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_VITAL_SIGNS_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + + } + + @Override + protected void updateToPass(ProgressNote target) { + target.init(); + + /* VitalSignsSectionEntriesOptional */ + VitalSignsSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createVitalSignsSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteVitalSignsSectionEntriesOptional( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteVitalSignsSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProgressNoteInstructionsSection() { + OperationsTestCase validateProgressNoteInstructionsSectionTestCase = new OperationsTestCase( + "validateProgressNoteInstructionsSection", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_INSTRUCTIONS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + + } + + @Override + protected void updateToPass(ProgressNote target) { + target.init(); + + /* InstructionsSection */ + InstructionsSection section = + + ConsolFactory.eINSTANCE.createInstructionsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteInstructionsSection( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteInstructionsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProgressNoteDocumentationOfServiceEvent2EffectiveTimeLow() { + OperationsTestCase validateProgressNoteDocumentationOfServiceEvent2EffectiveTimeLowTestCase = new OperationsTestCase( + "validateProgressNoteDocumentationOfServiceEvent2EffectiveTimeLow", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_DOCUMENTATION_OF_SERVICE_EVENT2_EFFECTIVE_TIME_LOW__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + se.setEffectiveTime(ts); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected void updateToPass(ProgressNote target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + IVXB_TS low = DatatypesFactory.eINSTANCE.createIVXB_TS(); + + low.setValue("12345"); + ts.setLow(low); + se.setEffectiveTime(ts); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteDocumentationOfServiceEvent2EffectiveTimeLow( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteDocumentationOfServiceEvent2EffectiveTimeLowTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProgressNoteDocumentationOfServiceEvent2EffectiveTimeHigh() { + OperationsTestCase validateProgressNoteDocumentationOfServiceEvent2EffectiveTimeHighTestCase = new OperationsTestCase( + "validateProgressNoteDocumentationOfServiceEvent2EffectiveTimeHigh", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_DOCUMENTATION_OF_SERVICE_EVENT2_EFFECTIVE_TIME_HIGH__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + se.setEffectiveTime(ts); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected void updateToPass(ProgressNote target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + IVXB_TS high = DatatypesFactory.eINSTANCE.createIVXB_TS(); + + high.setValue("12345"); + ts.setHigh(high); + se.setEffectiveTime(ts); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteDocumentationOfServiceEvent2EffectiveTimeHigh( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteDocumentationOfServiceEvent2EffectiveTimeHighTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProgressNoteDocumentationOfServiceEvent2TemplateId() { + OperationsTestCase validateProgressNoteDocumentationOfServiceEvent2TemplateIdTestCase = new OperationsTestCase( + "validateProgressNoteDocumentationOfServiceEvent2TemplateId", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_DOCUMENTATION_OF_SERVICE_EVENT2_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected void updateToPass(ProgressNote target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + se.getTemplateIds().add(DatatypesFactory.eINSTANCE.createII("2.16.840.1.113883.10.20.21.3.1")); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteDocumentationOfServiceEvent2TemplateId( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteDocumentationOfServiceEvent2TemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProgressNoteDocumentationOfServiceEvent2ClassCode() { + OperationsTestCase validateProgressNoteDocumentationOfServiceEvent2ClassCodeTestCase = new OperationsTestCase( + "validateProgressNoteDocumentationOfServiceEvent2ClassCode", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_DOCUMENTATION_OF_SERVICE_EVENT2_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected void updateToPass(ProgressNote target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + se.setEffectiveTime(DatatypesFactory.eINSTANCE.createIVL_TS()); + se.setClassCode(ActClassRoot.PCPR); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteDocumentationOfServiceEvent2ClassCode( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteDocumentationOfServiceEvent2ClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProgressNoteDocumentationOfServiceEvent2EffectiveTime() { + OperationsTestCase validateProgressNoteDocumentationOfServiceEvent2EffectiveTimeTestCase = new OperationsTestCase( + "validateProgressNoteDocumentationOfServiceEvent2EffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_DOCUMENTATION_OF_SERVICE_EVENT2_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected void updateToPass(ProgressNote target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + se.setEffectiveTime(DatatypesFactory.eINSTANCE.createIVL_TS()); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteDocumentationOfServiceEvent2EffectiveTime( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteDocumentationOfServiceEvent2EffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProgressNoteDocumentationOfServiceEvent2() { + OperationsTestCase validateProgressNoteDocumentationOfServiceEvent2TestCase = new OperationsTestCase( + "validateProgressNoteDocumentationOfServiceEvent2", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_DOCUMENTATION_OF_SERVICE_EVENT2__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + + target.getDocumentationOfs().add(dof); + } + + @Override + protected void updateToPass(ProgressNote target) { + target.getDocumentationOfs().clear(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteDocumentationOfServiceEvent2( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteDocumentationOfServiceEvent2TestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProgressNoteComponentOfEncompassingEncounter6LocationHealthCareFacility1Id() { + OperationsTestCase validateProgressNoteComponentOfEncompassingEncounter6LocationHealthCareFacility1IdTestCase = new OperationsTestCase( + "validateProgressNoteComponentOfEncompassingEncounter6LocationHealthCareFacility1Id", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_COMPONENT_OF_ENCOMPASSING_ENCOUNTER6_LOCATION_HEALTH_CARE_FACILITY1_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + target.init(); + Component1 cof = CDAFactory.eINSTANCE.createComponent1(); + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + cof.setEncompassingEncounter(ee); + target.setComponentOf(cof); + target.getComponentOf().getEncompassingEncounter().setLocation(CDAFactory.eINSTANCE.createLocation()); + target.getComponentOf().getEncompassingEncounter().getLocation().setHealthCareFacility( + CDAFactory.eINSTANCE.createHealthCareFacility()); + } + + @Override + protected void updateToPass(ProgressNote target) { + target.getComponentOf().getEncompassingEncounter().getLocation().getHealthCareFacility().getIds().add( + DatatypesFactory.eINSTANCE.createII()); + ; + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteComponentOfEncompassingEncounter6LocationHealthCareFacility1Id( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteComponentOfEncompassingEncounter6LocationHealthCareFacility1IdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProgressNoteComponentOfEncompassingEncounter6LocationHealthCareFacility() { + OperationsTestCase validateProgressNoteComponentOfEncompassingEncounter6LocationHealthCareFacilityTestCase = new OperationsTestCase( + "validateProgressNoteComponentOfEncompassingEncounter6LocationHealthCareFacility", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_COMPONENT_OF_ENCOMPASSING_ENCOUNTER6_LOCATION_HEALTH_CARE_FACILITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + target.init(); + Component1 cof = CDAFactory.eINSTANCE.createComponent1(); + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + ee.setLocation(CDAFactory.eINSTANCE.createLocation()); + cof.setEncompassingEncounter(ee); + target.setComponentOf(cof); + } + + @Override + protected void updateToPass(ProgressNote target) { + Component1 cof = CDAFactory.eINSTANCE.createComponent1(); + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + Location loc = CDAFactory.eINSTANCE.createLocation(); + loc.setHealthCareFacility(CDAFactory.eINSTANCE.createHealthCareFacility()); + ee.setLocation(loc); + cof.setEncompassingEncounter(ee); + target.setComponentOf(cof); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteComponentOfEncompassingEncounter6LocationHealthCareFacility( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteComponentOfEncompassingEncounter6LocationHealthCareFacilityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProgressNoteComponentOfEncompassingEncounter6EffectiveTime() { + OperationsTestCase validateProgressNoteComponentOfEncompassingEncounter6EffectiveTimeTestCase = new OperationsTestCase( + "validateProgressNoteComponentOfEncompassingEncounter6EffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_COMPONENT_OF_ENCOMPASSING_ENCOUNTER6_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + target.init(); + Component1 cof = CDAFactory.eINSTANCE.createComponent1(); + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + cof.setEncompassingEncounter(ee); + target.setComponentOf(cof); + } + + @Override + protected void updateToPass(ProgressNote target) { + target.getComponentOf().getEncompassingEncounter().setEffectiveTime( + DatatypesFactory.eINSTANCE.createIVL_TS()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteComponentOfEncompassingEncounter6EffectiveTime( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteComponentOfEncompassingEncounter6EffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProgressNoteComponentOfEncompassingEncounter6Id() { + OperationsTestCase validateProgressNoteComponentOfEncompassingEncounter6IdTestCase = new OperationsTestCase( + "validateProgressNoteComponentOfEncompassingEncounter6Id", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_COMPONENT_OF_ENCOMPASSING_ENCOUNTER6_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + target.init(); + Component1 cof = CDAFactory.eINSTANCE.createComponent1(); + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + cof.setEncompassingEncounter(ee); + target.setComponentOf(cof); + } + + @Override + protected void updateToPass(ProgressNote target) { + target.getComponentOf().getEncompassingEncounter().getIds().add(DatatypesFactory.eINSTANCE.createII()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteComponentOfEncompassingEncounter6Id( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteComponentOfEncompassingEncounter6IdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProgressNoteComponentOfEncompassingEncounter6Location() { + OperationsTestCase validateProgressNoteComponentOfEncompassingEncounter6LocationTestCase = new OperationsTestCase( + "validateProgressNoteComponentOfEncompassingEncounter6Location", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_COMPONENT_OF_ENCOMPASSING_ENCOUNTER6_LOCATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + target.init(); + Component1 cof = CDAFactory.eINSTANCE.createComponent1(); + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + cof.setEncompassingEncounter(ee); + target.setComponentOf(cof); + } + + @Override + protected void updateToPass(ProgressNote target) { + target.getComponentOf().getEncompassingEncounter().setLocation(CDAFactory.eINSTANCE.createLocation()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteComponentOfEncompassingEncounter6Location( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteComponentOfEncompassingEncounter6LocationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProgressNoteComponentOfEncompassingEncounter6() { + OperationsTestCase validateProgressNoteComponentOfEncompassingEncounter6TestCase = new OperationsTestCase( + "validateProgressNoteComponentOfEncompassingEncounter6", + operationsForOCL.getOCLValue("VALIDATE_PROGRESS_NOTE_COMPONENT_OF_ENCOMPASSING_ENCOUNTER6__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + target.init(); + Component1 cof = CDAFactory.eINSTANCE.createComponent1(); + target.setComponentOf(cof); + } + + @Override + protected void updateToPass(ProgressNote target) { + Component1 cof = CDAFactory.eINSTANCE.createComponent1(); + EncompassingEncounter ee = CDAFactory.eINSTANCE.createEncompassingEncounter(); + cof.setEncompassingEncounter(ee); + target.setComponentOf(cof); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProgressNoteOperations.validateProgressNoteComponentOfEncompassingEncounter6( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateProgressNoteComponentOfEncompassingEncounter6TestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetAssessmentSection() { + + ProgressNote target = objectFactory.create(); + target.getAssessmentSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPlanOfCareSection() { + + ProgressNote target = objectFactory.create(); + target.getPlanOfCareSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetAssessmentAndPlanSection() { + + ProgressNote target = objectFactory.create(); + target.getAssessmentAndPlanSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetAllergiesSectionEntriesOptional() { + + ProgressNote target = objectFactory.create(); + target.getAllergiesSectionEntriesOptional(); + + } + + /** + * + * @generated + */ + @Test + public void testGetChiefComplaintSection() { + + ProgressNote target = objectFactory.create(); + target.getChiefComplaintSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetInterventionsSection() { + + ProgressNote target = objectFactory.create(); + target.getInterventionsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetMedicationsSectionEntriesOptional() { + + ProgressNote target = objectFactory.create(); + target.getMedicationsSectionEntriesOptional(); + + } + + /** + * + * @generated + */ + @Test + public void testGetObjectiveSection() { + + ProgressNote target = objectFactory.create(); + target.getObjectiveSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPhysicalExamSection() { + + ProgressNote target = objectFactory.create(); + target.getPhysicalExamSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProblemSectionEntriesOptional() { + + ProgressNote target = objectFactory.create(); + target.getProblemSectionEntriesOptional(); + + } + + /** + * + * @generated + */ + @Test + public void testGetResultsSectionEntriesOptional() { + + ProgressNote target = objectFactory.create(); + target.getResultsSectionEntriesOptional(); + + } + + /** + * + * @generated + */ + @Test + public void testGetReviewOfSystemsSection() { + + ProgressNote target = objectFactory.create(); + target.getReviewOfSystemsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetSubjectiveSection() { + + ProgressNote target = objectFactory.create(); + target.getSubjectiveSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetVitalSignsSectionEntriesOptional() { + + ProgressNote target = objectFactory.create(); + target.getVitalSignsSectionEntriesOptional(); + + } + + /** + * + * @generated + */ + @Test + public void testGetInstructionsSection() { + + ProgressNote target = objectFactory.create(); + target.getInstructionsSection(); + + } + + /** + * + * @generated not + */ + @Test + public void testValidateGeneralHeaderConstraintsCode() { + OperationsTestCase validateGeneralHeaderConstraintsCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProgressNote target) { + + } + + @Override + protected void updateToPass(ProgressNote target) { + target.init(); + target.getCode().setCode("code"); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsCode( + (ProgressNote) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ProgressNoteOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ProgressNote create() { + return ConsolFactory.eINSTANCE.createProgressNote(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ProgressNoteOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ProgressNoteOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PurposeofReferenceObservationTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PurposeofReferenceObservationTest.java new file mode 100644 index 000000000..fb0e6dca1 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/PurposeofReferenceObservationTest.java @@ -0,0 +1,328 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.PurposeofReferenceObservation; +import org.openhealthtools.mdht.uml.cda.consol.operations.PurposeofReferenceObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; + +/** + * + * A static utility class that provides operations related to 'Purposeof Reference Observation' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PurposeofReferenceObservation#validatePurposeofReferenceObservationCodeCodeSystem(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Purposeof Reference Observation Code Code System}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PurposeofReferenceObservation#validatePurposeofReferenceObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Purposeof Reference Observation Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PurposeofReferenceObservation#validatePurposeofReferenceObservationClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Purposeof Reference Observation Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PurposeofReferenceObservation#validatePurposeofReferenceObservationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Purposeof Reference Observation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PurposeofReferenceObservation#validatePurposeofReferenceObservationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Purposeof Reference Observation Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.PurposeofReferenceObservation#validatePurposeofReferenceObservationValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Purposeof Reference Observation Value}
  • + *
+ *

+ * + * @generated + */ + +public class PurposeofReferenceObservationTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidatePurposeofReferenceObservationCodeCodeSystem() { + OperationsTestCase validatePurposeofReferenceObservationCodeCodeSystemTestCase = new OperationsTestCase( + "validatePurposeofReferenceObservationCodeCodeSystem", + operationsForOCL.getOCLValue("VALIDATE_PURPOSEOF_REFERENCE_OBSERVATION_CODE_CODE_SYSTEM__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PurposeofReferenceObservation target) { + + } + + @Override + protected void updateToPass(PurposeofReferenceObservation target) { + target.init(); + CD code = DatatypesFactory.eINSTANCE.createCD(); + code.setCode("ASSERTION"); + code.setCodeSystem("2.16.840.1.113883.5.4"); + target.setCode(code); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PurposeofReferenceObservationOperations.validatePurposeofReferenceObservationCodeCodeSystem( + (PurposeofReferenceObservation) objectToTest, diagnostician, map); + } + + }; + + validatePurposeofReferenceObservationCodeCodeSystemTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePurposeofReferenceObservationTemplateId() { + OperationsTestCase validatePurposeofReferenceObservationTemplateIdTestCase = new OperationsTestCase( + "validatePurposeofReferenceObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PURPOSEOF_REFERENCE_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PurposeofReferenceObservation target) { + + } + + @Override + protected void updateToPass(PurposeofReferenceObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PurposeofReferenceObservationOperations.validatePurposeofReferenceObservationTemplateId( + (PurposeofReferenceObservation) objectToTest, diagnostician, map); + } + + }; + + validatePurposeofReferenceObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePurposeofReferenceObservationClassCode() { + OperationsTestCase validatePurposeofReferenceObservationClassCodeTestCase = new OperationsTestCase( + "validatePurposeofReferenceObservationClassCode", + operationsForOCL.getOCLValue("VALIDATE_PURPOSEOF_REFERENCE_OBSERVATION_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PurposeofReferenceObservation target) { + + } + + @Override + protected void updateToPass(PurposeofReferenceObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PurposeofReferenceObservationOperations.validatePurposeofReferenceObservationClassCode( + (PurposeofReferenceObservation) objectToTest, diagnostician, map); + } + + }; + + validatePurposeofReferenceObservationClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePurposeofReferenceObservationCode() { + OperationsTestCase validatePurposeofReferenceObservationCodeTestCase = new OperationsTestCase( + "validatePurposeofReferenceObservationCode", + operationsForOCL.getOCLValue("VALIDATE_PURPOSEOF_REFERENCE_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PurposeofReferenceObservation target) { + + } + + @Override + protected void updateToPass(PurposeofReferenceObservation target) { + target.init(); + + CD cd = DatatypesFactory.eINSTANCE.createCD(); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PurposeofReferenceObservationOperations.validatePurposeofReferenceObservationCode( + (PurposeofReferenceObservation) objectToTest, diagnostician, map); + } + + }; + + validatePurposeofReferenceObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePurposeofReferenceObservationMoodCode() { + OperationsTestCase validatePurposeofReferenceObservationMoodCodeTestCase = new OperationsTestCase( + "validatePurposeofReferenceObservationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_PURPOSEOF_REFERENCE_OBSERVATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PurposeofReferenceObservation target) { + + } + + @Override + protected void updateToPass(PurposeofReferenceObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PurposeofReferenceObservationOperations.validatePurposeofReferenceObservationMoodCode( + (PurposeofReferenceObservation) objectToTest, diagnostician, map); + } + + }; + + validatePurposeofReferenceObservationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidatePurposeofReferenceObservationValue() { + OperationsTestCase validatePurposeofReferenceObservationValueTestCase = new OperationsTestCase( + "validatePurposeofReferenceObservationValue", + operationsForOCL.getOCLValue("VALIDATE_PURPOSEOF_REFERENCE_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + { + this.skipFailsTest(); + } + + @Override + protected void updateToFail(PurposeofReferenceObservation target) { + + } + + @Override + protected void updateToPass(PurposeofReferenceObservation target) { + target.init(); + CD value = DatatypesFactory.eINSTANCE.createCD("121079", "1.2.840.10008.2.16.4", "", ""); + target.getValues().add(value); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PurposeofReferenceObservationOperations.validatePurposeofReferenceObservationValue( + (PurposeofReferenceObservation) objectToTest, diagnostician, map); + } + + }; + + validatePurposeofReferenceObservationValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PurposeofReferenceObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public PurposeofReferenceObservation create() { + return ConsolFactory.eINSTANCE.createPurposeofReferenceObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PurposeofReferenceObservationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PurposeofReferenceObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/QuantityMeasurementObservationTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/QuantityMeasurementObservationTest.java new file mode 100644 index 000000000..12edfe127 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/QuantityMeasurementObservationTest.java @@ -0,0 +1,454 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.QuantityMeasurementObservation; +import org.openhealthtools.mdht.uml.cda.consol.operations.QuantityMeasurementObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.datatypes.PQ; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * + * A static utility class that provides operations related to 'Quantity Measurement Observation' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.QuantityMeasurementObservation#validateQuantityMeasurementObservationCodeCodeSystemDIR(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Quantity Measurement Observation Code Code System DIR}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.QuantityMeasurementObservation#validateQuantityMeasurementObservationCodeCodeSystemDICOM(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Quantity Measurement Observation Code Code System DICOM}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.QuantityMeasurementObservation#validateQuantityMeasurementObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Quantity Measurement Observation Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.QuantityMeasurementObservation#validateQuantityMeasurementObservationClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Quantity Measurement Observation Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.QuantityMeasurementObservation#validateQuantityMeasurementObservationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Quantity Measurement Observation Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.QuantityMeasurementObservation#validateQuantityMeasurementObservationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Quantity Measurement Observation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.QuantityMeasurementObservation#validateQuantityMeasurementObservationEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Quantity Measurement Observation Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.QuantityMeasurementObservation#validateQuantityMeasurementObservationValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Quantity Measurement Observation Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.QuantityMeasurementObservation#validateQuantityMeasurementObservationSOPInstanceObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Quantity Measurement Observation SOP Instance Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.QuantityMeasurementObservation#getSOPInstanceObservations() Get SOP Instance Observations}
  • + *
+ *

+ * + * @generated + */ + +public class QuantityMeasurementObservationTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateQuantityMeasurementObservationCodeCodeSystemDIR() { + OperationsTestCase validateQuantityMeasurementObservationCodeCodeSystemDIRTestCase = new OperationsTestCase( + "validateQuantityMeasurementObservationCodeCodeSystemDIR", + operationsForOCL.getOCLValue("VALIDATE_QUANTITY_MEASUREMENT_OBSERVATION_CODE_CODE_SYSTEM_DIR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(QuantityMeasurementObservation target) { + + } + + @Override + protected void updateToPass(QuantityMeasurementObservation target) { + target.init(); + target.setCode(DatatypesFactory.eINSTANCE.createCD("", "2.16.840.1.113883.6.96", "", "")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return QuantityMeasurementObservationOperations.validateQuantityMeasurementObservationCodeCodeSystemDIR( + (QuantityMeasurementObservation) objectToTest, diagnostician, map); + } + + }; + + validateQuantityMeasurementObservationCodeCodeSystemDIRTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateQuantityMeasurementObservationCodeCodeSystemDICOM() { + OperationsTestCase validateQuantityMeasurementObservationCodeCodeSystemDICOMTestCase = new OperationsTestCase( + "validateQuantityMeasurementObservationCodeCodeSystemDICOM", + operationsForOCL.getOCLValue("VALIDATE_QUANTITY_MEASUREMENT_OBSERVATION_CODE_CODE_SYSTEM_DICOM__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(QuantityMeasurementObservation target) { + + } + + @Override + protected void updateToPass(QuantityMeasurementObservation target) { + target.init(); + + target.setCode(DatatypesFactory.eINSTANCE.createCD("", "1.2.840.10008.2.16.4", "", "")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return QuantityMeasurementObservationOperations.validateQuantityMeasurementObservationCodeCodeSystemDICOM( + (QuantityMeasurementObservation) objectToTest, diagnostician, map); + } + + }; + + validateQuantityMeasurementObservationCodeCodeSystemDICOMTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateQuantityMeasurementObservationTemplateId() { + OperationsTestCase validateQuantityMeasurementObservationTemplateIdTestCase = new OperationsTestCase( + "validateQuantityMeasurementObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_QUANTITY_MEASUREMENT_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(QuantityMeasurementObservation target) { + + } + + @Override + protected void updateToPass(QuantityMeasurementObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return QuantityMeasurementObservationOperations.validateQuantityMeasurementObservationTemplateId( + (QuantityMeasurementObservation) objectToTest, diagnostician, map); + } + + }; + + validateQuantityMeasurementObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateQuantityMeasurementObservationClassCode() { + OperationsTestCase validateQuantityMeasurementObservationClassCodeTestCase = new OperationsTestCase( + "validateQuantityMeasurementObservationClassCode", + operationsForOCL.getOCLValue("VALIDATE_QUANTITY_MEASUREMENT_OBSERVATION_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(QuantityMeasurementObservation target) { + + } + + @Override + protected void updateToPass(QuantityMeasurementObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return QuantityMeasurementObservationOperations.validateQuantityMeasurementObservationClassCode( + (QuantityMeasurementObservation) objectToTest, diagnostician, map); + } + + }; + + validateQuantityMeasurementObservationClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateQuantityMeasurementObservationMoodCode() { + OperationsTestCase validateQuantityMeasurementObservationMoodCodeTestCase = new OperationsTestCase( + "validateQuantityMeasurementObservationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_QUANTITY_MEASUREMENT_OBSERVATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(QuantityMeasurementObservation target) { + + } + + @Override + protected void updateToPass(QuantityMeasurementObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return QuantityMeasurementObservationOperations.validateQuantityMeasurementObservationMoodCode( + (QuantityMeasurementObservation) objectToTest, diagnostician, map); + } + + }; + + validateQuantityMeasurementObservationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateQuantityMeasurementObservationCode() { + OperationsTestCase validateQuantityMeasurementObservationCodeTestCase = new OperationsTestCase( + "validateQuantityMeasurementObservationCode", + operationsForOCL.getOCLValue("VALIDATE_QUANTITY_MEASUREMENT_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(QuantityMeasurementObservation target) { + + } + + @Override + protected void updateToPass(QuantityMeasurementObservation target) { + target.init(); + + CD cd = DatatypesFactory.eINSTANCE.createCD(); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return QuantityMeasurementObservationOperations.validateQuantityMeasurementObservationCode( + (QuantityMeasurementObservation) objectToTest, diagnostician, map); + } + + }; + + validateQuantityMeasurementObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateQuantityMeasurementObservationEffectiveTime() { + OperationsTestCase validateQuantityMeasurementObservationEffectiveTimeTestCase = new OperationsTestCase( + "validateQuantityMeasurementObservationEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_QUANTITY_MEASUREMENT_OBSERVATION_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(QuantityMeasurementObservation target) { + + } + + @Override + protected void updateToPass(QuantityMeasurementObservation target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return QuantityMeasurementObservationOperations.validateQuantityMeasurementObservationEffectiveTime( + (QuantityMeasurementObservation) objectToTest, diagnostician, map); + } + + }; + + validateQuantityMeasurementObservationEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateQuantityMeasurementObservationValue() { + OperationsTestCase validateQuantityMeasurementObservationValueTestCase = new OperationsTestCase( + "validateQuantityMeasurementObservationValue", + operationsForOCL.getOCLValue("VALIDATE_QUANTITY_MEASUREMENT_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(QuantityMeasurementObservation target) { + + } + + @Override + protected void updateToPass(QuantityMeasurementObservation target) { + target.init(); + + PQ value = DatatypesFactory.eINSTANCE.createPQ(); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return QuantityMeasurementObservationOperations.validateQuantityMeasurementObservationValue( + (QuantityMeasurementObservation) objectToTest, diagnostician, map); + } + + }; + + validateQuantityMeasurementObservationValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateQuantityMeasurementObservationSOPInstanceObservation() { + OperationsTestCase validateQuantityMeasurementObservationSOPInstanceObservationTestCase = new OperationsTestCase( + "validateQuantityMeasurementObservationSOPInstanceObservation", + operationsForOCL.getOCLValue("VALIDATE_QUANTITY_MEASUREMENT_OBSERVATION_SOP_INSTANCE_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(QuantityMeasurementObservation target) { + + } + + @Override + protected void updateToPass(QuantityMeasurementObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.SPRT); + er.setObservation(ConsolFactory.eINSTANCE.createSOPInstanceObservation()); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return QuantityMeasurementObservationOperations.validateQuantityMeasurementObservationSOPInstanceObservation( + (QuantityMeasurementObservation) objectToTest, diagnostician, map); + } + + }; + + validateQuantityMeasurementObservationSOPInstanceObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetSOPInstanceObservations() { + + QuantityMeasurementObservation target = objectFactory.create(); + target.getSOPInstanceObservations(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends QuantityMeasurementObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public QuantityMeasurementObservation create() { + return ConsolFactory.eINSTANCE.createQuantityMeasurementObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends QuantityMeasurementObservationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // QuantityMeasurementObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ReactionObservationTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ReactionObservationTest.java new file mode 100644 index 000000000..ef74b493f --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ReactionObservationTest.java @@ -0,0 +1,1032 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ConsolPackage; +import org.openhealthtools.mdht.uml.cda.consol.GeneralStatusSection; +import org.openhealthtools.mdht.uml.cda.consol.MedicationActivity; +import org.openhealthtools.mdht.uml.cda.consol.ProcedureActivityProcedure; +import org.openhealthtools.mdht.uml.cda.consol.ReactionObservation; +import org.openhealthtools.mdht.uml.cda.consol.SeverityObservation; +import org.openhealthtools.mdht.uml.cda.consol.operations.ReactionObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * + * A static utility class that provides operations related to 'Reaction Observation' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ReactionObservation#validateReactionObservationTextReference(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Reaction Observation Text Reference}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ReactionObservation#validateReactionObservationTextReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Reaction Observation Text Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ReactionObservation#validateReactionObservationReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Reaction Observation Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ReactionObservation#validateReactionObservationEffectiveTimeLow(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Reaction Observation Effective Time Low}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ReactionObservation#validateReactionObservationEffectiveTimeHigh(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Reaction Observation Effective Time High}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ReactionObservation#validateReactionObservationSeverityObservationInversionInd(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Reaction Observation Severity Observation Inversion Ind}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ReactionObservation#validateReactionObservationProcedureActivityProcedureInversionInd(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Reaction Observation Procedure Activity Procedure Inversion Ind}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ReactionObservation#validateReactionObservationMedicationActivityInversionInd(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Reaction Observation Medication Activity Inversion Ind}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ReactionObservation#validateReactionObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Reaction Observation Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ReactionObservation#validateReactionObservationClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Reaction Observation Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ReactionObservation#validateReactionObservationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Reaction Observation Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ReactionObservation#validateReactionObservationId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Reaction Observation Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ReactionObservation#validateReactionObservationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Reaction Observation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ReactionObservation#validateReactionObservationText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Reaction Observation Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ReactionObservation#validateReactionObservationStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Reaction Observation Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ReactionObservation#validateReactionObservationEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Reaction Observation Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ReactionObservation#validateReactionObservationValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Reaction Observation Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ReactionObservation#validateReactionObservationSeverityObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Reaction Observation Severity Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ReactionObservation#validateReactionObservationProcedureActivityProcedure(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Reaction Observation Procedure Activity Procedure}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ReactionObservation#validateReactionObservationMedicationActivity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Reaction Observation Medication Activity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ReactionObservation#getSeverityObservation() Get Severity Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ReactionObservation#getProcedureActivityProcedures() Get Procedure Activity Procedures}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ReactionObservation#getMedicationActivities() Get Medication Activities}
  • + *
+ *

+ * + * @generated + */ + +public class ReactionObservationTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateReactionObservationTextReference() { + OperationsTestCase validateReactionObservationTextReferenceTestCase = new OperationsTestCase( + "validateReactionObservationTextReference", + operationsForOCL.getOCLValue("VALIDATE_REACTION_OBSERVATION_TEXT_REFERENCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReactionObservation target) { + target.init(); + target.setText(DatatypesFactory.eINSTANCE.createED("test")); + } + + @Override + protected void updateToPass(ReactionObservation target) { + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL("test")); + target.setText(txt); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReactionObservationOperations.validateReactionObservationTextReference( + (ReactionObservation) objectToTest, diagnostician, map); + } + + }; + + validateReactionObservationTextReferenceTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateReactionObservationTextReferenceValue() { + OperationsTestCase validateReactionObservationTextReferenceValueTestCase = new OperationsTestCase( + "validateReactionObservationTextReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_REACTION_OBSERVATION_TEXT_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReactionObservation target) { + target.init(); + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL()); + target.setText(txt); + } + + @Override + protected void updateToPass(ReactionObservation target) { + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL("test")); + target.setText(txt); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReactionObservationOperations.validateReactionObservationTextReferenceValue( + (ReactionObservation) objectToTest, diagnostician, map); + } + + }; + + validateReactionObservationTextReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateReactionObservationReferenceValue() { + OperationsTestCase validateReactionObservationReferenceValueTestCase = new NarrativeReferenceTestCase( + "validateReactionObservationReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_REACTION_OBSERVATION_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReactionObservation target) { + target.init(); + + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), "", + "No particular adverse reaction."); + + // add a reference to the section text + target.setText(createEDWithReference("Some sample text", "#1.2.3.4")); + + } + + @Override + protected void updateToPass(ReactionObservation target) { + + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), + "1.2.3.4", "No particular adverse reaction."); + + // add a reference to the section text + target.setText(createEDWithReference("Some sample text", "#1.2.3.4")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReactionObservationOperations.validateReactionObservationReferenceValue( + (ReactionObservation) objectToTest, diagnostician, map); + } + + }; + + validateReactionObservationReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateReactionObservationEffectiveTimeLow() { + OperationsTestCase validateReactionObservationEffectiveTimeLowTestCase = new OperationsTestCase( + "validateReactionObservationEffectiveTimeLow", + operationsForOCL.getOCLValue("VALIDATE_REACTION_OBSERVATION_EFFECTIVE_TIME_LOW__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReactionObservation target) { + target.init(); + target.setEffectiveTime(DatatypesFactory.eINSTANCE.createIVL_TS()); + } + + @Override + protected void updateToPass(ReactionObservation target) { + IVL_TS ef = DatatypesFactory.eINSTANCE.createIVL_TS(); + ef.setLow(DatatypesFactory.eINSTANCE.createIVXB_TS()); + target.setEffectiveTime(ef); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReactionObservationOperations.validateReactionObservationEffectiveTimeLow( + (ReactionObservation) objectToTest, diagnostician, map); + } + + }; + + validateReactionObservationEffectiveTimeLowTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateReactionObservationEffectiveTimeHigh() { + OperationsTestCase validateReactionObservationEffectiveTimeHighTestCase = new OperationsTestCase( + "validateReactionObservationEffectiveTimeHigh", + operationsForOCL.getOCLValue("VALIDATE_REACTION_OBSERVATION_EFFECTIVE_TIME_HIGH__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReactionObservation target) { + target.init(); + target.setEffectiveTime(DatatypesFactory.eINSTANCE.createIVL_TS()); + } + + @Override + protected void updateToPass(ReactionObservation target) { + IVL_TS ef = DatatypesFactory.eINSTANCE.createIVL_TS(); + ef.setHigh(DatatypesFactory.eINSTANCE.createIVXB_TS()); + target.setEffectiveTime(ef); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReactionObservationOperations.validateReactionObservationEffectiveTimeHigh( + (ReactionObservation) objectToTest, diagnostician, map); + } + + }; + + validateReactionObservationEffectiveTimeHighTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateReactionObservationSeverityObservationInversionInd() { + OperationsTestCase validateReactionObservationSeverityObservationInversionIndTestCase = new OperationsTestCase( + "validateReactionObservationSeverityObservationInversionInd", + operationsForOCL.getOCLValue("VALIDATE_REACTION_OBSERVATION_SEVERITY_OBSERVATION_INVERSION_IND__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReactionObservation target) { + target.init(); + target.getEntryRelationships().clear(); + target.getEntryRelationships().add( + createEntryRelationship(ENTRY_RELATIONSHIP_OBJECT.SEVERITY_OBS, false)); + + } + + @Override + public void addPassTests() { + + addPassTest(new PassTest() { + + @Override + public void updateToPass(ReactionObservation target) { + // Test case with only entry Relationship + // Should pass + target.getEntryRelationships().clear(); + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + target.getEntryRelationships().add(er); + } + + }); + } + + @Override + protected void updateToPass(ReactionObservation target) { + target.init(); + // Add Severity Observation + target.getEntryRelationships().clear(); + target.getEntryRelationships().add( + createEntryRelationship(ENTRY_RELATIONSHIP_OBJECT.SEVERITY_OBS, true)); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReactionObservationOperations.validateReactionObservationSeverityObservationInversionInd( + (ReactionObservation) objectToTest, diagnostician, map); + } + + }; + + validateReactionObservationSeverityObservationInversionIndTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateReactionObservationProcedureActivityProcedureInversionInd() { + OperationsTestCase validateReactionObservationProcedureActivityProcedureInversionIndTestCase = new OperationsTestCase( + "validateReactionObservationProcedureActivityProcedureInversionInd", + operationsForOCL.getOCLValue("VALIDATE_REACTION_OBSERVATION_PROCEDURE_ACTIVITY_PROCEDURE_INVERSION_IND__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReactionObservation target) { + target.init(); + target.getEntryRelationships().clear(); + target.getEntryRelationships().add( + createEntryRelationship(ENTRY_RELATIONSHIP_OBJECT.PROCEDURE_ACTIVITY_PROCEDURE, false)); + } + + @Override + public void addPassTests() { + + addPassTest(new PassTest() { + + @Override + public void updateToPass(ReactionObservation target) { + // Test case with only entry Relationship + // Should pass + target.getEntryRelationships().clear(); + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + target.getEntryRelationships().add(er); + } + + }); + } + + @Override + protected void updateToPass(ReactionObservation target) { + target.init(); + target.getEntryRelationships().clear(); + target.getEntryRelationships().add( + createEntryRelationship(ENTRY_RELATIONSHIP_OBJECT.PROCEDURE_ACTIVITY_PROCEDURE, true)); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReactionObservationOperations.validateReactionObservationProcedureActivityProcedureInversionInd( + (ReactionObservation) objectToTest, diagnostician, map); + } + + }; + + validateReactionObservationProcedureActivityProcedureInversionIndTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateReactionObservationMedicationActivityInversionInd() { + OperationsTestCase validateReactionObservationMedicationActivityInversionIndTestCase = new OperationsTestCase( + "validateReactionObservationMedicationActivityInversionInd", + operationsForOCL.getOCLValue("VALIDATE_REACTION_OBSERVATION_MEDICATION_ACTIVITY_INVERSION_IND__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReactionObservation target) { + target.init(); + target.getEntryRelationships().clear(); + target.getEntryRelationships().add( + createEntryRelationship(ENTRY_RELATIONSHIP_OBJECT.MEDICATION_ACTIVITY, false)); + } + + @Override + public void addPassTests() { + + addPassTest(new PassTest() { + + @Override + public void updateToPass(ReactionObservation target) { + // Test case with only entry Relationship + // Should pass + target.getEntryRelationships().clear(); + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + target.getEntryRelationships().add(er); + } + + }); + } + + @Override + protected void updateToPass(ReactionObservation target) { + target.init(); + target.getEntryRelationships().clear(); + target.getEntryRelationships().add( + createEntryRelationship(ENTRY_RELATIONSHIP_OBJECT.MEDICATION_ACTIVITY, true)); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReactionObservationOperations.validateReactionObservationMedicationActivityInversionInd( + (ReactionObservation) objectToTest, diagnostician, map); + } + + }; + + validateReactionObservationMedicationActivityInversionIndTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateReactionObservationTemplateId() { + OperationsTestCase validateReactionObservationTemplateIdTestCase = new OperationsTestCase( + "validateReactionObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_REACTION_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReactionObservation target) { + + } + + @Override + protected void updateToPass(ReactionObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReactionObservationOperations.validateReactionObservationTemplateId( + (ReactionObservation) objectToTest, diagnostician, map); + } + + }; + + validateReactionObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateReactionObservationClassCode() { + OperationsTestCase validateReactionObservationClassCodeTestCase = new OperationsTestCase( + "validateReactionObservationClassCode", + operationsForOCL.getOCLValue("VALIDATE_REACTION_OBSERVATION_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReactionObservation target) { + + } + + @Override + protected void updateToPass(ReactionObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReactionObservationOperations.validateReactionObservationClassCode( + (ReactionObservation) objectToTest, diagnostician, map); + } + + }; + + validateReactionObservationClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateReactionObservationMoodCode() { + OperationsTestCase validateReactionObservationMoodCodeTestCase = new OperationsTestCase( + "validateReactionObservationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_REACTION_OBSERVATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReactionObservation target) { + + } + + @Override + protected void updateToPass(ReactionObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReactionObservationOperations.validateReactionObservationMoodCode( + (ReactionObservation) objectToTest, diagnostician, map); + } + + }; + + validateReactionObservationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateReactionObservationId() { + OperationsTestCase validateReactionObservationIdTestCase = new OperationsTestCase( + "validateReactionObservationId", + operationsForOCL.getOCLValue("VALIDATE_REACTION_OBSERVATION_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReactionObservation target) { + + } + + @Override + protected void updateToPass(ReactionObservation target) { + target.init(); + + II ii = DatatypesFactory.eINSTANCE.createII(); + target.getIds().add(ii); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReactionObservationOperations.validateReactionObservationId( + (ReactionObservation) objectToTest, diagnostician, map); + } + + }; + + validateReactionObservationIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateReactionObservationCode() { + OperationsTestCase validateReactionObservationCodeTestCase = new OperationsTestCase( + "validateReactionObservationCode", + operationsForOCL.getOCLValue("VALIDATE_REACTION_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReactionObservation target) { + + } + + @Override + protected void updateToPass(ReactionObservation target) { + target.init(); + + CD cd = DatatypesFactory.eINSTANCE.createCD(); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReactionObservationOperations.validateReactionObservationCode( + (ReactionObservation) objectToTest, diagnostician, map); + } + + }; + + validateReactionObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateReactionObservationText() { + OperationsTestCase validateReactionObservationTextTestCase = new OperationsTestCase( + "validateReactionObservationText", + operationsForOCL.getOCLValue("VALIDATE_REACTION_OBSERVATION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReactionObservation target) { + + } + + @Override + protected void updateToPass(ReactionObservation target) { + target.init(); + target.setText(DatatypesFactory.eINSTANCE.createED()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReactionObservationOperations.validateReactionObservationText( + (ReactionObservation) objectToTest, diagnostician, map); + } + + }; + + validateReactionObservationTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateReactionObservationStatusCode() { + OperationsTestCase validateReactionObservationStatusCodeTestCase = new OperationsTestCase( + "validateReactionObservationStatusCode", + operationsForOCL.getOCLValue("VALIDATE_REACTION_OBSERVATION_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReactionObservation target) { + + } + + @Override + protected void updateToPass(ReactionObservation target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReactionObservationOperations.validateReactionObservationStatusCode( + (ReactionObservation) objectToTest, diagnostician, map); + } + + }; + + validateReactionObservationStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateReactionObservationEffectiveTime() { + OperationsTestCase validateReactionObservationEffectiveTimeTestCase = new OperationsTestCase( + "validateReactionObservationEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_REACTION_OBSERVATION_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReactionObservation target) { + + } + + @Override + protected void updateToPass(ReactionObservation target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReactionObservationOperations.validateReactionObservationEffectiveTime( + (ReactionObservation) objectToTest, diagnostician, map); + } + + }; + + validateReactionObservationEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateReactionObservationValue() { + OperationsTestCase validateReactionObservationValueTestCase = new OperationsTestCase( + "validateReactionObservationValue", + operationsForOCL.getOCLValue("VALIDATE_REACTION_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReactionObservation target) { + target.init(); + target.getValues().clear(); + CD value = DatatypesFactory.eINSTANCE.createCD(); + value.setCodeSystem("2.16.840.1.113883.3.88.12.3221.7.4"); + value.setCode("234422006"); + target.getValues().add(value); + } + + @Override + protected void updateToPass(ReactionObservation target) { + target.init(); + target.getValues().clear(); + CD value = DatatypesFactory.eINSTANCE.createCD(); + value.setCodeSystem("2.16.840.1.113883.6.96"); + value.setCode("234422006"); + target.getValues().add(value); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReactionObservationOperations.validateReactionObservationValue( + (ReactionObservation) objectToTest, diagnostician, map); + } + + }; + + validateReactionObservationValueTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateReactionObservationSeverityObservation() { + OperationsTestCase validateReactionObservationSeverityObservationTestCase = new OperationsTestCase( + "validateReactionObservationSeverityObservation", + operationsForOCL.getOCLValue("VALIDATE_REACTION_OBSERVATION_SEVERITY_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReactionObservation target) { + + } + + @Override + protected void updateToPass(ReactionObservation target) { + target.init(); + + SeverityObservation observation = ConsolFactory.eINSTANCE.createSeverityObservation().init(); + target.addObservation(observation); + for (org.openhealthtools.mdht.uml.cda.EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReactionObservationOperations.validateReactionObservationSeverityObservation( + (ReactionObservation) objectToTest, diagnostician, map); + } + + }; + + validateReactionObservationSeverityObservationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateReactionObservationProcedureActivityProcedure() { + OperationsTestCase validateReactionObservationProcedureActivityProcedureTestCase = new OperationsTestCase( + "validateReactionObservationProcedureActivityProcedure", + operationsForOCL.getOCLValue("VALIDATE_REACTION_OBSERVATION_PROCEDURE_ACTIVITY_PROCEDURE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReactionObservation target) { + target.init(); + EntryRelationship er = createEntryRelationship( + ENTRY_RELATIONSHIP_OBJECT.PROCEDURE_ACTIVITY_PROCEDURE, true); + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + target.getEntryRelationships().clear(); + target.getEntryRelationships().add(er); + } + + @Override + protected void updateToPass(ReactionObservation target) { + target.init(); + EntryRelationship er = createEntryRelationship( + ENTRY_RELATIONSHIP_OBJECT.PROCEDURE_ACTIVITY_PROCEDURE, true); + er.setTypeCode(x_ActRelationshipEntryRelationship.RSON); + target.getEntryRelationships().clear(); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReactionObservationOperations.validateReactionObservationProcedureActivityProcedure( + (ReactionObservation) objectToTest, diagnostician, map); + } + + }; + + validateReactionObservationProcedureActivityProcedureTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateReactionObservationMedicationActivity() { + OperationsTestCase validateReactionObservationMedicationActivityTestCase = new OperationsTestCase( + "validateReactionObservationMedicationActivity", + operationsForOCL.getOCLValue("VALIDATE_REACTION_OBSERVATION_MEDICATION_ACTIVITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReactionObservation target) { + target.init(); + EntryRelationship er = createEntryRelationship(ENTRY_RELATIONSHIP_OBJECT.MEDICATION_ACTIVITY, true); + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + target.getEntryRelationships().clear(); + target.getEntryRelationships().add(er); + } + + @Override + protected void updateToPass(ReactionObservation target) { + target.init(); + EntryRelationship er = createEntryRelationship(ENTRY_RELATIONSHIP_OBJECT.MEDICATION_ACTIVITY, true); + er.setTypeCode(x_ActRelationshipEntryRelationship.RSON); + target.getEntryRelationships().clear(); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReactionObservationOperations.validateReactionObservationMedicationActivity( + (ReactionObservation) objectToTest, diagnostician, map); + } + + }; + + validateReactionObservationMedicationActivityTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetSeverityObservation() { + + ReactionObservation target = objectFactory.create(); + target.getSeverityObservation(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProcedureActivityProcedures() { + + ReactionObservation target = objectFactory.create(); + target.getProcedureActivityProcedures(); + + } + + /** + * + * @generated + */ + @Test + public void testGetMedicationActivities() { + + ReactionObservation target = objectFactory.create(); + target.getMedicationActivities(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ReactionObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ReactionObservation create() { + return ConsolFactory.eINSTANCE.createReactionObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ReactionObservationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + + private enum ENTRY_RELATIONSHIP_OBJECT { + SEVERITY_OBS, PROCEDURE_ACTIVITY_PROCEDURE, MEDICATION_ACTIVITY + }; + + /** + * Creates the entryRelationship object with one entry based on the input type + * @param type + * @param inversionInd + * @return + */ + protected EntryRelationship createEntryRelationship(ENTRY_RELATIONSHIP_OBJECT type, boolean inversionInd) { + + EntryRelationship e = CDAFactory.eINSTANCE.createEntryRelationship(); + switch (type) { + case SEVERITY_OBS: + SeverityObservation sObs = ConsolFactory.eINSTANCE.createSeverityObservation(); + sObs.init(); + e.setObservation(sObs); + break; + case PROCEDURE_ACTIVITY_PROCEDURE: + ProcedureActivityProcedure paProcedure = ConsolFactory.eINSTANCE.createProcedureActivityProcedure(); + paProcedure.init(); + e.setProcedure(paProcedure); + break; + case MEDICATION_ACTIVITY: + MedicationActivity mAct = ConsolFactory.eINSTANCE.createMedicationActivity(); + mAct.init(); + e.setSubstanceAdministration(mAct); + break; + } + e.setInversionInd(Boolean.valueOf(inversionInd)); + + return e; + } +} // ReactionObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ReasonForReferralSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ReasonForReferralSectionTest.java new file mode 100644 index 000000000..a0f65c1b1 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ReasonForReferralSectionTest.java @@ -0,0 +1,290 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ReasonForReferralSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.ReasonForReferralSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Reason For Referral Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ReasonForReferralSection#validateReasonForReferralSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Reason For Referral Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ReasonForReferralSection#validateReasonForReferralSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Reason For Referral Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ReasonForReferralSection#validateReasonForReferralSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Reason For Referral Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ReasonForReferralSection#validateReasonForReferralSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Reason For Referral Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ReasonForReferralSection#validateReasonForReferralSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Reason For Referral Section Text}
  • + *
+ *

+ * + * @generated + */ + +public class ReasonForReferralSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateReasonForReferralSectionTemplateId() { + OperationsTestCase validateReasonForReferralSectionTemplateIdTestCase = new OperationsTestCase( + "validateReasonForReferralSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_REASON_FOR_REFERRAL_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReasonForReferralSection target) { + + } + + @Override + protected void updateToPass(ReasonForReferralSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReasonForReferralSectionOperations.validateReasonForReferralSectionTemplateId( + (ReasonForReferralSection) objectToTest, diagnostician, map); + } + + }; + + validateReasonForReferralSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateReasonForReferralSectionCode() { + OperationsTestCase validateReasonForReferralSectionCodeTestCase = new OperationsTestCase( + "validateReasonForReferralSectionCode", + operationsForOCL.getOCLValue("VALIDATE_REASON_FOR_REFERRAL_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReasonForReferralSection target) { + + } + + @Override + protected void updateToPass(ReasonForReferralSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReasonForReferralSectionOperations.validateReasonForReferralSectionCode( + (ReasonForReferralSection) objectToTest, diagnostician, map); + } + + }; + + validateReasonForReferralSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateReasonForReferralSectionCodeP() { + OperationsTestCase validateReasonForReferralSectionCodePTestCase = new OperationsTestCase( + "validateReasonForReferralSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_REASON_FOR_REFERRAL_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReasonForReferralSection target) { + + } + + @Override + protected void updateToPass(ReasonForReferralSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReasonForReferralSectionOperations.validateReasonForReferralSectionCodeP( + (ReasonForReferralSection) objectToTest, diagnostician, map); + } + + }; + + validateReasonForReferralSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateReasonForReferralSectionTitle() { + OperationsTestCase validateReasonForReferralSectionTitleTestCase = new OperationsTestCase( + "validateReasonForReferralSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_REASON_FOR_REFERRAL_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReasonForReferralSection target) { + + } + + @Override + protected void updateToPass(ReasonForReferralSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReasonForReferralSectionOperations.validateReasonForReferralSectionTitle( + (ReasonForReferralSection) objectToTest, diagnostician, map); + } + + }; + + validateReasonForReferralSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateReasonForReferralSectionText() { + OperationsTestCase validateReasonForReferralSectionTextTestCase = new OperationsTestCase( + "validateReasonForReferralSectionText", + operationsForOCL.getOCLValue("VALIDATE_REASON_FOR_REFERRAL_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReasonForReferralSection target) { + + } + + @Override + protected void updateToPass(ReasonForReferralSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReasonForReferralSectionOperations.validateReasonForReferralSectionText( + (ReasonForReferralSection) objectToTest, diagnostician, map); + } + + }; + + validateReasonForReferralSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ReasonForReferralSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ReasonForReferralSection create() { + return ConsolFactory.eINSTANCE.createReasonForReferralSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ReasonForReferralSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ReasonForReferralSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ReasonForVisitSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ReasonForVisitSectionTest.java new file mode 100644 index 000000000..02559d38e --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ReasonForVisitSectionTest.java @@ -0,0 +1,290 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ReasonForVisitSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.ReasonForVisitSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Reason For Visit Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ReasonForVisitSection#validateReasonForVisitSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Reason For Visit Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ReasonForVisitSection#validateReasonForVisitSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Reason For Visit Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ReasonForVisitSection#validateReasonForVisitSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Reason For Visit Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ReasonForVisitSection#validateReasonForVisitSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Reason For Visit Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ReasonForVisitSection#validateReasonForVisitSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Reason For Visit Section Title}
  • + *
+ *

+ * + * @generated + */ + +public class ReasonForVisitSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateReasonForVisitSectionTemplateId() { + OperationsTestCase validateReasonForVisitSectionTemplateIdTestCase = new OperationsTestCase( + "validateReasonForVisitSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_REASON_FOR_VISIT_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReasonForVisitSection target) { + + } + + @Override + protected void updateToPass(ReasonForVisitSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReasonForVisitSectionOperations.validateReasonForVisitSectionTemplateId( + (ReasonForVisitSection) objectToTest, diagnostician, map); + } + + }; + + validateReasonForVisitSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateReasonForVisitSectionCode() { + OperationsTestCase validateReasonForVisitSectionCodeTestCase = new OperationsTestCase( + "validateReasonForVisitSectionCode", + operationsForOCL.getOCLValue("VALIDATE_REASON_FOR_VISIT_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReasonForVisitSection target) { + + } + + @Override + protected void updateToPass(ReasonForVisitSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReasonForVisitSectionOperations.validateReasonForVisitSectionCode( + (ReasonForVisitSection) objectToTest, diagnostician, map); + } + + }; + + validateReasonForVisitSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateReasonForVisitSectionCodeP() { + OperationsTestCase validateReasonForVisitSectionCodePTestCase = new OperationsTestCase( + "validateReasonForVisitSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_REASON_FOR_VISIT_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReasonForVisitSection target) { + + } + + @Override + protected void updateToPass(ReasonForVisitSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReasonForVisitSectionOperations.validateReasonForVisitSectionCodeP( + (ReasonForVisitSection) objectToTest, diagnostician, map); + } + + }; + + validateReasonForVisitSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateReasonForVisitSectionText() { + OperationsTestCase validateReasonForVisitSectionTextTestCase = new OperationsTestCase( + "validateReasonForVisitSectionText", + operationsForOCL.getOCLValue("VALIDATE_REASON_FOR_VISIT_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReasonForVisitSection target) { + + } + + @Override + protected void updateToPass(ReasonForVisitSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReasonForVisitSectionOperations.validateReasonForVisitSectionText( + (ReasonForVisitSection) objectToTest, diagnostician, map); + } + + }; + + validateReasonForVisitSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateReasonForVisitSectionTitle() { + OperationsTestCase validateReasonForVisitSectionTitleTestCase = new OperationsTestCase( + "validateReasonForVisitSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_REASON_FOR_VISIT_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReasonForVisitSection target) { + + } + + @Override + protected void updateToPass(ReasonForVisitSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReasonForVisitSectionOperations.validateReasonForVisitSectionTitle( + (ReasonForVisitSection) objectToTest, diagnostician, map); + } + + }; + + validateReasonForVisitSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ReasonForVisitSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ReasonForVisitSection create() { + return ConsolFactory.eINSTANCE.createReasonForVisitSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ReasonForVisitSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ReasonForVisitSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ReferencedFramesObservationTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ReferencedFramesObservationTest.java new file mode 100644 index 000000000..d25ef555e --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ReferencedFramesObservationTest.java @@ -0,0 +1,305 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ReferencedFramesObservation; +import org.openhealthtools.mdht.uml.cda.consol.operations.ReferencedFramesObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * + * A static utility class that provides operations related to 'Referenced Frames Observation' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ReferencedFramesObservation#validateReferencedFramesObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Referenced Frames Observation Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ReferencedFramesObservation#validateReferencedFramesObservationClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Referenced Frames Observation Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ReferencedFramesObservation#validateReferencedFramesObservationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Referenced Frames Observation Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ReferencedFramesObservation#validateReferencedFramesObservationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Referenced Frames Observation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ReferencedFramesObservation#validateReferencedFramesObservationBoundaryObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Referenced Frames Observation Boundary Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ReferencedFramesObservation#getBoundaryObservation() Get Boundary Observation}
  • + *
+ *

+ * + * @generated + */ + +public class ReferencedFramesObservationTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateReferencedFramesObservationTemplateId() { + OperationsTestCase validateReferencedFramesObservationTemplateIdTestCase = new OperationsTestCase( + "validateReferencedFramesObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_REFERENCED_FRAMES_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReferencedFramesObservation target) { + + } + + @Override + protected void updateToPass(ReferencedFramesObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReferencedFramesObservationOperations.validateReferencedFramesObservationTemplateId( + (ReferencedFramesObservation) objectToTest, diagnostician, map); + } + + }; + + validateReferencedFramesObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateReferencedFramesObservationClassCode() { + OperationsTestCase validateReferencedFramesObservationClassCodeTestCase = new OperationsTestCase( + "validateReferencedFramesObservationClassCode", + operationsForOCL.getOCLValue("VALIDATE_REFERENCED_FRAMES_OBSERVATION_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReferencedFramesObservation target) { + + } + + @Override + protected void updateToPass(ReferencedFramesObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReferencedFramesObservationOperations.validateReferencedFramesObservationClassCode( + (ReferencedFramesObservation) objectToTest, diagnostician, map); + } + + }; + + validateReferencedFramesObservationClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateReferencedFramesObservationCode() { + OperationsTestCase validateReferencedFramesObservationCodeTestCase = new OperationsTestCase( + "validateReferencedFramesObservationCode", + operationsForOCL.getOCLValue("VALIDATE_REFERENCED_FRAMES_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReferencedFramesObservation target) { + + } + + @Override + protected void updateToPass(ReferencedFramesObservation target) { + target.init(); + + CD cd = DatatypesFactory.eINSTANCE.createCD("121190", "1.2.840.10008.2.16.4", "", ""); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReferencedFramesObservationOperations.validateReferencedFramesObservationCode( + (ReferencedFramesObservation) objectToTest, diagnostician, map); + } + + }; + + validateReferencedFramesObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateReferencedFramesObservationMoodCode() { + OperationsTestCase validateReferencedFramesObservationMoodCodeTestCase = new OperationsTestCase( + "validateReferencedFramesObservationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_REFERENCED_FRAMES_OBSERVATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReferencedFramesObservation target) { + + } + + @Override + protected void updateToPass(ReferencedFramesObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReferencedFramesObservationOperations.validateReferencedFramesObservationMoodCode( + (ReferencedFramesObservation) objectToTest, diagnostician, map); + } + + }; + + validateReferencedFramesObservationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateReferencedFramesObservationBoundaryObservation() { + OperationsTestCase validateReferencedFramesObservationBoundaryObservationTestCase = new OperationsTestCase( + "validateReferencedFramesObservationBoundaryObservation", + operationsForOCL.getOCLValue("VALIDATE_REFERENCED_FRAMES_OBSERVATION_BOUNDARY_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReferencedFramesObservation target) { + target.init(); + } + + @Override + protected void updateToPass(ReferencedFramesObservation target) { + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setObservation(ConsolFactory.eINSTANCE.createBoundaryObservation().init()); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReferencedFramesObservationOperations.validateReferencedFramesObservationBoundaryObservation( + (ReferencedFramesObservation) objectToTest, diagnostician, map); + } + + }; + + validateReferencedFramesObservationBoundaryObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetBoundaryObservation() { + + ReferencedFramesObservation target = objectFactory.create(); + target.getBoundaryObservation(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ReferencedFramesObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ReferencedFramesObservation create() { + return ConsolFactory.eINSTANCE.createReferencedFramesObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ReferencedFramesObservationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ReferencedFramesObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ResultObservationTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ResultObservationTest.java new file mode 100644 index 000000000..ac0c8df2d --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ResultObservationTest.java @@ -0,0 +1,862 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.Author; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.ObservationRange; +import org.openhealthtools.mdht.uml.cda.ReferenceRange; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ConsolPackage; +import org.openhealthtools.mdht.uml.cda.consol.GeneralStatusSection; +import org.openhealthtools.mdht.uml.cda.consol.ResultObservation; +import org.openhealthtools.mdht.uml.cda.consol.operations.ResultObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; + +/** + * + * A static utility class that provides operations related to 'Result Observation' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ResultObservation#validateResultObservationTextReference(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Observation Text Reference}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ResultObservation#validateResultObservationReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Observation Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ResultObservation#validateResultObservationTextReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Observation Text Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ResultObservation#validateResultObservationCodeValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Observation Code Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ResultObservation#validateResultObservationNoObservationRangeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Observation No Observation Range Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ResultObservation#validateResultObservationAuthorMultiplicity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Observation Author Multiplicity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ResultObservation#validateResultObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Observation Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ResultObservation#validateResultObservationClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Observation Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ResultObservation#validateResultObservationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Observation Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ResultObservation#validateResultObservationId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Observation Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ResultObservation#validateResultObservationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Observation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ResultObservation#validateResultObservationText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Observation Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ResultObservation#validateResultObservationStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Observation Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ResultObservation#validateResultObservationStatusCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Observation Status Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ResultObservation#validateResultObservationEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Observation Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ResultObservation#validateResultObservationValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Observation Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ResultObservation#validateResultObservationInterpretationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Observation Interpretation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ResultObservation#validateResultObservationMethodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Observation Method Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ResultObservation#validateResultObservationTargetSiteCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Observation Target Site Code}
  • + *
+ *

+ * + * @generated + */ + +public class ResultObservationTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateResultObservationTextReference() { + OperationsTestCase validateResultObservationTextReferenceTestCase = new OperationsTestCase( + "validateResultObservationTextReference", + operationsForOCL.getOCLValue("VALIDATE_RESULT_OBSERVATION_TEXT_REFERENCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultObservation target) { + target.init(); + ED txt = DatatypesFactory.eINSTANCE.createED(); + + target.setText(txt); + } + + @Override + protected void updateToPass(ResultObservation target) { + + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL("test")); + target.setText(txt); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultObservationOperations.validateResultObservationTextReference( + (ResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateResultObservationTextReferenceTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateResultObservationReferenceValue() { + OperationsTestCase validateResultObservationReferenceValueTestCase = new OperationsTestCase( + "validateResultObservationReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_RESULT_OBSERVATION_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultObservation target) { + target.init(); + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL()); + target.setText(txt); + } + + @Override + protected void updateToPass(ResultObservation target) { + + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL("test")); + target.setText(txt); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultObservationOperations.validateResultObservationReferenceValue( + (ResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateResultObservationReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateResultObservationTextReferenceValue() { + OperationsTestCase validateResultObservationTextReferenceValueTestCase = new NarrativeReferenceTestCase( + "validateResultObservationTextReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_RESULT_OBSERVATION_TEXT_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultObservation target) { + target.init(); + + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), "", + "No particular result observed."); + + // add a reference to the section text + target.setText(createEDWithReference("Some sample text", "#1.2.3.4")); + + } + + @Override + protected void updateToPass(ResultObservation target) { + + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), + "1.2.3.4", "No particular result observed."); + + // add a reference to the section text + target.setText(createEDWithReference("Some sample text", "#1.2.3.4")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultObservationOperations.validateResultObservationTextReferenceValue( + (ResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateResultObservationTextReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateResultObservationCodeValue() { + OperationsTestCase validateResultObservationCodeValueTestCase = new OperationsTestCase( + "validateResultObservationCodeValue", + operationsForOCL.getOCLValue("VALIDATE_RESULT_OBSERVATION_CODE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultObservation target) { + target.init(); + CD value = DatatypesFactory.eINSTANCE.createCD(); + // setting invalid codeSystem to cause failure + value.setCodeSystem("invalidCodeSystem"); + target.setCode(value); + } + + @Override + protected void updateToPass(ResultObservation target) { + + CD value = DatatypesFactory.eINSTANCE.createCD(); + // setting valid codeSystem + value.setCodeSystem("2.16.840.1.113883.6.1"); + target.setCode(value); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultObservationOperations.validateResultObservationCodeValue( + (ResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateResultObservationCodeValueTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateResultObservationNoObservationRangeCode() { + OperationsTestCase validateResultObservationNoObservationRangeCodeTestCase = new OperationsTestCase( + "validateResultObservationNoObservationRangeCode", + operationsForOCL.getOCLValue("VALIDATE_RESULT_OBSERVATION_NO_OBSERVATION_RANGE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultObservation target) { + target.init(); + ReferenceRange refRange = CDAFactory.eINSTANCE.createReferenceRange(); + ObservationRange obsRange = CDAFactory.eINSTANCE.createObservationRange(); + CD value = DatatypesFactory.eINSTANCE.createCD(); + + value.setCode("Test"); + obsRange.setCode(value); + refRange.setObservationRange(obsRange); + target.getReferenceRanges().add(refRange); + } + + @Override + protected void updateToPass(ResultObservation target) { + ReferenceRange refRange = CDAFactory.eINSTANCE.createReferenceRange(); + ObservationRange obsRange = CDAFactory.eINSTANCE.createObservationRange(); + CD value = DatatypesFactory.eINSTANCE.createCD(); + + target.getReferenceRanges().clear(); + obsRange.setCode(value); + refRange.setObservationRange(obsRange); + target.getReferenceRanges().add(refRange); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + return ResultObservationOperations.validateResultObservationNoObservationRangeCode( + (ResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateResultObservationNoObservationRangeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateResultObservationAuthorMultiplicity() { + OperationsTestCase validateResultObservationAuthorMultiplicityTestCase = new OperationsTestCase( + "validateResultObservationAuthorMultiplicity", + operationsForOCL.getOCLValue("VALIDATE_RESULT_OBSERVATION_AUTHOR_MULTIPLICITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultObservation target) { + target.init(); + Author author1 = CDAFactory.eINSTANCE.createAuthor(); + Author author2 = CDAFactory.eINSTANCE.createAuthor(); + + // adding two authors + target.getAuthors().add(author1); + target.getAuthors().add(author2); + + } + + @Override + protected void updateToPass(ResultObservation target) { + + target.getAuthors().clear(); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultObservationOperations.validateResultObservationAuthorMultiplicity( + (ResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateResultObservationAuthorMultiplicityTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateResultObservationTemplateId() { + OperationsTestCase validateResultObservationTemplateIdTestCase = new OperationsTestCase( + "validateResultObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_RESULT_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultObservation target) { + + } + + @Override + protected void updateToPass(ResultObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultObservationOperations.validateResultObservationTemplateId( + (ResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateResultObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateResultObservationClassCode() { + OperationsTestCase validateResultObservationClassCodeTestCase = new OperationsTestCase( + "validateResultObservationClassCode", + operationsForOCL.getOCLValue("VALIDATE_RESULT_OBSERVATION_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultObservation target) { + + } + + @Override + protected void updateToPass(ResultObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultObservationOperations.validateResultObservationClassCode( + (ResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateResultObservationClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateResultObservationMoodCode() { + OperationsTestCase validateResultObservationMoodCodeTestCase = new OperationsTestCase( + "validateResultObservationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_RESULT_OBSERVATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + { + skipFailsTest(); + } + + @Override + protected void updateToFail(ResultObservation target) { + + } + + @Override + protected void updateToPass(ResultObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultObservationOperations.validateResultObservationMoodCode( + (ResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateResultObservationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateResultObservationId() { + OperationsTestCase validateResultObservationIdTestCase = new OperationsTestCase( + "validateResultObservationId", + operationsForOCL.getOCLValue("VALIDATE_RESULT_OBSERVATION_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultObservation target) { + + } + + @Override + protected void updateToPass(ResultObservation target) { + + II ii = DatatypesFactory.eINSTANCE.createII(); + target.getIds().add(ii); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultObservationOperations.validateResultObservationId( + (ResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateResultObservationIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateResultObservationCode() { + OperationsTestCase validateResultObservationCodeTestCase = new OperationsTestCase( + "validateResultObservationCode", + operationsForOCL.getOCLValue("VALIDATE_RESULT_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultObservation target) { + target.setCode(null); + } + + @Override + protected void updateToPass(ResultObservation target) { + target.init(); + CE cd = DatatypesFactory.eINSTANCE.createCE(); + target.setCode(cd); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultObservationOperations.validateResultObservationCode( + (ResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateResultObservationCodeTestCase.doValidationTest(); + } + + /** + * check + * @generated NOT + */ + @Test + public void testValidateResultObservationText() { + OperationsTestCase validateResultObservationTextTestCase = new OperationsTestCase( + "validateResultObservationText", + operationsForOCL.getOCLValue("VALIDATE_RESULT_OBSERVATION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultObservation target) { + + } + + @Override + protected void updateToPass(ResultObservation target) { + target.init(); + ED text = DatatypesFactory.eINSTANCE.createED(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultObservationOperations.validateResultObservationText( + (ResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateResultObservationTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateResultObservationStatusCode() { + OperationsTestCase validateResultObservationStatusCodeTestCase = new OperationsTestCase( + "validateResultObservationStatusCode", + operationsForOCL.getOCLValue("VALIDATE_RESULT_OBSERVATION_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultObservation target) { + + } + + @Override + protected void updateToPass(ResultObservation target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultObservationOperations.validateResultObservationStatusCode( + (ResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateResultObservationStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateResultObservationStatusCodeP() { + OperationsTestCase validateResultObservationStatusCodePTestCase = new OperationsTestCase( + "validateResultObservationStatusCodeP", + operationsForOCL.getOCLValue("VALIDATE_RESULT_OBSERVATION_STATUS_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultObservation target) { + + } + + @Override + protected void updateToPass(ResultObservation target) { + target.init(); + target.setStatusCode(DatatypesFactory.eINSTANCE.createCS()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultObservationOperations.validateResultObservationStatusCodeP( + (ResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateResultObservationStatusCodePTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateResultObservationEffectiveTime() { + OperationsTestCase validateResultObservationEffectiveTimeTestCase = new OperationsTestCase( + "validateResultObservationEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_RESULT_OBSERVATION_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultObservation target) { + + } + + @Override + protected void updateToPass(ResultObservation target) { + target.init(); + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultObservationOperations.validateResultObservationEffectiveTime( + (ResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateResultObservationEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateResultObservationValue() { + OperationsTestCase validateResultObservationValueTestCase = new OperationsTestCase( + "validateResultObservationValue", + operationsForOCL.getOCLValue("VALIDATE_RESULT_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultObservation target) { + + } + + @Override + protected void updateToPass(ResultObservation target) { + target.init(); + CD value = DatatypesFactory.eINSTANCE.createCD(); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultObservationOperations.validateResultObservationValue( + (ResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateResultObservationValueTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateResultObservationInterpretationCode() { + OperationsTestCase validateResultObservationInterpretationCodeTestCase = new OperationsTestCase( + "validateResultObservationInterpretationCode", + operationsForOCL.getOCLValue("VALIDATE_RESULT_OBSERVATION_INTERPRETATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultObservation target) { + + } + + @Override + protected void updateToPass(ResultObservation target) { + target.init(); + CE interpCode = DatatypesFactory.eINSTANCE.createCE(); + target.getInterpretationCodes().add(interpCode); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultObservationOperations.validateResultObservationInterpretationCode( + (ResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateResultObservationInterpretationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateResultObservationMethodCode() { + OperationsTestCase validateResultObservationMethodCodeTestCase = new OperationsTestCase( + "validateResultObservationMethodCode", + operationsForOCL.getOCLValue("VALIDATE_RESULT_OBSERVATION_METHOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultObservation target) { + + } + + @Override + protected void updateToPass(ResultObservation target) { + target.init(); + CE methodCode = DatatypesFactory.eINSTANCE.createCE(); + target.getMethodCodes().add(methodCode); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultObservationOperations.validateResultObservationMethodCode( + (ResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateResultObservationMethodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + * TODO:Check + */ + @Test + public void testValidateResultObservationTargetSiteCode() { + OperationsTestCase validateResultObservationTargetSiteCodeTestCase = new OperationsTestCase( + "validateResultObservationTargetSiteCode", + operationsForOCL.getOCLValue("VALIDATE_RESULT_OBSERVATION_TARGET_SITE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultObservation target) { + + target.init(); + CD tsCode2 = DatatypesFactory.eINSTANCE.createCD(); + target.getTargetSiteCodes().add(tsCode2); + + } + + @Override + protected void updateToPass(ResultObservation target) { + target.getTargetSiteCodes().clear(); + CE tsCode1 = DatatypesFactory.eINSTANCE.createCE(); + target.getTargetSiteCodes().add(tsCode1); + CE tsCode3 = DatatypesFactory.eINSTANCE.createCE(); + target.getTargetSiteCodes().add(tsCode3); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultObservationOperations.validateResultObservationTargetSiteCode( + (ResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateResultObservationTargetSiteCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ResultObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ResultObservation create() { + return ConsolFactory.eINSTANCE.createResultObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ResultObservationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ResultObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ResultOrganizerTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ResultOrganizerTest.java new file mode 100644 index 000000000..92fea358f --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ResultOrganizerTest.java @@ -0,0 +1,483 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ResultObservation; +import org.openhealthtools.mdht.uml.cda.consol.ResultOrganizer; +import org.openhealthtools.mdht.uml.cda.consol.operations.ResultOrganizerOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActClassDocumentEntryOrganizer; + +/** + * + * A static utility class that provides operations related to 'Result Organizer' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ResultOrganizer#validateResultOrganizerCodeValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Organizer Code Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ResultOrganizer#validateResultOrganizerClassCodeValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Organizer Class Code Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ResultOrganizer#validateResultOrganizerTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Organizer Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ResultOrganizer#validateResultOrganizerClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Organizer Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ResultOrganizer#validateResultOrganizerMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Organizer Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ResultOrganizer#validateResultOrganizerId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Organizer Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ResultOrganizer#validateResultOrganizerStatusCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Organizer Status Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ResultOrganizer#validateResultOrganizerStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Organizer Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ResultOrganizer#validateResultOrganizerCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Organizer Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ResultOrganizer#validateResultOrganizerResultObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Organizer Result Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ResultOrganizer#getResultObservations() Get Result Observations}
  • + *
+ *

+ * + * @generated + */ + +public class ResultOrganizerTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateResultOrganizerCodeValue() { + OperationsTestCase validateResultOrganizerCodeValueTestCase = new OperationsTestCase( + "validateResultOrganizerCodeValue", + operationsForOCL.getOCLValue("VALIDATE_RESULT_ORGANIZER_CODE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultOrganizer target) { + CD code = DatatypesFactory.eINSTANCE.createCD(); + code.setCodeSystem(""); + target.setCode(code); + } + + @Override + protected void updateToPass(ResultOrganizer target) { + target.init(); + CD code = DatatypesFactory.eINSTANCE.createCD(); + code.setCodeSystem("2.16.840.1.113883.6.12"); + target.setCode(code); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultOrganizerOperations.validateResultOrganizerCodeValue( + (ResultOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateResultOrganizerCodeValueTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateResultOrganizerClassCodeValue() { + OperationsTestCase validateResultOrganizerClassCodeValueTestCase = new OperationsTestCase( + "validateResultOrganizerClassCodeValue", + operationsForOCL.getOCLValue("VALIDATE_RESULT_ORGANIZER_CLASS_CODE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultOrganizer target) { + target.init(); + } + + @Override + protected void updateToPass(ResultOrganizer target) { + + target.setClassCode(x_ActClassDocumentEntryOrganizer.CLUSTER); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultOrganizerOperations.validateResultOrganizerClassCodeValue( + (ResultOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateResultOrganizerClassCodeValueTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateResultOrganizerTemplateId() { + OperationsTestCase validateResultOrganizerTemplateIdTestCase = new OperationsTestCase( + "validateResultOrganizerTemplateId", + operationsForOCL.getOCLValue("VALIDATE_RESULT_ORGANIZER_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultOrganizer target) { + + } + + @Override + protected void updateToPass(ResultOrganizer target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultOrganizerOperations.validateResultOrganizerTemplateId( + (ResultOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateResultOrganizerTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateResultOrganizerClassCode() { + OperationsTestCase validateResultOrganizerClassCodeTestCase = new OperationsTestCase( + "validateResultOrganizerClassCode", + operationsForOCL.getOCLValue("VALIDATE_RESULT_ORGANIZER_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultOrganizer target) { + + } + + @Override + protected void updateToPass(ResultOrganizer target) { + target.init(); + + target.setClassCode(x_ActClassDocumentEntryOrganizer.BATTERY); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultOrganizerOperations.validateResultOrganizerClassCode( + (ResultOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateResultOrganizerClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateResultOrganizerMoodCode() { + OperationsTestCase validateResultOrganizerMoodCodeTestCase = new OperationsTestCase( + "validateResultOrganizerMoodCode", + operationsForOCL.getOCLValue("VALIDATE_RESULT_ORGANIZER_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultOrganizer target) { + + } + + @Override + protected void updateToPass(ResultOrganizer target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultOrganizerOperations.validateResultOrganizerMoodCode( + (ResultOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateResultOrganizerMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateResultOrganizerId() { + OperationsTestCase validateResultOrganizerIdTestCase = new OperationsTestCase( + "validateResultOrganizerId", + operationsForOCL.getOCLValue("VALIDATE_RESULT_ORGANIZER_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(ResultOrganizer target) { + + } + + @Override + protected void updateToPass(ResultOrganizer target) { + target.init(); + II ii = DatatypesFactory.eINSTANCE.createII(); + target.getIds().add(ii); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultOrganizerOperations.validateResultOrganizerId( + (ResultOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateResultOrganizerIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateResultOrganizerStatusCodeP() { + OperationsTestCase validateResultOrganizerStatusCodePTestCase = new OperationsTestCase( + "validateResultOrganizerStatusCodeP", + operationsForOCL.getOCLValue("VALIDATE_RESULT_ORGANIZER_STATUS_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultOrganizer target) { + + } + + @Override + protected void updateToPass(ResultOrganizer target) { + target.init(); + target.setStatusCode(DatatypesFactory.eINSTANCE.createCS()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultOrganizerOperations.validateResultOrganizerStatusCodeP( + (ResultOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateResultOrganizerStatusCodePTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateResultOrganizerStatusCode() { + OperationsTestCase validateResultOrganizerStatusCodeTestCase = new OperationsTestCase( + "validateResultOrganizerStatusCode", + operationsForOCL.getOCLValue("VALIDATE_RESULT_ORGANIZER_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultOrganizer target) { + + } + + @Override + protected void updateToPass(ResultOrganizer target) { + target.init(); + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultOrganizerOperations.validateResultOrganizerStatusCode( + (ResultOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateResultOrganizerStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateResultOrganizerCode() { + OperationsTestCase validateResultOrganizerCodeTestCase = new OperationsTestCase( + "validateResultOrganizerCode", + operationsForOCL.getOCLValue("VALIDATE_RESULT_ORGANIZER_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultOrganizer target) { + + } + + @Override + protected void updateToPass(ResultOrganizer target) { + target.init(); + target.setCode(DatatypesFactory.eINSTANCE.createCE()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultOrganizerOperations.validateResultOrganizerCode( + (ResultOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateResultOrganizerCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateResultOrganizerResultObservation() { + OperationsTestCase validateResultOrganizerResultObservationTestCase = new OperationsTestCase( + "validateResultOrganizerResultObservation", + operationsForOCL.getOCLValue("VALIDATE_RESULT_ORGANIZER_RESULT_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultOrganizer target) { + + } + + @Override + protected void updateToPass(ResultOrganizer target) { + target.init(); + ResultObservation resultObs = ConsolFactory.eINSTANCE.createResultObservation(); + target.addObservation(resultObs); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultOrganizerOperations.validateResultOrganizerResultObservation( + (ResultOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateResultOrganizerResultObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetResultObservations() { + + ResultOrganizer target = objectFactory.create(); + target.getResultObservations(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ResultOrganizerOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ResultOrganizer create() { + return ConsolFactory.eINSTANCE.createResultOrganizer(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ResultOrganizerOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ResultOrganizerOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ResultsSectionEntriesOptionalTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ResultsSectionEntriesOptionalTest.java new file mode 100644 index 000000000..1cf0b3d06 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ResultsSectionEntriesOptionalTest.java @@ -0,0 +1,345 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ResultOrganizer; +import org.openhealthtools.mdht.uml.cda.consol.ResultsSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.operations.ResultsSectionEntriesOptionalOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Results Section Entries Optional' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ResultsSectionEntriesOptional#validateResultsSectionEntriesOptionalTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Results Section Entries Optional Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ResultsSectionEntriesOptional#validateResultsSectionEntriesOptionalCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Results Section Entries Optional Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ResultsSectionEntriesOptional#validateResultsSectionEntriesOptionalCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Results Section Entries Optional Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ResultsSectionEntriesOptional#validateResultsSectionEntriesOptionalTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Results Section Entries Optional Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ResultsSectionEntriesOptional#validateResultsSectionEntriesOptionalText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Results Section Entries Optional Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ResultsSectionEntriesOptional#validateResultsSectionEntriesOptionalResultOrganizer(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Results Section Entries Optional Result Organizer}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ResultsSectionEntriesOptional#getResultOrganizers() Get Result Organizers}
  • + *
+ *

+ * + * @generated + */ + +public class ResultsSectionEntriesOptionalTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateResultsSectionEntriesOptionalTemplateId() { + OperationsTestCase validateResultsSectionEntriesOptionalTemplateIdTestCase = new OperationsTestCase( + "validateResultsSectionEntriesOptionalTemplateId", + operationsForOCL.getOCLValue("VALIDATE_RESULTS_SECTION_ENTRIES_OPTIONAL_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultsSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(ResultsSectionEntriesOptional target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultsSectionEntriesOptionalOperations.validateResultsSectionEntriesOptionalTemplateId( + (ResultsSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateResultsSectionEntriesOptionalTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateResultsSectionEntriesOptionalCode() { + OperationsTestCase validateResultsSectionEntriesOptionalCodeTestCase = new OperationsTestCase( + "validateResultsSectionEntriesOptionalCode", + operationsForOCL.getOCLValue("VALIDATE_RESULTS_SECTION_ENTRIES_OPTIONAL_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultsSectionEntriesOptional target) { + target.setCode(null); + } + + @Override + protected void updateToPass(ResultsSectionEntriesOptional target) { + + CE code = DatatypesFactory.eINSTANCE.createCE(); + code.setCodeSystem("2.16.840.1.113883.6.1"); + code.setCode("30954-2"); + code.setCodeSystemName("Relevant diagnostic tests and/or laboratory data"); + target.setCode(code); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultsSectionEntriesOptionalOperations.validateResultsSectionEntriesOptionalCode( + (ResultsSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateResultsSectionEntriesOptionalCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateResultsSectionEntriesOptionalCodeP() { + OperationsTestCase validateResultsSectionEntriesOptionalCodePTestCase = new OperationsTestCase( + "validateResultsSectionEntriesOptionalCodeP", + operationsForOCL.getOCLValue("VALIDATE_RESULTS_SECTION_ENTRIES_OPTIONAL_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultsSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(ResultsSectionEntriesOptional target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultsSectionEntriesOptionalOperations.validateResultsSectionEntriesOptionalCodeP( + (ResultsSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateResultsSectionEntriesOptionalCodePTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateResultsSectionEntriesOptionalTitle() { + OperationsTestCase validateResultsSectionEntriesOptionalTitleTestCase = new OperationsTestCase( + "validateResultsSectionEntriesOptionalTitle", + operationsForOCL.getOCLValue("VALIDATE_RESULTS_SECTION_ENTRIES_OPTIONAL_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultsSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(ResultsSectionEntriesOptional target) { + target.init(); + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultsSectionEntriesOptionalOperations.validateResultsSectionEntriesOptionalTitle( + (ResultsSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateResultsSectionEntriesOptionalTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateResultsSectionEntriesOptionalText() { + OperationsTestCase validateResultsSectionEntriesOptionalTextTestCase = new OperationsTestCase( + "validateResultsSectionEntriesOptionalText", + operationsForOCL.getOCLValue("VALIDATE_RESULTS_SECTION_ENTRIES_OPTIONAL_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultsSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(ResultsSectionEntriesOptional target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultsSectionEntriesOptionalOperations.validateResultsSectionEntriesOptionalText( + (ResultsSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateResultsSectionEntriesOptionalTextTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateResultsSectionEntriesOptionalResultOrganizer() { + OperationsTestCase validateResultsSectionEntriesOptionalResultOrganizerTestCase = new OperationsTestCase( + "validateResultsSectionEntriesOptionalResultOrganizer", + operationsForOCL.getOCLValue("VALIDATE_RESULTS_SECTION_ENTRIES_OPTIONAL_RESULT_ORGANIZER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultsSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(ResultsSectionEntriesOptional target) { + target.init(); + ResultOrganizer org = ConsolFactory.eINSTANCE.createResultOrganizer(); + target.addOrganizer(org); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultsSectionEntriesOptionalOperations.validateResultsSectionEntriesOptionalResultOrganizer( + (ResultsSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateResultsSectionEntriesOptionalResultOrganizerTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetResultOrganizers() { + + ResultsSectionEntriesOptional target = objectFactory.create(); + target.getResultOrganizers(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ResultsSectionEntriesOptionalOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ResultsSectionEntriesOptional create() { + return ConsolFactory.eINSTANCE.createResultsSectionEntriesOptional(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ResultsSectionEntriesOptionalOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ResultsSectionEntriesOptionalOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ResultsSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ResultsSectionTest.java new file mode 100644 index 000000000..f4cc12b5b --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ResultsSectionTest.java @@ -0,0 +1,340 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ResultOrganizer; +import org.openhealthtools.mdht.uml.cda.consol.ResultsSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.ResultsSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Results Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ResultsSection#validateResultsSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Results Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ResultsSection#validateResultsSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Results Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ResultsSection#validateResultsSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Results Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ResultsSection#validateResultsSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Results Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ResultsSection#validateResultsSectionResultOrganizer(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Results Section Result Organizer}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ResultsSection#getConsolResultOrganizers() Get Consol Result Organizers}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ResultsSection#validateResultsSectionEntriesOptionalTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Results Section Entries Optional Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class ResultsSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateResultsSectionCodeP() { + OperationsTestCase validateResultsSectionCodePTestCase = new OperationsTestCase( + "validateResultsSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_RESULTS_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultsSection target) { + + } + + @Override + protected void updateToPass(ResultsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultsSectionOperations.validateResultsSectionCodeP( + (ResultsSection) objectToTest, diagnostician, map); + } + + }; + + validateResultsSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateResultsSectionCode() { + OperationsTestCase validateResultsSectionCodeTestCase = new OperationsTestCase( + "validateResultsSectionCode", + operationsForOCL.getOCLValue("VALIDATE_RESULTS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultsSection target) { + + } + + @Override + protected void updateToPass(ResultsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultsSectionOperations.validateResultsSectionCode( + (ResultsSection) objectToTest, diagnostician, map); + } + + }; + + validateResultsSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateResultsSectionTitle() { + OperationsTestCase validateResultsSectionTitleTestCase = new OperationsTestCase( + "validateResultsSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_RESULTS_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultsSection target) { + + } + + @Override + protected void updateToPass(ResultsSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultsSectionOperations.validateResultsSectionTitle( + (ResultsSection) objectToTest, diagnostician, map); + } + + }; + + validateResultsSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateResultsSectionText() { + OperationsTestCase validateResultsSectionTextTestCase = new OperationsTestCase( + "validateResultsSectionText", + operationsForOCL.getOCLValue("VALIDATE_RESULTS_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultsSection target) { + + } + + @Override + protected void updateToPass(ResultsSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultsSectionOperations.validateResultsSectionText( + (ResultsSection) objectToTest, diagnostician, map); + } + + }; + + validateResultsSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateResultsSectionResultOrganizer() { + OperationsTestCase validateResultsSectionResultOrganizerTestCase = new OperationsTestCase( + "validateResultsSectionResultOrganizer", + operationsForOCL.getOCLValue("VALIDATE_RESULTS_SECTION_RESULT_ORGANIZER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultsSection target) { + + } + + @Override + protected void updateToPass(ResultsSection target) { + target.init(); + ResultOrganizer org = ConsolFactory.eINSTANCE.createResultOrganizer(); + target.addOrganizer(org); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultsSectionOperations.validateResultsSectionResultOrganizer( + (ResultsSection) objectToTest, diagnostician, map); + } + + }; + + validateResultsSectionResultOrganizerTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetConsolResultOrganizers() { + + ResultsSection target = objectFactory.create(); + target.getConsolResultOrganizers(); + + } + + /** + * + * @generated + */ + @Test + public void testValidateResultsSectionEntriesOptionalTemplateId() { + OperationsTestCase validateResultsSectionEntriesOptionalTemplateIdTestCase = new OperationsTestCase( + "validateResultsSectionEntriesOptionalTemplateId", + operationsForOCL.getOCLValue("VALIDATE_RESULTS_SECTION_ENTRIES_OPTIONAL_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultsSection target) { + + } + + @Override + protected void updateToPass(ResultsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultsSectionOperations.validateResultsSectionEntriesOptionalTemplateId( + (ResultsSection) objectToTest, diagnostician, map); + } + + }; + + validateResultsSectionEntriesOptionalTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ResultsSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ResultsSection create() { + return ConsolFactory.eINSTANCE.createResultsSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ResultsSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ResultsSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ReviewOfSystemsSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ReviewOfSystemsSectionTest.java new file mode 100644 index 000000000..207f97fad --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ReviewOfSystemsSectionTest.java @@ -0,0 +1,290 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ReviewOfSystemsSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.ReviewOfSystemsSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Review Of Systems Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ReviewOfSystemsSection#validateReviewOfSystemsSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Review Of Systems Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ReviewOfSystemsSection#validateReviewOfSystemsSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Review Of Systems Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ReviewOfSystemsSection#validateReviewOfSystemsSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Review Of Systems Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ReviewOfSystemsSection#validateReviewOfSystemsSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Review Of Systems Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ReviewOfSystemsSection#validateReviewOfSystemsSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Review Of Systems Section Text}
  • + *
+ *

+ * + * @generated + */ + +public class ReviewOfSystemsSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateReviewOfSystemsSectionTemplateId() { + OperationsTestCase validateReviewOfSystemsSectionTemplateIdTestCase = new OperationsTestCase( + "validateReviewOfSystemsSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_REVIEW_OF_SYSTEMS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReviewOfSystemsSection target) { + + } + + @Override + protected void updateToPass(ReviewOfSystemsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReviewOfSystemsSectionOperations.validateReviewOfSystemsSectionTemplateId( + (ReviewOfSystemsSection) objectToTest, diagnostician, map); + } + + }; + + validateReviewOfSystemsSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateReviewOfSystemsSectionCode() { + OperationsTestCase validateReviewOfSystemsSectionCodeTestCase = new OperationsTestCase( + "validateReviewOfSystemsSectionCode", + operationsForOCL.getOCLValue("VALIDATE_REVIEW_OF_SYSTEMS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReviewOfSystemsSection target) { + + } + + @Override + protected void updateToPass(ReviewOfSystemsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReviewOfSystemsSectionOperations.validateReviewOfSystemsSectionCode( + (ReviewOfSystemsSection) objectToTest, diagnostician, map); + } + + }; + + validateReviewOfSystemsSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateReviewOfSystemsSectionCodeP() { + OperationsTestCase validateReviewOfSystemsSectionCodePTestCase = new OperationsTestCase( + "validateReviewOfSystemsSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_REVIEW_OF_SYSTEMS_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReviewOfSystemsSection target) { + + } + + @Override + protected void updateToPass(ReviewOfSystemsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReviewOfSystemsSectionOperations.validateReviewOfSystemsSectionCodeP( + (ReviewOfSystemsSection) objectToTest, diagnostician, map); + } + + }; + + validateReviewOfSystemsSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateReviewOfSystemsSectionTitle() { + OperationsTestCase validateReviewOfSystemsSectionTitleTestCase = new OperationsTestCase( + "validateReviewOfSystemsSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_REVIEW_OF_SYSTEMS_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReviewOfSystemsSection target) { + + } + + @Override + protected void updateToPass(ReviewOfSystemsSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReviewOfSystemsSectionOperations.validateReviewOfSystemsSectionTitle( + (ReviewOfSystemsSection) objectToTest, diagnostician, map); + } + + }; + + validateReviewOfSystemsSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateReviewOfSystemsSectionText() { + OperationsTestCase validateReviewOfSystemsSectionTextTestCase = new OperationsTestCase( + "validateReviewOfSystemsSectionText", + operationsForOCL.getOCLValue("VALIDATE_REVIEW_OF_SYSTEMS_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReviewOfSystemsSection target) { + + } + + @Override + protected void updateToPass(ReviewOfSystemsSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReviewOfSystemsSectionOperations.validateReviewOfSystemsSectionText( + (ReviewOfSystemsSection) objectToTest, diagnostician, map); + } + + }; + + validateReviewOfSystemsSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ReviewOfSystemsSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ReviewOfSystemsSection create() { + return ConsolFactory.eINSTANCE.createReviewOfSystemsSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ReviewOfSystemsSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ReviewOfSystemsSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/SOPInstanceObservationTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/SOPInstanceObservationTest.java new file mode 100644 index 000000000..0b6c65a8e --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/SOPInstanceObservationTest.java @@ -0,0 +1,794 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.SOPInstanceObservation; +import org.openhealthtools.mdht.uml.cda.consol.operations.SOPInstanceObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * + * A static utility class that provides operations related to 'SOP Instance Observation' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SOPInstanceObservation#validateSOPInstanceObservationEffectiveTimeHasValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate SOP Instance Observation Effective Time Has Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SOPInstanceObservation#validateSOPInstanceObservationEffectiveTimeNoLow(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate SOP Instance Observation Effective Time No Low}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SOPInstanceObservation#validateSOPInstanceObservationEffectiveTimeNoHigh(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate SOP Instance Observation Effective Time No High}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SOPInstanceObservation#validateSOPInstanceObservationTextMediaType(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate SOP Instance Observation Text Media Type}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SOPInstanceObservation#validateSOPInstanceObservationTextReference(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate SOP Instance Observation Text Reference}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SOPInstanceObservation#validateSOPInstanceObservationTextReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate SOP Instance Observation Text Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SOPInstanceObservation#validateSOPInstanceObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate SOP Instance Observation Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SOPInstanceObservation#validateSOPInstanceObservationClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate SOP Instance Observation Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SOPInstanceObservation#validateSOPInstanceObservationEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate SOP Instance Observation Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SOPInstanceObservation#validateSOPInstanceObservationId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate SOP Instance Observation Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SOPInstanceObservation#validateSOPInstanceObservationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate SOP Instance Observation Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SOPInstanceObservation#validateSOPInstanceObservationText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate SOP Instance Observation Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SOPInstanceObservation#validateSOPInstanceObservationCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate SOP Instance Observation Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SOPInstanceObservation#validateSOPInstanceObservationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate SOP Instance Observation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SOPInstanceObservation#validateSOPInstanceObservationSOPInstanceObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate SOP Instance Observation SOP Instance Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SOPInstanceObservation#validateSOPInstanceObservationPurposeofReferenceObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate SOP Instance Observation Purposeof Reference Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SOPInstanceObservation#validateSOPInstanceObservationReferencedFramesObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate SOP Instance Observation Referenced Frames Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SOPInstanceObservation#getSOPInstanceObservations() Get SOP Instance Observations}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SOPInstanceObservation#getPurposeofReferenceObservations() Get Purposeof Reference Observations}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SOPInstanceObservation#getReferencedFramesObservations() Get Referenced Frames Observations}
  • + *
+ *

+ * + * @generated + */ + +public class SOPInstanceObservationTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateSOPInstanceObservationEffectiveTimeHasValue() { + OperationsTestCase validateSOPInstanceObservationEffectiveTimeHasValueTestCase = new OperationsTestCase( + "validateSOPInstanceObservationEffectiveTimeHasValue", + operationsForOCL.getOCLValue("VALIDATE_SOP_INSTANCE_OBSERVATION_EFFECTIVE_TIME_HAS_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SOPInstanceObservation target) { + target.init(); + target.setEffectiveTime(DatatypesFactory.eINSTANCE.createIVL_TS()); + } + + @Override + protected void updateToPass(SOPInstanceObservation target) { + IVL_TS ef = DatatypesFactory.eINSTANCE.createIVL_TS(); + ef.setValue("test"); + target.setEffectiveTime(ef); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SOPInstanceObservationOperations.validateSOPInstanceObservationEffectiveTimeHasValue( + (SOPInstanceObservation) objectToTest, diagnostician, map); + } + + }; + + validateSOPInstanceObservationEffectiveTimeHasValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateSOPInstanceObservationEffectiveTimeNoLow() { + OperationsTestCase validateSOPInstanceObservationEffectiveTimeNoLowTestCase = new OperationsTestCase( + "validateSOPInstanceObservationEffectiveTimeNoLow", + operationsForOCL.getOCLValue("VALIDATE_SOP_INSTANCE_OBSERVATION_EFFECTIVE_TIME_NO_LOW__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SOPInstanceObservation target) { + target.init(); + IVL_TS ef = DatatypesFactory.eINSTANCE.createIVL_TS(); + ef.setLow(DatatypesFactory.eINSTANCE.createIVXB_TS()); + target.setEffectiveTime(ef); + } + + @Override + protected void updateToPass(SOPInstanceObservation target) { + IVL_TS ef = DatatypesFactory.eINSTANCE.createIVL_TS(); + ef.setValue("test"); + target.setEffectiveTime(ef); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SOPInstanceObservationOperations.validateSOPInstanceObservationEffectiveTimeNoLow( + (SOPInstanceObservation) objectToTest, diagnostician, map); + } + + }; + + validateSOPInstanceObservationEffectiveTimeNoLowTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateSOPInstanceObservationEffectiveTimeNoHigh() { + OperationsTestCase validateSOPInstanceObservationEffectiveTimeNoHighTestCase = new OperationsTestCase( + "validateSOPInstanceObservationEffectiveTimeNoHigh", + operationsForOCL.getOCLValue("VALIDATE_SOP_INSTANCE_OBSERVATION_EFFECTIVE_TIME_NO_HIGH__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SOPInstanceObservation target) { + target.init(); + IVL_TS ef = DatatypesFactory.eINSTANCE.createIVL_TS(); + ef.setHigh(DatatypesFactory.eINSTANCE.createIVXB_TS()); + target.setEffectiveTime(ef); + } + + @Override + protected void updateToPass(SOPInstanceObservation target) { + IVL_TS ef = DatatypesFactory.eINSTANCE.createIVL_TS(); + ef.setValue("test"); + target.setEffectiveTime(ef); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SOPInstanceObservationOperations.validateSOPInstanceObservationEffectiveTimeNoHigh( + (SOPInstanceObservation) objectToTest, diagnostician, map); + } + + }; + + validateSOPInstanceObservationEffectiveTimeNoHighTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateSOPInstanceObservationTextMediaType() { + OperationsTestCase validateSOPInstanceObservationTextMediaTypeTestCase = new OperationsTestCase( + "validateSOPInstanceObservationTextMediaType", + operationsForOCL.getOCLValue("VALIDATE_SOP_INSTANCE_OBSERVATION_TEXT_MEDIA_TYPE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SOPInstanceObservation target) { + target.init(); + target.setText(DatatypesFactory.eINSTANCE.createED()); + } + + @Override + protected void updateToPass(SOPInstanceObservation target) { + ED text = DatatypesFactory.eINSTANCE.createED(); + text.setMediaType("application/dicom"); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SOPInstanceObservationOperations.validateSOPInstanceObservationTextMediaType( + (SOPInstanceObservation) objectToTest, diagnostician, map); + } + + }; + + validateSOPInstanceObservationTextMediaTypeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateSOPInstanceObservationTextReference() { + OperationsTestCase validateSOPInstanceObservationTextReferenceTestCase = new OperationsTestCase( + "validateSOPInstanceObservationTextReference", + operationsForOCL.getOCLValue("VALIDATE_SOP_INSTANCE_OBSERVATION_TEXT_REFERENCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SOPInstanceObservation target) { + target.init(); + target.setText(DatatypesFactory.eINSTANCE.createED()); + } + + @Override + protected void updateToPass(SOPInstanceObservation target) { + ED text = DatatypesFactory.eINSTANCE.createED(); + text.setReference(DatatypesFactory.eINSTANCE.createTEL()); + target.setText(text); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SOPInstanceObservationOperations.validateSOPInstanceObservationTextReference( + (SOPInstanceObservation) objectToTest, diagnostician, map); + } + + }; + + validateSOPInstanceObservationTextReferenceTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateSOPInstanceObservationTextReferenceValue() { + OperationsTestCase validateSOPInstanceObservationTextReferenceValueTestCase = new OperationsTestCase( + "validateSOPInstanceObservationTextReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_SOP_INSTANCE_OBSERVATION_TEXT_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SOPInstanceObservation target) { + target.init(); + ED text = DatatypesFactory.eINSTANCE.createED(); + text.setReference(DatatypesFactory.eINSTANCE.createTEL()); + target.setText(text); + } + + @Override + protected void updateToPass(SOPInstanceObservation target) { + ED text = DatatypesFactory.eINSTANCE.createED(); + text.setReference(DatatypesFactory.eINSTANCE.createTEL("test")); + target.setText(text); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SOPInstanceObservationOperations.validateSOPInstanceObservationTextReferenceValue( + (SOPInstanceObservation) objectToTest, diagnostician, map); + } + + }; + + validateSOPInstanceObservationTextReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSOPInstanceObservationTemplateId() { + OperationsTestCase validateSOPInstanceObservationTemplateIdTestCase = new OperationsTestCase( + "validateSOPInstanceObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_SOP_INSTANCE_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SOPInstanceObservation target) { + + } + + @Override + protected void updateToPass(SOPInstanceObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SOPInstanceObservationOperations.validateSOPInstanceObservationTemplateId( + (SOPInstanceObservation) objectToTest, diagnostician, map); + } + + }; + + validateSOPInstanceObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSOPInstanceObservationClassCode() { + OperationsTestCase validateSOPInstanceObservationClassCodeTestCase = new OperationsTestCase( + "validateSOPInstanceObservationClassCode", + operationsForOCL.getOCLValue("VALIDATE_SOP_INSTANCE_OBSERVATION_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SOPInstanceObservation target) { + + } + + @Override + protected void updateToPass(SOPInstanceObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SOPInstanceObservationOperations.validateSOPInstanceObservationClassCode( + (SOPInstanceObservation) objectToTest, diagnostician, map); + } + + }; + + validateSOPInstanceObservationClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSOPInstanceObservationEffectiveTime() { + OperationsTestCase validateSOPInstanceObservationEffectiveTimeTestCase = new OperationsTestCase( + "validateSOPInstanceObservationEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_SOP_INSTANCE_OBSERVATION_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SOPInstanceObservation target) { + + } + + @Override + protected void updateToPass(SOPInstanceObservation target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SOPInstanceObservationOperations.validateSOPInstanceObservationEffectiveTime( + (SOPInstanceObservation) objectToTest, diagnostician, map); + } + + }; + + validateSOPInstanceObservationEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSOPInstanceObservationId() { + OperationsTestCase validateSOPInstanceObservationIdTestCase = new OperationsTestCase( + "validateSOPInstanceObservationId", + operationsForOCL.getOCLValue("VALIDATE_SOP_INSTANCE_OBSERVATION_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SOPInstanceObservation target) { + + } + + @Override + protected void updateToPass(SOPInstanceObservation target) { + target.init(); + + II ii = DatatypesFactory.eINSTANCE.createII(); + target.getIds().add(ii); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SOPInstanceObservationOperations.validateSOPInstanceObservationId( + (SOPInstanceObservation) objectToTest, diagnostician, map); + } + + }; + + validateSOPInstanceObservationIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSOPInstanceObservationMoodCode() { + OperationsTestCase validateSOPInstanceObservationMoodCodeTestCase = new OperationsTestCase( + "validateSOPInstanceObservationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_SOP_INSTANCE_OBSERVATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SOPInstanceObservation target) { + + } + + @Override + protected void updateToPass(SOPInstanceObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SOPInstanceObservationOperations.validateSOPInstanceObservationMoodCode( + (SOPInstanceObservation) objectToTest, diagnostician, map); + } + + }; + + validateSOPInstanceObservationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSOPInstanceObservationText() { + OperationsTestCase validateSOPInstanceObservationTextTestCase = new OperationsTestCase( + "validateSOPInstanceObservationText", + operationsForOCL.getOCLValue("VALIDATE_SOP_INSTANCE_OBSERVATION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SOPInstanceObservation target) { + + } + + @Override + protected void updateToPass(SOPInstanceObservation target) { + target.init(); + + ED text = DatatypesFactory.eINSTANCE.createED(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SOPInstanceObservationOperations.validateSOPInstanceObservationText( + (SOPInstanceObservation) objectToTest, diagnostician, map); + } + + }; + + validateSOPInstanceObservationTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSOPInstanceObservationCodeP() { + OperationsTestCase validateSOPInstanceObservationCodePTestCase = new OperationsTestCase( + "validateSOPInstanceObservationCodeP", + operationsForOCL.getOCLValue("VALIDATE_SOP_INSTANCE_OBSERVATION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SOPInstanceObservation target) { + + } + + @Override + protected void updateToPass(SOPInstanceObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SOPInstanceObservationOperations.validateSOPInstanceObservationCodeP( + (SOPInstanceObservation) objectToTest, diagnostician, map); + } + + }; + + validateSOPInstanceObservationCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateSOPInstanceObservationCode() { + OperationsTestCase validateSOPInstanceObservationCodeTestCase = new OperationsTestCase( + "validateSOPInstanceObservationCode", + operationsForOCL.getOCLValue("VALIDATE_SOP_INSTANCE_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SOPInstanceObservation target) { + + } + + @Override + protected void updateToPass(SOPInstanceObservation target) { + target.init(); + + CD cd = DatatypesFactory.eINSTANCE.createCD(); + cd.setCodeSystem("1.2.840.10008.2.6.1"); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SOPInstanceObservationOperations.validateSOPInstanceObservationCode( + (SOPInstanceObservation) objectToTest, diagnostician, map); + } + + }; + + validateSOPInstanceObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateSOPInstanceObservationSOPInstanceObservation() { + OperationsTestCase validateSOPInstanceObservationSOPInstanceObservationTestCase = new OperationsTestCase( + "validateSOPInstanceObservationSOPInstanceObservation", + operationsForOCL.getOCLValue("VALIDATE_SOP_INSTANCE_OBSERVATION_SOP_INSTANCE_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SOPInstanceObservation target) { + target.init(); + } + + @Override + protected void updateToPass(SOPInstanceObservation target) { + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setObservation(ConsolFactory.eINSTANCE.createSOPInstanceObservation().init()); + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SOPInstanceObservationOperations.validateSOPInstanceObservationSOPInstanceObservation( + (SOPInstanceObservation) objectToTest, diagnostician, map); + } + + }; + + validateSOPInstanceObservationSOPInstanceObservationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateSOPInstanceObservationPurposeofReferenceObservation() { + OperationsTestCase validateSOPInstanceObservationPurposeofReferenceObservationTestCase = new OperationsTestCase( + "validateSOPInstanceObservationPurposeofReferenceObservation", + operationsForOCL.getOCLValue("VALIDATE_SOP_INSTANCE_OBSERVATION_PURPOSEOF_REFERENCE_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SOPInstanceObservation target) { + target.init(); + } + + @Override + protected void updateToPass(SOPInstanceObservation target) { + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setObservation(ConsolFactory.eINSTANCE.createPurposeofReferenceObservation().init()); + er.setTypeCode(x_ActRelationshipEntryRelationship.RSON); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SOPInstanceObservationOperations.validateSOPInstanceObservationPurposeofReferenceObservation( + (SOPInstanceObservation) objectToTest, diagnostician, map); + } + + }; + + validateSOPInstanceObservationPurposeofReferenceObservationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateSOPInstanceObservationReferencedFramesObservation() { + OperationsTestCase validateSOPInstanceObservationReferencedFramesObservationTestCase = new OperationsTestCase( + "validateSOPInstanceObservationReferencedFramesObservation", + operationsForOCL.getOCLValue("VALIDATE_SOP_INSTANCE_OBSERVATION_REFERENCED_FRAMES_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SOPInstanceObservation target) { + target.init(); + } + + @Override + protected void updateToPass(SOPInstanceObservation target) { + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setObservation(ConsolFactory.eINSTANCE.createReferencedFramesObservation().init()); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SOPInstanceObservationOperations.validateSOPInstanceObservationReferencedFramesObservation( + (SOPInstanceObservation) objectToTest, diagnostician, map); + } + + }; + + validateSOPInstanceObservationReferencedFramesObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetSOPInstanceObservations() { + + SOPInstanceObservation target = objectFactory.create(); + target.getSOPInstanceObservations(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPurposeofReferenceObservations() { + + SOPInstanceObservation target = objectFactory.create(); + target.getPurposeofReferenceObservations(); + + } + + /** + * + * @generated + */ + @Test + public void testGetReferencedFramesObservations() { + + SOPInstanceObservation target = objectFactory.create(); + target.getReferencedFramesObservations(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends SOPInstanceObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public SOPInstanceObservation create() { + return ConsolFactory.eINSTANCE.createSOPInstanceObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends SOPInstanceObservationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // SOPInstanceObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/SeriesActTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/SeriesActTest.java new file mode 100644 index 000000000..70f592487 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/SeriesActTest.java @@ -0,0 +1,653 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.SeriesAct; +import org.openhealthtools.mdht.uml.cda.consol.operations.SeriesActOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CR; +import org.openhealthtools.mdht.uml.hl7.datatypes.CV; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * + * A static utility class that provides operations related to 'Series Act' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SeriesAct#validateSeriesActIdHasRoot(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Series Act Id Has Root}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SeriesAct#validateSeriesActIdNoExtension(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Series Act Id No Extension}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SeriesAct#validateSeriesActCodeQualifier(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Series Act Code Qualifier}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SeriesAct#validateSeriesActCodeQualifierCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Series Act Code Qualifier Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SeriesAct#validateSeriesActCodeQualifierValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Series Act Code Qualifier Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SeriesAct#validateSeriesActCodeQualifierValueCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Series Act Code Qualifier Value Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SeriesAct#validateSeriesActTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Series Act Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SeriesAct#validateSeriesActClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Series Act Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SeriesAct#validateSeriesActMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Series Act Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SeriesAct#validateSeriesActCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Series Act Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SeriesAct#validateSeriesActEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Series Act Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SeriesAct#validateSeriesActId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Series Act Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SeriesAct#validateSeriesActText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Series Act Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SeriesAct#validateSeriesActSOPInstanceObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Series Act SOP Instance Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SeriesAct#getSOPInstanceObservations() Get SOP Instance Observations}
  • + *
+ *

+ * + * @generated + */ + +public class SeriesActTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateSeriesActIdHasRoot() { + OperationsTestCase validateSeriesActIdHasRootTestCase = new OperationsTestCase( + "validateSeriesActIdHasRoot", + operationsForOCL.getOCLValue("VALIDATE_SERIES_ACT_ID_HAS_ROOT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SeriesAct target) { + target.init(); + target.getIds().add(DatatypesFactory.eINSTANCE.createII()); + } + + @Override + protected void updateToPass(SeriesAct target) { + target.getIds().clear(); + II id = DatatypesFactory.eINSTANCE.createII(); + id.setRoot("test"); + target.getIds().add(id); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SeriesActOperations.validateSeriesActIdHasRoot((SeriesAct) objectToTest, diagnostician, map); + } + + }; + + validateSeriesActIdHasRootTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateSeriesActIdNoExtension() { + OperationsTestCase validateSeriesActIdNoExtensionTestCase = new OperationsTestCase( + "validateSeriesActIdNoExtension", + operationsForOCL.getOCLValue("VALIDATE_SERIES_ACT_ID_NO_EXTENSION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SeriesAct target) { + target.init(); + II id = DatatypesFactory.eINSTANCE.createII(); + id.setExtension("test"); + target.getIds().add(id); + } + + @Override + protected void updateToPass(SeriesAct target) { + target.getIds().clear(); + II id = DatatypesFactory.eINSTANCE.createII(); + id.setRoot("test"); + target.getIds().add(id); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SeriesActOperations.validateSeriesActIdNoExtension((SeriesAct) objectToTest, diagnostician, map); + } + + }; + + validateSeriesActIdNoExtensionTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateSeriesActCodeQualifier() { + OperationsTestCase validateSeriesActCodeQualifierTestCase = new OperationsTestCase( + "validateSeriesActCodeQualifier", + operationsForOCL.getOCLValue("VALIDATE_SERIES_ACT_CODE_QUALIFIER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SeriesAct target) { + + } + + @Override + protected void updateToPass(SeriesAct target) { + target.init(); + CD code = DatatypesFactory.eINSTANCE.createCD(); + CR qual = DatatypesFactory.eINSTANCE.createCR(); + CV name = DatatypesFactory.eINSTANCE.createCV(); + name.setCode("121139"); + qual.setName(name); + code.getQualifiers().add(qual); + target.setCode(code); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SeriesActOperations.validateSeriesActCodeQualifier((SeriesAct) objectToTest, diagnostician, map); + } + + }; + + validateSeriesActCodeQualifierTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateSeriesActCodeQualifierCode() { + OperationsTestCase validateSeriesActCodeQualifierCodeTestCase = new OperationsTestCase( + "validateSeriesActCodeQualifierCode", + operationsForOCL.getOCLValue("VALIDATE_SERIES_ACT_CODE_QUALIFIER_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SeriesAct target) { + + } + + @Override + protected void updateToPass(SeriesAct target) { + target.init(); + CD code = DatatypesFactory.eINSTANCE.createCD(); + CR qual = DatatypesFactory.eINSTANCE.createCR(); + CV name = DatatypesFactory.eINSTANCE.createCV(); + name.setCode("121139"); + name.setCodeSystem("1.2.840.10008.2.16.4"); + qual.setName(name); + code.getQualifiers().add(qual); + target.setCode(code); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SeriesActOperations.validateSeriesActCodeQualifierCode( + (SeriesAct) objectToTest, diagnostician, map); + } + + }; + + validateSeriesActCodeQualifierCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateSeriesActCodeQualifierValue() { + OperationsTestCase validateSeriesActCodeQualifierValueTestCase = new OperationsTestCase( + "validateSeriesActCodeQualifierValue", + operationsForOCL.getOCLValue("VALIDATE_SERIES_ACT_CODE_QUALIFIER_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SeriesAct target) { + + } + + @Override + protected void updateToPass(SeriesAct target) { + target.init(); + CD code = DatatypesFactory.eINSTANCE.createCD(); + CR qual = DatatypesFactory.eINSTANCE.createCR(); + CD val = DatatypesFactory.eINSTANCE.createCD(); + val.setCodeSystem("1.2.840.10008.2.16.4"); + qual.setValue(val); + code.getQualifiers().add(qual); + target.setCode(code); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SeriesActOperations.validateSeriesActCodeQualifierValue( + (SeriesAct) objectToTest, diagnostician, map); + } + + }; + + validateSeriesActCodeQualifierValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateSeriesActCodeQualifierValueCode() { + OperationsTestCase validateSeriesActCodeQualifierValueCodeTestCase = new OperationsTestCase( + "validateSeriesActCodeQualifierValueCode", + operationsForOCL.getOCLValue("VALIDATE_SERIES_ACT_CODE_QUALIFIER_VALUE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SeriesAct target) { + + } + + @Override + protected void updateToPass(SeriesAct target) { + target.init(); + CD code = DatatypesFactory.eINSTANCE.createCD(); + CR qual = DatatypesFactory.eINSTANCE.createCR(); + CD val = DatatypesFactory.eINSTANCE.createCD(); + val.setCodeSystem("1.2.840.10008.2.16.4"); + qual.setValue(val); + code.getQualifiers().add(qual); + target.setCode(code); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SeriesActOperations.validateSeriesActCodeQualifierValueCode( + (SeriesAct) objectToTest, diagnostician, map); + } + + }; + + validateSeriesActCodeQualifierValueCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSeriesActTemplateId() { + OperationsTestCase validateSeriesActTemplateIdTestCase = new OperationsTestCase( + "validateSeriesActTemplateId", + operationsForOCL.getOCLValue("VALIDATE_SERIES_ACT_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SeriesAct target) { + + } + + @Override + protected void updateToPass(SeriesAct target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SeriesActOperations.validateSeriesActTemplateId((SeriesAct) objectToTest, diagnostician, map); + } + + }; + + validateSeriesActTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSeriesActClassCode() { + OperationsTestCase validateSeriesActClassCodeTestCase = new OperationsTestCase( + "validateSeriesActClassCode", + operationsForOCL.getOCLValue("VALIDATE_SERIES_ACT_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SeriesAct target) { + + } + + @Override + protected void updateToPass(SeriesAct target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SeriesActOperations.validateSeriesActClassCode((SeriesAct) objectToTest, diagnostician, map); + } + + }; + + validateSeriesActClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSeriesActMoodCode() { + OperationsTestCase validateSeriesActMoodCodeTestCase = new OperationsTestCase( + "validateSeriesActMoodCode", + operationsForOCL.getOCLValue("VALIDATE_SERIES_ACT_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SeriesAct target) { + + } + + @Override + protected void updateToPass(SeriesAct target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SeriesActOperations.validateSeriesActMoodCode((SeriesAct) objectToTest, diagnostician, map); + } + + }; + + validateSeriesActMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateSeriesActCode() { + OperationsTestCase validateSeriesActCodeTestCase = new OperationsTestCase( + "validateSeriesActCode", + operationsForOCL.getOCLValue("VALIDATE_SERIES_ACT_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(SeriesAct target) { + + } + + @Override + protected void updateToPass(SeriesAct target) { + target.init(); + target.setCode(DatatypesFactory.eINSTANCE.createCE("113015", "1.2.840.10008.2.16.4")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SeriesActOperations.validateSeriesActCode((SeriesAct) objectToTest, diagnostician, map); + } + + }; + + validateSeriesActCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSeriesActEffectiveTime() { + OperationsTestCase validateSeriesActEffectiveTimeTestCase = new OperationsTestCase( + "validateSeriesActEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_SERIES_ACT_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SeriesAct target) { + + } + + @Override + protected void updateToPass(SeriesAct target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SeriesActOperations.validateSeriesActEffectiveTime((SeriesAct) objectToTest, diagnostician, map); + } + + }; + + validateSeriesActEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateSeriesActId() { + OperationsTestCase validateSeriesActIdTestCase = new OperationsTestCase( + "validateSeriesActId", + operationsForOCL.getOCLValue("VALIDATE_SERIES_ACT_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(SeriesAct target) { + target.init(); + } + + @Override + protected void updateToPass(SeriesAct target) { + target.getIds().add(DatatypesFactory.eINSTANCE.createII()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SeriesActOperations.validateSeriesActId((SeriesAct) objectToTest, diagnostician, map); + } + + }; + + validateSeriesActIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSeriesActText() { + OperationsTestCase validateSeriesActTextTestCase = new OperationsTestCase( + "validateSeriesActText", + operationsForOCL.getOCLValue("VALIDATE_SERIES_ACT_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(SeriesAct target) { + + } + + @Override + protected void updateToPass(SeriesAct target) { + target.init(); + + ED text = DatatypesFactory.eINSTANCE.createED(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SeriesActOperations.validateSeriesActText((SeriesAct) objectToTest, diagnostician, map); + } + + }; + + validateSeriesActTextTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateSeriesActSOPInstanceObservation() { + OperationsTestCase validateSeriesActSOPInstanceObservationTestCase = new OperationsTestCase( + "validateSeriesActSOPInstanceObservation", + operationsForOCL.getOCLValue("VALIDATE_SERIES_ACT_SOP_INSTANCE_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SeriesAct target) { + target.init(); + } + + @Override + protected void updateToPass(SeriesAct target) { + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setObservation(ConsolFactory.eINSTANCE.createSOPInstanceObservation().init()); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SeriesActOperations.validateSeriesActSOPInstanceObservation( + (SeriesAct) objectToTest, diagnostician, map); + } + + }; + + validateSeriesActSOPInstanceObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetSOPInstanceObservations() { + + SeriesAct target = objectFactory.create(); + target.getSOPInstanceObservations(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends SeriesActOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public SeriesAct create() { + return ConsolFactory.eINSTANCE.createSeriesAct(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends SeriesActOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // SeriesActOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ServiceDeliveryLocationTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ServiceDeliveryLocationTest.java new file mode 100644 index 000000000..0e8ddf40b --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/ServiceDeliveryLocationTest.java @@ -0,0 +1,405 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.PlayingEntity; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ServiceDeliveryLocation; +import org.openhealthtools.mdht.uml.cda.consol.operations.ServiceDeliveryLocationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.vocab.EntityClassRoot; + +/** + * + * A static utility class that provides operations related to 'Service Delivery Location' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ServiceDeliveryLocation#validateServiceDeliveryLocationHasPlayingEntity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Service Delivery Location Has Playing Entity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ServiceDeliveryLocation#validateServiceDeliveryLocationHasPlayingEntityClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Service Delivery Location Has Playing Entity Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ServiceDeliveryLocation#validateServiceDeliveryLocationHasPlayingEntityName(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Service Delivery Location Has Playing Entity Name}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ServiceDeliveryLocation#validateServiceDeliveryLocationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Service Delivery Location Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ServiceDeliveryLocation#validateServiceDeliveryLocationClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Service Delivery Location Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ServiceDeliveryLocation#validateServiceDeliveryLocationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Service Delivery Location Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ServiceDeliveryLocation#validateServiceDeliveryLocationAddr(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Service Delivery Location Addr}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.ServiceDeliveryLocation#validateServiceDeliveryLocationTelecom(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Service Delivery Location Telecom}
  • + *
+ *

+ * + * @generated + */ + +public class ServiceDeliveryLocationTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateServiceDeliveryLocationHasPlayingEntity() { + OperationsTestCase validateServiceDeliveryLocationHasPlayingEntityTestCase = new OperationsTestCase( + "validateServiceDeliveryLocationHasPlayingEntity", + operationsForOCL.getOCLValue("VALIDATE_SERVICE_DELIVERY_LOCATION_HAS_PLAYING_ENTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ServiceDeliveryLocation target) { + target.init(); + } + + @Override + protected void updateToPass(ServiceDeliveryLocation target) { + + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + target.setPlayingEntity(pe); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ServiceDeliveryLocationOperations.validateServiceDeliveryLocationHasPlayingEntity( + (ServiceDeliveryLocation) objectToTest, diagnostician, map); + } + + }; + + validateServiceDeliveryLocationHasPlayingEntityTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateServiceDeliveryLocationHasPlayingEntityClassCode() { + OperationsTestCase validateServiceDeliveryLocationHasPlayingEntityClassCodeTestCase = new OperationsTestCase( + "validateServiceDeliveryLocationHasPlayingEntityClassCode", + operationsForOCL.getOCLValue("VALIDATE_SERVICE_DELIVERY_LOCATION_HAS_PLAYING_ENTITY_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ServiceDeliveryLocation target) { + target.init(); + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + + target.setPlayingEntity(pe); + } + + @Override + protected void updateToPass(ServiceDeliveryLocation target) { + + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + + pe.setClassCode(EntityClassRoot.PLC); + target.setPlayingEntity(pe); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ServiceDeliveryLocationOperations.validateServiceDeliveryLocationHasPlayingEntityClassCode( + (ServiceDeliveryLocation) objectToTest, diagnostician, map); + } + + }; + + validateServiceDeliveryLocationHasPlayingEntityClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateServiceDeliveryLocationHasPlayingEntityName() { + OperationsTestCase validateServiceDeliveryLocationHasPlayingEntityNameTestCase = new OperationsTestCase( + "validateServiceDeliveryLocationHasPlayingEntityName", + operationsForOCL.getOCLValue("VALIDATE_SERVICE_DELIVERY_LOCATION_HAS_PLAYING_ENTITY_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ServiceDeliveryLocation target) { + target.init(); + target.setPlayingEntity(CDAFactory.eINSTANCE.createPlayingEntity()); + + } + + @Override + protected void updateToPass(ServiceDeliveryLocation target) { + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + pe.getNames().add(DatatypesFactory.eINSTANCE.createPN()); + target.setPlayingEntity(pe); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ServiceDeliveryLocationOperations.validateServiceDeliveryLocationHasPlayingEntityName( + (ServiceDeliveryLocation) objectToTest, diagnostician, map); + } + + }; + + validateServiceDeliveryLocationHasPlayingEntityNameTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateServiceDeliveryLocationTemplateId() { + OperationsTestCase validateServiceDeliveryLocationTemplateIdTestCase = new OperationsTestCase( + "validateServiceDeliveryLocationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_SERVICE_DELIVERY_LOCATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ServiceDeliveryLocation target) { + + } + + @Override + protected void updateToPass(ServiceDeliveryLocation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ServiceDeliveryLocationOperations.validateServiceDeliveryLocationTemplateId( + (ServiceDeliveryLocation) objectToTest, diagnostician, map); + } + + }; + + validateServiceDeliveryLocationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateServiceDeliveryLocationClassCode() { + OperationsTestCase validateServiceDeliveryLocationClassCodeTestCase = new OperationsTestCase( + "validateServiceDeliveryLocationClassCode", + operationsForOCL.getOCLValue("VALIDATE_SERVICE_DELIVERY_LOCATION_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + { + // we cannot violate the constraint because it only checks that the mood + // code is non-null and of type RoleClassRoot but EMF and Java enforce + // this + this.skipFailsTest(); + } + + @Override + protected void updateToFail(ServiceDeliveryLocation target) { + + } + + @Override + protected void updateToPass(ServiceDeliveryLocation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ServiceDeliveryLocationOperations.validateServiceDeliveryLocationClassCode( + (ServiceDeliveryLocation) objectToTest, diagnostician, map); + } + + }; + + validateServiceDeliveryLocationClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateServiceDeliveryLocationCode() { + OperationsTestCase validateServiceDeliveryLocationCodeTestCase = new OperationsTestCase( + "validateServiceDeliveryLocationCode", + operationsForOCL.getOCLValue("VALIDATE_SERVICE_DELIVERY_LOCATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ServiceDeliveryLocation target) { + target.init(); + } + + @Override + protected void updateToPass(ServiceDeliveryLocation target) { + target.setCode(DatatypesFactory.eINSTANCE.createCE("", "2.16.840.1.113883.6.259")); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ServiceDeliveryLocationOperations.validateServiceDeliveryLocationCode( + (ServiceDeliveryLocation) objectToTest, diagnostician, map); + } + + }; + + validateServiceDeliveryLocationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateServiceDeliveryLocationAddr() { + OperationsTestCase validateServiceDeliveryLocationAddrTestCase = new OperationsTestCase( + "validateServiceDeliveryLocationAddr", + operationsForOCL.getOCLValue("VALIDATE_SERVICE_DELIVERY_LOCATION_ADDR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ServiceDeliveryLocation target) { + target.init(); + } + + @Override + protected void updateToPass(ServiceDeliveryLocation target) { + + target.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ServiceDeliveryLocationOperations.validateServiceDeliveryLocationAddr( + (ServiceDeliveryLocation) objectToTest, diagnostician, map); + } + + }; + + validateServiceDeliveryLocationAddrTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateServiceDeliveryLocationTelecom() { + OperationsTestCase validateServiceDeliveryLocationTelecomTestCase = new OperationsTestCase( + "validateServiceDeliveryLocationTelecom", + operationsForOCL.getOCLValue("VALIDATE_SERVICE_DELIVERY_LOCATION_TELECOM__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ServiceDeliveryLocation target) { + target.init(); + } + + @Override + protected void updateToPass(ServiceDeliveryLocation target) { + target.getTelecoms().add(DatatypesFactory.eINSTANCE.createTEL()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ServiceDeliveryLocationOperations.validateServiceDeliveryLocationTelecom( + (ServiceDeliveryLocation) objectToTest, diagnostician, map); + } + + }; + + validateServiceDeliveryLocationTelecomTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ServiceDeliveryLocationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ServiceDeliveryLocation create() { + return ConsolFactory.eINSTANCE.createServiceDeliveryLocation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ServiceDeliveryLocationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ServiceDeliveryLocationOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/SeverityObservationTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/SeverityObservationTest.java new file mode 100644 index 000000000..6f9cd097a --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/SeverityObservationTest.java @@ -0,0 +1,534 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ConsolPackage; +import org.openhealthtools.mdht.uml.cda.consol.GeneralStatusSection; +import org.openhealthtools.mdht.uml.cda.consol.SeverityObservation; +import org.openhealthtools.mdht.uml.cda.consol.operations.SeverityObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; + +/** + * + * A static utility class that provides operations related to 'Severity Observation' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SeverityObservation#validateSeverityObservationTextReference(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Severity Observation Text Reference}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SeverityObservation#validateSeverityObservationTextReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Severity Observation Text Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SeverityObservation#validateSeverityObservationReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Severity Observation Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SeverityObservation#validateSeverityObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Severity Observation Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SeverityObservation#validateSeverityObservationClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Severity Observation Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SeverityObservation#validateSeverityObservationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Severity Observation Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SeverityObservation#validateSeverityObservationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Severity Observation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SeverityObservation#validateSeverityObservationText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Severity Observation Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SeverityObservation#validateSeverityObservationStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Severity Observation Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SeverityObservation#validateSeverityObservationValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Severity Observation Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SeverityObservation#validateSeverityObservationInterpretationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Severity Observation Interpretation Code}
  • + *
+ *

+ * + * @generated + */ + +public class SeverityObservationTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateSeverityObservationTextReference() { + OperationsTestCase validateSeverityObservationTextReferenceTestCase = new OperationsTestCase( + "validateSeverityObservationTextReference", + operationsForOCL.getOCLValue("VALIDATE_SEVERITY_OBSERVATION_TEXT_REFERENCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SeverityObservation target) { + target.init(); + target.setText(DatatypesFactory.eINSTANCE.createED("test")); + } + + @Override + protected void updateToPass(SeverityObservation target) { + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL("test")); + target.setText(txt); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SeverityObservationOperations.validateSeverityObservationTextReference( + (SeverityObservation) objectToTest, diagnostician, map); + } + + }; + + validateSeverityObservationTextReferenceTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateSeverityObservationTextReferenceValue() { + OperationsTestCase validateSeverityObservationTextReferenceValueTestCase = new OperationsTestCase( + "validateSeverityObservationTextReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_SEVERITY_OBSERVATION_TEXT_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SeverityObservation target) { + target.init(); + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL()); + target.setText(txt); + } + + @Override + protected void updateToPass(SeverityObservation target) { + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL("test")); + target.setText(txt); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SeverityObservationOperations.validateSeverityObservationTextReferenceValue( + (SeverityObservation) objectToTest, diagnostician, map); + } + + }; + + validateSeverityObservationTextReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSeverityObservationReferenceValue() { + OperationsTestCase validateSeverityObservationReferenceValueTestCase = new NarrativeReferenceTestCase( + "validateSeverityObservationReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_SEVERITY_OBSERVATION_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SeverityObservation target) { + target.init(); + + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), "", + "Not a particularly severe reaction."); + + // add a reference to the section text + target.setText(createEDWithReference("Some sample text", "#1.2.3.4")); + + } + + @Override + protected void updateToPass(SeverityObservation target) { + + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), + "1.2.3.4", "Not a particularly severe reaction."); + + // add a reference to the section text + target.setText(createEDWithReference("Some sample text", "#1.2.3.4")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SeverityObservationOperations.validateSeverityObservationReferenceValue( + (SeverityObservation) objectToTest, diagnostician, map); + } + + }; + + validateSeverityObservationReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSeverityObservationTemplateId() { + OperationsTestCase validateSeverityObservationTemplateIdTestCase = new OperationsTestCase( + "validateSeverityObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_SEVERITY_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SeverityObservation target) { + + } + + @Override + protected void updateToPass(SeverityObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SeverityObservationOperations.validateSeverityObservationTemplateId( + (SeverityObservation) objectToTest, diagnostician, map); + } + + }; + + validateSeverityObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSeverityObservationClassCode() { + OperationsTestCase validateSeverityObservationClassCodeTestCase = new OperationsTestCase( + "validateSeverityObservationClassCode", + operationsForOCL.getOCLValue("VALIDATE_SEVERITY_OBSERVATION_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SeverityObservation target) { + + } + + @Override + protected void updateToPass(SeverityObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SeverityObservationOperations.validateSeverityObservationClassCode( + (SeverityObservation) objectToTest, diagnostician, map); + } + + }; + + validateSeverityObservationClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSeverityObservationMoodCode() { + OperationsTestCase validateSeverityObservationMoodCodeTestCase = new OperationsTestCase( + "validateSeverityObservationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_SEVERITY_OBSERVATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SeverityObservation target) { + + } + + @Override + protected void updateToPass(SeverityObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SeverityObservationOperations.validateSeverityObservationMoodCode( + (SeverityObservation) objectToTest, diagnostician, map); + } + + }; + + validateSeverityObservationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSeverityObservationCode() { + OperationsTestCase validateSeverityObservationCodeTestCase = new OperationsTestCase( + "validateSeverityObservationCode", + operationsForOCL.getOCLValue("VALIDATE_SEVERITY_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SeverityObservation target) { + + } + + @Override + protected void updateToPass(SeverityObservation target) { + target.init(); + CE cd = DatatypesFactory.eINSTANCE.createCE(); + cd.setCode("SEV"); + cd.setCodeSystem("2.16.840.1.113883.5.4"); + target.setCode(cd); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SeverityObservationOperations.validateSeverityObservationCode( + (SeverityObservation) objectToTest, diagnostician, map); + } + + }; + + validateSeverityObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSeverityObservationText() { + OperationsTestCase validateSeverityObservationTextTestCase = new OperationsTestCase( + "validateSeverityObservationText", + operationsForOCL.getOCLValue("VALIDATE_SEVERITY_OBSERVATION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SeverityObservation target) { + + } + + @Override + protected void updateToPass(SeverityObservation target) { + target.init(); + target.setText(DatatypesFactory.eINSTANCE.createED()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SeverityObservationOperations.validateSeverityObservationText( + (SeverityObservation) objectToTest, diagnostician, map); + } + + }; + + validateSeverityObservationTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSeverityObservationStatusCode() { + OperationsTestCase validateSeverityObservationStatusCodeTestCase = new OperationsTestCase( + "validateSeverityObservationStatusCode", + operationsForOCL.getOCLValue("VALIDATE_SEVERITY_OBSERVATION_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SeverityObservation target) { + + } + + @Override + protected void updateToPass(SeverityObservation target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SeverityObservationOperations.validateSeverityObservationStatusCode( + (SeverityObservation) objectToTest, diagnostician, map); + } + + }; + + validateSeverityObservationStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSeverityObservationValue() { + OperationsTestCase validateSeverityObservationValueTestCase = new OperationsTestCase( + "validateSeverityObservationValue", + operationsForOCL.getOCLValue("VALIDATE_SEVERITY_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SeverityObservation target) { + + } + + @Override + protected void updateToPass(SeverityObservation target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD(); + value.setCodeSystem("2.16.840.1.113883.6.96"); + value.setCode("255604002"); + target.getValues().add(value); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SeverityObservationOperations.validateSeverityObservationValue( + (SeverityObservation) objectToTest, diagnostician, map); + } + + }; + + validateSeverityObservationValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateSeverityObservationInterpretationCode() { + OperationsTestCase validateSeverityObservationInterpretationCodeTestCase = new OperationsTestCase( + "validateSeverityObservationInterpretationCode", + operationsForOCL.getOCLValue("VALIDATE_SEVERITY_OBSERVATION_INTERPRETATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SeverityObservation target) { + target.init(); + + target.getInterpretationCodes().clear(); + target.getInterpretationCodes().add(DatatypesFactory.eINSTANCE.createCE("code", "aaaaa")); + + } + + @Override + protected void updateToPass(SeverityObservation target) { + target.getInterpretationCodes().clear(); + target.getInterpretationCodes().add( + DatatypesFactory.eINSTANCE.createCE("Carrier", "2.16.840.1.113883.5.83")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SeverityObservationOperations.validateSeverityObservationInterpretationCode( + (SeverityObservation) objectToTest, diagnostician, map); + } + + }; + + validateSeverityObservationInterpretationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends SeverityObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public SeverityObservation create() { + return ConsolFactory.eINSTANCE.createSeverityObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends SeverityObservationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // SeverityObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/SmokingStatusObservationTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/SmokingStatusObservationTest.java new file mode 100644 index 000000000..11931648c --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/SmokingStatusObservationTest.java @@ -0,0 +1,548 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.SmokingStatusObservation; +import org.openhealthtools.mdht.uml.cda.consol.operations.SmokingStatusObservationOperations; +import org.openhealthtools.mdht.uml.cda.consol.operations.TobaccoUseOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; + +/** + * + * A static utility class that provides operations related to 'Smoking Status Observation' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SmokingStatusObservation#validateSmokingStatusObservationEffectiveTimeLow(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Smoking Status Observation Effective Time Low}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SmokingStatusObservation#validateSmokingStatusObservationClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Smoking Status Observation Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SmokingStatusObservation#validateSmokingStatusObservationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Smoking Status Observation Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SmokingStatusObservation#validateSmokingStatusObservationCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Smoking Status Observation Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SmokingStatusObservation#validateSmokingStatusObservationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Smoking Status Observation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SmokingStatusObservation#validateSmokingStatusObservationEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Smoking Status Observation Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SmokingStatusObservation#validateSmokingStatusObservationStatusCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Smoking Status Observation Status Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SmokingStatusObservation#validateSmokingStatusObservationStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Smoking Status Observation Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SmokingStatusObservation#validateSmokingStatusObservationValueP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Smoking Status Observation Value P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SmokingStatusObservation#validateSmokingStatusObservationValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Smoking Status Observation Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SmokingStatusObservation#validateTobaccoUseTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Tobacco Use Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class SmokingStatusObservationTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateSmokingStatusObservationEffectiveTimeLow() { + OperationsTestCase validateSmokingStatusObservationEffectiveTimeLowTestCase = new OperationsTestCase( + "validateSmokingStatusObservationEffectiveTimeLow", + operationsForOCL.getOCLValue("VALIDATE_SMOKING_STATUS_OBSERVATION_EFFECTIVE_TIME_LOW__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SmokingStatusObservation target) { + target.init(); + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + + target.setEffectiveTime(ts); + } + + @Override + protected void updateToPass(SmokingStatusObservation target) { + target.init(); + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + ts.setLow(DatatypesFactory.eINSTANCE.createIVXB_TS()); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SmokingStatusObservationOperations.validateSmokingStatusObservationEffectiveTimeLow( + (SmokingStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateSmokingStatusObservationEffectiveTimeLowTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSmokingStatusObservationClassCode() { + OperationsTestCase validateSmokingStatusObservationClassCodeTestCase = new OperationsTestCase( + "validateSmokingStatusObservationClassCode", + operationsForOCL.getOCLValue("VALIDATE_SMOKING_STATUS_OBSERVATION_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SmokingStatusObservation target) { + + } + + @Override + protected void updateToPass(SmokingStatusObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SmokingStatusObservationOperations.validateSmokingStatusObservationClassCode( + (SmokingStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateSmokingStatusObservationClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSmokingStatusObservationMoodCode() { + OperationsTestCase validateSmokingStatusObservationMoodCodeTestCase = new OperationsTestCase( + "validateSmokingStatusObservationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_SMOKING_STATUS_OBSERVATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SmokingStatusObservation target) { + + } + + @Override + protected void updateToPass(SmokingStatusObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SmokingStatusObservationOperations.validateSmokingStatusObservationMoodCode( + (SmokingStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateSmokingStatusObservationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSmokingStatusObservationCodeP() { + OperationsTestCase validateSmokingStatusObservationCodePTestCase = new OperationsTestCase( + "validateSmokingStatusObservationCodeP", + operationsForOCL.getOCLValue("VALIDATE_SMOKING_STATUS_OBSERVATION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SmokingStatusObservation target) { + + } + + @Override + protected void updateToPass(SmokingStatusObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SmokingStatusObservationOperations.validateSmokingStatusObservationCodeP( + (SmokingStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateSmokingStatusObservationCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateSmokingStatusObservationCode() { + OperationsTestCase validateSmokingStatusObservationCodeTestCase = new OperationsTestCase( + "validateSmokingStatusObservationCode", + operationsForOCL.getOCLValue("VALIDATE_SMOKING_STATUS_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SmokingStatusObservation target) { + + } + + @Override + protected void updateToPass(SmokingStatusObservation target) { + target.init(); + + CD cd = DatatypesFactory.eINSTANCE.createCD("ASSERTION", "2.16.840.1.113883.5.4", "", ""); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SmokingStatusObservationOperations.validateSmokingStatusObservationCode( + (SmokingStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateSmokingStatusObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSmokingStatusObservationEffectiveTime() { + OperationsTestCase validateSmokingStatusObservationEffectiveTimeTestCase = new OperationsTestCase( + "validateSmokingStatusObservationEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_SMOKING_STATUS_OBSERVATION_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SmokingStatusObservation target) { + + } + + @Override + protected void updateToPass(SmokingStatusObservation target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SmokingStatusObservationOperations.validateSmokingStatusObservationEffectiveTime( + (SmokingStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateSmokingStatusObservationEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSmokingStatusObservationStatusCodeP() { + OperationsTestCase validateSmokingStatusObservationStatusCodePTestCase = new OperationsTestCase( + "validateSmokingStatusObservationStatusCodeP", + operationsForOCL.getOCLValue("VALIDATE_SMOKING_STATUS_OBSERVATION_STATUS_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SmokingStatusObservation target) { + + } + + @Override + protected void updateToPass(SmokingStatusObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SmokingStatusObservationOperations.validateSmokingStatusObservationStatusCodeP( + (SmokingStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateSmokingStatusObservationStatusCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSmokingStatusObservationStatusCode() { + OperationsTestCase validateSmokingStatusObservationStatusCodeTestCase = new OperationsTestCase( + "validateSmokingStatusObservationStatusCode", + operationsForOCL.getOCLValue("VALIDATE_SMOKING_STATUS_OBSERVATION_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SmokingStatusObservation target) { + + } + + @Override + protected void updateToPass(SmokingStatusObservation target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SmokingStatusObservationOperations.validateSmokingStatusObservationStatusCode( + (SmokingStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateSmokingStatusObservationStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateSmokingStatusObservationValueP() { + OperationsTestCase validateSmokingStatusObservationValuePTestCase = new OperationsTestCase( + "validateSmokingStatusObservationValueP", + operationsForOCL.getOCLValue("VALIDATE_SMOKING_STATUS_OBSERVATION_VALUE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SmokingStatusObservation target) { + + } + + @Override + protected void updateToPass(SmokingStatusObservation target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD("449868002", "2.16.840.1.113883.6.96", "", ""); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SmokingStatusObservationOperations.validateSmokingStatusObservationValueP( + (SmokingStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateSmokingStatusObservationValuePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateSmokingStatusObservationValue() { + OperationsTestCase validateSmokingStatusObservationValueTestCase = new OperationsTestCase( + "validateSmokingStatusObservationValue", + operationsForOCL.getOCLValue("VALIDATE_SMOKING_STATUS_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SmokingStatusObservation target) { + + } + + @Override + protected void updateToPass(SmokingStatusObservation target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD("449868002", "2.16.840.1.113883.6.96", "", ""); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SmokingStatusObservationOperations.validateSmokingStatusObservationValue( + (SmokingStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateSmokingStatusObservationValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateTobaccoUseTemplateId() { + OperationsTestCase validateTobaccoUseTemplateIdTestCase = new OperationsTestCase( + "validateTobaccoUseTemplateId", + operationsForOCL.getOCLValue("VALIDATE_TOBACCO_USE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SmokingStatusObservation target) { + + } + + @Override + protected void updateToPass(SmokingStatusObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SmokingStatusObservationOperations.validateTobaccoUseTemplateId( + (SmokingStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateTobaccoUseTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateTobaccoUseValue() { + OperationsTestCase validateTobaccoUseValueTestCase = new OperationsTestCase( + "validateTobaccoUseValue", + operationsForOCL.getOCLValue("VALIDATE_TOBACCO_USE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(SmokingStatusObservation target) { + + } + + @Override + protected void updateToPass(SmokingStatusObservation target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD("449868002", "2.16.840.1.113883.6.96", "", ""); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return TobaccoUseOperations.validateTobaccoUseValue( + (SmokingStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateTobaccoUseValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends SmokingStatusObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public SmokingStatusObservation create() { + return ConsolFactory.eINSTANCE.createSmokingStatusObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends SmokingStatusObservationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // SmokingStatusObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/SocialHistoryObservationTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/SocialHistoryObservationTest.java new file mode 100644 index 000000000..334a7e26a --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/SocialHistoryObservationTest.java @@ -0,0 +1,547 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ConsolPackage; +import org.openhealthtools.mdht.uml.cda.consol.GeneralStatusSection; +import org.openhealthtools.mdht.uml.cda.consol.SocialHistoryObservation; +import org.openhealthtools.mdht.uml.cda.consol.operations.SocialHistoryObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.datatypes.TEL; + +/** + * + * A static utility class that provides operations related to 'Social History Observation' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SocialHistoryObservation#validateSocialHistoryObservationOriginalText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Social History Observation Original Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SocialHistoryObservation#validateSocialHistoryObservationReference(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Social History Observation Reference}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SocialHistoryObservation#validateSocialHistoryObservationReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Social History Observation Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SocialHistoryObservation#validateSocialHistoryObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Social History Observation Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SocialHistoryObservation#validateSocialHistoryObservationClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Social History Observation Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SocialHistoryObservation#validateSocialHistoryObservationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Social History Observation Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SocialHistoryObservation#validateSocialHistoryObservationId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Social History Observation Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SocialHistoryObservation#validateSocialHistoryObservationCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Social History Observation Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SocialHistoryObservation#validateSocialHistoryObservationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Social History Observation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SocialHistoryObservation#validateSocialHistoryObservationStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Social History Observation Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SocialHistoryObservation#validateSocialHistoryObservationValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Social History Observation Value}
  • + *
+ *

+ * + * @generated + */ + +public class SocialHistoryObservationTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateSocialHistoryObservationOriginalText() { + OperationsTestCase validateSocialHistoryObservationOriginalTextTestCase = new OperationsTestCase( + "validateSocialHistoryObservationOriginalText", + operationsForOCL.getOCLValue("VALIDATE_SOCIAL_HISTORY_OBSERVATION_ORIGINAL_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistoryObservation target) { + target.init(); + CD objCode = DatatypesFactory.eINSTANCE.createCD(); + target.setCode(objCode); + } + + @Override + protected void updateToPass(SocialHistoryObservation target) { + target.setClassCode(null); + CD objCode = DatatypesFactory.eINSTANCE.createCD(); + objCode.setOriginalText(DatatypesFactory.eINSTANCE.createED()); + target.setCode(objCode); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistoryObservationOperations.validateSocialHistoryObservationOriginalText( + (SocialHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateSocialHistoryObservationOriginalTextTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSocialHistoryObservationReference() { + OperationsTestCase validateSocialHistoryObservationReferenceTestCase = new OperationsTestCase( + "validateSocialHistoryObservationReference", + operationsForOCL.getOCLValue("VALIDATE_SOCIAL_HISTORY_OBSERVATION_REFERENCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistoryObservation target) { + target.init(); + CD objCode = DatatypesFactory.eINSTANCE.createCD(); + ED objOrigText = DatatypesFactory.eINSTANCE.createED(); + objCode.setOriginalText(objOrigText); + target.setCode(objCode); + + } + + @Override + protected void updateToPass(SocialHistoryObservation target) { + CD objCode = DatatypesFactory.eINSTANCE.createCD(); + ED objOrigText = DatatypesFactory.eINSTANCE.createED(); + TEL objReference = DatatypesFactory.eINSTANCE.createTEL(); + objReference.setValue("#test"); + objOrigText.setReference(objReference); + objCode.setOriginalText(objOrigText); + target.setCode(objCode); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistoryObservationOperations.validateSocialHistoryObservationReference( + (SocialHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateSocialHistoryObservationReferenceTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSocialHistoryObservationReferenceValue() { + OperationsTestCase validateSocialHistoryObservationReferenceValueTestCase = new NarrativeReferenceTestCase( + "validateSocialHistoryObservationReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_SOCIAL_HISTORY_OBSERVATION_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistoryObservation target) { + target.init(); + // CD code = DatatypesFactory.eINSTANCE.createCD(); + // ED ot = DatatypesFactory.eINSTANCE.createED(); + // TEL ref = DatatypesFactory.eINSTANCE.createTEL(); + // ot.setReference(ref); + // code.setOriginalText(ot); + // target.setCode(code); + // + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), "", + "No particular adverse reaction."); + + // add a reference to the section text + target.setCode(createCDWithOriginalTextReference("Some sample text", "#1.2.3.4")); + + } + + @Override + protected void updateToPass(SocialHistoryObservation target) { + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), + "1.2.3.4", "No particular adverse reaction."); + + // add a reference to the section text + target.setCode(createCDWithOriginalTextReference("Some sample text", "#1.2.3.4")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistoryObservationOperations.validateSocialHistoryObservationReferenceValue( + (SocialHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateSocialHistoryObservationReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSocialHistoryObservationTemplateId() { + OperationsTestCase validateSocialHistoryObservationTemplateIdTestCase = new OperationsTestCase( + "validateSocialHistoryObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_SOCIAL_HISTORY_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistoryObservation target) { + + } + + @Override + protected void updateToPass(SocialHistoryObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistoryObservationOperations.validateSocialHistoryObservationTemplateId( + (SocialHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateSocialHistoryObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSocialHistoryObservationClassCode() { + OperationsTestCase validateSocialHistoryObservationClassCodeTestCase = new OperationsTestCase( + "validateSocialHistoryObservationClassCode", + operationsForOCL.getOCLValue("VALIDATE_SOCIAL_HISTORY_OBSERVATION_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistoryObservation target) { + + } + + @Override + protected void updateToPass(SocialHistoryObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistoryObservationOperations.validateSocialHistoryObservationClassCode( + (SocialHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateSocialHistoryObservationClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSocialHistoryObservationMoodCode() { + OperationsTestCase validateSocialHistoryObservationMoodCodeTestCase = new OperationsTestCase( + "validateSocialHistoryObservationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_SOCIAL_HISTORY_OBSERVATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistoryObservation target) { + + } + + @Override + protected void updateToPass(SocialHistoryObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistoryObservationOperations.validateSocialHistoryObservationMoodCode( + (SocialHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateSocialHistoryObservationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSocialHistoryObservationId() { + OperationsTestCase validateSocialHistoryObservationIdTestCase = new OperationsTestCase( + "validateSocialHistoryObservationId", + operationsForOCL.getOCLValue("VALIDATE_SOCIAL_HISTORY_OBSERVATION_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistoryObservation target) { + + } + + @Override + protected void updateToPass(SocialHistoryObservation target) { + target.init(); + + II ii = DatatypesFactory.eINSTANCE.createII(); + target.getIds().add(ii); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistoryObservationOperations.validateSocialHistoryObservationId( + (SocialHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateSocialHistoryObservationIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSocialHistoryObservationCode() { + OperationsTestCase validateSocialHistoryObservationCodeTestCase = new OperationsTestCase( + "validateSocialHistoryObservationCode", + operationsForOCL.getOCLValue("VALIDATE_SOCIAL_HISTORY_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistoryObservation target) { + + } + + @Override + protected void updateToPass(SocialHistoryObservation target) { + target.init(); + + CD cd = DatatypesFactory.eINSTANCE.createCD(); + cd.setCodeSystem("2.16.840.1.113883.6.96"); + cd.setCode("256235009"); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistoryObservationOperations.validateSocialHistoryObservationCode( + (SocialHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateSocialHistoryObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSocialHistoryObservationCodeP() { + OperationsTestCase validateSocialHistoryObservationCodePTestCase = new OperationsTestCase( + "validateSocialHistoryObservationCodeP", + operationsForOCL.getOCLValue("VALIDATE_SOCIAL_HISTORY_OBSERVATION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistoryObservation target) { + + } + + @Override + protected void updateToPass(SocialHistoryObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistoryObservationOperations.validateSocialHistoryObservationCodeP( + (SocialHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateSocialHistoryObservationCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSocialHistoryObservationStatusCode() { + OperationsTestCase validateSocialHistoryObservationStatusCodeTestCase = new OperationsTestCase( + "validateSocialHistoryObservationStatusCode", + operationsForOCL.getOCLValue("VALIDATE_SOCIAL_HISTORY_OBSERVATION_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistoryObservation target) { + + } + + @Override + protected void updateToPass(SocialHistoryObservation target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistoryObservationOperations.validateSocialHistoryObservationStatusCode( + (SocialHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateSocialHistoryObservationStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSocialHistoryObservationValue() { + OperationsTestCase validateSocialHistoryObservationValueTestCase = new OperationsTestCase( + "validateSocialHistoryObservationValue", + operationsForOCL.getOCLValue("VALIDATE_SOCIAL_HISTORY_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistoryObservation target) { + + } + + @Override + protected void updateToPass(SocialHistoryObservation target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD(); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistoryObservationOperations.validateSocialHistoryObservationValue( + (SocialHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateSocialHistoryObservationValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends SocialHistoryObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public SocialHistoryObservation create() { + return ConsolFactory.eINSTANCE.createSocialHistoryObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends SocialHistoryObservationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // SocialHistoryObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/SocialHistorySectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/SocialHistorySectionTest.java new file mode 100644 index 000000000..e4a06ec44 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/SocialHistorySectionTest.java @@ -0,0 +1,482 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.SocialHistorySection; +import org.openhealthtools.mdht.uml.cda.consol.operations.SocialHistorySectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Social History Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SocialHistorySection#validateSocialHistorySectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Social History Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SocialHistorySection#validateSocialHistorySectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Social History Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SocialHistorySection#validateSocialHistorySectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Social History Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SocialHistorySection#validateSocialHistorySectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Social History Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SocialHistorySection#validateSocialHistorySectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Social History Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SocialHistorySection#validateSocialHistorySectionSocialHistoryObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Social History Section Social History Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SocialHistorySection#validateSocialHistorySectionPregnancyObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Social History Section Pregnancy Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SocialHistorySection#validateSocialHistorySectionSmokingStatusObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Social History Section Smoking Status Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SocialHistorySection#validateSocialHistorySectionTobaccoUse(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Social History Section Tobacco Use}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SocialHistorySection#getSocialHistoryObservations() Get Social History Observations}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SocialHistorySection#getPregnancyObservations() Get Pregnancy Observations}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SocialHistorySection#getSmokingStatusObservations() Get Smoking Status Observations}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SocialHistorySection#getTobaccoUses() Get Tobacco Uses}
  • + *
+ *

+ * + * @generated + */ + +public class SocialHistorySectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateSocialHistorySectionTemplateId() { + OperationsTestCase validateSocialHistorySectionTemplateIdTestCase = new OperationsTestCase( + "validateSocialHistorySectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_SOCIAL_HISTORY_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistorySection target) { + + } + + @Override + protected void updateToPass(SocialHistorySection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistorySectionOperations.validateSocialHistorySectionTemplateId( + (SocialHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateSocialHistorySectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSocialHistorySectionCode() { + OperationsTestCase validateSocialHistorySectionCodeTestCase = new OperationsTestCase( + "validateSocialHistorySectionCode", + operationsForOCL.getOCLValue("VALIDATE_SOCIAL_HISTORY_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistorySection target) { + + } + + @Override + protected void updateToPass(SocialHistorySection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistorySectionOperations.validateSocialHistorySectionCode( + (SocialHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateSocialHistorySectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSocialHistorySectionCodeP() { + OperationsTestCase validateSocialHistorySectionCodePTestCase = new OperationsTestCase( + "validateSocialHistorySectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_SOCIAL_HISTORY_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistorySection target) { + + } + + @Override + protected void updateToPass(SocialHistorySection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistorySectionOperations.validateSocialHistorySectionCodeP( + (SocialHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateSocialHistorySectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSocialHistorySectionTitle() { + OperationsTestCase validateSocialHistorySectionTitleTestCase = new OperationsTestCase( + "validateSocialHistorySectionTitle", + operationsForOCL.getOCLValue("VALIDATE_SOCIAL_HISTORY_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistorySection target) { + + } + + @Override + protected void updateToPass(SocialHistorySection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistorySectionOperations.validateSocialHistorySectionTitle( + (SocialHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateSocialHistorySectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSocialHistorySectionText() { + OperationsTestCase validateSocialHistorySectionTextTestCase = new OperationsTestCase( + "validateSocialHistorySectionText", + operationsForOCL.getOCLValue("VALIDATE_SOCIAL_HISTORY_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistorySection target) { + + } + + @Override + protected void updateToPass(SocialHistorySection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistorySectionOperations.validateSocialHistorySectionText( + (SocialHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateSocialHistorySectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSocialHistorySectionSocialHistoryObservation() { + OperationsTestCase validateSocialHistorySectionSocialHistoryObservationTestCase = new OperationsTestCase( + "validateSocialHistorySectionSocialHistoryObservation", + operationsForOCL.getOCLValue("VALIDATE_SOCIAL_HISTORY_SECTION_SOCIAL_HISTORY_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistorySection target) { + + } + + @Override + protected void updateToPass(SocialHistorySection target) { + target.init(); + target.addObservation(ConsolFactory.eINSTANCE.createSocialHistoryObservation()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistorySectionOperations.validateSocialHistorySectionSocialHistoryObservation( + (SocialHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateSocialHistorySectionSocialHistoryObservationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateSocialHistorySectionPregnancyObservation() { + OperationsTestCase validateSocialHistorySectionPregnancyObservationTestCase = new OperationsTestCase( + "validateSocialHistorySectionPregnancyObservation", + operationsForOCL.getOCLValue("VALIDATE_SOCIAL_HISTORY_SECTION_PREGNANCY_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistorySection target) { + + } + + @Override + protected void updateToPass(SocialHistorySection target) { + target.init(); + target.addObservation(ConsolFactory.eINSTANCE.createPregnancyObservation()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistorySectionOperations.validateSocialHistorySectionPregnancyObservation( + (SocialHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateSocialHistorySectionPregnancyObservationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateSocialHistorySectionSmokingStatusObservation() { + OperationsTestCase validateSocialHistorySectionSmokingStatusObservationTestCase = new OperationsTestCase( + "validateSocialHistorySectionSmokingStatusObservation", + operationsForOCL.getOCLValue("VALIDATE_SOCIAL_HISTORY_SECTION_SMOKING_STATUS_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistorySection target) { + + } + + @Override + protected void updateToPass(SocialHistorySection target) { + target.init(); + target.addObservation(ConsolFactory.eINSTANCE.createSmokingStatusObservation()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistorySectionOperations.validateSocialHistorySectionSmokingStatusObservation( + (SocialHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateSocialHistorySectionSmokingStatusObservationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateSocialHistorySectionTobaccoUse() { + OperationsTestCase validateSocialHistorySectionTobaccoUseTestCase = new OperationsTestCase( + "validateSocialHistorySectionTobaccoUse", + operationsForOCL.getOCLValue("VALIDATE_SOCIAL_HISTORY_SECTION_TOBACCO_USE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistorySection target) { + + } + + @Override + protected void updateToPass(SocialHistorySection target) { + target.init(); + target.addObservation(ConsolFactory.eINSTANCE.createTobaccoUse()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistorySectionOperations.validateSocialHistorySectionTobaccoUse( + (SocialHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateSocialHistorySectionTobaccoUseTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetSocialHistoryObservations() { + + SocialHistorySection target = objectFactory.create(); + target.getSocialHistoryObservations(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPregnancyObservations() { + + SocialHistorySection target = objectFactory.create(); + target.getPregnancyObservations(); + + } + + /** + * + * @generated + */ + @Test + public void testGetSmokingStatusObservations() { + + SocialHistorySection target = objectFactory.create(); + target.getSmokingStatusObservations(); + + } + + /** + * + * @generated + */ + @Test + public void testGetTobaccoUses() { + + SocialHistorySection target = objectFactory.create(); + target.getTobaccoUses(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends SocialHistorySectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public SocialHistorySection create() { + return ConsolFactory.eINSTANCE.createSocialHistorySection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends SocialHistorySectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // SocialHistorySectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/StudyActTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/StudyActTest.java new file mode 100644 index 000000000..f3deed61e --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/StudyActTest.java @@ -0,0 +1,609 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ConsolPackage; +import org.openhealthtools.mdht.uml.cda.consol.GeneralStatusSection; +import org.openhealthtools.mdht.uml.cda.consol.StudyAct; +import org.openhealthtools.mdht.uml.cda.consol.operations.StudyActOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * + * A static utility class that provides operations related to 'Study Act' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.StudyAct#validateStudyActIdsHaveRoot(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Study Act Ids Have Root}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.StudyAct#validateStudyActNoIdExtension(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Study Act No Id Extension}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.StudyAct#validateStudyActTextReference(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Study Act Text Reference}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.StudyAct#validateStudyActTextReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Study Act Text Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.StudyAct#validateStudyActReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Study Act Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.StudyAct#validateStudyActTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Study Act Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.StudyAct#validateStudyActClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Study Act Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.StudyAct#validateStudyActMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Study Act Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.StudyAct#validateStudyActId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Study Act Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.StudyAct#validateStudyActCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Study Act Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.StudyAct#validateStudyActEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Study Act Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.StudyAct#validateStudyActText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Study Act Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.StudyAct#validateStudyActSeriesAct(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Study Act Series Act}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.StudyAct#getSeriesAct() Get Series Act}
  • + *
+ *

+ * + * @generated + */ + +public class StudyActTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateStudyActIdsHaveRoot() { + OperationsTestCase validateStudyActIdsHaveRootTestCase = new OperationsTestCase( + "validateStudyActIdsHaveRoot", + operationsForOCL.getOCLValue("VALIDATE_STUDY_ACT_IDS_HAVE_ROOT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(StudyAct target) { + target.init(); + target.getIds().add(DatatypesFactory.eINSTANCE.createII()); + } + + @Override + protected void updateToPass(StudyAct target) { + target.getIds().clear(); + II id = DatatypesFactory.eINSTANCE.createII(); + id.setRoot("test"); + target.getIds().add(id); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return StudyActOperations.validateStudyActIdsHaveRoot((StudyAct) objectToTest, diagnostician, map); + } + + }; + + validateStudyActIdsHaveRootTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateStudyActNoIdExtension() { + OperationsTestCase validateStudyActNoIdExtensionTestCase = new OperationsTestCase( + "validateStudyActNoIdExtension", + operationsForOCL.getOCLValue("VALIDATE_STUDY_ACT_NO_ID_EXTENSION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(StudyAct target) { + target.init(); + II id = DatatypesFactory.eINSTANCE.createII(); + id.setExtension("test"); + target.getIds().add(id); + } + + @Override + protected void updateToPass(StudyAct target) { + target.getIds().clear(); + II id = DatatypesFactory.eINSTANCE.createII(); + id.setRoot("test"); + target.getIds().add(id); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return StudyActOperations.validateStudyActNoIdExtension((StudyAct) objectToTest, diagnostician, map); + } + + }; + + validateStudyActNoIdExtensionTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateStudyActTextReference() { + OperationsTestCase validateStudyActTextReferenceTestCase = new OperationsTestCase( + "validateStudyActTextReference", + operationsForOCL.getOCLValue("VALIDATE_STUDY_ACT_TEXT_REFERENCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(StudyAct target) { + target.init(); + ED txt = DatatypesFactory.eINSTANCE.createED(); + target.setText(txt); + } + + @Override + protected void updateToPass(StudyAct target) { + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL()); + target.setText(txt); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return StudyActOperations.validateStudyActTextReference((StudyAct) objectToTest, diagnostician, map); + } + + }; + + validateStudyActTextReferenceTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateStudyActTextReferenceValue() { + OperationsTestCase validateStudyActTextReferenceValueTestCase = new OperationsTestCase( + "validateStudyActTextReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_STUDY_ACT_TEXT_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(StudyAct target) { + target.init(); + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL()); + target.setText(txt); + } + + @Override + protected void updateToPass(StudyAct target) { + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL("test")); + target.setText(txt); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return StudyActOperations.validateStudyActTextReferenceValue( + (StudyAct) objectToTest, diagnostician, map); + } + + }; + + validateStudyActTextReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateStudyActReferenceValue() { + OperationsTestCase validateStudyActReferenceValueTestCase = new NarrativeReferenceTestCase( + "validateStudyActReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_STUDY_ACT_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(StudyAct target) { + target.init(); + + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), "", + "No particular health status observed."); + + // add a reference to the section text + target.setText(createEDWithReference("Some sample text", "#1.2.3.4")); + } + + @Override + protected void updateToPass(StudyAct target) { + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), + "1.2.3.4", "No particular health status observed."); + + // add a reference to the section text + target.setText(createEDWithReference("Some sample text", "#1.2.3.4")); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return StudyActOperations.validateStudyActReferenceValue((StudyAct) objectToTest, diagnostician, map); + } + + }; + + validateStudyActReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateStudyActTemplateId() { + OperationsTestCase validateStudyActTemplateIdTestCase = new OperationsTestCase( + "validateStudyActTemplateId", + operationsForOCL.getOCLValue("VALIDATE_STUDY_ACT_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(StudyAct target) { + + } + + @Override + protected void updateToPass(StudyAct target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return StudyActOperations.validateStudyActTemplateId((StudyAct) objectToTest, diagnostician, map); + } + + }; + + validateStudyActTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateStudyActClassCode() { + OperationsTestCase validateStudyActClassCodeTestCase = new OperationsTestCase( + "validateStudyActClassCode", + operationsForOCL.getOCLValue("VALIDATE_STUDY_ACT_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(StudyAct target) { + + } + + @Override + protected void updateToPass(StudyAct target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return StudyActOperations.validateStudyActClassCode((StudyAct) objectToTest, diagnostician, map); + } + + }; + + validateStudyActClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateStudyActMoodCode() { + OperationsTestCase validateStudyActMoodCodeTestCase = new OperationsTestCase( + "validateStudyActMoodCode", + operationsForOCL.getOCLValue("VALIDATE_STUDY_ACT_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(StudyAct target) { + + } + + @Override + protected void updateToPass(StudyAct target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return StudyActOperations.validateStudyActMoodCode((StudyAct) objectToTest, diagnostician, map); + } + + }; + + validateStudyActMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateStudyActId() { + OperationsTestCase validateStudyActIdTestCase = new OperationsTestCase( + "validateStudyActId", + operationsForOCL.getOCLValue("VALIDATE_STUDY_ACT_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(StudyAct target) { + target.init(); + } + + @Override + protected void updateToPass(StudyAct target) { + target.getIds().add(DatatypesFactory.eINSTANCE.createII()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return StudyActOperations.validateStudyActId((StudyAct) objectToTest, diagnostician, map); + } + + }; + + validateStudyActIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateStudyActCode() { + OperationsTestCase validateStudyActCodeTestCase = new OperationsTestCase( + "validateStudyActCode", + operationsForOCL.getOCLValue("VALIDATE_STUDY_ACT_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(StudyAct target) { + + } + + @Override + protected void updateToPass(StudyAct target) { + target.init(); + target.setCode(DatatypesFactory.eINSTANCE.createCE("113014", "1.2.840.10008.2.16.4")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return StudyActOperations.validateStudyActCode((StudyAct) objectToTest, diagnostician, map); + } + + }; + + validateStudyActCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateStudyActEffectiveTime() { + OperationsTestCase validateStudyActEffectiveTimeTestCase = new OperationsTestCase( + "validateStudyActEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_STUDY_ACT_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(StudyAct target) { + + } + + @Override + protected void updateToPass(StudyAct target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return StudyActOperations.validateStudyActEffectiveTime((StudyAct) objectToTest, diagnostician, map); + } + + }; + + validateStudyActEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateStudyActText() { + OperationsTestCase validateStudyActTextTestCase = new OperationsTestCase( + "validateStudyActText", + operationsForOCL.getOCLValue("VALIDATE_STUDY_ACT_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(StudyAct target) { + + } + + @Override + protected void updateToPass(StudyAct target) { + target.init(); + + ED text = DatatypesFactory.eINSTANCE.createED(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return StudyActOperations.validateStudyActText((StudyAct) objectToTest, diagnostician, map); + } + + }; + + validateStudyActTextTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateStudyActSeriesAct() { + OperationsTestCase validateStudyActSeriesActTestCase = new OperationsTestCase( + "validateStudyActSeriesAct", + operationsForOCL.getOCLValue("VALIDATE_STUDY_ACT_SERIES_ACT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(StudyAct target) { + target.init(); + } + + @Override + protected void updateToPass(StudyAct target) { + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setAct(ConsolFactory.eINSTANCE.createSeriesAct().init()); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return StudyActOperations.validateStudyActSeriesAct((StudyAct) objectToTest, diagnostician, map); + } + + }; + + validateStudyActSeriesActTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetSeriesAct() { + + StudyAct target = objectFactory.create(); + target.getSeriesAct(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends StudyActOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public StudyAct create() { + return ConsolFactory.eINSTANCE.createStudyAct(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends StudyActOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // StudyActOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/SubjectiveSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/SubjectiveSectionTest.java new file mode 100644 index 000000000..93bad2538 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/SubjectiveSectionTest.java @@ -0,0 +1,290 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.SubjectiveSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.SubjectiveSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Subjective Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SubjectiveSection#validateSubjectiveSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Subjective Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SubjectiveSection#validateSubjectiveSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Subjective Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SubjectiveSection#validateSubjectiveSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Subjective Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SubjectiveSection#validateSubjectiveSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Subjective Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SubjectiveSection#validateSubjectiveSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Subjective Section Title}
  • + *
+ *

+ * + * @generated + */ + +public class SubjectiveSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateSubjectiveSectionTemplateId() { + OperationsTestCase validateSubjectiveSectionTemplateIdTestCase = new OperationsTestCase( + "validateSubjectiveSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_SUBJECTIVE_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SubjectiveSection target) { + + } + + @Override + protected void updateToPass(SubjectiveSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SubjectiveSectionOperations.validateSubjectiveSectionTemplateId( + (SubjectiveSection) objectToTest, diagnostician, map); + } + + }; + + validateSubjectiveSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSubjectiveSectionCode() { + OperationsTestCase validateSubjectiveSectionCodeTestCase = new OperationsTestCase( + "validateSubjectiveSectionCode", + operationsForOCL.getOCLValue("VALIDATE_SUBJECTIVE_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SubjectiveSection target) { + + } + + @Override + protected void updateToPass(SubjectiveSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SubjectiveSectionOperations.validateSubjectiveSectionCode( + (SubjectiveSection) objectToTest, diagnostician, map); + } + + }; + + validateSubjectiveSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSubjectiveSectionCodeP() { + OperationsTestCase validateSubjectiveSectionCodePTestCase = new OperationsTestCase( + "validateSubjectiveSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_SUBJECTIVE_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SubjectiveSection target) { + + } + + @Override + protected void updateToPass(SubjectiveSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SubjectiveSectionOperations.validateSubjectiveSectionCodeP( + (SubjectiveSection) objectToTest, diagnostician, map); + } + + }; + + validateSubjectiveSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSubjectiveSectionText() { + OperationsTestCase validateSubjectiveSectionTextTestCase = new OperationsTestCase( + "validateSubjectiveSectionText", + operationsForOCL.getOCLValue("VALIDATE_SUBJECTIVE_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SubjectiveSection target) { + + } + + @Override + protected void updateToPass(SubjectiveSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SubjectiveSectionOperations.validateSubjectiveSectionText( + (SubjectiveSection) objectToTest, diagnostician, map); + } + + }; + + validateSubjectiveSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSubjectiveSectionTitle() { + OperationsTestCase validateSubjectiveSectionTitleTestCase = new OperationsTestCase( + "validateSubjectiveSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_SUBJECTIVE_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SubjectiveSection target) { + + } + + @Override + protected void updateToPass(SubjectiveSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SubjectiveSectionOperations.validateSubjectiveSectionTitle( + (SubjectiveSection) objectToTest, diagnostician, map); + } + + }; + + validateSubjectiveSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends SubjectiveSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public SubjectiveSection create() { + return ConsolFactory.eINSTANCE.createSubjectiveSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends SubjectiveSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // SubjectiveSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/SupportGuardianTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/SupportGuardianTest.java new file mode 100644 index 000000000..f87605d63 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/SupportGuardianTest.java @@ -0,0 +1,45 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Support Guardian' model objects. + * + * + * + * @generated + */ + +public class SupportGuardianTest extends CDAValidationTest { + + /** + * No Operations Test + * @generated + */ + @Test + public void testNoOperations() { + } + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // SupportGuardianOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/SupportParticipantTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/SupportParticipantTest.java new file mode 100644 index 000000000..4aa83fdc8 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/SupportParticipantTest.java @@ -0,0 +1,45 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Support Participant' model objects. + * + * + * + * @generated + */ + +public class SupportParticipantTest extends CDAValidationTest { + + /** + * No Operations Test + * @generated + */ + @Test + public void testNoOperations() { + } + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // SupportParticipantOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/SupportTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/SupportTest.java new file mode 100644 index 000000000..113b0f8c4 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/SupportTest.java @@ -0,0 +1,45 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Support' model objects. + * + * + * + * @generated + */ + +public class SupportTest extends CDAValidationTest { + + /** + * No Operations Test + * @generated + */ + @Test + public void testNoOperations() { + } + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // SupportOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/SurgicalDrainsSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/SurgicalDrainsSectionTest.java new file mode 100644 index 000000000..6a4ef0aa5 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/SurgicalDrainsSectionTest.java @@ -0,0 +1,290 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.SurgicalDrainsSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.SurgicalDrainsSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Surgical Drains Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SurgicalDrainsSection#validateSurgicalDrainsSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Surgical Drains Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SurgicalDrainsSection#validateSurgicalDrainsSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Surgical Drains Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SurgicalDrainsSection#validateSurgicalDrainsSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Surgical Drains Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SurgicalDrainsSection#validateSurgicalDrainsSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Surgical Drains Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.SurgicalDrainsSection#validateSurgicalDrainsSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Surgical Drains Section Title}
  • + *
+ *

+ * + * @generated + */ + +public class SurgicalDrainsSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateSurgicalDrainsSectionTemplateId() { + OperationsTestCase validateSurgicalDrainsSectionTemplateIdTestCase = new OperationsTestCase( + "validateSurgicalDrainsSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_SURGICAL_DRAINS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SurgicalDrainsSection target) { + + } + + @Override + protected void updateToPass(SurgicalDrainsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SurgicalDrainsSectionOperations.validateSurgicalDrainsSectionTemplateId( + (SurgicalDrainsSection) objectToTest, diagnostician, map); + } + + }; + + validateSurgicalDrainsSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSurgicalDrainsSectionCode() { + OperationsTestCase validateSurgicalDrainsSectionCodeTestCase = new OperationsTestCase( + "validateSurgicalDrainsSectionCode", + operationsForOCL.getOCLValue("VALIDATE_SURGICAL_DRAINS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SurgicalDrainsSection target) { + + } + + @Override + protected void updateToPass(SurgicalDrainsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SurgicalDrainsSectionOperations.validateSurgicalDrainsSectionCode( + (SurgicalDrainsSection) objectToTest, diagnostician, map); + } + + }; + + validateSurgicalDrainsSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSurgicalDrainsSectionCodeP() { + OperationsTestCase validateSurgicalDrainsSectionCodePTestCase = new OperationsTestCase( + "validateSurgicalDrainsSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_SURGICAL_DRAINS_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SurgicalDrainsSection target) { + + } + + @Override + protected void updateToPass(SurgicalDrainsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SurgicalDrainsSectionOperations.validateSurgicalDrainsSectionCodeP( + (SurgicalDrainsSection) objectToTest, diagnostician, map); + } + + }; + + validateSurgicalDrainsSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSurgicalDrainsSectionText() { + OperationsTestCase validateSurgicalDrainsSectionTextTestCase = new OperationsTestCase( + "validateSurgicalDrainsSectionText", + operationsForOCL.getOCLValue("VALIDATE_SURGICAL_DRAINS_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SurgicalDrainsSection target) { + + } + + @Override + protected void updateToPass(SurgicalDrainsSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SurgicalDrainsSectionOperations.validateSurgicalDrainsSectionText( + (SurgicalDrainsSection) objectToTest, diagnostician, map); + } + + }; + + validateSurgicalDrainsSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSurgicalDrainsSectionTitle() { + OperationsTestCase validateSurgicalDrainsSectionTitleTestCase = new OperationsTestCase( + "validateSurgicalDrainsSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_SURGICAL_DRAINS_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SurgicalDrainsSection target) { + + } + + @Override + protected void updateToPass(SurgicalDrainsSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SurgicalDrainsSectionOperations.validateSurgicalDrainsSectionTitle( + (SurgicalDrainsSection) objectToTest, diagnostician, map); + } + + }; + + validateSurgicalDrainsSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends SurgicalDrainsSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public SurgicalDrainsSection create() { + return ConsolFactory.eINSTANCE.createSurgicalDrainsSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends SurgicalDrainsSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // SurgicalDrainsSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/TextObservationTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/TextObservationTest.java new file mode 100644 index 000000000..097725556 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/TextObservationTest.java @@ -0,0 +1,603 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ConsolPackage; +import org.openhealthtools.mdht.uml.cda.consol.GeneralStatusSection; +import org.openhealthtools.mdht.uml.cda.consol.TextObservation; +import org.openhealthtools.mdht.uml.cda.consol.operations.TextObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * + * A static utility class that provides operations related to 'Text Observation' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.TextObservation#validateTextObservationTextReference(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Text Observation Text Reference}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.TextObservation#validateTextObservationTextReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Text Observation Text Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.TextObservation#validateTextObservationReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Text Observation Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.TextObservation#validateTextObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Text Observation Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.TextObservation#validateTextObservationClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Text Observation Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.TextObservation#validateTextObservationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Text Observation Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.TextObservation#validateTextObservationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Text Observation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.TextObservation#validateTextObservationEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Text Observation Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.TextObservation#validateTextObservationText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Text Observation Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.TextObservation#validateTextObservationValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Text Observation Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.TextObservation#validateTextObservationSOPInstanceObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Text Observation SOP Instance Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.TextObservation#validateTextObservationQuantityMeasurementObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Text Observation Quantity Measurement Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.TextObservation#getSOPInstanceObservations() Get SOP Instance Observations}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.TextObservation#getQuantityMeasurementObservations() Get Quantity Measurement Observations}
  • + *
+ *

+ * + * @generated + */ + +public class TextObservationTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateTextObservationTextReference() { + OperationsTestCase validateTextObservationTextReferenceTestCase = new OperationsTestCase( + "validateTextObservationTextReference", + operationsForOCL.getOCLValue("VALIDATE_TEXT_OBSERVATION_TEXT_REFERENCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(TextObservation target) { + target.init(); + ED txt = DatatypesFactory.eINSTANCE.createED(); + target.setText(txt); + } + + @Override + protected void updateToPass(TextObservation target) { + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL()); + target.setText(txt); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return TextObservationOperations.validateTextObservationTextReference( + (TextObservation) objectToTest, diagnostician, map); + } + + }; + + validateTextObservationTextReferenceTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateTextObservationTextReferenceValue() { + OperationsTestCase validateTextObservationTextReferenceValueTestCase = new OperationsTestCase( + "validateTextObservationTextReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_TEXT_OBSERVATION_TEXT_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(TextObservation target) { + target.init(); + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL()); + target.setText(txt); + } + + @Override + protected void updateToPass(TextObservation target) { + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL("test")); + target.setText(txt); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return TextObservationOperations.validateTextObservationTextReferenceValue( + (TextObservation) objectToTest, diagnostician, map); + } + + }; + + validateTextObservationTextReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateTextObservationReferenceValue() { + OperationsTestCase validateTextObservationReferenceValueTestCase = new NarrativeReferenceTestCase( + "validateTextObservationReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_TEXT_OBSERVATION_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(TextObservation target) { + target.init(); + + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), "", + "No particular health status observed."); + + // add a reference to the section text + target.setText(createEDWithReference("Some sample text", "#1.2.3.4")); + } + + @Override + protected void updateToPass(TextObservation target) { + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), + "1.2.3.4", "No particular health status observed."); + + // add a reference to the section text + target.setText(createEDWithReference("Some sample text", "#1.2.3.4")); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return TextObservationOperations.validateTextObservationReferenceValue( + (TextObservation) objectToTest, diagnostician, map); + } + + }; + + validateTextObservationReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateTextObservationTemplateId() { + OperationsTestCase validateTextObservationTemplateIdTestCase = new OperationsTestCase( + "validateTextObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_TEXT_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(TextObservation target) { + + } + + @Override + protected void updateToPass(TextObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return TextObservationOperations.validateTextObservationTemplateId( + (TextObservation) objectToTest, diagnostician, map); + } + + }; + + validateTextObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateTextObservationClassCode() { + OperationsTestCase validateTextObservationClassCodeTestCase = new OperationsTestCase( + "validateTextObservationClassCode", + operationsForOCL.getOCLValue("VALIDATE_TEXT_OBSERVATION_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(TextObservation target) { + + } + + @Override + protected void updateToPass(TextObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return TextObservationOperations.validateTextObservationClassCode( + (TextObservation) objectToTest, diagnostician, map); + } + + }; + + validateTextObservationClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateTextObservationMoodCode() { + OperationsTestCase validateTextObservationMoodCodeTestCase = new OperationsTestCase( + "validateTextObservationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_TEXT_OBSERVATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(TextObservation target) { + + } + + @Override + protected void updateToPass(TextObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return TextObservationOperations.validateTextObservationMoodCode( + (TextObservation) objectToTest, diagnostician, map); + } + + }; + + validateTextObservationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateTextObservationCode() { + OperationsTestCase validateTextObservationCodeTestCase = new OperationsTestCase( + "validateTextObservationCode", + operationsForOCL.getOCLValue("VALIDATE_TEXT_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(TextObservation target) { + + } + + @Override + protected void updateToPass(TextObservation target) { + target.init(); + + CE cd = DatatypesFactory.eINSTANCE.createCE(); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return TextObservationOperations.validateTextObservationCode( + (TextObservation) objectToTest, diagnostician, map); + } + + }; + + validateTextObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateTextObservationEffectiveTime() { + OperationsTestCase validateTextObservationEffectiveTimeTestCase = new OperationsTestCase( + "validateTextObservationEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_TEXT_OBSERVATION_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(TextObservation target) { + + } + + @Override + protected void updateToPass(TextObservation target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return TextObservationOperations.validateTextObservationEffectiveTime( + (TextObservation) objectToTest, diagnostician, map); + } + + }; + + validateTextObservationEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateTextObservationText() { + OperationsTestCase validateTextObservationTextTestCase = new OperationsTestCase( + "validateTextObservationText", + operationsForOCL.getOCLValue("VALIDATE_TEXT_OBSERVATION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(TextObservation target) { + + } + + @Override + protected void updateToPass(TextObservation target) { + target.init(); + + ED text = DatatypesFactory.eINSTANCE.createED(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return TextObservationOperations.validateTextObservationText( + (TextObservation) objectToTest, diagnostician, map); + } + + }; + + validateTextObservationTextTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateTextObservationValue() { + OperationsTestCase validateTextObservationValueTestCase = new OperationsTestCase( + "validateTextObservationValue", + operationsForOCL.getOCLValue("VALIDATE_TEXT_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(TextObservation target) { + + } + + @Override + protected void updateToPass(TextObservation target) { + target.init(); + + ED value = DatatypesFactory.eINSTANCE.createED(); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return TextObservationOperations.validateTextObservationValue( + (TextObservation) objectToTest, diagnostician, map); + } + + }; + + validateTextObservationValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateTextObservationSOPInstanceObservation() { + OperationsTestCase validateTextObservationSOPInstanceObservationTestCase = new OperationsTestCase( + "validateTextObservationSOPInstanceObservation", + operationsForOCL.getOCLValue("VALIDATE_TEXT_OBSERVATION_SOP_INSTANCE_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(TextObservation target) { + + } + + @Override + protected void updateToPass(TextObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.SPRT); + er.setObservation(ConsolFactory.eINSTANCE.createSOPInstanceObservation()); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return TextObservationOperations.validateTextObservationSOPInstanceObservation( + (TextObservation) objectToTest, diagnostician, map); + } + + }; + + validateTextObservationSOPInstanceObservationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateTextObservationQuantityMeasurementObservation() { + OperationsTestCase validateTextObservationQuantityMeasurementObservationTestCase = new OperationsTestCase( + "validateTextObservationQuantityMeasurementObservation", + operationsForOCL.getOCLValue("VALIDATE_TEXT_OBSERVATION_QUANTITY_MEASUREMENT_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(TextObservation target) { + + } + + @Override + protected void updateToPass(TextObservation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.SPRT); + er.setObservation(ConsolFactory.eINSTANCE.createQuantityMeasurementObservation()); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return TextObservationOperations.validateTextObservationQuantityMeasurementObservation( + (TextObservation) objectToTest, diagnostician, map); + } + + }; + + validateTextObservationQuantityMeasurementObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetSOPInstanceObservations() { + + TextObservation target = objectFactory.create(); + target.getSOPInstanceObservations(); + + } + + /** + * + * @generated + */ + @Test + public void testGetQuantityMeasurementObservations() { + + TextObservation target = objectFactory.create(); + target.getQuantityMeasurementObservations(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends TextObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public TextObservation create() { + return ConsolFactory.eINSTANCE.createTextObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends TextObservationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // TextObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/TobaccoUseTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/TobaccoUseTest.java new file mode 100644 index 000000000..3c346381a --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/TobaccoUseTest.java @@ -0,0 +1,490 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.TobaccoUse; +import org.openhealthtools.mdht.uml.cda.consol.operations.TobaccoUseOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; + +/** + * + * A static utility class that provides operations related to 'Tobacco Use' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.TobaccoUse#validateTobaccoUseEffectiveTimeLow(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Tobacco Use Effective Time Low}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.TobaccoUse#validateTobaccoUseTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Tobacco Use Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.TobaccoUse#validateTobaccoUseClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Tobacco Use Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.TobaccoUse#validateTobaccoUseMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Tobacco Use Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.TobaccoUse#validateTobaccoUseCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Tobacco Use Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.TobaccoUse#validateTobaccoUseCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Tobacco Use Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.TobaccoUse#validateTobaccoUseEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Tobacco Use Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.TobaccoUse#validateTobaccoUseStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Tobacco Use Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.TobaccoUse#validateTobaccoUseStatusCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Tobacco Use Status Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.TobaccoUse#validateTobaccoUseValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Tobacco Use Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.TobaccoUse#validateTobaccoUseValueP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Tobacco Use Value P}
  • + *
+ *

+ * + * @generated + */ + +public class TobaccoUseTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateTobaccoUseEffectiveTimeLow() { + OperationsTestCase validateTobaccoUseEffectiveTimeLowTestCase = new OperationsTestCase( + "validateTobaccoUseEffectiveTimeLow", + operationsForOCL.getOCLValue("VALIDATE_TOBACCO_USE_EFFECTIVE_TIME_LOW__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(TobaccoUse target) { + target.init(); + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + } + + @Override + protected void updateToPass(TobaccoUse target) { + IVL_TS ts = target.getEffectiveTime(); + ts.setLow(DatatypesFactory.eINSTANCE.createIVXB_TS()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return TobaccoUseOperations.validateTobaccoUseEffectiveTimeLow( + (TobaccoUse) objectToTest, diagnostician, map); + } + + }; + + validateTobaccoUseEffectiveTimeLowTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateTobaccoUseTemplateId() { + OperationsTestCase validateTobaccoUseTemplateIdTestCase = new OperationsTestCase( + "validateTobaccoUseTemplateId", + operationsForOCL.getOCLValue("VALIDATE_TOBACCO_USE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(TobaccoUse target) { + + } + + @Override + protected void updateToPass(TobaccoUse target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return TobaccoUseOperations.validateTobaccoUseTemplateId((TobaccoUse) objectToTest, diagnostician, map); + } + + }; + + validateTobaccoUseTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateTobaccoUseClassCode() { + OperationsTestCase validateTobaccoUseClassCodeTestCase = new OperationsTestCase( + "validateTobaccoUseClassCode", + operationsForOCL.getOCLValue("VALIDATE_TOBACCO_USE_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(TobaccoUse target) { + + } + + @Override + protected void updateToPass(TobaccoUse target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return TobaccoUseOperations.validateTobaccoUseClassCode((TobaccoUse) objectToTest, diagnostician, map); + } + + }; + + validateTobaccoUseClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateTobaccoUseMoodCode() { + OperationsTestCase validateTobaccoUseMoodCodeTestCase = new OperationsTestCase( + "validateTobaccoUseMoodCode", + operationsForOCL.getOCLValue("VALIDATE_TOBACCO_USE_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(TobaccoUse target) { + + } + + @Override + protected void updateToPass(TobaccoUse target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return TobaccoUseOperations.validateTobaccoUseMoodCode((TobaccoUse) objectToTest, diagnostician, map); + } + + }; + + validateTobaccoUseMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateTobaccoUseCodeP() { + OperationsTestCase validateTobaccoUseCodePTestCase = new OperationsTestCase( + "validateTobaccoUseCodeP", + operationsForOCL.getOCLValue("VALIDATE_TOBACCO_USE_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(TobaccoUse target) { + + } + + @Override + protected void updateToPass(TobaccoUse target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return TobaccoUseOperations.validateTobaccoUseCodeP((TobaccoUse) objectToTest, diagnostician, map); + } + + }; + + validateTobaccoUseCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateTobaccoUseCode() { + OperationsTestCase validateTobaccoUseCodeTestCase = new OperationsTestCase( + "validateTobaccoUseCode", + operationsForOCL.getOCLValue("VALIDATE_TOBACCO_USE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(TobaccoUse target) { + + } + + @Override + protected void updateToPass(TobaccoUse target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return TobaccoUseOperations.validateTobaccoUseCode((TobaccoUse) objectToTest, diagnostician, map); + } + + }; + + validateTobaccoUseCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateTobaccoUseEffectiveTime() { + OperationsTestCase validateTobaccoUseEffectiveTimeTestCase = new OperationsTestCase( + "validateTobaccoUseEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_TOBACCO_USE_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(TobaccoUse target) { + + } + + @Override + protected void updateToPass(TobaccoUse target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return TobaccoUseOperations.validateTobaccoUseEffectiveTime( + (TobaccoUse) objectToTest, diagnostician, map); + } + + }; + + validateTobaccoUseEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateTobaccoUseStatusCode() { + OperationsTestCase validateTobaccoUseStatusCodeTestCase = new OperationsTestCase( + "validateTobaccoUseStatusCode", + operationsForOCL.getOCLValue("VALIDATE_TOBACCO_USE_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(TobaccoUse target) { + + } + + @Override + protected void updateToPass(TobaccoUse target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return TobaccoUseOperations.validateTobaccoUseStatusCode((TobaccoUse) objectToTest, diagnostician, map); + } + + }; + + validateTobaccoUseStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateTobaccoUseStatusCodeP() { + OperationsTestCase validateTobaccoUseStatusCodePTestCase = new OperationsTestCase( + "validateTobaccoUseStatusCodeP", + operationsForOCL.getOCLValue("VALIDATE_TOBACCO_USE_STATUS_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(TobaccoUse target) { + + } + + @Override + protected void updateToPass(TobaccoUse target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return TobaccoUseOperations.validateTobaccoUseStatusCodeP((TobaccoUse) objectToTest, diagnostician, map); + } + + }; + + validateTobaccoUseStatusCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateTobaccoUseValue() { + OperationsTestCase validateTobaccoUseValueTestCase = new OperationsTestCase( + "validateTobaccoUseValue", + operationsForOCL.getOCLValue("VALIDATE_TOBACCO_USE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(TobaccoUse target) { + + } + + @Override + protected void updateToPass(TobaccoUse target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD("", "2.16.840.1.113883.6.96", "", ""); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return TobaccoUseOperations.validateTobaccoUseValue((TobaccoUse) objectToTest, diagnostician, map); + } + + }; + + validateTobaccoUseValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateTobaccoUseValueP() { + OperationsTestCase validateTobaccoUseValuePTestCase = new OperationsTestCase( + "validateTobaccoUseValueP", + operationsForOCL.getOCLValue("VALIDATE_TOBACCO_USE_VALUE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(TobaccoUse target) { + + } + + @Override + protected void updateToPass(TobaccoUse target) { + target.init(); + CD value = DatatypesFactory.eINSTANCE.createCD("", "2.16.840.1.113883.6.96", "", ""); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return TobaccoUseOperations.validateTobaccoUseValueP((TobaccoUse) objectToTest, diagnostician, map); + } + + }; + + validateTobaccoUseValuePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends TobaccoUseOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public TobaccoUse create() { + return ConsolFactory.eINSTANCE.createTobaccoUse(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends TobaccoUseOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // TobaccoUseOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/UnstructuredDocumentTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/UnstructuredDocumentTest.java new file mode 100644 index 000000000..f833aade8 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/UnstructuredDocumentTest.java @@ -0,0 +1,767 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.AssignedAuthor; +import org.openhealthtools.mdht.uml.cda.AssignedCustodian; +import org.openhealthtools.mdht.uml.cda.Author; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Component2; +import org.openhealthtools.mdht.uml.cda.Custodian; +import org.openhealthtools.mdht.uml.cda.CustodianOrganization; +import org.openhealthtools.mdht.uml.cda.PatientRole; +import org.openhealthtools.mdht.uml.cda.RecordTarget; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.UnstructuredDocument; +import org.openhealthtools.mdht.uml.cda.consol.operations.UnstructuredDocumentOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; + +/** + * + * A static utility class that provides operations related to 'Unstructured Document' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.UnstructuredDocument#validateUnstructuredDocumentTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Unstructured Document Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.UnstructuredDocument#validateUnstructuredDocumentRecordTarget(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Unstructured Document Record Target}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.UnstructuredDocument#validateUnstructuredDocumentAuthor(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Unstructured Document Author}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.UnstructuredDocument#validateUnstructuredDocumentComponent(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Unstructured Document Component}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.UnstructuredDocument#validateUnstructuredDocumentCustodian(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Unstructured Document Custodian}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.UnstructuredDocument#validateUnstructuredDocumentRecordTargetPatientRole2Id(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Unstructured Document Record Target Patient Role2 Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.UnstructuredDocument#validateUnstructuredDocumentRecordTargetPatientRole2(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Unstructured Document Record Target Patient Role2}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.UnstructuredDocument#validateUnstructuredDocumentAuthorAssignedAuthor2Addr(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Unstructured Document Author Assigned Author2 Addr}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.UnstructuredDocument#validateUnstructuredDocumentAuthorAssignedAuthor2Telecom(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Unstructured Document Author Assigned Author2 Telecom}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.UnstructuredDocument#validateUnstructuredDocumentAuthorAssignedAuthor2(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Unstructured Document Author Assigned Author2}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.UnstructuredDocument#validateUnstructuredDocumentCustodianAssignedCustodian3CustodianOrganizationAddr(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Unstructured Document Custodian Assigned Custodian3 Custodian Organization Addr}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.UnstructuredDocument#validateUnstructuredDocumentCustodianAssignedCustodian3CustodianOrganizationId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Unstructured Document Custodian Assigned Custodian3 Custodian Organization Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.UnstructuredDocument#validateUnstructuredDocumentCustodianAssignedCustodian3CustodianOrganizationName(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Unstructured Document Custodian Assigned Custodian3 Custodian Organization Name}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.UnstructuredDocument#validateUnstructuredDocumentCustodianAssignedCustodian3CustodianOrganizationTelecom(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Unstructured Document Custodian Assigned Custodian3 Custodian Organization Telecom}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.UnstructuredDocument#validateUnstructuredDocumentCustodianAssignedCustodian3CustodianOrganization(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Unstructured Document Custodian Assigned Custodian3 Custodian Organization}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.UnstructuredDocument#validateUnstructuredDocumentCustodianAssignedCustodian2(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Unstructured Document Custodian Assigned Custodian2}
  • + *
+ *

+ * + * @generated + */ + +public class UnstructuredDocumentTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateUnstructuredDocumentTemplateId() { + OperationsTestCase validateUnstructuredDocumentTemplateIdTestCase = new OperationsTestCase( + "validateUnstructuredDocumentTemplateId", + operationsForOCL.getOCLValue("VALIDATE_UNSTRUCTURED_DOCUMENT_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(UnstructuredDocument target) { + + } + + @Override + protected void updateToPass(UnstructuredDocument target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return UnstructuredDocumentOperations.validateUnstructuredDocumentTemplateId( + (UnstructuredDocument) objectToTest, diagnostician, map); + } + + }; + + validateUnstructuredDocumentTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateUnstructuredDocumentRecordTarget() { + OperationsTestCase validateUnstructuredDocumentRecordTargetTestCase = new OperationsTestCase( + "validateUnstructuredDocumentRecordTarget", + operationsForOCL.getOCLValue("VALIDATE_UNSTRUCTURED_DOCUMENT_RECORD_TARGET__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(UnstructuredDocument target) { + target.init(); + + } + + @Override + protected void updateToPass(UnstructuredDocument target) { + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + target.getRecordTargets().add(rt); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return UnstructuredDocumentOperations.validateUnstructuredDocumentRecordTarget( + (UnstructuredDocument) objectToTest, diagnostician, map); + } + + }; + + validateUnstructuredDocumentRecordTargetTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateUnstructuredDocumentAuthor() { + OperationsTestCase validateUnstructuredDocumentAuthorTestCase = new OperationsTestCase( + "validateUnstructuredDocumentAuthor", + operationsForOCL.getOCLValue("VALIDATE_UNSTRUCTURED_DOCUMENT_AUTHOR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(UnstructuredDocument target) { + target.init(); + } + + @Override + protected void updateToPass(UnstructuredDocument target) { + Author author = CDAFactory.eINSTANCE.createAuthor(); + target.getAuthors().add(author); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return UnstructuredDocumentOperations.validateUnstructuredDocumentAuthor( + (UnstructuredDocument) objectToTest, diagnostician, map); + } + + }; + + validateUnstructuredDocumentAuthorTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateUnstructuredDocumentComponent() { + OperationsTestCase validateUnstructuredDocumentComponentTestCase = new OperationsTestCase( + "validateUnstructuredDocumentComponent", + operationsForOCL.getOCLValue("VALIDATE_UNSTRUCTURED_DOCUMENT_COMPONENT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(UnstructuredDocument target) { + target.init(); + } + + @Override + protected void updateToPass(UnstructuredDocument target) { + + Component2 value = CDAFactory.eINSTANCE.createComponent2(); + + target.setComponent(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return UnstructuredDocumentOperations.validateUnstructuredDocumentComponent( + (UnstructuredDocument) objectToTest, diagnostician, map); + } + + }; + + validateUnstructuredDocumentComponentTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateUnstructuredDocumentCustodian() { + OperationsTestCase validateUnstructuredDocumentCustodianTestCase = new OperationsTestCase( + "validateUnstructuredDocumentCustodian", + operationsForOCL.getOCLValue("VALIDATE_UNSTRUCTURED_DOCUMENT_CUSTODIAN__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(UnstructuredDocument target) { + + } + + @Override + protected void updateToPass(UnstructuredDocument target) { + target.init(); + Custodian custodian = CDAFactory.eINSTANCE.createCustodian(); + target.setCustodian(custodian); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return UnstructuredDocumentOperations.validateUnstructuredDocumentCustodian( + (UnstructuredDocument) objectToTest, diagnostician, map); + } + + }; + + validateUnstructuredDocumentCustodianTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateUnstructuredDocumentRecordTargetPatientRole2Id() { + OperationsTestCase validateUnstructuredDocumentRecordTargetPatientRole2IdTestCase = new OperationsTestCase( + "validateUnstructuredDocumentRecordTargetPatientRole2Id", + operationsForOCL.getOCLValue("VALIDATE_UNSTRUCTURED_DOCUMENT_RECORD_TARGET_PATIENT_ROLE2_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(UnstructuredDocument target) { + target.init(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected void updateToPass(UnstructuredDocument target) { + target.getRecordTargets().clear(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + pr.getIds().add(DatatypesFactory.eINSTANCE.createII()); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return UnstructuredDocumentOperations.validateUnstructuredDocumentRecordTargetPatientRole2Id( + (UnstructuredDocument) objectToTest, diagnostician, map); + } + + }; + + validateUnstructuredDocumentRecordTargetPatientRole2IdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateUnstructuredDocumentRecordTargetPatientRole2() { + OperationsTestCase validateUnstructuredDocumentRecordTargetPatientRole2TestCase = new OperationsTestCase( + "validateUnstructuredDocumentRecordTargetPatientRole2", + operationsForOCL.getOCLValue("VALIDATE_UNSTRUCTURED_DOCUMENT_RECORD_TARGET_PATIENT_ROLE2__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(UnstructuredDocument target) { + target.init(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + target.getRecordTargets().add(rt); + } + + @Override + protected void updateToPass(UnstructuredDocument target) { + target.getRecordTargets().clear(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + pr.getIds().add(DatatypesFactory.eINSTANCE.createII()); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return UnstructuredDocumentOperations.validateUnstructuredDocumentRecordTargetPatientRole2( + (UnstructuredDocument) objectToTest, diagnostician, map); + } + + }; + + validateUnstructuredDocumentRecordTargetPatientRole2TestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateUnstructuredDocumentAuthorAssignedAuthor2Addr() { + OperationsTestCase validateUnstructuredDocumentAuthorAssignedAuthor2AddrTestCase = new OperationsTestCase( + "validateUnstructuredDocumentAuthorAssignedAuthor2Addr", + operationsForOCL.getOCLValue("VALIDATE_UNSTRUCTURED_DOCUMENT_AUTHOR_ASSIGNED_AUTHOR2_ADDR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(UnstructuredDocument target) { + target.init(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + + author.setAssignedAuthor(aa); + target.getAuthors().add(author); + } + + @Override + protected void updateToPass(UnstructuredDocument target) { + + target.getAuthors().clear(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + aa.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + author.setAssignedAuthor(aa); + target.getAuthors().add(author); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return UnstructuredDocumentOperations.validateUnstructuredDocumentAuthorAssignedAuthor2Addr( + (UnstructuredDocument) objectToTest, diagnostician, map); + } + + }; + + validateUnstructuredDocumentAuthorAssignedAuthor2AddrTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateUnstructuredDocumentAuthorAssignedAuthor2Telecom() { + OperationsTestCase validateUnstructuredDocumentAuthorAssignedAuthor2TelecomTestCase = new OperationsTestCase( + "validateUnstructuredDocumentAuthorAssignedAuthor2Telecom", + operationsForOCL.getOCLValue("VALIDATE_UNSTRUCTURED_DOCUMENT_AUTHOR_ASSIGNED_AUTHOR2_TELECOM__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(UnstructuredDocument target) { + target.init(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + author.setAssignedAuthor(aa); + target.getAuthors().add(author); + } + + @Override + protected void updateToPass(UnstructuredDocument target) { + target.getAuthors().clear(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + aa.getTelecoms().add(DatatypesFactory.eINSTANCE.createTEL()); + author.setAssignedAuthor(aa); + target.getAuthors().add(author); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return UnstructuredDocumentOperations.validateUnstructuredDocumentAuthorAssignedAuthor2Telecom( + (UnstructuredDocument) objectToTest, diagnostician, map); + } + + }; + + validateUnstructuredDocumentAuthorAssignedAuthor2TelecomTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateUnstructuredDocumentAuthorAssignedAuthor2() { + OperationsTestCase validateUnstructuredDocumentAuthorAssignedAuthor2TestCase = new OperationsTestCase( + "validateUnstructuredDocumentAuthorAssignedAuthor2", + operationsForOCL.getOCLValue("VALIDATE_UNSTRUCTURED_DOCUMENT_AUTHOR_ASSIGNED_AUTHOR2__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(UnstructuredDocument target) { + target.init(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + target.getAuthors().add(author); + } + + @Override + protected void updateToPass(UnstructuredDocument target) { + target.getAuthors().clear(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + author.setAssignedAuthor(aa); + target.getAuthors().add(author); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return UnstructuredDocumentOperations.validateUnstructuredDocumentAuthorAssignedAuthor2( + (UnstructuredDocument) objectToTest, diagnostician, map); + } + + }; + + validateUnstructuredDocumentAuthorAssignedAuthor2TestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateUnstructuredDocumentCustodianAssignedCustodian3CustodianOrganizationAddr() { + OperationsTestCase validateUnstructuredDocumentCustodianAssignedCustodian3CustodianOrganizationAddrTestCase = new OperationsTestCase( + "validateUnstructuredDocumentCustodianAssignedCustodian3CustodianOrganizationAddr", + operationsForOCL.getOCLValue("VALIDATE_UNSTRUCTURED_DOCUMENT_CUSTODIAN_ASSIGNED_CUSTODIAN3_CUSTODIAN_ORGANIZATION_ADDR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(UnstructuredDocument target) { + target.init(); + Custodian custodian = CDAFactory.eINSTANCE.createCustodian(); + AssignedCustodian ac = CDAFactory.eINSTANCE.createAssignedCustodian(); + CustodianOrganization co = CDAFactory.eINSTANCE.createCustodianOrganization(); + ac.setRepresentedCustodianOrganization(co); + custodian.setAssignedCustodian(ac); + target.setCustodian(custodian); + } + + @Override + protected void updateToPass(UnstructuredDocument target) { + target.getCustodian().getAssignedCustodian().getRepresentedCustodianOrganization().setAddr( + DatatypesFactory.eINSTANCE.createAD()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return UnstructuredDocumentOperations.validateUnstructuredDocumentCustodianAssignedCustodian3CustodianOrganizationAddr( + (UnstructuredDocument) objectToTest, diagnostician, map); + } + + }; + + validateUnstructuredDocumentCustodianAssignedCustodian3CustodianOrganizationAddrTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateUnstructuredDocumentCustodianAssignedCustodian3CustodianOrganizationId() { + OperationsTestCase validateUnstructuredDocumentCustodianAssignedCustodian3CustodianOrganizationIdTestCase = new OperationsTestCase( + "validateUnstructuredDocumentCustodianAssignedCustodian3CustodianOrganizationId", + operationsForOCL.getOCLValue("VALIDATE_UNSTRUCTURED_DOCUMENT_CUSTODIAN_ASSIGNED_CUSTODIAN3_CUSTODIAN_ORGANIZATION_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(UnstructuredDocument target) { + target.init(); + Custodian custodian = CDAFactory.eINSTANCE.createCustodian(); + AssignedCustodian ac = CDAFactory.eINSTANCE.createAssignedCustodian(); + CustodianOrganization co = CDAFactory.eINSTANCE.createCustodianOrganization(); + ac.setRepresentedCustodianOrganization(co); + custodian.setAssignedCustodian(ac); + target.setCustodian(custodian); + } + + @Override + protected void updateToPass(UnstructuredDocument target) { + target.getCustodian().getAssignedCustodian().getRepresentedCustodianOrganization().getIds().add( + DatatypesFactory.eINSTANCE.createII()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return UnstructuredDocumentOperations.validateUnstructuredDocumentCustodianAssignedCustodian3CustodianOrganizationId( + (UnstructuredDocument) objectToTest, diagnostician, map); + } + + }; + + validateUnstructuredDocumentCustodianAssignedCustodian3CustodianOrganizationIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateUnstructuredDocumentCustodianAssignedCustodian3CustodianOrganizationName() { + OperationsTestCase validateUnstructuredDocumentCustodianAssignedCustodian3CustodianOrganizationNameTestCase = new OperationsTestCase( + "validateUnstructuredDocumentCustodianAssignedCustodian3CustodianOrganizationName", + operationsForOCL.getOCLValue("VALIDATE_UNSTRUCTURED_DOCUMENT_CUSTODIAN_ASSIGNED_CUSTODIAN3_CUSTODIAN_ORGANIZATION_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(UnstructuredDocument target) { + target.init(); + Custodian custodian = CDAFactory.eINSTANCE.createCustodian(); + AssignedCustodian ac = CDAFactory.eINSTANCE.createAssignedCustodian(); + CustodianOrganization co = CDAFactory.eINSTANCE.createCustodianOrganization(); + ac.setRepresentedCustodianOrganization(co); + custodian.setAssignedCustodian(ac); + target.setCustodian(custodian); + } + + @Override + protected void updateToPass(UnstructuredDocument target) { + target.getCustodian().getAssignedCustodian().getRepresentedCustodianOrganization().setName( + DatatypesFactory.eINSTANCE.createON()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return UnstructuredDocumentOperations.validateUnstructuredDocumentCustodianAssignedCustodian3CustodianOrganizationName( + (UnstructuredDocument) objectToTest, diagnostician, map); + } + + }; + + validateUnstructuredDocumentCustodianAssignedCustodian3CustodianOrganizationNameTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateUnstructuredDocumentCustodianAssignedCustodian3CustodianOrganizationTelecom() { + OperationsTestCase validateUnstructuredDocumentCustodianAssignedCustodian3CustodianOrganizationTelecomTestCase = new OperationsTestCase( + "validateUnstructuredDocumentCustodianAssignedCustodian3CustodianOrganizationTelecom", + operationsForOCL.getOCLValue("VALIDATE_UNSTRUCTURED_DOCUMENT_CUSTODIAN_ASSIGNED_CUSTODIAN3_CUSTODIAN_ORGANIZATION_TELECOM__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(UnstructuredDocument target) { + target.init(); + Custodian custodian = CDAFactory.eINSTANCE.createCustodian(); + AssignedCustodian ac = CDAFactory.eINSTANCE.createAssignedCustodian(); + CustodianOrganization co = CDAFactory.eINSTANCE.createCustodianOrganization(); + ac.setRepresentedCustodianOrganization(co); + custodian.setAssignedCustodian(ac); + target.setCustodian(custodian); + } + + @Override + protected void updateToPass(UnstructuredDocument target) { + target.getCustodian().getAssignedCustodian().getRepresentedCustodianOrganization().setTelecom( + DatatypesFactory.eINSTANCE.createTEL()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return UnstructuredDocumentOperations.validateUnstructuredDocumentCustodianAssignedCustodian3CustodianOrganizationTelecom( + (UnstructuredDocument) objectToTest, diagnostician, map); + } + + }; + + validateUnstructuredDocumentCustodianAssignedCustodian3CustodianOrganizationTelecomTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateUnstructuredDocumentCustodianAssignedCustodian3CustodianOrganization() { + OperationsTestCase validateUnstructuredDocumentCustodianAssignedCustodian3CustodianOrganizationTestCase = new OperationsTestCase( + "validateUnstructuredDocumentCustodianAssignedCustodian3CustodianOrganization", + operationsForOCL.getOCLValue("VALIDATE_UNSTRUCTURED_DOCUMENT_CUSTODIAN_ASSIGNED_CUSTODIAN3_CUSTODIAN_ORGANIZATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(UnstructuredDocument target) { + target.init(); + Custodian custodian = CDAFactory.eINSTANCE.createCustodian(); + AssignedCustodian ac = CDAFactory.eINSTANCE.createAssignedCustodian(); + + custodian.setAssignedCustodian(ac); + target.setCustodian(custodian); + } + + @Override + protected void updateToPass(UnstructuredDocument target) { + Custodian custodian = CDAFactory.eINSTANCE.createCustodian(); + AssignedCustodian ac = CDAFactory.eINSTANCE.createAssignedCustodian(); + CustodianOrganization co = CDAFactory.eINSTANCE.createCustodianOrganization(); + ac.setRepresentedCustodianOrganization(co); + custodian.setAssignedCustodian(ac); + target.setCustodian(custodian); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return UnstructuredDocumentOperations.validateUnstructuredDocumentCustodianAssignedCustodian3CustodianOrganization( + (UnstructuredDocument) objectToTest, diagnostician, map); + } + + }; + + validateUnstructuredDocumentCustodianAssignedCustodian3CustodianOrganizationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateUnstructuredDocumentCustodianAssignedCustodian2() { + OperationsTestCase validateUnstructuredDocumentCustodianAssignedCustodian2TestCase = new OperationsTestCase( + "validateUnstructuredDocumentCustodianAssignedCustodian2", + operationsForOCL.getOCLValue("VALIDATE_UNSTRUCTURED_DOCUMENT_CUSTODIAN_ASSIGNED_CUSTODIAN2__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(UnstructuredDocument target) { + target.init(); + Custodian custodian = CDAFactory.eINSTANCE.createCustodian(); + target.setCustodian(custodian); + } + + @Override + protected void updateToPass(UnstructuredDocument target) { + AssignedCustodian ac = CDAFactory.eINSTANCE.createAssignedCustodian(); + CustodianOrganization co = CDAFactory.eINSTANCE.createCustodianOrganization(); + ac.setRepresentedCustodianOrganization(co); + target.getCustodian().setAssignedCustodian(ac); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return UnstructuredDocumentOperations.validateUnstructuredDocumentCustodianAssignedCustodian2( + (UnstructuredDocument) objectToTest, diagnostician, map); + } + + }; + + validateUnstructuredDocumentCustodianAssignedCustodian2TestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends UnstructuredDocumentOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public UnstructuredDocument create() { + return ConsolFactory.eINSTANCE.createUnstructuredDocument(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends UnstructuredDocumentOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // UnstructuredDocumentOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/VitalSignObservationTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/VitalSignObservationTest.java new file mode 100644 index 000000000..aa5ce6ce7 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/VitalSignObservationTest.java @@ -0,0 +1,755 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ConsolPackage; +import org.openhealthtools.mdht.uml.cda.consol.GeneralStatusSection; +import org.openhealthtools.mdht.uml.cda.consol.VitalSignObservation; +import org.openhealthtools.mdht.uml.cda.consol.operations.VitalSignObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; + +/** + * + * A static utility class that provides operations related to 'Vital Sign Observation' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.VitalSignObservation#validateVitalSignObservationTextReference(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Sign Observation Text Reference}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.VitalSignObservation#validateVitalSignObservationReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Sign Observation Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.VitalSignObservation#validateVitalSignObservationTextReferenceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Sign Observation Text Reference Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.VitalSignObservation#validateVitalSignObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Sign Observation Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.VitalSignObservation#validateVitalSignObservationClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Sign Observation Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.VitalSignObservation#validateVitalSignObservationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Sign Observation Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.VitalSignObservation#validateVitalSignObservationId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Sign Observation Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.VitalSignObservation#validateVitalSignObservationCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Sign Observation Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.VitalSignObservation#validateVitalSignObservationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Sign Observation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.VitalSignObservation#validateVitalSignObservationStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Sign Observation Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.VitalSignObservation#validateVitalSignObservationEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Sign Observation Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.VitalSignObservation#validateVitalSignObservationValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Sign Observation Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.VitalSignObservation#validateVitalSignObservationInterpretationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Sign Observation Interpretation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.VitalSignObservation#validateVitalSignObservationMethodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Sign Observation Method Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.VitalSignObservation#validateVitalSignObservationTargetSiteCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Sign Observation Target Site Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.VitalSignObservation#validateVitalSignObservationText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Sign Observation Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.VitalSignObservation#validateVitalSignObservationAuthor(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Sign Observation Author}
  • + *
+ *

+ * + * @generated + */ + +public class VitalSignObservationTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateVitalSignObservationTextReference() { + OperationsTestCase validateVitalSignObservationTextReferenceTestCase = new OperationsTestCase( + "validateVitalSignObservationTextReference", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGN_OBSERVATION_TEXT_REFERENCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignObservation target) { + target.init(); + ED txt = DatatypesFactory.eINSTANCE.createED(); + target.setText(txt); + } + + @Override + protected void updateToPass(VitalSignObservation target) { + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL()); + target.setText(txt); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignObservationOperations.validateVitalSignObservationTextReference( + (VitalSignObservation) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignObservationTextReferenceTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateVitalSignObservationReferenceValue() { + OperationsTestCase validateVitalSignObservationReferenceValueTestCase = new OperationsTestCase( + "validateVitalSignObservationReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGN_OBSERVATION_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignObservation target) { + target.init(); + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL()); + target.setText(txt); + } + + @Override + protected void updateToPass(VitalSignObservation target) { + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL("test")); + target.setText(txt); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignObservationOperations.validateVitalSignObservationReferenceValue( + (VitalSignObservation) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignObservationReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateVitalSignObservationTextReferenceValue() { + OperationsTestCase validateVitalSignObservationTextReferenceValueTestCase = new NarrativeReferenceTestCase( + "validateVitalSignObservationTextReferenceValue", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGN_OBSERVATION_TEXT_REFERENCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignObservation target) { + target.init(); + + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), "", + "No particular health status observed."); + + // add a reference to the section text + target.setText(createEDWithReference("Some sample text", "#1.2.3.4")); + } + + @Override + protected void updateToPass(VitalSignObservation target) { + // add the observation to a section, as required by the constraint, that has text that we can reference + addText( + createSectionForClinicalStatement(target, ConsolPackage.eINSTANCE, GeneralStatusSection.class), + "1.2.3.4", "No particular health status observed."); + + // add a reference to the section text + target.setText(createEDWithReference("Some sample text", "#1.2.3.4")); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignObservationOperations.validateVitalSignObservationTextReferenceValue( + (VitalSignObservation) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignObservationTextReferenceValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateVitalSignObservationTemplateId() { + OperationsTestCase validateVitalSignObservationTemplateIdTestCase = new OperationsTestCase( + "validateVitalSignObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGN_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignObservation target) { + + } + + @Override + protected void updateToPass(VitalSignObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignObservationOperations.validateVitalSignObservationTemplateId( + (VitalSignObservation) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateVitalSignObservationClassCode() { + OperationsTestCase validateVitalSignObservationClassCodeTestCase = new OperationsTestCase( + "validateVitalSignObservationClassCode", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGN_OBSERVATION_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignObservation target) { + + } + + @Override + protected void updateToPass(VitalSignObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignObservationOperations.validateVitalSignObservationClassCode( + (VitalSignObservation) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignObservationClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateVitalSignObservationMoodCode() { + OperationsTestCase validateVitalSignObservationMoodCodeTestCase = new OperationsTestCase( + "validateVitalSignObservationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGN_OBSERVATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignObservation target) { + + } + + @Override + protected void updateToPass(VitalSignObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignObservationOperations.validateVitalSignObservationMoodCode( + (VitalSignObservation) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignObservationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateVitalSignObservationId() { + OperationsTestCase validateVitalSignObservationIdTestCase = new OperationsTestCase( + "validateVitalSignObservationId", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGN_OBSERVATION_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignObservation target) { + + } + + @Override + protected void updateToPass(VitalSignObservation target) { + target.init(); + + II ii = DatatypesFactory.eINSTANCE.createII(); + target.getIds().add(ii); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignObservationOperations.validateVitalSignObservationId( + (VitalSignObservation) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignObservationIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateVitalSignObservationCodeP() { + OperationsTestCase validateVitalSignObservationCodePTestCase = new OperationsTestCase( + "validateVitalSignObservationCodeP", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGN_OBSERVATION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignObservation target) { + + } + + @Override + protected void updateToPass(VitalSignObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignObservationOperations.validateVitalSignObservationCodeP( + (VitalSignObservation) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignObservationCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateVitalSignObservationCode() { + OperationsTestCase validateVitalSignObservationCodeTestCase = new OperationsTestCase( + "validateVitalSignObservationCode", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGN_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignObservation target) { + + } + + @Override + protected void updateToPass(VitalSignObservation target) { + target.init(); + + CD cd = DatatypesFactory.eINSTANCE.createCD("8310-5", "2.16.840.1.113883.6.1", "", ""); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignObservationOperations.validateVitalSignObservationCode( + (VitalSignObservation) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateVitalSignObservationStatusCode() { + OperationsTestCase validateVitalSignObservationStatusCodeTestCase = new OperationsTestCase( + "validateVitalSignObservationStatusCode", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGN_OBSERVATION_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignObservation target) { + + } + + @Override + protected void updateToPass(VitalSignObservation target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignObservationOperations.validateVitalSignObservationStatusCode( + (VitalSignObservation) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignObservationStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateVitalSignObservationEffectiveTime() { + OperationsTestCase validateVitalSignObservationEffectiveTimeTestCase = new OperationsTestCase( + "validateVitalSignObservationEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGN_OBSERVATION_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignObservation target) { + + } + + @Override + protected void updateToPass(VitalSignObservation target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignObservationOperations.validateVitalSignObservationEffectiveTime( + (VitalSignObservation) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignObservationEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateVitalSignObservationValue() { + OperationsTestCase validateVitalSignObservationValueTestCase = new OperationsTestCase( + "validateVitalSignObservationValue", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGN_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignObservation target) { + + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD(); + target.getValues().add(value); + } + + @Override + protected void updateToPass(VitalSignObservation target) { + + target.getValues().clear(); + + target.getValues().add(DatatypesFactory.eINSTANCE.createPQ()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignObservationOperations.validateVitalSignObservationValue( + (VitalSignObservation) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignObservationValueTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateVitalSignObservationInterpretationCode() { + OperationsTestCase validateVitalSignObservationInterpretationCodeTestCase = new OperationsTestCase( + "validateVitalSignObservationInterpretationCode", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGN_OBSERVATION_INTERPRETATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignObservation target) { + + } + + @Override + protected void updateToPass(VitalSignObservation target) { + target.init(); + target.getInterpretationCodes().add(DatatypesFactory.eINSTANCE.createCE()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignObservationOperations.validateVitalSignObservationInterpretationCode( + (VitalSignObservation) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignObservationInterpretationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateVitalSignObservationMethodCode() { + OperationsTestCase validateVitalSignObservationMethodCodeTestCase = new OperationsTestCase( + "validateVitalSignObservationMethodCode", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGN_OBSERVATION_METHOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignObservation target) { + + } + + @Override + protected void updateToPass(VitalSignObservation target) { + target.init(); + + target.getMethodCodes().add(DatatypesFactory.eINSTANCE.createCE()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignObservationOperations.validateVitalSignObservationMethodCode( + (VitalSignObservation) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignObservationMethodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateVitalSignObservationTargetSiteCode() { + OperationsTestCase validateVitalSignObservationTargetSiteCodeTestCase = new OperationsTestCase( + "validateVitalSignObservationTargetSiteCode", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGN_OBSERVATION_TARGET_SITE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignObservation target) { + target.init(); + } + + @Override + protected void updateToPass(VitalSignObservation target) { + target.getTargetSiteCodes().add(DatatypesFactory.eINSTANCE.createCD()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignObservationOperations.validateVitalSignObservationTargetSiteCode( + (VitalSignObservation) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignObservationTargetSiteCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateVitalSignObservationText() { + OperationsTestCase validateVitalSignObservationTextTestCase = new OperationsTestCase( + "validateVitalSignObservationText", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGN_OBSERVATION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignObservation target) { + target.init(); + } + + @Override + protected void updateToPass(VitalSignObservation target) { + + target.setText(DatatypesFactory.eINSTANCE.createED()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignObservationOperations.validateVitalSignObservationText( + (VitalSignObservation) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignObservationTextTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateVitalSignObservationAuthor() { + OperationsTestCase validateVitalSignObservationAuthorTestCase = new OperationsTestCase( + "validateVitalSignObservationAuthor", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGN_OBSERVATION_AUTHOR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignObservation target) { + target.init(); + } + + @Override + protected void updateToPass(VitalSignObservation target) { + + target.getAuthors().add(CDAFactory.eINSTANCE.createAuthor()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignObservationOperations.validateVitalSignObservationAuthor( + (VitalSignObservation) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignObservationAuthorTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends VitalSignObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public VitalSignObservation create() { + return ConsolFactory.eINSTANCE.createVitalSignObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends VitalSignObservationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // VitalSignObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/VitalSignsOrganizerTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/VitalSignsOrganizerTest.java new file mode 100644 index 000000000..5c926a7d3 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/VitalSignsOrganizerTest.java @@ -0,0 +1,415 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.Observation; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.VitalSignsOrganizer; +import org.openhealthtools.mdht.uml.cda.consol.operations.VitalSignsOrganizerOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; + +/** + * + * A static utility class that provides operations related to 'Vital Signs Organizer' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.VitalSignsOrganizer#validateVitalSignsOrganizerTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Signs Organizer Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.VitalSignsOrganizer#validateVitalSignsOrganizerClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Signs Organizer Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.VitalSignsOrganizer#validateVitalSignsOrganizerMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Signs Organizer Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.VitalSignsOrganizer#validateVitalSignsOrganizerId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Signs Organizer Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.VitalSignsOrganizer#validateVitalSignsOrganizerCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Signs Organizer Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.VitalSignsOrganizer#validateVitalSignsOrganizerStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Signs Organizer Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.VitalSignsOrganizer#validateVitalSignsOrganizerEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Signs Organizer Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.VitalSignsOrganizer#validateVitalSignsOrganizerVitalSignObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Signs Organizer Vital Sign Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.VitalSignsOrganizer#getVitalSignObservations() Get Vital Sign Observations}
  • + *
+ *

+ * + * @generated + */ + +public class VitalSignsOrganizerTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateVitalSignsOrganizerTemplateId() { + OperationsTestCase validateVitalSignsOrganizerTemplateIdTestCase = new OperationsTestCase( + "validateVitalSignsOrganizerTemplateId", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGNS_ORGANIZER_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignsOrganizer target) { + + } + + @Override + protected void updateToPass(VitalSignsOrganizer target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignsOrganizerOperations.validateVitalSignsOrganizerTemplateId( + (VitalSignsOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignsOrganizerTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateVitalSignsOrganizerClassCode() { + OperationsTestCase validateVitalSignsOrganizerClassCodeTestCase = new OperationsTestCase( + "validateVitalSignsOrganizerClassCode", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGNS_ORGANIZER_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignsOrganizer target) { + + } + + @Override + protected void updateToPass(VitalSignsOrganizer target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignsOrganizerOperations.validateVitalSignsOrganizerClassCode( + (VitalSignsOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignsOrganizerClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateVitalSignsOrganizerMoodCode() { + OperationsTestCase validateVitalSignsOrganizerMoodCodeTestCase = new OperationsTestCase( + "validateVitalSignsOrganizerMoodCode", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGNS_ORGANIZER_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignsOrganizer target) { + + } + + @Override + protected void updateToPass(VitalSignsOrganizer target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignsOrganizerOperations.validateVitalSignsOrganizerMoodCode( + (VitalSignsOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignsOrganizerMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateVitalSignsOrganizerId() { + OperationsTestCase validateVitalSignsOrganizerIdTestCase = new OperationsTestCase( + "validateVitalSignsOrganizerId", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGNS_ORGANIZER_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignsOrganizer target) { + + } + + @Override + protected void updateToPass(VitalSignsOrganizer target) { + target.init(); + + II ii = DatatypesFactory.eINSTANCE.createII(); + target.getIds().add(ii); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignsOrganizerOperations.validateVitalSignsOrganizerId( + (VitalSignsOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignsOrganizerIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateVitalSignsOrganizerCode() { + OperationsTestCase validateVitalSignsOrganizerCodeTestCase = new OperationsTestCase( + "validateVitalSignsOrganizerCode", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGNS_ORGANIZER_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignsOrganizer target) { + + } + + @Override + protected void updateToPass(VitalSignsOrganizer target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignsOrganizerOperations.validateVitalSignsOrganizerCode( + (VitalSignsOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignsOrganizerCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateVitalSignsOrganizerStatusCode() { + OperationsTestCase validateVitalSignsOrganizerStatusCodeTestCase = new OperationsTestCase( + "validateVitalSignsOrganizerStatusCode", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGNS_ORGANIZER_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignsOrganizer target) { + + } + + @Override + protected void updateToPass(VitalSignsOrganizer target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignsOrganizerOperations.validateVitalSignsOrganizerStatusCode( + (VitalSignsOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignsOrganizerStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateVitalSignsOrganizerEffectiveTime() { + OperationsTestCase validateVitalSignsOrganizerEffectiveTimeTestCase = new OperationsTestCase( + "validateVitalSignsOrganizerEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGNS_ORGANIZER_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignsOrganizer target) { + + } + + @Override + protected void updateToPass(VitalSignsOrganizer target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignsOrganizerOperations.validateVitalSignsOrganizerEffectiveTime( + (VitalSignsOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignsOrganizerEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateVitalSignsOrganizerVitalSignObservation() { + OperationsTestCase validateVitalSignsOrganizerVitalSignObservationTestCase = new OperationsTestCase( + "validateVitalSignsOrganizerVitalSignObservation", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGNS_ORGANIZER_VITAL_SIGN_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignsOrganizer target) { + target.init(); + } + + @Override + protected void updateToPass(VitalSignsOrganizer target) { + + Observation observation = ConsolFactory.eINSTANCE.createVitalSignObservation().init(); + + target.addObservation(observation); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignsOrganizerOperations.validateVitalSignsOrganizerVitalSignObservation( + (VitalSignsOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignsOrganizerVitalSignObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetVitalSignObservations() { + + VitalSignsOrganizer target = objectFactory.create(); + target.getVitalSignObservations(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends VitalSignsOrganizerOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public VitalSignsOrganizer create() { + return ConsolFactory.eINSTANCE.createVitalSignsOrganizer(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends VitalSignsOrganizerOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // VitalSignsOrganizerOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/VitalSignsSectionEntriesOptionalTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/VitalSignsSectionEntriesOptionalTest.java new file mode 100644 index 000000000..71100a32e --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/VitalSignsSectionEntriesOptionalTest.java @@ -0,0 +1,337 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.VitalSignsOrganizer; +import org.openhealthtools.mdht.uml.cda.consol.VitalSignsSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.operations.VitalSignsSectionEntriesOptionalOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; + +/** + * + * A static utility class that provides operations related to 'Vital Signs Section Entries Optional' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.VitalSignsSectionEntriesOptional#validateVitalSignsSectionEntriesOptionalTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Signs Section Entries Optional Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.VitalSignsSectionEntriesOptional#validateVitalSignsSectionEntriesOptionalCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Signs Section Entries Optional Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.VitalSignsSectionEntriesOptional#validateVitalSignsSectionEntriesOptionalCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Signs Section Entries Optional Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.VitalSignsSectionEntriesOptional#validateVitalSignsSectionEntriesOptionalText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Signs Section Entries Optional Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.VitalSignsSectionEntriesOptional#validateVitalSignsSectionEntriesOptionalTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Signs Section Entries Optional Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.VitalSignsSectionEntriesOptional#validateVitalSignsSectionEntriesOptionalVitalSignsOrganizer(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Signs Section Entries Optional Vital Signs Organizer}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.VitalSignsSectionEntriesOptional#getVitalSignsOrganizers() Get Vital Signs Organizers}
  • + *
+ *

+ * + * @generated + */ + +public class VitalSignsSectionEntriesOptionalTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateVitalSignsSectionEntriesOptionalTemplateId() { + OperationsTestCase validateVitalSignsSectionEntriesOptionalTemplateIdTestCase = new OperationsTestCase( + "validateVitalSignsSectionEntriesOptionalTemplateId", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGNS_SECTION_ENTRIES_OPTIONAL_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignsSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(VitalSignsSectionEntriesOptional target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignsSectionEntriesOptionalOperations.validateVitalSignsSectionEntriesOptionalTemplateId( + (VitalSignsSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignsSectionEntriesOptionalTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateVitalSignsSectionEntriesOptionalCode() { + OperationsTestCase validateVitalSignsSectionEntriesOptionalCodeTestCase = new OperationsTestCase( + "validateVitalSignsSectionEntriesOptionalCode", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGNS_SECTION_ENTRIES_OPTIONAL_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignsSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(VitalSignsSectionEntriesOptional target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignsSectionEntriesOptionalOperations.validateVitalSignsSectionEntriesOptionalCode( + (VitalSignsSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignsSectionEntriesOptionalCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateVitalSignsSectionEntriesOptionalCodeP() { + OperationsTestCase validateVitalSignsSectionEntriesOptionalCodePTestCase = new OperationsTestCase( + "validateVitalSignsSectionEntriesOptionalCodeP", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGNS_SECTION_ENTRIES_OPTIONAL_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignsSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(VitalSignsSectionEntriesOptional target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignsSectionEntriesOptionalOperations.validateVitalSignsSectionEntriesOptionalCodeP( + (VitalSignsSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignsSectionEntriesOptionalCodePTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateVitalSignsSectionEntriesOptionalTitle() { + OperationsTestCase validateVitalSignsSectionEntriesOptionalTitleTestCase = new OperationsTestCase( + "validateVitalSignsSectionEntriesOptionalTitle", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGNS_SECTION_ENTRIES_OPTIONAL_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignsSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(VitalSignsSectionEntriesOptional target) { + target.init(); + + target.setTitle(DatatypesFactory.eINSTANCE.createST()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignsSectionEntriesOptionalOperations.validateVitalSignsSectionEntriesOptionalTitle( + (VitalSignsSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignsSectionEntriesOptionalTitleTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateVitalSignsSectionEntriesOptionalVitalSignsOrganizer() { + OperationsTestCase validateVitalSignsSectionEntriesOptionalVitalSignsOrganizerTestCase = new OperationsTestCase( + "validateVitalSignsSectionEntriesOptionalVitalSignsOrganizer", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGNS_SECTION_ENTRIES_OPTIONAL_VITAL_SIGNS_ORGANIZER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignsSectionEntriesOptional target) { + target.init(); + } + + @Override + protected void updateToPass(VitalSignsSectionEntriesOptional target) { + + VitalSignsOrganizer organizer = ConsolFactory.eINSTANCE.createVitalSignsOrganizer().init(); + target.addOrganizer(organizer); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignsSectionEntriesOptionalOperations.validateVitalSignsSectionEntriesOptionalVitalSignsOrganizer( + (VitalSignsSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignsSectionEntriesOptionalVitalSignsOrganizerTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetVitalSignsOrganizers() { + + VitalSignsSectionEntriesOptional target = objectFactory.create(); + target.getVitalSignsOrganizers(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateVitalSignsSectionEntriesOptionalText() { + OperationsTestCase validateVitalSignsSectionEntriesOptionalTextTestCase = new OperationsTestCase( + "validateVitalSignsSectionEntriesOptionalText", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGNS_SECTION_ENTRIES_OPTIONAL_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignsSectionEntriesOptional target) { + + } + + @Override + protected void updateToPass(VitalSignsSectionEntriesOptional target) { + target.init(); + + target.setText(CDAFactory.eINSTANCE.createStrucDocText()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignsSectionEntriesOptionalOperations.validateVitalSignsSectionEntriesOptionalText( + (VitalSignsSectionEntriesOptional) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignsSectionEntriesOptionalTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends VitalSignsSectionEntriesOptionalOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public VitalSignsSectionEntriesOptional create() { + return ConsolFactory.eINSTANCE.createVitalSignsSectionEntriesOptional(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends VitalSignsSectionEntriesOptionalOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // VitalSignsSectionEntriesOptionalOperations diff --git a/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/VitalSignsSectionTest.java b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/VitalSignsSectionTest.java new file mode 100644 index 000000000..d4e91016b --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consol.tests/src/org/openhealthtools/mdht/uml/cda/consol/tests/VitalSignsSectionTest.java @@ -0,0 +1,342 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.VitalSignsOrganizer; +import org.openhealthtools.mdht.uml.cda.consol.VitalSignsSection; +import org.openhealthtools.mdht.uml.cda.consol.operations.VitalSignsSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Vital Signs Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.VitalSignsSection#validateVitalSignsSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Signs Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.VitalSignsSection#validateVitalSignsSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Signs Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.VitalSignsSection#validateVitalSignsSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Signs Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.VitalSignsSection#validateVitalSignsSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Signs Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.VitalSignsSection#validateVitalSignsSectionVitalSignsOrganizer(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Signs Section Vital Signs Organizer}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.VitalSignsSection#getConsolVitalSignsOrganizers() Get Consol Vital Signs Organizers}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.consol.VitalSignsSection#validateVitalSignsSectionEntriesOptionalTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Signs Section Entries Optional Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class VitalSignsSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateVitalSignsSectionCodeP() { + OperationsTestCase validateVitalSignsSectionCodePTestCase = new OperationsTestCase( + "validateVitalSignsSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGNS_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignsSection target) { + + } + + @Override + protected void updateToPass(VitalSignsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignsSectionOperations.validateVitalSignsSectionCodeP( + (VitalSignsSection) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignsSectionCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateVitalSignsSectionCode() { + OperationsTestCase validateVitalSignsSectionCodeTestCase = new OperationsTestCase( + "validateVitalSignsSectionCode", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGNS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignsSection target) { + + } + + @Override + protected void updateToPass(VitalSignsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignsSectionOperations.validateVitalSignsSectionCode( + (VitalSignsSection) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignsSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateVitalSignsSectionTitle() { + OperationsTestCase validateVitalSignsSectionTitleTestCase = new OperationsTestCase( + "validateVitalSignsSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGNS_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignsSection target) { + + } + + @Override + protected void updateToPass(VitalSignsSection target) { + target.init(); + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignsSectionOperations.validateVitalSignsSectionTitle( + (VitalSignsSection) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignsSectionTitleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateVitalSignsSectionText() { + OperationsTestCase validateVitalSignsSectionTextTestCase = new OperationsTestCase( + "validateVitalSignsSectionText", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGNS_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignsSection target) { + + } + + @Override + protected void updateToPass(VitalSignsSection target) { + target.init(); + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignsSectionOperations.validateVitalSignsSectionText( + (VitalSignsSection) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignsSectionTextTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateVitalSignsSectionVitalSignsOrganizer() { + OperationsTestCase validateVitalSignsSectionVitalSignsOrganizerTestCase = new OperationsTestCase( + "validateVitalSignsSectionVitalSignsOrganizer", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGNS_SECTION_VITAL_SIGNS_ORGANIZER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignsSection target) { + + } + + @Override + protected void updateToPass(VitalSignsSection target) { + target.init(); + + VitalSignsOrganizer vitalSignsOrganizer = ConsolFactory.eINSTANCE.createVitalSignsOrganizer().init(); + target.addOrganizer(vitalSignsOrganizer); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignsSectionOperations.validateVitalSignsSectionVitalSignsOrganizer( + (VitalSignsSection) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignsSectionVitalSignsOrganizerTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetConsolVitalSignsOrganizers() { + + VitalSignsSection target = objectFactory.create(); + target.getConsolVitalSignsOrganizers(); + + } + + /** + * + * @generated + */ + @Test + public void testValidateVitalSignsSectionEntriesOptionalTemplateId() { + OperationsTestCase validateVitalSignsSectionEntriesOptionalTemplateIdTestCase = new OperationsTestCase( + "validateVitalSignsSectionEntriesOptionalTemplateId", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGNS_SECTION_ENTRIES_OPTIONAL_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignsSection target) { + + } + + @Override + protected void updateToPass(VitalSignsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignsSectionOperations.validateVitalSignsSectionEntriesOptionalTemplateId( + (VitalSignsSection) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignsSectionEntriesOptionalTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends VitalSignsSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public VitalSignsSection create() { + return ConsolFactory.eINSTANCE.createVitalSignsSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends VitalSignsSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // VitalSignsSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.consoltoc.tests/.classpath b/org.openhealthtools.mdht.uml.cda.consoltoc.tests/.classpath new file mode 100644 index 000000000..ed2bc1287 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consoltoc.tests/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.openhealthtools.mdht.uml.cda.consoltoc.tests/.project b/org.openhealthtools.mdht.uml.cda.consoltoc.tests/.project new file mode 100644 index 000000000..6ab347c8d --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consoltoc.tests/.project @@ -0,0 +1,28 @@ + + + org.openhealthtools.mdht.uml.cda.consoltoc.tests + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.pde.PluginNature + + diff --git a/org.openhealthtools.mdht.uml.cda.consoltoc.tests/.settings/org.eclipse.jdt.core.prefs b/org.openhealthtools.mdht.uml.cda.consoltoc.tests/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..fd79a3e6c --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consoltoc.tests/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,355 @@ +#Mon May 16 10:24:25 EDT 2011 +eclipse.preferences.version=1 +org.eclipse.jdt.core.codeComplete.argumentPrefixes= +org.eclipse.jdt.core.codeComplete.argumentSuffixes= +org.eclipse.jdt.core.codeComplete.fieldPrefixes= +org.eclipse.jdt.core.codeComplete.fieldSuffixes= +org.eclipse.jdt.core.codeComplete.localPrefixes= +org.eclipse.jdt.core.codeComplete.localSuffixes= +org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.5 +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.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning +org.eclipse.jdt.core.compiler.problem.deadCode=warning +org.eclipse.jdt.core.compiler.problem.deprecation=warning +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore +org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=error +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore +org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning +org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +org.eclipse.jdt.core.compiler.problem.nullReference=warning +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore +org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=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 +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedImport=warning +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +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.5 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=36 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=36 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=36 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=36 +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_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=49 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=32 +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_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=0 +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 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=1 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=150 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@fmtOff +org.eclipse.jdt.core.formatter.enabling_tag=@fmtOn +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +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=true +org.eclipse.jdt.core.formatter.indentation.size=4 +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_parameter=do not 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=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +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_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_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 +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +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_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 +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +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_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not 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_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 +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +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_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 +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +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_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_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 +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=false +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=120 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +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=false +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/org.openhealthtools.mdht.uml.cda.consoltoc.tests/.settings/org.eclipse.jdt.ui.prefs b/org.openhealthtools.mdht.uml.cda.consoltoc.tests/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 000000000..6245d2099 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consoltoc.tests/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,120 @@ +#Tue Mar 29 22:38:51 EDT 2011 +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=false +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=false +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=false +cleanup.format_source_code=true +cleanup.format_source_code_changes_only=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=false +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=true +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=true +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=true +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_blocks=true +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_parentheses_in_expressions=false +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup_profile=_MDHT +cleanup_settings_version=2 +eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true +formatter_profile=_MDHT +formatter_settings_version=11 +org.eclipse.jdt.ui.exception.name=e +org.eclipse.jdt.ui.gettersetter.use.is=true +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com; +org.eclipse.jdt.ui.javadoc=true +org.eclipse.jdt.ui.keywordthis=false +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.overrideannotation=true +org.eclipse.jdt.ui.staticondemandthreshold=99 +org.eclipse.jdt.ui.text.custom_code_templates= +sp_cleanup.add_default_serial_version_id=true +sp_cleanup.add_generated_serial_version_id=false +sp_cleanup.add_missing_annotations=true +sp_cleanup.add_missing_deprecated_annotations=true +sp_cleanup.add_missing_methods=false +sp_cleanup.add_missing_nls_tags=false +sp_cleanup.add_missing_override_annotations=true +sp_cleanup.add_missing_override_annotations_interface_methods=false +sp_cleanup.add_serial_version_id=false +sp_cleanup.always_use_blocks=true +sp_cleanup.always_use_parentheses_in_expressions=false +sp_cleanup.always_use_this_for_non_static_field_access=false +sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.convert_to_enhanced_for_loop=false +sp_cleanup.correct_indentation=false +sp_cleanup.format_source_code=true +sp_cleanup.format_source_code_changes_only=false +sp_cleanup.make_local_variable_final=false +sp_cleanup.make_parameters_final=false +sp_cleanup.make_private_fields_final=true +sp_cleanup.make_type_abstract_if_missing_method=false +sp_cleanup.make_variable_declarations_final=false +sp_cleanup.never_use_blocks=false +sp_cleanup.never_use_parentheses_in_expressions=true +sp_cleanup.on_save_use_additional_actions=true +sp_cleanup.organize_imports=true +sp_cleanup.qualify_static_field_accesses_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_with_declaring_class=false +sp_cleanup.qualify_static_method_accesses_with_declaring_class=false +sp_cleanup.remove_private_constructors=true +sp_cleanup.remove_trailing_whitespaces=true +sp_cleanup.remove_trailing_whitespaces_all=true +sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +sp_cleanup.remove_unnecessary_casts=true +sp_cleanup.remove_unnecessary_nls_tags=false +sp_cleanup.remove_unused_imports=false +sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_private_fields=true +sp_cleanup.remove_unused_private_members=false +sp_cleanup.remove_unused_private_methods=true +sp_cleanup.remove_unused_private_types=true +sp_cleanup.sort_members=false +sp_cleanup.sort_members_all=false +sp_cleanup.use_blocks=false +sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_parentheses_in_expressions=false +sp_cleanup.use_this_for_non_static_field_access=false +sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true +sp_cleanup.use_this_for_non_static_method_access=false +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/org.openhealthtools.mdht.uml.cda.consoltoc.tests/META-INF/MANIFEST.MF b/org.openhealthtools.mdht.uml.cda.consoltoc.tests/META-INF/MANIFEST.MF new file mode 100644 index 000000000..110f7eff5 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consoltoc.tests/META-INF/MANIFEST.MF @@ -0,0 +1,22 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: org.openhealthtools.mdht.uml.cda.consoltoc.tests;singleton:=true +Bundle-Version: 1.1.0.qualifier +Bundle-ClassPath: . +Bundle-Vendor: %providerName +Bundle-Localization: plugin +Bundle-RequiredExecutionEnvironment: J2SE-1.5 +Export-Package: org.openhealthtools.mdht.uml.cda.consoltoc.tests +Require-Bundle: org.eclipse.core.runtime, + org.openhealthtools.mdht.uml.cda.consoltoc;visibility:=reexport, + org.openhealthtools.mdht.uml.cda;visibility:=reexport, + org.openhealthtools.mdht.uml.cda.consol;visibility:=reexport, + org.openhealthtools.mdht.uml.hl7.datatypes;visibility:=reexport, + org.eclipse.emf.ecore;visibility:=reexport, + org.openhealthtools.mdht.uml.hl7.rim;visibility:=reexport, + org.openhealthtools.mdht.uml.hl7.vocab;visibility:=reexport, + org.eclipse.emf.ecore.xmi;visibility:=reexport, + org.junit;visibility:=reexport, + org.openhealthtools.mdht.uml.cda.test;bundle-version="1.0.0" +Bundle-ActivationPolicy: lazy diff --git a/org.openhealthtools.mdht.uml.cda.consoltoc.tests/build.properties b/org.openhealthtools.mdht.uml.cda.consoltoc.tests/build.properties new file mode 100644 index 000000000..276ee2eec --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consoltoc.tests/build.properties @@ -0,0 +1,16 @@ +############################################################################### +# Copyright (c) 2012 Rama Ramakrishnan and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Rama Ramakrishnan (Agilex Corporation) - initial API and implementation +############################################################################### +bin.includes = .,\ + META-INF/,\ + plugin.properties +jars.compile.order = . +source.. = src/ +output.. = bin/ diff --git a/org.openhealthtools.mdht.uml.cda.consoltoc.tests/plugin.properties b/org.openhealthtools.mdht.uml.cda.consoltoc.tests/plugin.properties new file mode 100644 index 000000000..dfeb170f1 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consoltoc.tests/plugin.properties @@ -0,0 +1,12 @@ +############################################################################### +# Copyright (c) 2012 Rama Ramakrishnan and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Rama Ramakrishnan (Agilex Corporation) - initial API and implementation +############################################################################### +pluginName = consoltoc_Ecore Tests +providerName = www.example.org diff --git a/org.openhealthtools.mdht.uml.cda.consoltoc.tests/samples/DI_sample_l3_conformances.xml b/org.openhealthtools.mdht.uml.cda.consoltoc.tests/samples/DI_sample_l3_conformances.xml new file mode 100644 index 000000000..f8ff91521 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consoltoc.tests/samples/DI_sample_l3_conformances.xml @@ -0,0 +1,858 @@ + + + + + + + + + + Discharge Instructions + + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + + Mr. + Adam + Frankie + Everyman + + + + + + + + + + + + + + + + Good Health Clinic + + + 17 Daws Rd. + Blue Bell + MA + 02368 + USA + + + + + + + + + + + + + + + + + +
+ + + Problems + + + + + + + + + + + + + +
Conditions
+ Pneumonia: Resolved in March 1998 + Pneumonia: Resolved in March 1998 + 1998
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ + + Advance Directives + + + Directive1 + Directive2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ + + Allergies + + + + + + + + + + + + + + + + + + + + + + + + + + +
SubstanceReactionStatus
Penicillin + Hives + Active
Aspirin + Wheezing + Active
Codeine + Nausea + Active
+
+ + + + + + + + + + + + + + + + + + + + + + + + Adverse reaction to substance + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Adverse reaction to substance + + + + + + + + + + + + + +
+
+ +
+ + + Hospital Discharge Medications + + + + + + + + + + + + + + + + + + + + + + +
MedicationDirectionsStart DateStatusIndicationsFill Instructions
Proventil 0.09 MG/ACTUAT inhalant solution2 puffs QID PRN wheezing2011-03-01ActiveBronchitis (32398004 SNOMED CT)Generic Substitition Allowed
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ + + Medical Equipment + + + + + + + + + + + + + + + +
Equipment
Automatic implantable cardioverter/defibrillator
Automatic implantable cardioverter/defibrillator2
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
+
+ +
+ + + Plan of Care + + + + + + + + + + + + + + +
Planned ActivityPlanned Date
ColonoscopyApril 21, 2000
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ + + Immunizations + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
VaccineDateStatus
+ + Influenza virus vaccine, IM + Nov 1999Completed
+ + Influenza virus vaccine, IM + Dec 1998Completed
+ + Pneumococcal polysaccharide vaccine, IM + Dec 1998Completed
+ + Tetanus and diphtheria toxoids, IM + 1997Refused
+
+ + + + + + Immunization-1 + + + + + + + + Tetanus and diphtheria toxoids - preservative free + + + + + + Maine Pharmacies + + + 34857, Ada Monroe street + + Cold Mountain + NC + 34536 + + + + + + + + + + + + + + + + + + + + + Immunization-1 + + + + + + + + Tetanus and diphtheria toxoids - preservative free + + + + + + Maine Pharmacies + + + 34857, Ada Monroe street + + Cold Mountain + NC + 34536 + + + + + + + + + + + + + + + +
+
+
+
+
\ No newline at end of file diff --git a/org.openhealthtools.mdht.uml.cda.consoltoc.tests/samples/DS.sample.l1.conformances.xml b/org.openhealthtools.mdht.uml.cda.consoltoc.tests/samples/DS.sample.l1.conformances.xml new file mode 100644 index 000000000..5b8de96a4 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consoltoc.tests/samples/DS.sample.l1.conformances.xml @@ -0,0 +1,99 @@ + + + + + + + + + + Good Health Discharge Summary + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + Mr. + Adam + Frankie + Everyman + + + + + + + + + + + + + Good Health Clinic + + + 17 Daws Rd. + Blue Bell + MA + 02368 + USA + + + + + + + + + + + + + + + + + dhUhkasd437hbjfQSdhUhkasd437hbjfQS7dhUhkasd437hbjfQSdhUhkasd437hbjfQ + + + diff --git a/org.openhealthtools.mdht.uml.cda.consoltoc.tests/samples/DS.sample.l2.conformances.xml b/org.openhealthtools.mdht.uml.cda.consoltoc.tests/samples/DS.sample.l2.conformances.xml new file mode 100644 index 000000000..9f49d2ab8 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consoltoc.tests/samples/DS.sample.l2.conformances.xml @@ -0,0 +1,608 @@ + + + + + + + + + + Good Health Discharge Summary + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + Mr. + Adam + Frankie + Everyman + + + + + + + + + + + + + Good Health Clinic + + + 17 Daws Rd. + Blue Bell + MA + 02368 + USA + + + + + + + + + + + + + + + + + + + +
+ + + Problems + + + Pneumonia: Resolved in March 1998 + Lower Back Pain - Consultation 1999 + + +
+
+ + + +
+ + + Allergies + + + + + + + + + + + + + + + + + + + + + + + + + + +
SubstanceReactionStatus
Penicillin + Hives + Active
Aspirin + Wheezing + Active
Codeine + Nausea + Active
+
+
+
+ + + +
+ + + Procedures + + + + + + + + + + + + + + +
ProcedureDate
+ Colonic polypectomy + 1998
+
+
+
+ + + +
+ + + Hospital Discharge Diagnosis + + + Diverticula of intestine + + +
+
+ + + +
+ + + Hospital Discharge Medications + + + + + + + + + + + + + + + + + + + + + + +
MedicationDirectionsStart DateStatusIndicationsFill Instructions
Proventil 0.09 MG/ACTUAT inhalant solution2 puffs QID PRN wheezing2011-03-01ActiveBronchitis (32398004 SNOMED CT)Generic Substitition Allowed
+
+
+
+ + + +
+ + + Hospital Course + Following a colonoscopy, the patient was admitted and started on Lovenox and nitroglycerin paste. + + The patient had serial cardiac enzymes and was ruled out for myocardial + + infarction. The patient underwent a dual isotope stress test. There was no + + evidence of reversible ischemia on the Cardiolite scan. The patient has been + + ambulated. The patient had a Holter monitor placed but the report is not + + available at this time. The patient has remained hemodynamically stable. + + Will discharge. +
+
+ + + +
+ + + Plan of Care + + + + + + + + + + + + + + +
Planned ActivityPlanned Date
ColonoscopyApril 21, 2000
+
+
+
+ + + +
+ + + Immunizations + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
VaccineDateStatus
+ Influenza virus vaccine, IMNov 1999Completed
+ Influenza virus vaccine, IMDec 1998Completed
+ Pneumococcal polysaccharide vaccine, IMDec 1998Completed
+ Tetanus and diphtheria toxoids, IM1997Refused
+
+
+
+ + + +
+ + + Review of Systems + + Patient denies recent history of fever or malaise. Positive for weakness and shortness of breath. One episode of melena. No recent headaches. Positive for osteoarthritis in hips, knees and hands. + +
+
+ + + +
+ + + + Social History + + + + + + + + + + + + + + + + + + + + + + + + + + +
Social History ElementDescriptionEffective Dates
+ smoking1 pack per day1947 - 1972
+ smokingNone1973 -
+ Alcohol consumptionNone1973 -
+
+
+
+ +
+ + + Vital Signs + + + + + + + + + + + + + + + + + + + + + + + + + + +
Date / Time: Nov 14, 1999April 7, 2000
Height + 177 cm + + 177 cm +
Weight + 86 kg + + 88 kg +
Blood Pressure + 132/86 mmHg + + 145/88 mmHg +
+
+
+
+ + +
+ + + Hospital Discharge Physical + GENERAL: Well-developed, slightly obese man.
+ + NECK: Supple, with no jugular venous distension.
+ + HEART: Intermittent tachycardia without murmurs or gallops.
+ + PULMONARY: Decreased breath sounds, but no clear-cut rales or + + wheezes.
+ + EXTREMITIES: Free of edema.
+
+
+ +
+ + + Hospital Discharge Studies Summary + + + + + + + + + + + + + + + + + + +
Laboratory InformationChemistries and drug levels
Potasium4.0
NA (135-145meq/l)140
+
+ + + + + + + + + + + + + +
Other TestsResults
EKGSinus rhythm without acute changes.
+
+
+
+ +
+ + + History of Present Illness + + This patient was only recently discharged for a recurrent GI bleed as described below. + He presented to the ER today c/o a dark stool yesterday but a normal brown stool today. On exam he was hypotensive in the 80?s resolved after .... .... .... + Lab at discharge: Glucose 112, BUN 16, creatinine 1.1, electrolytes normal. H. pylori antibody pending. Admission hematocrit 16%, discharge hematocrit 29%. WBC 7300, platelet count 256,000. Urinalysis normal. Urine culture: No growth. INR 1.1, PTT 40. + He was transfused with 6 units of packed red blood cells with .... .... .... + GI evaluation 12 September: Colonoscopy showed single red clot in .... .... .... + +
+
+ + + +
+ + + Reason for Visit/Chief Complaint + + Dark stools. + +
+
+ + + +
+ + + CHIEF COMPLAINT + Chronic Back pain and High Blood Presssure +
+
+ + + +
+ + + REASON FOR VISIT + To further look into the chronic back pain +
+
+ + +
+ + + Discharge Diet + No solid food for 2 days. Follow the B.R.A.T. diet for 2 days after that. Regular diet may be resumed 4 days after discharge. +
+
+ + +
+ + + + Functional Status + + + + + + + + + + + + + + + + + + + + + +
Functional ConditionEffective DatesCondition Status
Dependence on cane1999Active
Memory impairment1998Active
+
+
+
+ + +
+ + + + Family history + + Father (deceased) + + + + + + + + + + + + + + + + + +
DiagnosisAge At Onset
Myocardial Infarction (cause of death)57
Diabetes40
+
+
+
+
+
+
diff --git a/org.openhealthtools.mdht.uml.cda.consoltoc.tests/samples/DS.sample.l3.conformances-1.xml b/org.openhealthtools.mdht.uml.cda.consoltoc.tests/samples/DS.sample.l3.conformances-1.xml new file mode 100644 index 000000000..9eb18ec36 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consoltoc.tests/samples/DS.sample.l3.conformances-1.xml @@ -0,0 +1,1028 @@ + + + + + + + + + + Good Health Discharge Summary + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + Mr. + Adam + Frankie + Everyman + + + + + + + + + + + + + Good Health Clinic + + + 17 Daws Rd. + Blue Bell + MA + 02368 + USA + + + + + + + + + + + + + + + + + + +
+ + + Problems + + + Pneumonia: Resolved in March 1998 + Lower Back Pain - Consultation 1999 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + Allergies + + + + + + + + + + + + + + + + + + + + + + + + + + +
SubstanceReactionStatus
Penicillin + Hives + Active
Aspirin + Wheezing + Active
Codeine + Nausea + Active
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ + + Procedures + + + + + + + + + + + + + + +
ProcedureDate
+ Colonic polypectomy + 1998
+
+ + + + + + + + + + + + + + + + + + + + 123, Main Street + Baltimore + VA + 10001 + + + + West Elm Pharmacies + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 123, Main Street + Baltimore + VA + 10001 + + + + West Elm Pharmacies + + + + + + + + + + + + + + + + + + + + + + + + + + + + 123, Main Street + Baltimore + VA + 10001 + + + + West Elm Pharmacies + + + + + +
+
+ + + +
+ + + Hospital Discharge Diagnosis + + + Diverticula of intestine + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + Hospital Discharge Medications + + + + + + + + + + + + + + + + + + + + + + +
MedicationDirectionsStart DateStatusIndicationsFill Instructions
Proventil 0.09 MG/ACTUAT inhalant solution2 puffs QID PRN wheezing2011-03-01ActiveBronchitis (32398004 SNOMED CT)Generic Substitition Allowed
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + Hospital Course + The patient was admitted and started on Lovenox and nitroglycerin paste. +
+
+ + + +
+ + + + + + Plan of Care + + + + + + + + + + + + + + + +
Planned ActivityPlanned Date
ColonoscopyApril 21, 2000
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + Immunizations + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
VaccineDateStatus
+ Influenza virus vaccine, IMNov 1999Completed
+ Influenza virus vaccine, IMDec 1998Completed
+ Pneumococcal polysaccharide vaccine, IMDec 1998Completed
+ Tetanus and diphtheria toxoids, IM1997Refused
+
+ + + + + + + + + + + + + + + + + + + + + + + Maine Pharmacies + + + 34857, Ada Monroe street + Cold Mountain + NC + 34536 + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + Review of Systems + + Patient denies recent history of fever or malaise. Positive for weakness and shortness of breath. One episode of melena. No recent headaches. Positive for osteoarthritis in hips, knees and hands. + +
+
+ + + +
+ + + + Social History + + + + + + + + + + + + + + + + + + + + + + + + + + +
Social History ElementDescriptionEffective Dates
+ smoking1 pack per day1947 - 1972
+ smokingNone1973 -
+ Alcohol consumptionNone1973 -
+
+
+
+ +
+ + + Vital Signs + + + + + + + + + + + + + + + + + + + + + + + + + + +
Date / Time: Nov 14, 1999April 7, 2000
Height + 177 cm + + 177 cm +
Weight + 86 kg + + 88 kg +
Blood Pressure + 132/86 mmHg + + 145/88 mmHg +
+
+
+
+ + +
+ + + Hospital Discharge Physical + GENERAL: Well-developed, slightly obese man.
+ + NECK: Supple, with no jugular venous distension.
+ + HEART: Intermittent tachycardia without murmurs or gallops.
+ + PULMONARY: Decreased breath sounds, but no clear-cut rales or + + wheezes.
+ + EXTREMITIES: Free of edema.
+
+
+ +
+ + + Hospital Discharge Studies Summary + + + + + + + + + + + + + + + + + + +
Laboratory InformationChemistries and drug levels
Potasium4.0
NA (135-145meq/l)140
+
+ + + + + + + + + + + + + +
Other TestsResults
EKGSinus rhythm without acute changes.
+
+
+
+ +
+ + + History of Present Illness + + This patient was only recently discharged for a recurrent GI bleed as described below. + He presented to the ER today c/o a dark stool yesterday but a normal brown stool today. On exam he was hypotensive in the 80?s resolved after .... .... .... + Lab at discharge: Glucose 112, BUN 16, creatinine 1.1, electrolytes normal. H. pylori antibody pending. Admission hematocrit 16%, discharge hematocrit 29%. WBC 7300, platelet count 256,000. Urinalysis normal. Urine culture: No growth. INR 1.1, PTT 40. + He was transfused with 6 units of packed red blood cells with .... .... .... + GI evaluation 12 September: Colonoscopy showed single red clot in .... .... .... + +
+
+ + + +
+ + + Reason for Visit/Chief Complaint + + Dark stools. + +
+
+ + + +
+ + + CHIEF COMPLAINT + Chronic Back pain and High Blood Presssure +
+
+ + + +
+ + + REASON FOR VISIT + To further look into the chronic back pain +
+
+ + +
+ + + Discharge Diet + No solid food for 2 days. Follow the B.R.A.T. diet for 2 days after that. Regular diet may be resumed 4 days after discharge. +
+
+ + +
+ + + + Functional Status + + + + + + + + + + + + + + + + + + + + + +
Functional ConditionEffective DatesCondition Status
Dependence on cane1999Active
Memory impairment1998Active
+
+
+
+ + +
+ + + + Family history + + Father (deceased) + + + + + + + + + + + + + + + + + +
DiagnosisAge At Onset
Myocardial Infarction (cause of death)57
Diabetes40
+
+
+
+
+
+
diff --git a/org.openhealthtools.mdht.uml.cda.consoltoc.tests/samples/DS.sample.l3.conformances.xml b/org.openhealthtools.mdht.uml.cda.consoltoc.tests/samples/DS.sample.l3.conformances.xml new file mode 100644 index 000000000..511f4b877 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consoltoc.tests/samples/DS.sample.l3.conformances.xml @@ -0,0 +1,1236 @@ + + + + + + + + + + Discharge Summary + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + US + + + + + Mr. + Adam + Frankie + Everyman + + + + + + + 21 North Ave. + Burlington + MA + 02368 + USA + + + PO Box 72186 + Burlington + MA + 02368 + USA + + + + + + Dr + HL + Seven + Jr + + + Henry + Seven + + + + + + GBMC + + 6535 North Charles Street + Baltimore + MD + 21204 + USA + + + + + + + + + + + + + + + + + + + 21 North Ave. + Burlington + MA + 02368 + USA + + + + + + Ms + Penelope + Typegood + + + + + + + + + 527 Maple St. + Burlington + MA + 02368 + USA + + + + + Mrs + HL + Seven + Jr + + + + + + + + + Good Health Clinic + + + 17 Daws Rd. + Blue Bell + MA + 02368 + USA + + + + + + + + + Dr + Larry + Fine + + + + Good Health Clinic + + + + + + + + + + + + 83 Main St. + Burlington + MA + 02368 + USA + + + + + Mrs + Henrietta + Seven + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + Problems + + Pneumonia: Resolved in March 1998 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + Allergies + + + + + + + + + + + + + + + + + + + + + + + + + + +
SubstanceReactionStatus
Penicillin + Hives + Active
Aspirin + Wheezing + Active
Codeine + Nausea + Active
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ + + Procedures + + + + + + + + + + + + + + + + + + + + + + + + + + +
ProcedureDate
+ Colonic polypectomy + 2001
+ UCL Surgery + 2003
+ MRI Scan + 2009
+
+ + + + + + + + + + + + + + + + + + + + 123, Main Street + Baltimore + VA + 10001 + + + + West Elm Pharmacies + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 123, Main Street + Baltimore + VA + 10001 + + + + West Elm Pharmacies + + + + + + + + + + + + + + + + + + + + + + + + + + + + 123, Main Street + Baltimore + VA + 10001 + + + + West Elm Pharmacies + + + + + +
+
+ + + +
+ + + Hospital Discharge Diagnosis + + Diverticula of intestine + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + Hospital Discharge Medications + + + + + + + + + + + + + + + + + + + + + + +
MedicationDirectionsStart DateStatusIndicationsFill Instructions
Proventil 0.09 MG/ACTUAT inhalant solution2 puffs QID PRN wheezing2011-03-01ActiveBronchitis (32398004 SNOMED CT)Generic Substitition Allowed
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + Hospital Course + The patient was admitted and started on Lovenox and nitroglycerin paste. +
+
+ + + +
+ + + + + + Plan of Care + + + + + + + + + + + + + + + +
Planned ActivityPlanned Date
ColonoscopyApril 21, 2000
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + Immunizations + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
VaccineDateStatus
+ Influenza virus vaccine, IMNov 1999Completed
+ Influenza virus vaccine, IMDec 1998Completed
+ Pneumococcal polysaccharide vaccine, IMDec 1998Completed
+ Tetanus and diphtheria toxoids, IM1997Refused
+
+ + + + + + + + + + + + + + + Tetanus and diphtheria toxoids - preservative free + + + + + + + Maine Pharmacies + + + 34857, Ada Monroe street + Cold Mountain + NC + 34536 + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + Review of Systems + + Patient denies recent history of fever or malaise. Positive for weakness and shortness of breath. One episode of melena. No recent headaches. Positive for osteoarthritis in hips, knees and hands. + +
+
+ + + +
+ + + + Social History + + + + + + + + + + + + + + + + + + + + + + + + + + +
Social History ElementDescriptionEffective Dates
+ smoking1 pack per day1947 - 1972
+ smokingNone1973 -
+ Alcohol consumptionNone1973 -
+
+
+
+ +
+ + + Vital Signs + + + + + + + + + + + + + + + + + + + + + + + + + + +
Date / Time: Nov 14, 1999April 7, 2000
Height + 177 cm + + 177 cm +
Weight + 86 kg + + 88 kg +
Blood Pressure + 132/86 mmHg + + 145/88 mmHg +
+
+
+
+ + +
+ + + Hospital Discharge Physical + GENERAL: Well-developed, slightly obese man.
+ + NECK: Supple, with no jugular venous distension.
+ + HEART: Intermittent tachycardia without murmurs or gallops.
+ + PULMONARY: Decreased breath sounds, but no clear-cut rales or + + wheezes.
+ + EXTREMITIES: Free of edema.
+
+
+ +
+ + + Hospital Discharge Studies Summary + + + + + + + + + + + + + + + + + + +
Laboratory InformationChemistries and drug levels
Potasium4.0
NA (135-145meq/l)140
+
+ + + + + + + + + + + + + +
Other TestsResults
EKGSinus rhythm without acute changes.
+
+
+
+ +
+ + + History of Present Illness + + This patient was only recently discharged for a recurrent GI bleed as described below. + He presented to the ER today c/o a dark stool yesterday but a normal brown stool today. On exam he was hypotensive in the 80?s resolved after .... .... .... + Lab at discharge: Glucose 112, BUN 16, creatinine 1.1, electrolytes normal. H. pylori antibody pending. Admission hematocrit 16%, discharge hematocrit 29%. WBC 7300, platelet count 256,000. Urinalysis normal. Urine culture: No growth. INR 1.1, PTT 40. + He was transfused with 6 units of packed red blood cells with .... .... .... + GI evaluation 12 September: Colonoscopy showed single red clot in .... .... .... + +
+
+ + + +
+ + + Reason for Visit/Chief Complaint + + Dark stools. + +
+
+ + + +
+ + + CHIEF COMPLAINT + Chronic Back pain and High Blood Presssure +
+
+ + + +
+ + + Procedures + + + + + + + + + + + + + + +
ProcedureDate
+ Colonic polypectomy + 1998
+
+
+
+ + + +
+ + + REASON FOR VISIT + To further look into the chronic back pain +
+
+ + +
+ + + Discharge Diet + No solid food for 2 days. Follow the B.R.A.T. diet for 2 days after that. Regular diet may be resumed 4 days after discharge. +
+
+ + +
+ + + + Functional Status + + + + + + + + + + + + + + + + + + + + + +
Functional ConditionEffective DatesCondition Status
Dependence on cane1999Active
Memory impairment1998Active
+
+
+
+ + +
+ + + + Family history + + Father (deceased) + + + + + + + + + + + + + + + + + +
DiagnosisAge At Onset
Myocardial Infarction (cause of death)57
Diabetes40
+
+
+
+
+
+
\ No newline at end of file diff --git a/org.openhealthtools.mdht.uml.cda.consoltoc.tests/src/org/openhealthtools/mdht/uml/cda/consoltoc/tests/ConsoltocExample.java b/org.openhealthtools.mdht.uml.cda.consoltoc.tests/src/org/openhealthtools/mdht/uml/cda/consoltoc/tests/ConsoltocExample.java new file mode 100644 index 000000000..dc6281c71 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consoltoc.tests/src/org/openhealthtools/mdht/uml/cda/consoltoc/tests/ConsoltocExample.java @@ -0,0 +1,122 @@ +/******************************************************************************* + * Copyright (c) 2012 Rama Ramakrishnan and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Rama Ramakrishnan (Agilex Corporation) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consoltoc.tests; + +import java.io.File; +import java.io.IOException; + +import org.eclipse.emf.common.util.Diagnostic; +import org.eclipse.emf.common.util.URI; + +import org.eclipse.emf.ecore.EObject; + +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; + +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; + +import org.eclipse.emf.ecore.util.Diagnostician; + +import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl; + +import org.openhealthtools.mdht.uml.cda.consoltoc.ConsoltocFactory; +import org.openhealthtools.mdht.uml.cda.consoltoc.ConsoltocPackage; +import org.openhealthtools.mdht.uml.cda.consoltoc.DischargeSummary; + +/** + * A sample utility for the 'consoltoc' + * package. + * @generated + */ +public class ConsoltocExample { + /** + * Load all the argument file paths or URIs as + * instances of the model. + * @param args the file paths or URIs. + * @generated + */ + public static void main(String[] args) { + // Create a resource set to hold the resources. + // + ResourceSet resourceSet = new ResourceSetImpl(); + + // Register the appropriate resource factory to handle all file extensions. + // + resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put( + Resource.Factory.Registry.DEFAULT_EXTENSION, new XMIResourceFactoryImpl()); + + // Register the package to ensure it is available during loading. + // + resourceSet.getPackageRegistry().put(ConsoltocPackage.eNS_URI, ConsoltocPackage.eINSTANCE); + + // If there are no arguments, emit an appropriate usage message. + // + if (args.length == 0) { + System.out.println("Enter a list of file paths or URIs that have content like this:"); + try { + Resource resource = resourceSet.createResource(URI.createURI("http:///My.consoltoc")); + DischargeSummary root = ConsoltocFactory.eINSTANCE.createDischargeSummary(); + resource.getContents().add(root); + resource.save(System.out, null); + } catch (IOException exception) { + exception.printStackTrace(); + } + } else { + // Iterate over all the arguments. + // + for (int i = 0; i < args.length; ++i) { + // Construct the URI for the instance file. + // The argument is treated as a file path only if it denotes an existing file. + // Otherwise, it's directly treated as a URL. + // + File file = new File(args[i]); + URI uri = file.isFile() + ? URI.createFileURI(file.getAbsolutePath()) + : URI.createURI(args[i]); + + try { + // Demand load resource for this file. + // + Resource resource = resourceSet.getResource(uri, true); + System.out.println("Loaded " + uri); + + // Validate the contents of the loaded resource. + // + for (EObject eObject : resource.getContents()) { + Diagnostic diagnostic = Diagnostician.INSTANCE.validate(eObject); + if (diagnostic.getSeverity() != Diagnostic.OK) { + printDiagnostic(diagnostic, ""); + } + } + } catch (RuntimeException exception) { + System.out.println("Problem loading " + uri); + exception.printStackTrace(); + } + } + } + } + + /** + * Prints diagnostics with indentation. + * @param diagnostic the diagnostic to print. + * @param indent the indentation for printing. + * @generated + */ + protected static void printDiagnostic(Diagnostic diagnostic, String indent) { + System.out.print(indent); + System.out.println(diagnostic.getMessage()); + for (Diagnostic child : diagnostic.getChildren()) { + printDiagnostic(child, indent + " "); + } + } + +} // ConsoltocExample diff --git a/org.openhealthtools.mdht.uml.cda.consoltoc.tests/src/org/openhealthtools/mdht/uml/cda/consoltoc/tests/ConsoltocTests.java b/org.openhealthtools.mdht.uml.cda.consoltoc.tests/src/org/openhealthtools/mdht/uml/cda/consoltoc/tests/ConsoltocTests.java new file mode 100644 index 000000000..1cc468e20 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consoltoc.tests/src/org/openhealthtools/mdht/uml/cda/consoltoc/tests/ConsoltocTests.java @@ -0,0 +1,38 @@ +/******************************************************************************* + * Copyright (c) 2012 Rama Ramakrishnan and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Rama Ramakrishnan (Agilex Corporation) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consoltoc.tests; + +import junit.framework.JUnit4TestAdapter; +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +/** + * A test suite for the 'consoltoc' + * package. + * + + * @generated + */ +@RunWith(Suite.class) +@Suite.SuiteClasses({ + DischargeSummaryTest.class, ConsultationRequestTest.class, ConsultationSummaryTest.class, + DischargeInstructionsTest.class }) +public class ConsoltocTests { + + /** + * + * @generated + */ + public static junit.framework.Test suite() { + return new JUnit4TestAdapter(ConsoltocTests.class); + } + +} // ConsoltocTests diff --git a/org.openhealthtools.mdht.uml.cda.consoltoc.tests/src/org/openhealthtools/mdht/uml/cda/consoltoc/tests/ConsultationRequestTest.java b/org.openhealthtools.mdht.uml.cda.consoltoc.tests/src/org/openhealthtools/mdht/uml/cda/consoltoc/tests/ConsultationRequestTest.java new file mode 100644 index 000000000..2368cf496 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consoltoc.tests/src/org/openhealthtools/mdht/uml/cda/consoltoc/tests/ConsultationRequestTest.java @@ -0,0 +1,1508 @@ +/******************************************************************************* + * Copyright (c) 2012 Rama Ramakrishnan and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Rama Ramakrishnan (Agilex Corporation) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consoltoc.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.consol.AdvanceDirectivesSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.AllergiesSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.AssessmentAndPlanSection; +import org.openhealthtools.mdht.uml.cda.consol.ChiefComplaintAndReasonForVisitSection; +import org.openhealthtools.mdht.uml.cda.consol.ChiefComplaintSection; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.EncountersSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.FamilyHistorySection; +import org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusSection; +import org.openhealthtools.mdht.uml.cda.consol.GeneralStatusSection; +import org.openhealthtools.mdht.uml.cda.consol.HistoryOfPastIllnessSection; +import org.openhealthtools.mdht.uml.cda.consol.HistoryOfPresentIllnessSection; +import org.openhealthtools.mdht.uml.cda.consol.ImmunizationsSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.MedicalEquipmentSection; +import org.openhealthtools.mdht.uml.cda.consol.MedicationsSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.PayersSection; +import org.openhealthtools.mdht.uml.cda.consol.PhysicalExamSection; +import org.openhealthtools.mdht.uml.cda.consol.PlanOfCareSection; +import org.openhealthtools.mdht.uml.cda.consol.ProblemSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.ProceduresSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.ReasonForReferralSection; +import org.openhealthtools.mdht.uml.cda.consol.ResultsSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.SocialHistorySection; +import org.openhealthtools.mdht.uml.cda.consol.VitalSignsSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consoltoc.ConsoltocFactory; +import org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationRequest; +import org.openhealthtools.mdht.uml.cda.consoltoc.operations.ConsultationRequestOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Consultation Request' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationRequest#validateConsultationRequestAllergiesSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Consultation Request Allergies Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationRequest#validateConsultationRequestAssessmentAndPlanSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Consultation Request Assessment And Plan Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationRequest#validateConsultationRequestHistoryOfPresentIllnessSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Consultation Request History Of Present Illness Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationRequest#validateConsultationRequestPhysicalExamSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Consultation Request Physical Exam Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationRequest#validateConsultationRequestReasonForReferralSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Consultation Request Reason For Referral Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationRequest#validateConsultationRequestMedicationsSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Consultation Request Medications Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationRequest#validateConsultationRequestProblemSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Consultation Request Problem Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationRequest#validateConsultationRequestProceduresSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Consultation Request Procedures Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationRequest#validateConsultationRequestResultsSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Consultation Request Results Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationRequest#validateConsultationRequestAdvanceDirectivesSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Consultation Request Advance Directives Section Entries Optional + * }
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationRequest#validateConsultationRequestEncountersSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Consultation Request Encounters Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationRequest#validateConsultationRequestFamilyHistorySection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Consultation Request Family History Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationRequest#validateConsultationRequestFunctionalStatusSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Consultation Request Functional Status Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationRequest#validateConsultationRequestImmunizationsSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Consultation Request Immunizations Section Entries Optional + * }
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationRequest#validateConsultationRequestMedicalEquipmentSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Consultation Request Medical Equipment Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationRequest#validateConsultationRequestPlanOfCareSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Consultation Request Plan Of Care Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationRequest#validateConsultationRequestSocialHistorySection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Consultation Request Social History Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationRequest#validateConsultationRequestVitalSignsSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Consultation Request Vital Signs Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationRequest#validateConsultationRequestChiefComplaintSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Consultation Request Chief Complaint Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationRequest#validateConsultationRequestChiefComplaintAndReasonForVisitSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Consultation Request Chief Complaint And Reason For Visit + * Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationRequest#validateConsultationRequestGeneralStatusSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Consultation Request General Status Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationRequest#validateConsultationRequestHistoryOfPastIllnessSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Consultation Request History Of Past Illness Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationRequest#validateConsultationRequestPayersSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Consultation Request Payers Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationRequest#getAllergiesSectionEntriesOptional() + * Get Allergies Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationRequest#getAssessmentAndPlanSection() + * Get Assessment And Plan Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationRequest#getHistoryOfPresentIllnessSection() + * Get History Of Present Illness Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationRequest#getPhysicalExamSection() + * Get Physical Exam Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationRequest#getReasonForReferralSection() + * Get Reason For Referral Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationRequest#getMedicationsSectionEntriesOptional() + * Get Medications Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationRequest#getProblemSectionEntriesOptional() + * Get Problem Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationRequest#getProceduresSectionEntriesOptional() + * Get Procedures Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationRequest#getResultsSectionEntriesOptional() + * Get Results Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationRequest#getAdvanceDirectivesSectionEntriesOptional() + * Get Advance Directives Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationRequest#getEncountersSectionEntriesOptional() + * Get Encounters Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationRequest#getFamilyHistorySection() + * Get Family History Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationRequest#getFunctionalStatusSection() + * Get Functional Status Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationRequest#getImmunizationsSectionEntriesOptional() + * Get Immunizations Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationRequest#getMedicalEquipmentSection() + * Get Medical Equipment Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationRequest#getPlanOfCareSection() + * Get Plan Of Care Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationRequest#getSocialHistorySection() + * Get Social History Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationRequest#getVitalSignsSectionEntriesOptional() + * Get Vital Signs Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationRequest#getChiefComplaintSection() + * Get Chief Complaint Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationRequest#getChiefComplaintAndReasonForVisitSection() + * Get Chief Complaint And Reason For Visit Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationRequest#getGeneralStatusSection() + * Get General Status Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationRequest#getHistoryOfPastIllnessSection() + * Get History Of Past Illness Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationRequest#getPayersSection() + * Get Payers Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationRequest#validateGeneralHeaderConstraintsTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate General Header Constraints Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class ConsultationRequestTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationRequestAllergiesSectionEntriesOptional() { + OperationsTestCase validateConsultationRequestAllergiesSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateConsultationRequestAllergiesSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_REQUEST_ALLERGIES_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationRequest target) { + + } + + @Override + protected void updateToPass(ConsultationRequest target) { + target.init(); + + /* AllergiesSectionEntriesOptional */ + AllergiesSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createAllergiesSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationRequestOperations.validateConsultationRequestAllergiesSectionEntriesOptional( + (ConsultationRequest) objectToTest, diagnostician, map); + } + + }; + + validateConsultationRequestAllergiesSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationRequestAssessmentAndPlanSection() { + OperationsTestCase validateConsultationRequestAssessmentAndPlanSectionTestCase = new OperationsTestCase( + "validateConsultationRequestAssessmentAndPlanSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_REQUEST_ASSESSMENT_AND_PLAN_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationRequest target) { + + } + + @Override + protected void updateToPass(ConsultationRequest target) { + target.init(); + + /* AssessmentAndPlanSection */ + AssessmentAndPlanSection section = + + ConsolFactory.eINSTANCE.createAssessmentAndPlanSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationRequestOperations.validateConsultationRequestAssessmentAndPlanSection( + (ConsultationRequest) objectToTest, diagnostician, map); + } + + }; + + validateConsultationRequestAssessmentAndPlanSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationRequestHistoryOfPresentIllnessSection() { + OperationsTestCase validateConsultationRequestHistoryOfPresentIllnessSectionTestCase = new OperationsTestCase( + "validateConsultationRequestHistoryOfPresentIllnessSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_REQUEST_HISTORY_OF_PRESENT_ILLNESS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationRequest target) { + + } + + @Override + protected void updateToPass(ConsultationRequest target) { + target.init(); + + /* HistoryOfPresentIllnessSection */ + HistoryOfPresentIllnessSection section = + + ConsolFactory.eINSTANCE.createHistoryOfPresentIllnessSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationRequestOperations.validateConsultationRequestHistoryOfPresentIllnessSection( + (ConsultationRequest) objectToTest, diagnostician, map); + } + + }; + + validateConsultationRequestHistoryOfPresentIllnessSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationRequestPhysicalExamSection() { + OperationsTestCase validateConsultationRequestPhysicalExamSectionTestCase = new OperationsTestCase( + "validateConsultationRequestPhysicalExamSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_REQUEST_PHYSICAL_EXAM_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationRequest target) { + + } + + @Override + protected void updateToPass(ConsultationRequest target) { + target.init(); + + /* PhysicalExamSection */ + PhysicalExamSection section = + + ConsolFactory.eINSTANCE.createPhysicalExamSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationRequestOperations.validateConsultationRequestPhysicalExamSection( + (ConsultationRequest) objectToTest, diagnostician, map); + } + + }; + + validateConsultationRequestPhysicalExamSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationRequestReasonForReferralSection() { + OperationsTestCase validateConsultationRequestReasonForReferralSectionTestCase = new OperationsTestCase( + "validateConsultationRequestReasonForReferralSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_REQUEST_REASON_FOR_REFERRAL_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationRequest target) { + + } + + @Override + protected void updateToPass(ConsultationRequest target) { + target.init(); + + /* ReasonForReferralSection */ + ReasonForReferralSection section = + + ConsolFactory.eINSTANCE.createReasonForReferralSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationRequestOperations.validateConsultationRequestReasonForReferralSection( + (ConsultationRequest) objectToTest, diagnostician, map); + } + + }; + + validateConsultationRequestReasonForReferralSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationRequestMedicationsSectionEntriesOptional() { + OperationsTestCase validateConsultationRequestMedicationsSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateConsultationRequestMedicationsSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_REQUEST_MEDICATIONS_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationRequest target) { + + } + + @Override + protected void updateToPass(ConsultationRequest target) { + target.init(); + + /* MedicationsSectionEntriesOptional */ + MedicationsSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createMedicationsSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationRequestOperations.validateConsultationRequestMedicationsSectionEntriesOptional( + (ConsultationRequest) objectToTest, diagnostician, map); + } + + }; + + validateConsultationRequestMedicationsSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationRequestProblemSectionEntriesOptional() { + OperationsTestCase validateConsultationRequestProblemSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateConsultationRequestProblemSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_REQUEST_PROBLEM_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationRequest target) { + + } + + @Override + protected void updateToPass(ConsultationRequest target) { + target.init(); + + /* ProblemSectionEntriesOptional */ + ProblemSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createProblemSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationRequestOperations.validateConsultationRequestProblemSectionEntriesOptional( + (ConsultationRequest) objectToTest, diagnostician, map); + } + + }; + + validateConsultationRequestProblemSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationRequestProceduresSectionEntriesOptional() { + OperationsTestCase validateConsultationRequestProceduresSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateConsultationRequestProceduresSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_REQUEST_PROCEDURES_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationRequest target) { + + } + + @Override + protected void updateToPass(ConsultationRequest target) { + target.init(); + + /* ProceduresSectionEntriesOptional */ + ProceduresSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createProceduresSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationRequestOperations.validateConsultationRequestProceduresSectionEntriesOptional( + (ConsultationRequest) objectToTest, diagnostician, map); + } + + }; + + validateConsultationRequestProceduresSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationRequestResultsSectionEntriesOptional() { + OperationsTestCase validateConsultationRequestResultsSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateConsultationRequestResultsSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_REQUEST_RESULTS_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationRequest target) { + + } + + @Override + protected void updateToPass(ConsultationRequest target) { + target.init(); + + /* ResultsSectionEntriesOptional */ + ResultsSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createResultsSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationRequestOperations.validateConsultationRequestResultsSectionEntriesOptional( + (ConsultationRequest) objectToTest, diagnostician, map); + } + + }; + + validateConsultationRequestResultsSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationRequestAdvanceDirectivesSectionEntriesOptional() { + OperationsTestCase validateConsultationRequestAdvanceDirectivesSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateConsultationRequestAdvanceDirectivesSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_REQUEST_ADVANCE_DIRECTIVES_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationRequest target) { + + } + + @Override + protected void updateToPass(ConsultationRequest target) { + target.init(); + + /* AdvanceDirectivesSectionEntriesOptional */ + AdvanceDirectivesSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createAdvanceDirectivesSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationRequestOperations.validateConsultationRequestAdvanceDirectivesSectionEntriesOptional( + (ConsultationRequest) objectToTest, diagnostician, map); + } + + }; + + validateConsultationRequestAdvanceDirectivesSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationRequestEncountersSectionEntriesOptional() { + OperationsTestCase validateConsultationRequestEncountersSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateConsultationRequestEncountersSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_REQUEST_ENCOUNTERS_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationRequest target) { + + } + + @Override + protected void updateToPass(ConsultationRequest target) { + target.init(); + + /* EncountersSectionEntriesOptional */ + EncountersSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createEncountersSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationRequestOperations.validateConsultationRequestEncountersSectionEntriesOptional( + (ConsultationRequest) objectToTest, diagnostician, map); + } + + }; + + validateConsultationRequestEncountersSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationRequestFamilyHistorySection() { + OperationsTestCase validateConsultationRequestFamilyHistorySectionTestCase = new OperationsTestCase( + "validateConsultationRequestFamilyHistorySection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_REQUEST_FAMILY_HISTORY_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationRequest target) { + + } + + @Override + protected void updateToPass(ConsultationRequest target) { + target.init(); + + /* FamilyHistorySection */ + FamilyHistorySection section = + + ConsolFactory.eINSTANCE.createFamilyHistorySection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationRequestOperations.validateConsultationRequestFamilyHistorySection( + (ConsultationRequest) objectToTest, diagnostician, map); + } + + }; + + validateConsultationRequestFamilyHistorySectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationRequestFunctionalStatusSection() { + OperationsTestCase validateConsultationRequestFunctionalStatusSectionTestCase = new OperationsTestCase( + "validateConsultationRequestFunctionalStatusSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_REQUEST_FUNCTIONAL_STATUS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationRequest target) { + + } + + @Override + protected void updateToPass(ConsultationRequest target) { + target.init(); + + /* FunctionalStatusSection */ + FunctionalStatusSection section = + + ConsolFactory.eINSTANCE.createFunctionalStatusSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationRequestOperations.validateConsultationRequestFunctionalStatusSection( + (ConsultationRequest) objectToTest, diagnostician, map); + } + + }; + + validateConsultationRequestFunctionalStatusSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationRequestImmunizationsSectionEntriesOptional() { + OperationsTestCase validateConsultationRequestImmunizationsSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateConsultationRequestImmunizationsSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_REQUEST_IMMUNIZATIONS_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationRequest target) { + + } + + @Override + protected void updateToPass(ConsultationRequest target) { + target.init(); + + /* ImmunizationsSectionEntriesOptional */ + ImmunizationsSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createImmunizationsSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationRequestOperations.validateConsultationRequestImmunizationsSectionEntriesOptional( + (ConsultationRequest) objectToTest, diagnostician, map); + } + + }; + + validateConsultationRequestImmunizationsSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationRequestMedicalEquipmentSection() { + OperationsTestCase validateConsultationRequestMedicalEquipmentSectionTestCase = new OperationsTestCase( + "validateConsultationRequestMedicalEquipmentSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_REQUEST_MEDICAL_EQUIPMENT_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationRequest target) { + + } + + @Override + protected void updateToPass(ConsultationRequest target) { + target.init(); + + /* MedicalEquipmentSection */ + MedicalEquipmentSection section = + + ConsolFactory.eINSTANCE.createMedicalEquipmentSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationRequestOperations.validateConsultationRequestMedicalEquipmentSection( + (ConsultationRequest) objectToTest, diagnostician, map); + } + + }; + + validateConsultationRequestMedicalEquipmentSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationRequestPlanOfCareSection() { + OperationsTestCase validateConsultationRequestPlanOfCareSectionTestCase = new OperationsTestCase( + "validateConsultationRequestPlanOfCareSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_REQUEST_PLAN_OF_CARE_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationRequest target) { + + } + + @Override + protected void updateToPass(ConsultationRequest target) { + target.init(); + + /* PlanOfCareSection */ + PlanOfCareSection section = + + ConsolFactory.eINSTANCE.createPlanOfCareSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationRequestOperations.validateConsultationRequestPlanOfCareSection( + (ConsultationRequest) objectToTest, diagnostician, map); + } + + }; + + validateConsultationRequestPlanOfCareSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationRequestSocialHistorySection() { + OperationsTestCase validateConsultationRequestSocialHistorySectionTestCase = new OperationsTestCase( + "validateConsultationRequestSocialHistorySection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_REQUEST_SOCIAL_HISTORY_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationRequest target) { + + } + + @Override + protected void updateToPass(ConsultationRequest target) { + target.init(); + + /* SocialHistorySection */ + SocialHistorySection section = + + ConsolFactory.eINSTANCE.createSocialHistorySection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationRequestOperations.validateConsultationRequestSocialHistorySection( + (ConsultationRequest) objectToTest, diagnostician, map); + } + + }; + + validateConsultationRequestSocialHistorySectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationRequestVitalSignsSectionEntriesOptional() { + OperationsTestCase validateConsultationRequestVitalSignsSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateConsultationRequestVitalSignsSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_REQUEST_VITAL_SIGNS_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + protected void updateToFail(ConsultationRequest target) { + + } + + protected void updateToPass(ConsultationRequest target) { + target.init(); + + /* VitalSignsSectionEntriesOptional */ + VitalSignsSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createVitalSignsSectionEntriesOptional().init(); + + target.addSection(section); + + } + + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationRequestOperations.validateConsultationRequestVitalSignsSectionEntriesOptional( + (ConsultationRequest) objectToTest, diagnostician, map); + } + + }; + + validateConsultationRequestVitalSignsSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationRequestChiefComplaintSection() { + OperationsTestCase validateConsultationRequestChiefComplaintSectionTestCase = new OperationsTestCase( + "validateConsultationRequestChiefComplaintSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_REQUEST_CHIEF_COMPLAINT_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + protected void updateToFail(ConsultationRequest target) { + + } + + protected void updateToPass(ConsultationRequest target) { + target.init(); + + /* ChiefComplaintSection */ + ChiefComplaintSection section = + + ConsolFactory.eINSTANCE.createChiefComplaintSection().init(); + + target.addSection(section); + + } + + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationRequestOperations.validateConsultationRequestChiefComplaintSection( + (ConsultationRequest) objectToTest, diagnostician, map); + } + + }; + + validateConsultationRequestChiefComplaintSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationRequestChiefComplaintAndReasonForVisitSection() { + OperationsTestCase validateConsultationRequestChiefComplaintAndReasonForVisitSectionTestCase = new OperationsTestCase( + "validateConsultationRequestChiefComplaintAndReasonForVisitSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_REQUEST_CHIEF_COMPLAINT_AND_REASON_FOR_VISIT_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + protected void updateToFail(ConsultationRequest target) { + + } + + protected void updateToPass(ConsultationRequest target) { + target.init(); + + /* ChiefComplaintAndReasonForVisitSection */ + ChiefComplaintAndReasonForVisitSection section = + + ConsolFactory.eINSTANCE.createChiefComplaintAndReasonForVisitSection().init(); + + target.addSection(section); + + } + + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationRequestOperations.validateConsultationRequestChiefComplaintAndReasonForVisitSection( + (ConsultationRequest) objectToTest, diagnostician, map); + } + + }; + + validateConsultationRequestChiefComplaintAndReasonForVisitSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationRequestGeneralStatusSection() { + OperationsTestCase validateConsultationRequestGeneralStatusSectionTestCase = new OperationsTestCase( + "validateConsultationRequestGeneralStatusSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_REQUEST_GENERAL_STATUS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + protected void updateToFail(ConsultationRequest target) { + + } + + protected void updateToPass(ConsultationRequest target) { + target.init(); + + /* GeneralStatusSection */ + GeneralStatusSection section = + + ConsolFactory.eINSTANCE.createGeneralStatusSection().init(); + + target.addSection(section); + + } + + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationRequestOperations.validateConsultationRequestGeneralStatusSection( + (ConsultationRequest) objectToTest, diagnostician, map); + } + + }; + + validateConsultationRequestGeneralStatusSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationRequestHistoryOfPastIllnessSection() { + OperationsTestCase validateConsultationRequestHistoryOfPastIllnessSectionTestCase = new OperationsTestCase( + "validateConsultationRequestHistoryOfPastIllnessSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_REQUEST_HISTORY_OF_PAST_ILLNESS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + protected void updateToFail(ConsultationRequest target) { + + } + + protected void updateToPass(ConsultationRequest target) { + target.init(); + + /* HistoryOfPastIllnessSection */ + HistoryOfPastIllnessSection section = + + ConsolFactory.eINSTANCE.createHistoryOfPastIllnessSection().init(); + + target.addSection(section); + + } + + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationRequestOperations.validateConsultationRequestHistoryOfPastIllnessSection( + (ConsultationRequest) objectToTest, diagnostician, map); + } + + }; + + validateConsultationRequestHistoryOfPastIllnessSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationRequestPayersSection() { + OperationsTestCase validateConsultationRequestPayersSectionTestCase = new OperationsTestCase( + "validateConsultationRequestPayersSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_REQUEST_PAYERS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + protected void updateToFail(ConsultationRequest target) { + + } + + protected void updateToPass(ConsultationRequest target) { + target.init(); + + /* PayersSection */ + PayersSection section = + + ConsolFactory.eINSTANCE.createPayersSection().init(); + + target.addSection(section); + + } + + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationRequestOperations.validateConsultationRequestPayersSection( + (ConsultationRequest) objectToTest, diagnostician, map); + } + + }; + + validateConsultationRequestPayersSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetAllergiesSectionEntriesOptional() { + + ConsultationRequest target = objectFactory.create(); + target.getAllergiesSectionEntriesOptional(); + + } + + /** + * + * @generated + */ + @Test + public void testGetAssessmentAndPlanSection() { + + ConsultationRequest target = objectFactory.create(); + target.getAssessmentAndPlanSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetHistoryOfPresentIllnessSection() { + + ConsultationRequest target = objectFactory.create(); + target.getHistoryOfPresentIllnessSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPhysicalExamSection() { + + ConsultationRequest target = objectFactory.create(); + target.getPhysicalExamSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetReasonForReferralSection() { + + ConsultationRequest target = objectFactory.create(); + target.getReasonForReferralSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetMedicationsSectionEntriesOptional() { + + ConsultationRequest target = objectFactory.create(); + target.getMedicationsSectionEntriesOptional(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProblemSectionEntriesOptional() { + + ConsultationRequest target = objectFactory.create(); + target.getProblemSectionEntriesOptional(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProceduresSectionEntriesOptional() { + + ConsultationRequest target = objectFactory.create(); + target.getProceduresSectionEntriesOptional(); + + } + + /** + * + * @generated + */ + @Test + public void testGetResultsSectionEntriesOptional() { + + ConsultationRequest target = objectFactory.create(); + target.getResultsSectionEntriesOptional(); + + } + + /** + * + * @generated + */ + @Test + public void testGetAdvanceDirectivesSectionEntriesOptional() { + + ConsultationRequest target = objectFactory.create(); + target.getAdvanceDirectivesSectionEntriesOptional(); + + } + + /** + * + * @generated + */ + @Test + public void testGetEncountersSectionEntriesOptional() { + + ConsultationRequest target = objectFactory.create(); + target.getEncountersSectionEntriesOptional(); + + } + + /** + * + * @generated + */ + @Test + public void testGetFamilyHistorySection() { + + ConsultationRequest target = objectFactory.create(); + target.getFamilyHistorySection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetFunctionalStatusSection() { + + ConsultationRequest target = objectFactory.create(); + target.getFunctionalStatusSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetImmunizationsSectionEntriesOptional() { + + ConsultationRequest target = objectFactory.create(); + target.getImmunizationsSectionEntriesOptional(); + + } + + /** + * + * @generated + */ + @Test + public void testGetMedicalEquipmentSection() { + + ConsultationRequest target = objectFactory.create(); + target.getMedicalEquipmentSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPlanOfCareSection() { + + ConsultationRequest target = objectFactory.create(); + target.getPlanOfCareSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetSocialHistorySection() { + + ConsultationRequest target = objectFactory.create(); + target.getSocialHistorySection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetVitalSignsSectionEntriesOptional() { + + ConsultationRequest target = objectFactory.create(); + target.getVitalSignsSectionEntriesOptional(); + + } + + /** + * + * @generated + */ + @Test + public void testGetChiefComplaintSection() { + + ConsultationRequest target = objectFactory.create(); + target.getChiefComplaintSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetChiefComplaintAndReasonForVisitSection() { + + ConsultationRequest target = objectFactory.create(); + target.getChiefComplaintAndReasonForVisitSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetGeneralStatusSection() { + + ConsultationRequest target = objectFactory.create(); + target.getGeneralStatusSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetHistoryOfPastIllnessSection() { + + ConsultationRequest target = objectFactory.create(); + target.getHistoryOfPastIllnessSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPayersSection() { + + ConsultationRequest target = objectFactory.create(); + target.getPayersSection(); + + } + + /** + * + * @generated + */ + @Test + public void testValidateGeneralHeaderConstraintsTemplateId() { + OperationsTestCase validateGeneralHeaderConstraintsTemplateIdTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsTemplateId", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + protected void updateToFail(ConsultationRequest target) { + + } + + protected void updateToPass(ConsultationRequest target) { + target.init(); + + } + + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationRequestOperations.validateGeneralHeaderConstraintsTemplateId( + (ConsultationRequest) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ConsultationRequestOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public ConsultationRequest create() { + return ConsoltocFactory.eINSTANCE.createConsultationRequest(); + } + } + + /** + * + * @generated NOT + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends ConsultationRequestOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + protected EObject getObjectToTest() { + return null; + } + +} // ConsultationRequestOperations diff --git a/org.openhealthtools.mdht.uml.cda.consoltoc.tests/src/org/openhealthtools/mdht/uml/cda/consoltoc/tests/ConsultationSummaryTest.java b/org.openhealthtools.mdht.uml.cda.consoltoc.tests/src/org/openhealthtools/mdht/uml/cda/consoltoc/tests/ConsultationSummaryTest.java new file mode 100644 index 000000000..896d9f10f --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consoltoc.tests/src/org/openhealthtools/mdht/uml/cda/consoltoc/tests/ConsultationSummaryTest.java @@ -0,0 +1,1053 @@ +/******************************************************************************* + * Copyright (c) 2012 Rama Ramakrishnan and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Rama Ramakrishnan (Agilex Corporation) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consoltoc.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; + +import org.eclipse.emf.ecore.EObject; + +import org.junit.Test; + +import org.openhealthtools.mdht.uml.cda.consol.AdvanceDirectivesSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.AllergiesSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.EncountersSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.FamilyHistorySection; +import org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusSection; +import org.openhealthtools.mdht.uml.cda.consol.ImmunizationsSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.MedicalEquipmentSection; +import org.openhealthtools.mdht.uml.cda.consol.MedicationsSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.PayersSection; +import org.openhealthtools.mdht.uml.cda.consol.PlanOfCareSection; +import org.openhealthtools.mdht.uml.cda.consol.ProblemSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.ProceduresSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.ResultsSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.SocialHistorySection; +import org.openhealthtools.mdht.uml.cda.consol.VitalSignsSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consoltoc.ConsoltocFactory; +import org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationSummary; + +import org.openhealthtools.mdht.uml.cda.consoltoc.operations.ConsultationSummaryOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Consultation Summary' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationSummary#validateConsultationSummaryAllergiesSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Consultation Summary Allergies Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationSummary#validateConsultationSummaryMedicationsSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Consultation Summary Medications Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationSummary#validateConsultationSummaryProblemSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Consultation Summary Problem Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationSummary#validateConsultationSummaryResultsSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Consultation Summary Results Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationSummary#validateConsultationSummaryAdvanceDirectivesSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Consultation Summary Advance Directives Section Entries Optional + * }
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationSummary#validateConsultationSummaryEncountersSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Consultation Summary Encounters Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationSummary#validateConsultationSummaryFamilyHistorySection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Consultation Summary Family History Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationSummary#validateConsultationSummaryFunctionalStatusSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Consultation Summary Functional Status Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationSummary#validateConsultationSummaryImmunizationsSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Consultation Summary Immunizations Section Entries Optional + * }
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationSummary#validateConsultationSummaryProceduresSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Consultation Summary Procedures Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationSummary#validateConsultationSummaryMedicalEquipmentSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Consultation Summary Medical Equipment Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationSummary#validateConsultationSummaryPayersSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Consultation Summary Payers Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationSummary#validateConsultationSummaryPlanOfCareSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Consultation Summary Plan Of Care Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationSummary#validateConsultationSummarySocialHistorySection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Consultation Summary Social History Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationSummary#validateConsultationSummaryVitalSignsSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Consultation Summary Vital Signs Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationSummary#getAllergiesSectionEntriesOptional() + * Get Allergies Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationSummary#getMedicationsSectionEntriesOptional() + * Get Medications Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationSummary#getProblemSectionEntriesOptional() + * Get Problem Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationSummary#getResultsSectionEntriesOptional() + * Get Results Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationSummary#getAdvanceDirectivesSectionEntriesOptional() + * Get Advance Directives Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationSummary#getEncountersSectionEntriesOptional() + * Get Encounters Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationSummary#getFamilyHistorySection() + * Get Family History Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationSummary#getFunctionalStatusSection() + * Get Functional Status Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationSummary#getImmunizationsSectionEntriesOptional() + * Get Immunizations Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationSummary#getProceduresSectionEntriesOptional() + * Get Procedures Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationSummary#getMedicalEquipmentSection() + * Get Medical Equipment Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationSummary#getPayersSection() + * Get Payers Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationSummary#getPlanOfCareSection() + * Get Plan Of Care Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationSummary#getSocialHistorySection() + * Get Social History Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationSummary#getVitalSignsSectionEntriesOptional() + * Get Vital Signs Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.ConsultationSummary#validateGeneralHeaderConstraintsTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate General Header Constraints Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class ConsultationSummaryTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationSummaryAllergiesSectionEntriesOptional() { + OperationsTestCase validateConsultationSummaryAllergiesSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateConsultationSummaryAllergiesSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_SUMMARY_ALLERGIES_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationSummary target) { + + } + + @Override + protected void updateToPass(ConsultationSummary target) { + target.init(); + + /* AllergiesSectionEntriesOptional */ + AllergiesSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createAllergiesSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationSummaryOperations.validateConsultationSummaryAllergiesSectionEntriesOptional( + (ConsultationSummary) objectToTest, diagnostician, map); + } + + }; + + validateConsultationSummaryAllergiesSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationSummaryMedicationsSectionEntriesOptional() { + OperationsTestCase validateConsultationSummaryMedicationsSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateConsultationSummaryMedicationsSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_SUMMARY_MEDICATIONS_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationSummary target) { + + } + + @Override + protected void updateToPass(ConsultationSummary target) { + target.init(); + + /* MedicationsSectionEntriesOptional */ + MedicationsSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createMedicationsSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationSummaryOperations.validateConsultationSummaryMedicationsSectionEntriesOptional( + (ConsultationSummary) objectToTest, diagnostician, map); + } + + }; + + validateConsultationSummaryMedicationsSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationSummaryProblemSectionEntriesOptional() { + OperationsTestCase validateConsultationSummaryProblemSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateConsultationSummaryProblemSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_SUMMARY_PROBLEM_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationSummary target) { + + } + + @Override + protected void updateToPass(ConsultationSummary target) { + target.init(); + + /* ProblemSectionEntriesOptional */ + ProblemSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createProblemSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationSummaryOperations.validateConsultationSummaryProblemSectionEntriesOptional( + (ConsultationSummary) objectToTest, diagnostician, map); + } + + }; + + validateConsultationSummaryProblemSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationSummaryResultsSectionEntriesOptional() { + OperationsTestCase validateConsultationSummaryResultsSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateConsultationSummaryResultsSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_SUMMARY_RESULTS_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationSummary target) { + + } + + @Override + protected void updateToPass(ConsultationSummary target) { + target.init(); + + /* ResultsSectionEntriesOptional */ + ResultsSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createResultsSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationSummaryOperations.validateConsultationSummaryResultsSectionEntriesOptional( + (ConsultationSummary) objectToTest, diagnostician, map); + } + + }; + + validateConsultationSummaryResultsSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationSummaryAdvanceDirectivesSectionEntriesOptional() { + OperationsTestCase validateConsultationSummaryAdvanceDirectivesSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateConsultationSummaryAdvanceDirectivesSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_SUMMARY_ADVANCE_DIRECTIVES_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationSummary target) { + + } + + @Override + protected void updateToPass(ConsultationSummary target) { + target.init(); + + /* AdvanceDirectivesSectionEntriesOptional */ + AdvanceDirectivesSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createAdvanceDirectivesSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationSummaryOperations.validateConsultationSummaryAdvanceDirectivesSectionEntriesOptional( + (ConsultationSummary) objectToTest, diagnostician, map); + } + + }; + + validateConsultationSummaryAdvanceDirectivesSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationSummaryEncountersSectionEntriesOptional() { + OperationsTestCase validateConsultationSummaryEncountersSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateConsultationSummaryEncountersSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_SUMMARY_ENCOUNTERS_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationSummary target) { + + } + + @Override + protected void updateToPass(ConsultationSummary target) { + target.init(); + + /* EncountersSectionEntriesOptional */ + EncountersSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createEncountersSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationSummaryOperations.validateConsultationSummaryEncountersSectionEntriesOptional( + (ConsultationSummary) objectToTest, diagnostician, map); + } + + }; + + validateConsultationSummaryEncountersSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationSummaryFamilyHistorySection() { + OperationsTestCase validateConsultationSummaryFamilyHistorySectionTestCase = new OperationsTestCase( + "validateConsultationSummaryFamilyHistorySection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_SUMMARY_FAMILY_HISTORY_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationSummary target) { + + } + + @Override + protected void updateToPass(ConsultationSummary target) { + target.init(); + + /* FamilyHistorySection */ + FamilyHistorySection section = + + ConsolFactory.eINSTANCE.createFamilyHistorySection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationSummaryOperations.validateConsultationSummaryFamilyHistorySection( + (ConsultationSummary) objectToTest, diagnostician, map); + } + + }; + + validateConsultationSummaryFamilyHistorySectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationSummaryFunctionalStatusSection() { + OperationsTestCase validateConsultationSummaryFunctionalStatusSectionTestCase = new OperationsTestCase( + "validateConsultationSummaryFunctionalStatusSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_SUMMARY_FUNCTIONAL_STATUS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationSummary target) { + + } + + @Override + protected void updateToPass(ConsultationSummary target) { + target.init(); + + /* FunctionalStatusSection */ + FunctionalStatusSection section = + + ConsolFactory.eINSTANCE.createFunctionalStatusSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationSummaryOperations.validateConsultationSummaryFunctionalStatusSection( + (ConsultationSummary) objectToTest, diagnostician, map); + } + + }; + + validateConsultationSummaryFunctionalStatusSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationSummaryImmunizationsSectionEntriesOptional() { + OperationsTestCase validateConsultationSummaryImmunizationsSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateConsultationSummaryImmunizationsSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_SUMMARY_IMMUNIZATIONS_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationSummary target) { + + } + + @Override + protected void updateToPass(ConsultationSummary target) { + target.init(); + + /* ImmunizationsSectionEntriesOptional */ + ImmunizationsSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createImmunizationsSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationSummaryOperations.validateConsultationSummaryImmunizationsSectionEntriesOptional( + (ConsultationSummary) objectToTest, diagnostician, map); + } + + }; + + validateConsultationSummaryImmunizationsSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationSummaryProceduresSectionEntriesOptional() { + OperationsTestCase validateConsultationSummaryProceduresSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateConsultationSummaryProceduresSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_SUMMARY_PROCEDURES_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationSummary target) { + + } + + @Override + protected void updateToPass(ConsultationSummary target) { + target.init(); + + /* ProceduresSectionEntriesOptional */ + ProceduresSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createProceduresSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationSummaryOperations.validateConsultationSummaryProceduresSectionEntriesOptional( + (ConsultationSummary) objectToTest, diagnostician, map); + } + + }; + + validateConsultationSummaryProceduresSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationSummaryMedicalEquipmentSection() { + OperationsTestCase validateConsultationSummaryMedicalEquipmentSectionTestCase = new OperationsTestCase( + "validateConsultationSummaryMedicalEquipmentSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_SUMMARY_MEDICAL_EQUIPMENT_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationSummary target) { + + } + + @Override + protected void updateToPass(ConsultationSummary target) { + target.init(); + + /* MedicalEquipmentSection */ + MedicalEquipmentSection section = + + ConsolFactory.eINSTANCE.createMedicalEquipmentSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationSummaryOperations.validateConsultationSummaryMedicalEquipmentSection( + (ConsultationSummary) objectToTest, diagnostician, map); + } + + }; + + validateConsultationSummaryMedicalEquipmentSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationSummaryPayersSection() { + OperationsTestCase validateConsultationSummaryPayersSectionTestCase = new OperationsTestCase( + "validateConsultationSummaryPayersSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_SUMMARY_PAYERS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationSummary target) { + + } + + @Override + protected void updateToPass(ConsultationSummary target) { + target.init(); + + /* PayersSection */ + PayersSection section = + + ConsolFactory.eINSTANCE.createPayersSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationSummaryOperations.validateConsultationSummaryPayersSection( + (ConsultationSummary) objectToTest, diagnostician, map); + } + + }; + + validateConsultationSummaryPayersSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationSummaryPlanOfCareSection() { + OperationsTestCase validateConsultationSummaryPlanOfCareSectionTestCase = new OperationsTestCase( + "validateConsultationSummaryPlanOfCareSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_SUMMARY_PLAN_OF_CARE_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationSummary target) { + + } + + @Override + protected void updateToPass(ConsultationSummary target) { + target.init(); + + /* PlanOfCareSection */ + PlanOfCareSection section = + + ConsolFactory.eINSTANCE.createPlanOfCareSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationSummaryOperations.validateConsultationSummaryPlanOfCareSection( + (ConsultationSummary) objectToTest, diagnostician, map); + } + + }; + + validateConsultationSummaryPlanOfCareSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationSummarySocialHistorySection() { + OperationsTestCase validateConsultationSummarySocialHistorySectionTestCase = new OperationsTestCase( + "validateConsultationSummarySocialHistorySection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_SUMMARY_SOCIAL_HISTORY_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationSummary target) { + + } + + @Override + protected void updateToPass(ConsultationSummary target) { + target.init(); + + /* SocialHistorySection */ + SocialHistorySection section = + + ConsolFactory.eINSTANCE.createSocialHistorySection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationSummaryOperations.validateConsultationSummarySocialHistorySection( + (ConsultationSummary) objectToTest, diagnostician, map); + } + + }; + + validateConsultationSummarySocialHistorySectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationSummaryVitalSignsSectionEntriesOptional() { + OperationsTestCase validateConsultationSummaryVitalSignsSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateConsultationSummaryVitalSignsSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_SUMMARY_VITAL_SIGNS_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationSummary target) { + + } + + @Override + protected void updateToPass(ConsultationSummary target) { + target.init(); + + /* VitalSignsSectionEntriesOptional */ + VitalSignsSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createVitalSignsSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationSummaryOperations.validateConsultationSummaryVitalSignsSectionEntriesOptional( + (ConsultationSummary) objectToTest, diagnostician, map); + } + + }; + + validateConsultationSummaryVitalSignsSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testGetAllergiesSectionEntriesOptional() { + + ConsultationSummary target = objectFactory.create(); + target.getAllergiesSectionEntriesOptional(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetMedicationsSectionEntriesOptional() { + + ConsultationSummary target = objectFactory.create(); + target.getMedicationsSectionEntriesOptional(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetProblemSectionEntriesOptional() { + + ConsultationSummary target = objectFactory.create(); + target.getProblemSectionEntriesOptional(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetResultsSectionEntriesOptional() { + + ConsultationSummary target = objectFactory.create(); + target.getResultsSectionEntriesOptional(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetAdvanceDirectivesSectionEntriesOptional() { + + ConsultationSummary target = objectFactory.create(); + target.getAdvanceDirectivesSectionEntriesOptional(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetEncountersSectionEntriesOptional() { + + ConsultationSummary target = objectFactory.create(); + target.getEncountersSectionEntriesOptional(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetFamilyHistorySection() { + + ConsultationSummary target = objectFactory.create(); + target.getFamilyHistorySection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetFunctionalStatusSection() { + + ConsultationSummary target = objectFactory.create(); + target.getFunctionalStatusSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetImmunizationsSectionEntriesOptional() { + + ConsultationSummary target = objectFactory.create(); + target.getImmunizationsSectionEntriesOptional(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProceduresSectionEntriesOptional() { + + ConsultationSummary target = objectFactory.create(); + target.getProceduresSectionEntriesOptional(); + + } + + /** + * + * @generated + */ + @Test + public void testGetMedicalEquipmentSection() { + + ConsultationSummary target = objectFactory.create(); + target.getMedicalEquipmentSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPayersSection() { + + ConsultationSummary target = objectFactory.create(); + target.getPayersSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPlanOfCareSection() { + + ConsultationSummary target = objectFactory.create(); + target.getPlanOfCareSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetSocialHistorySection() { + + ConsultationSummary target = objectFactory.create(); + target.getSocialHistorySection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetVitalSignsSectionEntriesOptional() { + + ConsultationSummary target = objectFactory.create(); + target.getVitalSignsSectionEntriesOptional(); + + } + + /** + * + * @generated + */ + @Test + public void testValidateGeneralHeaderConstraintsTemplateId() { + OperationsTestCase validateGeneralHeaderConstraintsTemplateIdTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsTemplateId", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationSummary target) { + + } + + @Override + protected void updateToPass(ConsultationSummary target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationSummaryOperations.validateGeneralHeaderConstraintsTemplateId( + (ConsultationSummary) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ConsultationSummaryOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public ConsultationSummary create() { + return ConsoltocFactory.eINSTANCE.createConsultationSummary(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends ConsultationSummaryOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ConsultationSummaryOperations diff --git a/org.openhealthtools.mdht.uml.cda.consoltoc.tests/src/org/openhealthtools/mdht/uml/cda/consoltoc/tests/DischargeInstructionsTest.java b/org.openhealthtools.mdht.uml.cda.consoltoc.tests/src/org/openhealthtools/mdht/uml/cda/consoltoc/tests/DischargeInstructionsTest.java new file mode 100644 index 000000000..80371da80 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consoltoc.tests/src/org/openhealthtools/mdht/uml/cda/consoltoc/tests/DischargeInstructionsTest.java @@ -0,0 +1,574 @@ +/******************************************************************************* + * Copyright (c) 2012 Rama Ramakrishnan and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Rama Ramakrishnan (Agilex Corporation) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consoltoc.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; + +import org.eclipse.emf.ecore.EObject; + +import org.junit.Test; + +import org.openhealthtools.mdht.uml.cda.consol.AdvanceDirectivesSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.AllergiesSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeMedicationsSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.ImmunizationsSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.MedicalEquipmentSection; +import org.openhealthtools.mdht.uml.cda.consol.PlanOfCareSection; +import org.openhealthtools.mdht.uml.cda.consol.ProblemSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consoltoc.ConsoltocFactory; +import org.openhealthtools.mdht.uml.cda.consoltoc.DischargeInstructions; + +import org.openhealthtools.mdht.uml.cda.consoltoc.operations.DischargeInstructionsOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Discharge Instructions' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeInstructions#validateDischargeInstructionsPlanOfCareSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Discharge Instructions Plan Of Care Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeInstructions#validateDischargeInstructionsAllergiesSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Discharge Instructions Allergies Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeInstructions#validateDischargeInstructionsProblemSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Discharge Instructions Problem Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeInstructions#validateDischargeInstructionsHospitalDischargeMedicationsSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Discharge Instructions Hospital Discharge Medications Section + * Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeInstructions#validateDischargeInstructionsAdvanceDirectivesSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Discharge Instructions Advance Directives Section Entries + * Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeInstructions#validateDischargeInstructionsImmunizationsSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Discharge Instructions Immunizations Section Entries Optional + * }
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeInstructions#validateDischargeInstructionsMedicalEquipmentSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Discharge Instructions Medical Equipment Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeInstructions#getPlanOfCareSection() + * Get Plan Of Care Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeInstructions#getAllergiesSectionEntriesOptional() + * Get Allergies Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeInstructions#getProblemSectionEntriesOptional() + * Get Problem Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeInstructions#getHospitalDischargeMedicationsSectionEntriesOptional() + * Get Hospital Discharge Medications Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeInstructions#getAdvanceDirectivesSectionEntriesOptional() + * Get Advance Directives Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeInstructions#getImmunizationsSectionEntriesOptional() + * Get Immunizations Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeInstructions#getMedicalEquipmentSection() + * Get Medical Equipment Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeInstructions#validateGeneralHeaderConstraintsTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate General Header Constraints Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class DischargeInstructionsTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateDischargeInstructionsPlanOfCareSection() { + OperationsTestCase validateDischargeInstructionsPlanOfCareSectionTestCase = new OperationsTestCase( + "validateDischargeInstructionsPlanOfCareSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_INSTRUCTIONS_PLAN_OF_CARE_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeInstructions target) { + + } + + @Override + protected void updateToPass(DischargeInstructions target) { + target.init(); + + /* PlanOfCareSection */ + PlanOfCareSection section = + + ConsolFactory.eINSTANCE.createPlanOfCareSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeInstructionsOperations.validateDischargeInstructionsPlanOfCareSection( + (DischargeInstructions) objectToTest, diagnostician, map); + } + + }; + + validateDischargeInstructionsPlanOfCareSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeInstructionsAllergiesSectionEntriesOptional() { + OperationsTestCase validateDischargeInstructionsAllergiesSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateDischargeInstructionsAllergiesSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_INSTRUCTIONS_ALLERGIES_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeInstructions target) { + + } + + @Override + protected void updateToPass(DischargeInstructions target) { + target.init(); + + /* AllergiesSectionEntriesOptional */ + AllergiesSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createAllergiesSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeInstructionsOperations.validateDischargeInstructionsAllergiesSectionEntriesOptional( + (DischargeInstructions) objectToTest, diagnostician, map); + } + + }; + + validateDischargeInstructionsAllergiesSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeInstructionsProblemSectionEntriesOptional() { + OperationsTestCase validateDischargeInstructionsProblemSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateDischargeInstructionsProblemSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_INSTRUCTIONS_PROBLEM_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeInstructions target) { + + } + + @Override + protected void updateToPass(DischargeInstructions target) { + target.init(); + + /* ProblemSectionEntriesOptional */ + ProblemSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createProblemSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeInstructionsOperations.validateDischargeInstructionsProblemSectionEntriesOptional( + (DischargeInstructions) objectToTest, diagnostician, map); + } + + }; + + validateDischargeInstructionsProblemSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeInstructionsHospitalDischargeMedicationsSectionEntriesOptional() { + OperationsTestCase validateDischargeInstructionsHospitalDischargeMedicationsSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateDischargeInstructionsHospitalDischargeMedicationsSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_INSTRUCTIONS_HOSPITAL_DISCHARGE_MEDICATIONS_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeInstructions target) { + + } + + @Override + protected void updateToPass(DischargeInstructions target) { + target.init(); + + /* HospitalDischargeMedicationsSectionEntriesOptional */ + HospitalDischargeMedicationsSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createHospitalDischargeMedicationsSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeInstructionsOperations.validateDischargeInstructionsHospitalDischargeMedicationsSectionEntriesOptional( + (DischargeInstructions) objectToTest, diagnostician, map); + } + + }; + + validateDischargeInstructionsHospitalDischargeMedicationsSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeInstructionsAdvanceDirectivesSectionEntriesOptional() { + OperationsTestCase validateDischargeInstructionsAdvanceDirectivesSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateDischargeInstructionsAdvanceDirectivesSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_INSTRUCTIONS_ADVANCE_DIRECTIVES_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeInstructions target) { + + } + + @Override + protected void updateToPass(DischargeInstructions target) { + target.init(); + + /* AdvanceDirectivesSectionEntriesOptional */ + AdvanceDirectivesSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createAdvanceDirectivesSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeInstructionsOperations.validateDischargeInstructionsAdvanceDirectivesSectionEntriesOptional( + (DischargeInstructions) objectToTest, diagnostician, map); + } + + }; + + validateDischargeInstructionsAdvanceDirectivesSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeInstructionsImmunizationsSectionEntriesOptional() { + OperationsTestCase validateDischargeInstructionsImmunizationsSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateDischargeInstructionsImmunizationsSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_INSTRUCTIONS_IMMUNIZATIONS_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeInstructions target) { + + } + + @Override + protected void updateToPass(DischargeInstructions target) { + target.init(); + + /* ImmunizationsSectionEntriesOptional */ + ImmunizationsSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createImmunizationsSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeInstructionsOperations.validateDischargeInstructionsImmunizationsSectionEntriesOptional( + (DischargeInstructions) objectToTest, diagnostician, map); + } + + }; + + validateDischargeInstructionsImmunizationsSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeInstructionsMedicalEquipmentSection() { + OperationsTestCase validateDischargeInstructionsMedicalEquipmentSectionTestCase = new OperationsTestCase( + "validateDischargeInstructionsMedicalEquipmentSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_INSTRUCTIONS_MEDICAL_EQUIPMENT_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeInstructions target) { + + } + + @Override + protected void updateToPass(DischargeInstructions target) { + target.init(); + + /* MedicalEquipmentSection */ + MedicalEquipmentSection section = + + ConsolFactory.eINSTANCE.createMedicalEquipmentSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeInstructionsOperations.validateDischargeInstructionsMedicalEquipmentSection( + (DischargeInstructions) objectToTest, diagnostician, map); + } + + }; + + validateDischargeInstructionsMedicalEquipmentSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetPlanOfCareSection() { + + DischargeInstructions target = objectFactory.create(); + target.getPlanOfCareSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetAllergiesSectionEntriesOptional() { + + DischargeInstructions target = objectFactory.create(); + target.getAllergiesSectionEntriesOptional(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProblemSectionEntriesOptional() { + + DischargeInstructions target = objectFactory.create(); + target.getProblemSectionEntriesOptional(); + + } + + /** + * + * @generated + */ + @Test + public void testGetHospitalDischargeMedicationsSectionEntriesOptional() { + + DischargeInstructions target = objectFactory.create(); + target.getHospitalDischargeMedicationsSectionEntriesOptional(); + + } + + /** + * + * @generated + */ + @Test + public void testGetAdvanceDirectivesSectionEntriesOptional() { + + DischargeInstructions target = objectFactory.create(); + target.getAdvanceDirectivesSectionEntriesOptional(); + + } + + /** + * + * @generated + */ + @Test + public void testGetImmunizationsSectionEntriesOptional() { + + DischargeInstructions target = objectFactory.create(); + target.getImmunizationsSectionEntriesOptional(); + + } + + /** + * + * @generated + */ + @Test + public void testGetMedicalEquipmentSection() { + + DischargeInstructions target = objectFactory.create(); + target.getMedicalEquipmentSection(); + + } + + /** + * + * @generated + */ + @Test + public void testValidateGeneralHeaderConstraintsTemplateId() { + OperationsTestCase validateGeneralHeaderConstraintsTemplateIdTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsTemplateId", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeInstructions target) { + + } + + @Override + protected void updateToPass(DischargeInstructions target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeInstructionsOperations.validateGeneralHeaderConstraintsTemplateId( + (DischargeInstructions) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends DischargeInstructionsOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public DischargeInstructions create() { + return ConsoltocFactory.eINSTANCE.createDischargeInstructions(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends DischargeInstructionsOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // DischargeInstructionsOperations diff --git a/org.openhealthtools.mdht.uml.cda.consoltoc.tests/src/org/openhealthtools/mdht/uml/cda/consoltoc/tests/DischargeSummaryTest.java b/org.openhealthtools.mdht.uml.cda.consoltoc.tests/src/org/openhealthtools/mdht/uml/cda/consoltoc/tests/DischargeSummaryTest.java new file mode 100644 index 000000000..2b67b5286 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consoltoc.tests/src/org/openhealthtools/mdht/uml/cda/consoltoc/tests/DischargeSummaryTest.java @@ -0,0 +1,1339 @@ +/******************************************************************************* + * Copyright (c) 2012 Rama Ramakrishnan and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Rama Ramakrishnan (Agilex Corporation) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consoltoc.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.consol.AllergiesSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.ChiefComplaintAndReasonForVisitSection; +import org.openhealthtools.mdht.uml.cda.consol.ChiefComplaintSection; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.DischargeDietSection; +import org.openhealthtools.mdht.uml.cda.consol.FamilyHistorySection; +import org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusSection; +import org.openhealthtools.mdht.uml.cda.consol.HistoryOfPresentIllnessSection; +import org.openhealthtools.mdht.uml.cda.consol.HospitalCourseSection; +import org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeDiagnosisSection; +import org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeMedicationsSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.HospitalDischargePhysicalSection; +import org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeStudiesSummarySection; +import org.openhealthtools.mdht.uml.cda.consol.ImmunizationsSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.PlanOfCareSection; +import org.openhealthtools.mdht.uml.cda.consol.ProblemSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.ProceduresSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consol.ReasonForVisitSection; +import org.openhealthtools.mdht.uml.cda.consol.ReviewOfSystemsSection; +import org.openhealthtools.mdht.uml.cda.consol.SocialHistorySection; +import org.openhealthtools.mdht.uml.cda.consol.VitalSignsSectionEntriesOptional; +import org.openhealthtools.mdht.uml.cda.consoltoc.ConsoltocFactory; +import org.openhealthtools.mdht.uml.cda.consoltoc.DischargeSummary; +import org.openhealthtools.mdht.uml.cda.consoltoc.operations.DischargeSummaryOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Discharge Summary' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeSummary#validateDischargeSummaryAllergiesSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Discharge Summary Allergies Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeSummary#validateDischargeSummaryHospitalCourseSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Discharge Summary Hospital Course Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeSummary#validateDischargeSummaryHospitalDischargeDiagnosisSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Discharge Summary Hospital Discharge Diagnosis Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeSummary#validateDischargeSummaryHospitalDischargeMedicationsSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Discharge Summary Hospital Discharge Medications Section Entries + * Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeSummary#validateDischargeSummaryPlanOfCareSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Discharge Summary Plan Of Care Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeSummary#validateDischargeSummaryProblemSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Discharge Summary Problem Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeSummary#validateDischargeSummaryChiefComplaintSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Discharge Summary Chief Complaint Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeSummary#validateDischargeSummaryChiefComplaintAndReasonForVisitSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Discharge Summary Chief Complaint And Reason For Visit Section + * }
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeSummary#validateDischargeSummaryDischargeDietSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Discharge Summary Discharge Diet Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeSummary#validateDischargeSummaryFamilyHistorySection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Discharge Summary Family History Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeSummary#validateDischargeSummaryFunctionalStatusSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Discharge Summary Functional Status Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeSummary#validateDischargeSummaryHistoryOfPresentIllnessSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Discharge Summary History Of Present Illness Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeSummary#validateDischargeSummaryHospitalDischargePhysicalSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Discharge Summary Hospital Discharge Physical Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeSummary#validateDischargeSummaryHospitalDischargeStudiesSummarySection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Discharge Summary Hospital Discharge Studies Summary Section + * }
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeSummary#validateDischargeSummaryProceduresSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Discharge Summary Procedures Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeSummary#validateDischargeSummaryReasonForVisitSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Discharge Summary Reason For Visit Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeSummary#validateDischargeSummaryReviewOfSystemsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Discharge Summary Review Of Systems Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeSummary#validateDischargeSummarySocialHistorySection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Discharge Summary Social History Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeSummary#validateDischargeSummaryVitalSignsSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Discharge Summary Vital Signs Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeSummary#validateDischargeSummaryImmunizationsSectionEntriesOptional(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Discharge Summary Immunizations Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeSummary#getAllergiesSectionEntriesOptional() + * Get Allergies Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeSummary#getHospitalCourseSection() + * Get Hospital Course Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeSummary#getHospitalDischargeDiagnosisSection() + * Get Hospital Discharge Diagnosis Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeSummary#getHospitalDischargeMedicationsSectionEntriesOptional() + * Get Hospital Discharge Medications Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeSummary#getPlanOfCareSection() + * Get Plan Of Care Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeSummary#getProblemSectionEntriesOptional() + * Get Problem Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeSummary#getChiefComplaintSection() + * Get Chief Complaint Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeSummary#getChiefComplaintAndReasonForVisitSection() + * Get Chief Complaint And Reason For Visit Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeSummary#getDischargeDietSection() + * Get Discharge Diet Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeSummary#getFamilyHistorySection() + * Get Family History Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeSummary#getFunctionalStatusSection() + * Get Functional Status Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeSummary#getHistoryOfPresentIllnessSection() + * Get History Of Present Illness Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeSummary#getHospitalDischargePhysicalSection() + * Get Hospital Discharge Physical Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeSummary#getHospitalDischargeStudiesSummarySection() + * Get Hospital Discharge Studies Summary Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeSummary#getProceduresSectionEntriesOptional() + * Get Procedures Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeSummary#getReasonForVisitSection() + * Get Reason For Visit Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeSummary#getReviewOfSystemsSection() + * Get Review Of Systems Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeSummary#getSocialHistorySection() + * Get Social History Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeSummary#getVitalSignsSectionEntriesOptional() + * Get Vital Signs Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeSummary#getImmunizationsSectionEntriesOptional() + * Get Immunizations Section Entries Optional}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.consoltoc.DischargeSummary#validateGeneralHeaderConstraintsTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate General Header Constraints Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class DischargeSummaryTest extends CDAValidationTest { + /** + * + * @generated NOT + */ + @Test + public void testValidateDischargeSummaryAllergiesSectionEntriesOptional() { + OperationsTestCase validateDischargeSummaryAllergiesSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateDischargeSummaryAllergiesSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_ALLERGIES_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + /* AllergiesSectionEntriesOptional */ + AllergiesSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createAllergiesSectionEntriesOptional().init(); + target.addSection(section); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryAllergiesSectionEntriesOptional( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryAllergiesSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateDischargeSummaryHospitalCourseSection() { + OperationsTestCase validateDischargeSummaryHospitalCourseSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryHospitalCourseSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_HOSPITAL_COURSE_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* HospitalCourseSection */ + HospitalCourseSection section = + + ConsolFactory.eINSTANCE.createHospitalCourseSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryHospitalCourseSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryHospitalCourseSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryHospitalDischargeDiagnosisSection() { + OperationsTestCase validateDischargeSummaryHospitalDischargeDiagnosisSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryHospitalDischargeDiagnosisSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_HOSPITAL_DISCHARGE_DIAGNOSIS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* HospitalDischargeDiagnosisSection */ + HospitalDischargeDiagnosisSection section = + + ConsolFactory.eINSTANCE.createHospitalDischargeDiagnosisSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryHospitalDischargeDiagnosisSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryHospitalDischargeDiagnosisSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryHospitalDischargeMedicationsSectionEntriesOptional() { + OperationsTestCase validateDischargeSummaryHospitalDischargeMedicationsSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateDischargeSummaryHospitalDischargeMedicationsSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_HOSPITAL_DISCHARGE_MEDICATIONS_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* HospitalDischargeMedicationsSectionEntriesOptional */ + HospitalDischargeMedicationsSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createHospitalDischargeMedicationsSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryHospitalDischargeMedicationsSectionEntriesOptional( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryHospitalDischargeMedicationsSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryPlanOfCareSection() { + OperationsTestCase validateDischargeSummaryPlanOfCareSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryPlanOfCareSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_PLAN_OF_CARE_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* PlanOfCareSection */ + PlanOfCareSection section = + + ConsolFactory.eINSTANCE.createPlanOfCareSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryPlanOfCareSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryPlanOfCareSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryProblemSectionEntriesOptional() { + OperationsTestCase validateDischargeSummaryProblemSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateDischargeSummaryProblemSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_PROBLEM_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* ProblemSectionEntriesOptional */ + ProblemSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createProblemSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryProblemSectionEntriesOptional( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryProblemSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryChiefComplaintSection() { + OperationsTestCase validateDischargeSummaryChiefComplaintSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryChiefComplaintSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_CHIEF_COMPLAINT_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* ChiefComplaintSection */ + ChiefComplaintSection section = + + ConsolFactory.eINSTANCE.createChiefComplaintSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryChiefComplaintSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryChiefComplaintSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryChiefComplaintAndReasonForVisitSection() { + OperationsTestCase validateDischargeSummaryChiefComplaintAndReasonForVisitSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryChiefComplaintAndReasonForVisitSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_CHIEF_COMPLAINT_AND_REASON_FOR_VISIT_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* ChiefComplaintAndReasonForVisitSection */ + ChiefComplaintAndReasonForVisitSection section = + + ConsolFactory.eINSTANCE.createChiefComplaintAndReasonForVisitSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryChiefComplaintAndReasonForVisitSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryChiefComplaintAndReasonForVisitSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryDischargeDietSection() { + OperationsTestCase validateDischargeSummaryDischargeDietSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryDischargeDietSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_DISCHARGE_DIET_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* DischargeDietSection */ + DischargeDietSection section = + + ConsolFactory.eINSTANCE.createDischargeDietSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryDischargeDietSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryDischargeDietSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryFamilyHistorySection() { + OperationsTestCase validateDischargeSummaryFamilyHistorySectionTestCase = new OperationsTestCase( + "validateDischargeSummaryFamilyHistorySection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_FAMILY_HISTORY_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* FamilyHistorySection */ + FamilyHistorySection section = + + ConsolFactory.eINSTANCE.createFamilyHistorySection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryFamilyHistorySection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryFamilyHistorySectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryFunctionalStatusSection() { + OperationsTestCase validateDischargeSummaryFunctionalStatusSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryFunctionalStatusSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_FUNCTIONAL_STATUS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* FunctionalStatusSection */ + FunctionalStatusSection section = + + ConsolFactory.eINSTANCE.createFunctionalStatusSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryFunctionalStatusSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryFunctionalStatusSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryHistoryOfPresentIllnessSection() { + OperationsTestCase validateDischargeSummaryHistoryOfPresentIllnessSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryHistoryOfPresentIllnessSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_HISTORY_OF_PRESENT_ILLNESS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* HistoryOfPresentIllnessSection */ + HistoryOfPresentIllnessSection section = + + ConsolFactory.eINSTANCE.createHistoryOfPresentIllnessSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryHistoryOfPresentIllnessSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryHistoryOfPresentIllnessSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryHospitalDischargePhysicalSection() { + OperationsTestCase validateDischargeSummaryHospitalDischargePhysicalSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryHospitalDischargePhysicalSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_HOSPITAL_DISCHARGE_PHYSICAL_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* HospitalDischargePhysicalSection */ + HospitalDischargePhysicalSection section = + + ConsolFactory.eINSTANCE.createHospitalDischargePhysicalSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryHospitalDischargePhysicalSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryHospitalDischargePhysicalSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryHospitalDischargeStudiesSummarySection() { + OperationsTestCase validateDischargeSummaryHospitalDischargeStudiesSummarySectionTestCase = new OperationsTestCase( + "validateDischargeSummaryHospitalDischargeStudiesSummarySection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_HOSPITAL_DISCHARGE_STUDIES_SUMMARY_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* HospitalDischargeStudiesSummarySection */ + HospitalDischargeStudiesSummarySection section = + + ConsolFactory.eINSTANCE.createHospitalDischargeStudiesSummarySection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryHospitalDischargeStudiesSummarySection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryHospitalDischargeStudiesSummarySectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryProceduresSectionEntriesOptional() { + OperationsTestCase validateDischargeSummaryProceduresSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateDischargeSummaryProceduresSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_PROCEDURES_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* ProceduresSectionEntriesOptional */ + ProceduresSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createProceduresSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryProceduresSectionEntriesOptional( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryProceduresSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryReasonForVisitSection() { + OperationsTestCase validateDischargeSummaryReasonForVisitSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryReasonForVisitSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_REASON_FOR_VISIT_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* ReasonForVisitSection */ + ReasonForVisitSection section = + + ConsolFactory.eINSTANCE.createReasonForVisitSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryReasonForVisitSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryReasonForVisitSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryReviewOfSystemsSection() { + OperationsTestCase validateDischargeSummaryReviewOfSystemsSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryReviewOfSystemsSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_REVIEW_OF_SYSTEMS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* ReviewOfSystemsSection */ + ReviewOfSystemsSection section = + + ConsolFactory.eINSTANCE.createReviewOfSystemsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryReviewOfSystemsSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryReviewOfSystemsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummarySocialHistorySection() { + OperationsTestCase validateDischargeSummarySocialHistorySectionTestCase = new OperationsTestCase( + "validateDischargeSummarySocialHistorySection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_SOCIAL_HISTORY_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* SocialHistorySection */ + SocialHistorySection section = + + ConsolFactory.eINSTANCE.createSocialHistorySection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummarySocialHistorySection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummarySocialHistorySectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryVitalSignsSectionEntriesOptional() { + OperationsTestCase validateDischargeSummaryVitalSignsSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateDischargeSummaryVitalSignsSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_VITAL_SIGNS_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* VitalSignsSectionEntriesOptional */ + VitalSignsSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createVitalSignsSectionEntriesOptional().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryVitalSignsSectionEntriesOptional( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryVitalSignsSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryImmunizationsSectionEntriesOptional() { + OperationsTestCase validateDischargeSummaryImmunizationsSectionEntriesOptionalTestCase = new OperationsTestCase( + "validateDischargeSummaryImmunizationsSectionEntriesOptional", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_IMMUNIZATIONS_SECTION_ENTRIES_OPTIONAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + protected void updateToFail(DischargeSummary target) { + + } + + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* ImmunizationsSectionEntriesOptional */ + ImmunizationsSectionEntriesOptional section = + + ConsolFactory.eINSTANCE.createImmunizationsSectionEntriesOptional().init(); + + target.addSection(section); + + } + + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryImmunizationsSectionEntriesOptional( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryImmunizationsSectionEntriesOptionalTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testGetAllergiesSectionEntriesOptional() { + + DischargeSummary target = objectFactory.create(); + target.getAllergiesSectionEntriesOptional(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetHospitalCourseSection() { + + DischargeSummary target = objectFactory.create(); + target.getHospitalCourseSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetHospitalDischargeDiagnosisSection() { + + DischargeSummary target = objectFactory.create(); + target.getHospitalDischargeDiagnosisSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetHospitalDischargeMedicationsSectionEntriesOptional() { + + DischargeSummary target = objectFactory.create(); + target.getHospitalDischargeMedicationsSectionEntriesOptional(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetPlanOfCareSection() { + + DischargeSummary target = objectFactory.create(); + target.getPlanOfCareSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetProblemSectionEntriesOptional() { + + DischargeSummary target = objectFactory.create(); + target.getProblemSectionEntriesOptional(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetChiefComplaintSection() { + + DischargeSummary target = objectFactory.create(); + target.getChiefComplaintSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetChiefComplaintAndReasonForVisitSection() { + + DischargeSummary target = objectFactory.create(); + target.getChiefComplaintAndReasonForVisitSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetDischargeDietSection() { + + DischargeSummary target = objectFactory.create(); + target.getDischargeDietSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetFamilyHistorySection() { + + DischargeSummary target = objectFactory.create(); + target.getFamilyHistorySection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetFunctionalStatusSection() { + + DischargeSummary target = objectFactory.create(); + target.getFunctionalStatusSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetHistoryOfPresentIllnessSection() { + + DischargeSummary target = objectFactory.create(); + target.getHistoryOfPresentIllnessSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetHospitalDischargePhysicalSection() { + + DischargeSummary target = objectFactory.create(); + target.getHospitalDischargePhysicalSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetHospitalDischargeStudiesSummarySection() { + + DischargeSummary target = objectFactory.create(); + target.getHospitalDischargeStudiesSummarySection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetProceduresSectionEntriesOptional() { + + DischargeSummary target = objectFactory.create(); + target.getProceduresSectionEntriesOptional(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetReasonForVisitSection() { + + DischargeSummary target = objectFactory.create(); + target.getReasonForVisitSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetReviewOfSystemsSection() { + + DischargeSummary target = objectFactory.create(); + target.getReviewOfSystemsSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetSocialHistorySection() { + + DischargeSummary target = objectFactory.create(); + target.getSocialHistorySection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetVitalSignsSectionEntriesOptional() { + + DischargeSummary target = objectFactory.create(); + target.getVitalSignsSectionEntriesOptional(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetImmunizationsSectionEntriesOptional() { + + DischargeSummary target = objectFactory.create(); + target.getImmunizationsSectionEntriesOptional(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateGeneralHeaderConstraintsTemplateId() { + OperationsTestCase validateGeneralHeaderConstraintsTemplateIdTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsTemplateId", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + protected void updateToFail(DischargeSummary target) { + + } + + protected void updateToPass(DischargeSummary target) { + target.init(); + + } + + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateGeneralHeaderConstraintsTemplateId( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + private static class OperationsForOCL extends DischargeSummaryOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated NOT + */ + private static class ObjectFactory implements TestObjectFactory { + + public DischargeSummary create() { + return ConsoltocFactory.eINSTANCE.createDischargeSummary(); + } + } + + /** + * + * @generated NOT + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends DischargeSummaryOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + protected EObject getObjectToTest() { + return null; + } + +} // DischargeSummaryOperations diff --git a/org.openhealthtools.mdht.uml.cda.consoltoc.tests/src/org/openhealthtools/mdht/uml/cda/consoltoc/tests/Main.java b/org.openhealthtools.mdht.uml.cda.consoltoc.tests/src/org/openhealthtools/mdht/uml/cda/consoltoc/tests/Main.java new file mode 100644 index 000000000..c5cf796bb --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consoltoc.tests/src/org/openhealthtools/mdht/uml/cda/consoltoc/tests/Main.java @@ -0,0 +1,116 @@ +/******************************************************************************* + * Copyright (c) 2012 Rama Ramakrishnan and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Rama Ramakrishnan (Agilex Corporation) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consoltoc.tests; + +import java.io.BufferedWriter; +import java.io.FileInputStream; +import java.io.FileWriter; + +import org.eclipse.emf.common.util.Diagnostic; +import org.openhealthtools.mdht.uml.cda.ClinicalDocument; +import org.openhealthtools.mdht.uml.cda.consoltoc.ConsoltocPackage; +import org.openhealthtools.mdht.uml.cda.consoltoc.DischargeSummary; +import org.openhealthtools.mdht.uml.cda.util.CDADiagnostic; +import org.openhealthtools.mdht.uml.cda.util.CDAUtil; +import org.openhealthtools.mdht.uml.cda.util.ValidationResult; + +/** + * @author ramakrishnanr + * + */ +public class Main { + + /** + * @param args + */ + public static void main(String[] args) { + System.out.println("========================="); + // testDS("DS.sample.l3.conformances"); + validateAndLog("DS.sample.l3.conformances"); + System.out.println("========================="); + } + + public static void testDS(String fileName) { + new StringBuffer(); + String path = "samples/"; + ConsoltocPackage.eINSTANCE.eClass(); + ValidationResult result = new ValidationResult(); + try { + ClinicalDocument clinicalDocument = CDAUtil.load((new FileInputStream(path + fileName + ".xml")), result); + + System.out.println(clinicalDocument); + System.out.println(clinicalDocument.getAllSections().size()); + for (Object j : clinicalDocument.getAllSections()) { + System.out.println(j); + } + + DischargeSummary ds = (DischargeSummary) clinicalDocument; + System.out.println(ds.getAllergiesSectionEntriesOptional()); + + } catch (Exception e) { + e.printStackTrace(); + } + } + + public static void writeLog(String fileName, StringBuffer sb) { + String path = "log/"; + try { + FileWriter fw = new FileWriter(path + fileName + ".log"); + BufferedWriter out = new BufferedWriter(fw); + out.write(sb.toString()); + out.close(); + } catch (Exception e) { + e.printStackTrace(); + } + } + + public static StringBuffer validate(String fileName) { + StringBuffer sb = new StringBuffer(); + String path = "samples/"; + + ValidationResult result = new ValidationResult(); + try { + CDAUtil.load((new FileInputStream(path + fileName + ".xml")), result); + + } catch (Exception e) { + e.printStackTrace(); + } + // for (Diagnostic d: result.getInfoDiagnostics()) { + // CDADiagnostic cdaDiagnostic = new CDADiagnostic(d); + // sb.append("INFO|"+cdaDiagnostic.getMessage() + // +"|"+cdaDiagnostic.getPath()+ "|"+ cdaDiagnostic.getCode() + "|" + + // cdaDiagnostic.getSource()); + // sb.append("\n"); + // } + for (Diagnostic dq : result.getErrorDiagnostics()) { + CDADiagnostic cdaDiagnosticq = new CDADiagnostic(dq); + sb.append("ERROR|" + cdaDiagnosticq.getMessage() + "|" + cdaDiagnosticq.getPath() + "|" + + cdaDiagnosticq.getCode() + "|" + cdaDiagnosticq.getSource()); + sb.append("\n"); + } + // for (Diagnostic dw: result.getWarningDiagnostics()) { + // CDADiagnostic cdaDiagnosticw = new CDADiagnostic(dw); + // sb.append("WARN|"+cdaDiagnosticw.getMessage() +"|"+ + // cdaDiagnosticw.getPath()+ "|"+ cdaDiagnosticw.getSource() + "|" + + // cdaDiagnosticw.getCode() + "|" + cdaDiagnosticw.getSource() ); + // sb.append("\n"); + // } + System.out.println(sb.toString()); + return sb; + } + + public static void validateAndLog(String fileName) { + ConsoltocPackage.eINSTANCE.eClass(); + StringBuffer sb = validate(fileName); + writeLog(fileName, sb); + } + +} diff --git a/org.openhealthtools.mdht.uml.cda.consoltoc.tests/src/org/openhealthtools/mdht/uml/cda/consoltoc/tests/consoltoc_EcoreAllTests.java b/org.openhealthtools.mdht.uml.cda.consoltoc.tests/src/org/openhealthtools/mdht/uml/cda/consoltoc/tests/consoltoc_EcoreAllTests.java new file mode 100644 index 000000000..e55135c2c --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.consoltoc.tests/src/org/openhealthtools/mdht/uml/cda/consoltoc/tests/consoltoc_EcoreAllTests.java @@ -0,0 +1,51 @@ +/******************************************************************************* + * Copyright (c) 2012 Rama Ramakrishnan and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Rama Ramakrishnan (Agilex Corporation) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.consoltoc.tests; + +import junit.framework.Test; +import junit.framework.TestSuite; + +import junit.textui.TestRunner; + +/** + * A test suite for the 'consoltoc_Ecore + * ' model. + * @generated + */ +public class consoltoc_EcoreAllTests extends TestSuite { + + /** + * + * @generated + */ + public static void main(String[] args) { + TestRunner.run(suite()); + } + + /** + * + * @generated + */ + public static Test suite() { + TestSuite suite = new consoltoc_EcoreAllTests("consoltoc_Ecore Tests"); + suite.addTest(ConsoltocTests.suite()); + return suite; + } + + /** + * + * @generated + */ + public consoltoc_EcoreAllTests(String name) { + super(name); + } + +} // consoltoc_EcoreAllTests diff --git a/org.openhealthtools.mdht.uml.cda.emspcr.tests/.classpath b/org.openhealthtools.mdht.uml.cda.emspcr.tests/.classpath new file mode 100644 index 000000000..121e527a9 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.emspcr.tests/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.openhealthtools.mdht.uml.cda.emspcr.tests/.project b/org.openhealthtools.mdht.uml.cda.emspcr.tests/.project new file mode 100644 index 000000000..46f73538b --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.emspcr.tests/.project @@ -0,0 +1,28 @@ + + + org.openhealthtools.mdht.uml.cda.emspcr.tests + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.pde.PluginNature + + diff --git a/org.openhealthtools.mdht.uml.cda.emspcr.tests/.settings/org.eclipse.jdt.core.prefs b/org.openhealthtools.mdht.uml.cda.emspcr.tests/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..fd79a3e6c --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.emspcr.tests/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,355 @@ +#Mon May 16 10:24:25 EDT 2011 +eclipse.preferences.version=1 +org.eclipse.jdt.core.codeComplete.argumentPrefixes= +org.eclipse.jdt.core.codeComplete.argumentSuffixes= +org.eclipse.jdt.core.codeComplete.fieldPrefixes= +org.eclipse.jdt.core.codeComplete.fieldSuffixes= +org.eclipse.jdt.core.codeComplete.localPrefixes= +org.eclipse.jdt.core.codeComplete.localSuffixes= +org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.5 +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.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning +org.eclipse.jdt.core.compiler.problem.deadCode=warning +org.eclipse.jdt.core.compiler.problem.deprecation=warning +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore +org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=error +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore +org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning +org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +org.eclipse.jdt.core.compiler.problem.nullReference=warning +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore +org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=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 +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedImport=warning +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +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.5 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=36 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=36 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=36 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=36 +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_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=49 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=32 +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_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=0 +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 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=1 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=150 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@fmtOff +org.eclipse.jdt.core.formatter.enabling_tag=@fmtOn +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +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=true +org.eclipse.jdt.core.formatter.indentation.size=4 +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_parameter=do not 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=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +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_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_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 +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +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_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 +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +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_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not 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_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 +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +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_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 +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +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_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_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 +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=false +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=120 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +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=false +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/org.openhealthtools.mdht.uml.cda.emspcr.tests/.settings/org.eclipse.jdt.ui.prefs b/org.openhealthtools.mdht.uml.cda.emspcr.tests/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 000000000..6245d2099 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.emspcr.tests/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,120 @@ +#Tue Mar 29 22:38:51 EDT 2011 +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=false +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=false +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=false +cleanup.format_source_code=true +cleanup.format_source_code_changes_only=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=false +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=true +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=true +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=true +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_blocks=true +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_parentheses_in_expressions=false +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup_profile=_MDHT +cleanup_settings_version=2 +eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true +formatter_profile=_MDHT +formatter_settings_version=11 +org.eclipse.jdt.ui.exception.name=e +org.eclipse.jdt.ui.gettersetter.use.is=true +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com; +org.eclipse.jdt.ui.javadoc=true +org.eclipse.jdt.ui.keywordthis=false +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.overrideannotation=true +org.eclipse.jdt.ui.staticondemandthreshold=99 +org.eclipse.jdt.ui.text.custom_code_templates= +sp_cleanup.add_default_serial_version_id=true +sp_cleanup.add_generated_serial_version_id=false +sp_cleanup.add_missing_annotations=true +sp_cleanup.add_missing_deprecated_annotations=true +sp_cleanup.add_missing_methods=false +sp_cleanup.add_missing_nls_tags=false +sp_cleanup.add_missing_override_annotations=true +sp_cleanup.add_missing_override_annotations_interface_methods=false +sp_cleanup.add_serial_version_id=false +sp_cleanup.always_use_blocks=true +sp_cleanup.always_use_parentheses_in_expressions=false +sp_cleanup.always_use_this_for_non_static_field_access=false +sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.convert_to_enhanced_for_loop=false +sp_cleanup.correct_indentation=false +sp_cleanup.format_source_code=true +sp_cleanup.format_source_code_changes_only=false +sp_cleanup.make_local_variable_final=false +sp_cleanup.make_parameters_final=false +sp_cleanup.make_private_fields_final=true +sp_cleanup.make_type_abstract_if_missing_method=false +sp_cleanup.make_variable_declarations_final=false +sp_cleanup.never_use_blocks=false +sp_cleanup.never_use_parentheses_in_expressions=true +sp_cleanup.on_save_use_additional_actions=true +sp_cleanup.organize_imports=true +sp_cleanup.qualify_static_field_accesses_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_with_declaring_class=false +sp_cleanup.qualify_static_method_accesses_with_declaring_class=false +sp_cleanup.remove_private_constructors=true +sp_cleanup.remove_trailing_whitespaces=true +sp_cleanup.remove_trailing_whitespaces_all=true +sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +sp_cleanup.remove_unnecessary_casts=true +sp_cleanup.remove_unnecessary_nls_tags=false +sp_cleanup.remove_unused_imports=false +sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_private_fields=true +sp_cleanup.remove_unused_private_members=false +sp_cleanup.remove_unused_private_methods=true +sp_cleanup.remove_unused_private_types=true +sp_cleanup.sort_members=false +sp_cleanup.sort_members_all=false +sp_cleanup.use_blocks=false +sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_parentheses_in_expressions=false +sp_cleanup.use_this_for_non_static_field_access=false +sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true +sp_cleanup.use_this_for_non_static_method_access=false +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/org.openhealthtools.mdht.uml.cda.emspcr.tests/META-INF/MANIFEST.MF b/org.openhealthtools.mdht.uml.cda.emspcr.tests/META-INF/MANIFEST.MF new file mode 100644 index 000000000..fbc801d9d --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.emspcr.tests/META-INF/MANIFEST.MF @@ -0,0 +1,22 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: org.openhealthtools.mdht.uml.cda.emspcr.tests;singleton:=true +Bundle-Version: 0.7.0.qualifier +Bundle-ClassPath: . +Bundle-Vendor: %providerName +Bundle-Localization: plugin +Bundle-RequiredExecutionEnvironment: J2SE-1.5 +Export-Package: org.openhealthtools.mdht.uml.cda.emspcr.tests +Require-Bundle: org.eclipse.core.runtime, + org.openhealthtools.mdht.uml.cda.emspcr;visibility:=reexport, + org.openhealthtools.mdht.uml.cda;visibility:=reexport, + org.eclipse.emf.ecore;visibility:=reexport, + org.openhealthtools.mdht.uml.hl7.vocab;visibility:=reexport, + org.openhealthtools.mdht.uml.hl7.rim;visibility:=reexport, + org.openhealthtools.mdht.uml.hl7.datatypes;visibility:=reexport, + org.openhealthtools.mdht.uml.cda.consol;visibility:=reexport, + org.eclipse.emf.ecore.xmi;visibility:=reexport, + org.junit;visibility:=reexport, + org.openhealthtools.mdht.uml.cda.test;bundle-version="1.1.0" +Bundle-ActivationPolicy: lazy diff --git a/org.openhealthtools.mdht.uml.cda.emspcr.tests/build.properties b/org.openhealthtools.mdht.uml.cda.emspcr.tests/build.properties new file mode 100644 index 000000000..6cf6ee0dc --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.emspcr.tests/build.properties @@ -0,0 +1,12 @@ + +# +# +# +# $Id$ + +bin.includes = .,\ + META-INF/,\ + plugin.properties +jars.compile.order = . +source.. = src/ +output.. = bin/ diff --git a/org.openhealthtools.mdht.uml.cda.emspcr.tests/plugin.properties b/org.openhealthtools.mdht.uml.cda.emspcr.tests/plugin.properties new file mode 100644 index 000000000..e7c8c8146 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.emspcr.tests/plugin.properties @@ -0,0 +1,8 @@ + +# +# +# +# $Id$ + +pluginName = emspcr_Ecore Tests +providerName = www.example.org diff --git a/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/DerivedEntryTest.java b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/DerivedEntryTest.java new file mode 100644 index 000000000..2cbb5ecec --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/DerivedEntryTest.java @@ -0,0 +1,244 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.emspcr.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; + +import org.eclipse.emf.ecore.EObject; + +import org.junit.Test; + +import org.openhealthtools.mdht.uml.cda.emspcr.DerivedEntry; +import org.openhealthtools.mdht.uml.cda.emspcr.EmspcrFactory; + +import org.openhealthtools.mdht.uml.cda.emspcr.operations.DerivedEntryOperations; + +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Derived Entry' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.DerivedEntry#validateDerivedEntryTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Derived Entry Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.DerivedEntry#validateDerivedEntryTypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Derived Entry Type Code}
  • + *
+ *

+ * + * @generated + */ + +public class DerivedEntryTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateDerivedEntryTemplateId() { + OperationsTestCase validateDerivedEntryTemplateIdTestCase = new OperationsTestCase( + "validateDerivedEntryTemplateId", + operationsForOCL.getOCLValue("VALIDATE_DERIVED_ENTRY_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(DerivedEntry target) { + + } + + @Override + protected void updateToPass(DerivedEntry target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return DerivedEntryOperations.validateDerivedEntryTemplateId( + (DerivedEntry) objectToTest, diagnostician, map); + } + + }; + + validateDerivedEntryTemplateIdTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateDerivedEntryTypeCode() { + OperationsTestCase validateDerivedEntryTypeCodeTestCase = new OperationsTestCase( + "validateDerivedEntryTypeCode", + operationsForOCL.getOCLValue("VALIDATE_DERIVED_ENTRY_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(DerivedEntry target) { + + } + + @Override + protected void updateToPass(DerivedEntry target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return DerivedEntryOperations.validateDerivedEntryTypeCode( + (DerivedEntry) objectToTest, diagnostician, map); + } + + }; + + validateDerivedEntryTypeCodeTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + private static class OperationsForOCL extends DerivedEntryOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public DerivedEntry create() { + return EmspcrFactory.eINSTANCE.createDerivedEntry(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends DerivedEntryOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // DerivedEntryOperations diff --git a/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSAdvanceDirectivesSectionTest.java b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSAdvanceDirectivesSectionTest.java new file mode 100644 index 000000000..15475c7ba --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSAdvanceDirectivesSectionTest.java @@ -0,0 +1,463 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.emspcr.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; + +import org.eclipse.emf.ecore.EObject; + +import org.junit.Test; + +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; + +import org.openhealthtools.mdht.uml.cda.emspcr.EMSAdvanceDirectivesSection; +import org.openhealthtools.mdht.uml.cda.emspcr.EmspcrFactory; + +import org.openhealthtools.mdht.uml.cda.emspcr.operations.EMSAdvanceDirectivesSectionOperations; + +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'EMS Advance Directives Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSAdvanceDirectivesSection#validateEMSAdvanceDirectivesSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Advance Directives Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSAdvanceDirectivesSection#validateEMSAdvanceDirectivesSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Advance Directives Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSAdvanceDirectivesSection#validateEMSAdvanceDirectivesSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Advance Directives Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSAdvanceDirectivesSection#validateEMSAdvanceDirectivesSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Advance Directives Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSAdvanceDirectivesSection#validateEMSAdvanceDirectivesSectionEntry1(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Advance Directives Section Entry1}
  • + *
+ *

+ * + * @generated + */ + +public class EMSAdvanceDirectivesSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateEMSAdvanceDirectivesSectionTemplateId() { + OperationsTestCase validateEMSAdvanceDirectivesSectionTemplateIdTestCase = new OperationsTestCase( + "validateEMSAdvanceDirectivesSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_EMS_ADVANCE_DIRECTIVES_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSAdvanceDirectivesSection target) { + + } + + @Override + protected void updateToPass(EMSAdvanceDirectivesSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSAdvanceDirectivesSectionOperations.validateEMSAdvanceDirectivesSectionTemplateId( + (EMSAdvanceDirectivesSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSAdvanceDirectivesSectionTemplateIdTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSAdvanceDirectivesSectionCode() { + OperationsTestCase validateEMSAdvanceDirectivesSectionCodeTestCase = new OperationsTestCase( + "validateEMSAdvanceDirectivesSectionCode", + operationsForOCL.getOCLValue("VALIDATE_EMS_ADVANCE_DIRECTIVES_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSAdvanceDirectivesSection target) { + + } + + @Override + protected void updateToPass(EMSAdvanceDirectivesSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSAdvanceDirectivesSectionOperations.validateEMSAdvanceDirectivesSectionCode( + (EMSAdvanceDirectivesSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSAdvanceDirectivesSectionCodeTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSAdvanceDirectivesSectionTitle() { + OperationsTestCase validateEMSAdvanceDirectivesSectionTitleTestCase = new OperationsTestCase( + "validateEMSAdvanceDirectivesSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_EMS_ADVANCE_DIRECTIVES_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSAdvanceDirectivesSection target) { + + } + + @Override + protected void updateToPass(EMSAdvanceDirectivesSection target) { + target.init(); + + + + + + + + + + + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title ); + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSAdvanceDirectivesSectionOperations.validateEMSAdvanceDirectivesSectionTitle( + (EMSAdvanceDirectivesSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSAdvanceDirectivesSectionTitleTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSAdvanceDirectivesSectionText() { + OperationsTestCase validateEMSAdvanceDirectivesSectionTextTestCase = new OperationsTestCase( + "validateEMSAdvanceDirectivesSectionText", + operationsForOCL.getOCLValue("VALIDATE_EMS_ADVANCE_DIRECTIVES_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSAdvanceDirectivesSection target) { + + } + + @Override + protected void updateToPass(EMSAdvanceDirectivesSection target) { + target.init(); + + + + + + + + + + + + + + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text ); + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSAdvanceDirectivesSectionOperations.validateEMSAdvanceDirectivesSectionText( + (EMSAdvanceDirectivesSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSAdvanceDirectivesSectionTextTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSAdvanceDirectivesSectionEntry1() { + OperationsTestCase validateEMSAdvanceDirectivesSectionEntry1TestCase = new OperationsTestCase( + "validateEMSAdvanceDirectivesSectionEntry1", + operationsForOCL.getOCLValue("VALIDATE_EMS_ADVANCE_DIRECTIVES_SECTION_ENTRY1__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSAdvanceDirectivesSection target) { + + } + + @Override + protected void updateToPass(EMSAdvanceDirectivesSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSAdvanceDirectivesSectionOperations.validateEMSAdvanceDirectivesSectionEntry1( + (EMSAdvanceDirectivesSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSAdvanceDirectivesSectionEntry1TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + private static class OperationsForOCL extends EMSAdvanceDirectivesSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public EMSAdvanceDirectivesSection create() { + return EmspcrFactory.eINSTANCE.createEMSAdvanceDirectivesSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends EMSAdvanceDirectivesSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // EMSAdvanceDirectivesSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSAllergiesAndAdverseReactionsSectionTest.java b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSAllergiesAndAdverseReactionsSectionTest.java new file mode 100644 index 000000000..886ff3879 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSAllergiesAndAdverseReactionsSectionTest.java @@ -0,0 +1,532 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.emspcr.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; + +import org.eclipse.emf.ecore.EObject; + +import org.junit.Test; + +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; + +import org.openhealthtools.mdht.uml.cda.emspcr.EMSAllergiesAndAdverseReactionsSection; +import org.openhealthtools.mdht.uml.cda.emspcr.EmspcrFactory; + +import org.openhealthtools.mdht.uml.cda.emspcr.operations.EMSAllergiesAndAdverseReactionsSectionOperations; + +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'EMS Allergies And Adverse Reactions Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSAllergiesAndAdverseReactionsSection#validateEMSAllergiesAndAdverseReactionsSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Allergies And Adverse Reactions Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSAllergiesAndAdverseReactionsSection#validateEMSAllergiesAndAdverseReactionsSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Allergies And Adverse Reactions Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSAllergiesAndAdverseReactionsSection#validateEMSAllergiesAndAdverseReactionsSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Allergies And Adverse Reactions Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSAllergiesAndAdverseReactionsSection#validateEMSAllergiesAndAdverseReactionsSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Allergies And Adverse Reactions Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSAllergiesAndAdverseReactionsSection#validateEMSAllergiesAndAdverseReactionsSectionEntry1(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Allergies And Adverse Reactions Section Entry1}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSAllergiesAndAdverseReactionsSection#validateEMSAllergiesAndAdverseReactionsSectionEntry2(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Allergies And Adverse Reactions Section Entry2}
  • + *
+ *

+ * + * @generated + */ + +public class EMSAllergiesAndAdverseReactionsSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateEMSAllergiesAndAdverseReactionsSectionTemplateId() { + OperationsTestCase validateEMSAllergiesAndAdverseReactionsSectionTemplateIdTestCase = new OperationsTestCase( + "validateEMSAllergiesAndAdverseReactionsSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_EMS_ALLERGIES_AND_ADVERSE_REACTIONS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSAllergiesAndAdverseReactionsSection target) { + + } + + @Override + protected void updateToPass(EMSAllergiesAndAdverseReactionsSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSAllergiesAndAdverseReactionsSectionOperations.validateEMSAllergiesAndAdverseReactionsSectionTemplateId( + (EMSAllergiesAndAdverseReactionsSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSAllergiesAndAdverseReactionsSectionTemplateIdTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSAllergiesAndAdverseReactionsSectionCode() { + OperationsTestCase validateEMSAllergiesAndAdverseReactionsSectionCodeTestCase = new OperationsTestCase( + "validateEMSAllergiesAndAdverseReactionsSectionCode", + operationsForOCL.getOCLValue("VALIDATE_EMS_ALLERGIES_AND_ADVERSE_REACTIONS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSAllergiesAndAdverseReactionsSection target) { + + } + + @Override + protected void updateToPass(EMSAllergiesAndAdverseReactionsSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSAllergiesAndAdverseReactionsSectionOperations.validateEMSAllergiesAndAdverseReactionsSectionCode( + (EMSAllergiesAndAdverseReactionsSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSAllergiesAndAdverseReactionsSectionCodeTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSAllergiesAndAdverseReactionsSectionTitle() { + OperationsTestCase validateEMSAllergiesAndAdverseReactionsSectionTitleTestCase = new OperationsTestCase( + "validateEMSAllergiesAndAdverseReactionsSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_EMS_ALLERGIES_AND_ADVERSE_REACTIONS_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSAllergiesAndAdverseReactionsSection target) { + + } + + @Override + protected void updateToPass(EMSAllergiesAndAdverseReactionsSection target) { + target.init(); + + + + + + + + + + + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title ); + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSAllergiesAndAdverseReactionsSectionOperations.validateEMSAllergiesAndAdverseReactionsSectionTitle( + (EMSAllergiesAndAdverseReactionsSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSAllergiesAndAdverseReactionsSectionTitleTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSAllergiesAndAdverseReactionsSectionText() { + OperationsTestCase validateEMSAllergiesAndAdverseReactionsSectionTextTestCase = new OperationsTestCase( + "validateEMSAllergiesAndAdverseReactionsSectionText", + operationsForOCL.getOCLValue("VALIDATE_EMS_ALLERGIES_AND_ADVERSE_REACTIONS_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSAllergiesAndAdverseReactionsSection target) { + + } + + @Override + protected void updateToPass(EMSAllergiesAndAdverseReactionsSection target) { + target.init(); + + + + + + + + + + + + + + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text ); + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSAllergiesAndAdverseReactionsSectionOperations.validateEMSAllergiesAndAdverseReactionsSectionText( + (EMSAllergiesAndAdverseReactionsSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSAllergiesAndAdverseReactionsSectionTextTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSAllergiesAndAdverseReactionsSectionEntry1() { + OperationsTestCase validateEMSAllergiesAndAdverseReactionsSectionEntry1TestCase = new OperationsTestCase( + "validateEMSAllergiesAndAdverseReactionsSectionEntry1", + operationsForOCL.getOCLValue("VALIDATE_EMS_ALLERGIES_AND_ADVERSE_REACTIONS_SECTION_ENTRY1__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSAllergiesAndAdverseReactionsSection target) { + + } + + @Override + protected void updateToPass(EMSAllergiesAndAdverseReactionsSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSAllergiesAndAdverseReactionsSectionOperations.validateEMSAllergiesAndAdverseReactionsSectionEntry1( + (EMSAllergiesAndAdverseReactionsSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSAllergiesAndAdverseReactionsSectionEntry1TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSAllergiesAndAdverseReactionsSectionEntry2() { + OperationsTestCase validateEMSAllergiesAndAdverseReactionsSectionEntry2TestCase = new OperationsTestCase( + "validateEMSAllergiesAndAdverseReactionsSectionEntry2", + operationsForOCL.getOCLValue("VALIDATE_EMS_ALLERGIES_AND_ADVERSE_REACTIONS_SECTION_ENTRY2__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSAllergiesAndAdverseReactionsSection target) { + + } + + @Override + protected void updateToPass(EMSAllergiesAndAdverseReactionsSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSAllergiesAndAdverseReactionsSectionOperations.validateEMSAllergiesAndAdverseReactionsSectionEntry2( + (EMSAllergiesAndAdverseReactionsSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSAllergiesAndAdverseReactionsSectionEntry2TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + private static class OperationsForOCL extends EMSAllergiesAndAdverseReactionsSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public EMSAllergiesAndAdverseReactionsSection create() { + return EmspcrFactory.eINSTANCE.createEMSAllergiesAndAdverseReactionsSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends EMSAllergiesAndAdverseReactionsSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // EMSAllergiesAndAdverseReactionsSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSBillingSectionTest.java b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSBillingSectionTest.java new file mode 100644 index 000000000..251e22823 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSBillingSectionTest.java @@ -0,0 +1,532 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.emspcr.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; + +import org.eclipse.emf.ecore.EObject; + +import org.junit.Test; + +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; + +import org.openhealthtools.mdht.uml.cda.emspcr.EMSBillingSection; +import org.openhealthtools.mdht.uml.cda.emspcr.EmspcrFactory; + +import org.openhealthtools.mdht.uml.cda.emspcr.operations.EMSBillingSectionOperations; + +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'EMS Billing Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSBillingSection#validateEMSBillingSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Billing Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSBillingSection#validateEMSBillingSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Billing Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSBillingSection#validateEMSBillingSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Billing Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSBillingSection#validateEMSBillingSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Billing Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSBillingSection#validateEMSBillingSectionBillingConditionentry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Billing Section Billing Conditionentry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSBillingSection#validateEMSBillingSectionLosentry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Billing Section Losentry}
  • + *
+ *

+ * + * @generated + */ + +public class EMSBillingSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateEMSBillingSectionTemplateId() { + OperationsTestCase validateEMSBillingSectionTemplateIdTestCase = new OperationsTestCase( + "validateEMSBillingSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_EMS_BILLING_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSBillingSection target) { + + } + + @Override + protected void updateToPass(EMSBillingSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSBillingSectionOperations.validateEMSBillingSectionTemplateId( + (EMSBillingSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSBillingSectionTemplateIdTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSBillingSectionCode() { + OperationsTestCase validateEMSBillingSectionCodeTestCase = new OperationsTestCase( + "validateEMSBillingSectionCode", + operationsForOCL.getOCLValue("VALIDATE_EMS_BILLING_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSBillingSection target) { + + } + + @Override + protected void updateToPass(EMSBillingSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSBillingSectionOperations.validateEMSBillingSectionCode( + (EMSBillingSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSBillingSectionCodeTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSBillingSectionTitle() { + OperationsTestCase validateEMSBillingSectionTitleTestCase = new OperationsTestCase( + "validateEMSBillingSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_EMS_BILLING_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSBillingSection target) { + + } + + @Override + protected void updateToPass(EMSBillingSection target) { + target.init(); + + + + + + + + + + + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title ); + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSBillingSectionOperations.validateEMSBillingSectionTitle( + (EMSBillingSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSBillingSectionTitleTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSBillingSectionText() { + OperationsTestCase validateEMSBillingSectionTextTestCase = new OperationsTestCase( + "validateEMSBillingSectionText", + operationsForOCL.getOCLValue("VALIDATE_EMS_BILLING_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSBillingSection target) { + + } + + @Override + protected void updateToPass(EMSBillingSection target) { + target.init(); + + + + + + + + + + + + + + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text ); + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSBillingSectionOperations.validateEMSBillingSectionText( + (EMSBillingSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSBillingSectionTextTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSBillingSectionBillingConditionentry() { + OperationsTestCase validateEMSBillingSectionBillingConditionentryTestCase = new OperationsTestCase( + "validateEMSBillingSectionBillingConditionentry", + operationsForOCL.getOCLValue("VALIDATE_EMS_BILLING_SECTION_BILLING_CONDITIONENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSBillingSection target) { + + } + + @Override + protected void updateToPass(EMSBillingSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSBillingSectionOperations.validateEMSBillingSectionBillingConditionentry( + (EMSBillingSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSBillingSectionBillingConditionentryTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSBillingSectionLosentry() { + OperationsTestCase validateEMSBillingSectionLosentryTestCase = new OperationsTestCase( + "validateEMSBillingSectionLosentry", + operationsForOCL.getOCLValue("VALIDATE_EMS_BILLING_SECTION_LOSENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSBillingSection target) { + + } + + @Override + protected void updateToPass(EMSBillingSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSBillingSectionOperations.validateEMSBillingSectionLosentry( + (EMSBillingSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSBillingSectionLosentryTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + private static class OperationsForOCL extends EMSBillingSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public EMSBillingSection create() { + return EmspcrFactory.eINSTANCE.createEMSBillingSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends EMSBillingSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // EMSBillingSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSCardiacArrestEventSectionTest.java b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSCardiacArrestEventSectionTest.java new file mode 100644 index 000000000..a64ae2f4b --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSCardiacArrestEventSectionTest.java @@ -0,0 +1,463 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.emspcr.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; + +import org.eclipse.emf.ecore.EObject; + +import org.junit.Test; + +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; + +import org.openhealthtools.mdht.uml.cda.emspcr.EMSCardiacArrestEventSection; +import org.openhealthtools.mdht.uml.cda.emspcr.EmspcrFactory; + +import org.openhealthtools.mdht.uml.cda.emspcr.operations.EMSCardiacArrestEventSectionOperations; + +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'EMS Cardiac Arrest Event Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSCardiacArrestEventSection#validateEMSCardiacArrestEventSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Cardiac Arrest Event Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSCardiacArrestEventSection#validateEMSCardiacArrestEventSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Cardiac Arrest Event Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSCardiacArrestEventSection#validateEMSCardiacArrestEventSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Cardiac Arrest Event Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSCardiacArrestEventSection#validateEMSCardiacArrestEventSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Cardiac Arrest Event Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSCardiacArrestEventSection#validateEMSCardiacArrestEventSectionEntry1(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Cardiac Arrest Event Section Entry1}
  • + *
+ *

+ * + * @generated + */ + +public class EMSCardiacArrestEventSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateEMSCardiacArrestEventSectionTemplateId() { + OperationsTestCase validateEMSCardiacArrestEventSectionTemplateIdTestCase = new OperationsTestCase( + "validateEMSCardiacArrestEventSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_EMS_CARDIAC_ARREST_EVENT_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSCardiacArrestEventSection target) { + + } + + @Override + protected void updateToPass(EMSCardiacArrestEventSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSCardiacArrestEventSectionOperations.validateEMSCardiacArrestEventSectionTemplateId( + (EMSCardiacArrestEventSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSCardiacArrestEventSectionTemplateIdTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSCardiacArrestEventSectionCode() { + OperationsTestCase validateEMSCardiacArrestEventSectionCodeTestCase = new OperationsTestCase( + "validateEMSCardiacArrestEventSectionCode", + operationsForOCL.getOCLValue("VALIDATE_EMS_CARDIAC_ARREST_EVENT_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSCardiacArrestEventSection target) { + + } + + @Override + protected void updateToPass(EMSCardiacArrestEventSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSCardiacArrestEventSectionOperations.validateEMSCardiacArrestEventSectionCode( + (EMSCardiacArrestEventSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSCardiacArrestEventSectionCodeTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSCardiacArrestEventSectionTitle() { + OperationsTestCase validateEMSCardiacArrestEventSectionTitleTestCase = new OperationsTestCase( + "validateEMSCardiacArrestEventSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_EMS_CARDIAC_ARREST_EVENT_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSCardiacArrestEventSection target) { + + } + + @Override + protected void updateToPass(EMSCardiacArrestEventSection target) { + target.init(); + + + + + + + + + + + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title ); + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSCardiacArrestEventSectionOperations.validateEMSCardiacArrestEventSectionTitle( + (EMSCardiacArrestEventSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSCardiacArrestEventSectionTitleTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSCardiacArrestEventSectionText() { + OperationsTestCase validateEMSCardiacArrestEventSectionTextTestCase = new OperationsTestCase( + "validateEMSCardiacArrestEventSectionText", + operationsForOCL.getOCLValue("VALIDATE_EMS_CARDIAC_ARREST_EVENT_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSCardiacArrestEventSection target) { + + } + + @Override + protected void updateToPass(EMSCardiacArrestEventSection target) { + target.init(); + + + + + + + + + + + + + + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text ); + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSCardiacArrestEventSectionOperations.validateEMSCardiacArrestEventSectionText( + (EMSCardiacArrestEventSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSCardiacArrestEventSectionTextTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSCardiacArrestEventSectionEntry1() { + OperationsTestCase validateEMSCardiacArrestEventSectionEntry1TestCase = new OperationsTestCase( + "validateEMSCardiacArrestEventSectionEntry1", + operationsForOCL.getOCLValue("VALIDATE_EMS_CARDIAC_ARREST_EVENT_SECTION_ENTRY1__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSCardiacArrestEventSection target) { + + } + + @Override + protected void updateToPass(EMSCardiacArrestEventSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSCardiacArrestEventSectionOperations.validateEMSCardiacArrestEventSectionEntry1( + (EMSCardiacArrestEventSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSCardiacArrestEventSectionEntry1TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + private static class OperationsForOCL extends EMSCardiacArrestEventSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public EMSCardiacArrestEventSection create() { + return EmspcrFactory.eINSTANCE.createEMSCardiacArrestEventSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends EMSCardiacArrestEventSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // EMSCardiacArrestEventSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSCurrentMedicationSectionTest.java b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSCurrentMedicationSectionTest.java new file mode 100644 index 000000000..c35f3e072 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSCurrentMedicationSectionTest.java @@ -0,0 +1,601 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.emspcr.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; + +import org.eclipse.emf.ecore.EObject; + +import org.junit.Test; + +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; + +import org.openhealthtools.mdht.uml.cda.emspcr.EMSCurrentMedicationSection; +import org.openhealthtools.mdht.uml.cda.emspcr.EmspcrFactory; + +import org.openhealthtools.mdht.uml.cda.emspcr.operations.EMSCurrentMedicationSectionOperations; + +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'EMS Current Medication Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSCurrentMedicationSection#validateEMSCurrentMedicationSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Current Medication Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSCurrentMedicationSection#validateEMSCurrentMedicationSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Current Medication Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSCurrentMedicationSection#validateEMSCurrentMedicationSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Current Medication Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSCurrentMedicationSection#validateEMSCurrentMedicationSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Current Medication Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSCurrentMedicationSection#validateEMSCurrentMedicationSectionEntry1(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Current Medication Section Entry1}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSCurrentMedicationSection#validateEMSCurrentMedicationSectionEntry2(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Current Medication Section Entry2}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSCurrentMedicationSection#validateEMSCurrentMedicationSectionEntry3(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Current Medication Section Entry3}
  • + *
+ *

+ * + * @generated + */ + +public class EMSCurrentMedicationSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateEMSCurrentMedicationSectionTemplateId() { + OperationsTestCase validateEMSCurrentMedicationSectionTemplateIdTestCase = new OperationsTestCase( + "validateEMSCurrentMedicationSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_EMS_CURRENT_MEDICATION_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSCurrentMedicationSection target) { + + } + + @Override + protected void updateToPass(EMSCurrentMedicationSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSCurrentMedicationSectionOperations.validateEMSCurrentMedicationSectionTemplateId( + (EMSCurrentMedicationSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSCurrentMedicationSectionTemplateIdTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSCurrentMedicationSectionCode() { + OperationsTestCase validateEMSCurrentMedicationSectionCodeTestCase = new OperationsTestCase( + "validateEMSCurrentMedicationSectionCode", + operationsForOCL.getOCLValue("VALIDATE_EMS_CURRENT_MEDICATION_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSCurrentMedicationSection target) { + + } + + @Override + protected void updateToPass(EMSCurrentMedicationSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSCurrentMedicationSectionOperations.validateEMSCurrentMedicationSectionCode( + (EMSCurrentMedicationSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSCurrentMedicationSectionCodeTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSCurrentMedicationSectionTitle() { + OperationsTestCase validateEMSCurrentMedicationSectionTitleTestCase = new OperationsTestCase( + "validateEMSCurrentMedicationSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_EMS_CURRENT_MEDICATION_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSCurrentMedicationSection target) { + + } + + @Override + protected void updateToPass(EMSCurrentMedicationSection target) { + target.init(); + + + + + + + + + + + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title ); + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSCurrentMedicationSectionOperations.validateEMSCurrentMedicationSectionTitle( + (EMSCurrentMedicationSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSCurrentMedicationSectionTitleTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSCurrentMedicationSectionText() { + OperationsTestCase validateEMSCurrentMedicationSectionTextTestCase = new OperationsTestCase( + "validateEMSCurrentMedicationSectionText", + operationsForOCL.getOCLValue("VALIDATE_EMS_CURRENT_MEDICATION_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSCurrentMedicationSection target) { + + } + + @Override + protected void updateToPass(EMSCurrentMedicationSection target) { + target.init(); + + + + + + + + + + + + + + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text ); + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSCurrentMedicationSectionOperations.validateEMSCurrentMedicationSectionText( + (EMSCurrentMedicationSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSCurrentMedicationSectionTextTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSCurrentMedicationSectionEntry1() { + OperationsTestCase validateEMSCurrentMedicationSectionEntry1TestCase = new OperationsTestCase( + "validateEMSCurrentMedicationSectionEntry1", + operationsForOCL.getOCLValue("VALIDATE_EMS_CURRENT_MEDICATION_SECTION_ENTRY1__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSCurrentMedicationSection target) { + + } + + @Override + protected void updateToPass(EMSCurrentMedicationSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSCurrentMedicationSectionOperations.validateEMSCurrentMedicationSectionEntry1( + (EMSCurrentMedicationSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSCurrentMedicationSectionEntry1TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSCurrentMedicationSectionEntry2() { + OperationsTestCase validateEMSCurrentMedicationSectionEntry2TestCase = new OperationsTestCase( + "validateEMSCurrentMedicationSectionEntry2", + operationsForOCL.getOCLValue("VALIDATE_EMS_CURRENT_MEDICATION_SECTION_ENTRY2__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSCurrentMedicationSection target) { + + } + + @Override + protected void updateToPass(EMSCurrentMedicationSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSCurrentMedicationSectionOperations.validateEMSCurrentMedicationSectionEntry2( + (EMSCurrentMedicationSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSCurrentMedicationSectionEntry2TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSCurrentMedicationSectionEntry3() { + OperationsTestCase validateEMSCurrentMedicationSectionEntry3TestCase = new OperationsTestCase( + "validateEMSCurrentMedicationSectionEntry3", + operationsForOCL.getOCLValue("VALIDATE_EMS_CURRENT_MEDICATION_SECTION_ENTRY3__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSCurrentMedicationSection target) { + + } + + @Override + protected void updateToPass(EMSCurrentMedicationSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSCurrentMedicationSectionOperations.validateEMSCurrentMedicationSectionEntry3( + (EMSCurrentMedicationSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSCurrentMedicationSectionEntry3TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + private static class OperationsForOCL extends EMSCurrentMedicationSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public EMSCurrentMedicationSection create() { + return EmspcrFactory.eINSTANCE.createEMSCurrentMedicationSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends EMSCurrentMedicationSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // EMSCurrentMedicationSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSDispatchSectionTest.java b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSDispatchSectionTest.java new file mode 100644 index 000000000..cd97b2728 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSDispatchSectionTest.java @@ -0,0 +1,532 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.emspcr.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; + +import org.eclipse.emf.ecore.EObject; + +import org.junit.Test; + +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; + +import org.openhealthtools.mdht.uml.cda.emspcr.EMSDispatchSection; +import org.openhealthtools.mdht.uml.cda.emspcr.EmspcrFactory; + +import org.openhealthtools.mdht.uml.cda.emspcr.operations.EMSDispatchSectionOperations; + +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'EMS Dispatch Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSDispatchSection#validateEMSDispatchSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Dispatch Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSDispatchSection#validateEMSDispatchSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Dispatch Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSDispatchSection#validateEMSDispatchSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Dispatch Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSDispatchSection#validateEMSDispatchSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Dispatch Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSDispatchSection#validateEMSDispatchSectionEntry1(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Dispatch Section Entry1}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSDispatchSection#validateEMSDispatchSectionEntry2(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Dispatch Section Entry2}
  • + *
+ *

+ * + * @generated + */ + +public class EMSDispatchSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateEMSDispatchSectionTemplateId() { + OperationsTestCase validateEMSDispatchSectionTemplateIdTestCase = new OperationsTestCase( + "validateEMSDispatchSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_EMS_DISPATCH_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSDispatchSection target) { + + } + + @Override + protected void updateToPass(EMSDispatchSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSDispatchSectionOperations.validateEMSDispatchSectionTemplateId( + (EMSDispatchSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSDispatchSectionTemplateIdTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSDispatchSectionCode() { + OperationsTestCase validateEMSDispatchSectionCodeTestCase = new OperationsTestCase( + "validateEMSDispatchSectionCode", + operationsForOCL.getOCLValue("VALIDATE_EMS_DISPATCH_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSDispatchSection target) { + + } + + @Override + protected void updateToPass(EMSDispatchSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSDispatchSectionOperations.validateEMSDispatchSectionCode( + (EMSDispatchSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSDispatchSectionCodeTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSDispatchSectionTitle() { + OperationsTestCase validateEMSDispatchSectionTitleTestCase = new OperationsTestCase( + "validateEMSDispatchSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_EMS_DISPATCH_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSDispatchSection target) { + + } + + @Override + protected void updateToPass(EMSDispatchSection target) { + target.init(); + + + + + + + + + + + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title ); + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSDispatchSectionOperations.validateEMSDispatchSectionTitle( + (EMSDispatchSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSDispatchSectionTitleTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSDispatchSectionText() { + OperationsTestCase validateEMSDispatchSectionTextTestCase = new OperationsTestCase( + "validateEMSDispatchSectionText", + operationsForOCL.getOCLValue("VALIDATE_EMS_DISPATCH_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSDispatchSection target) { + + } + + @Override + protected void updateToPass(EMSDispatchSection target) { + target.init(); + + + + + + + + + + + + + + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text ); + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSDispatchSectionOperations.validateEMSDispatchSectionText( + (EMSDispatchSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSDispatchSectionTextTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSDispatchSectionEntry1() { + OperationsTestCase validateEMSDispatchSectionEntry1TestCase = new OperationsTestCase( + "validateEMSDispatchSectionEntry1", + operationsForOCL.getOCLValue("VALIDATE_EMS_DISPATCH_SECTION_ENTRY1__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSDispatchSection target) { + + } + + @Override + protected void updateToPass(EMSDispatchSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSDispatchSectionOperations.validateEMSDispatchSectionEntry1( + (EMSDispatchSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSDispatchSectionEntry1TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSDispatchSectionEntry2() { + OperationsTestCase validateEMSDispatchSectionEntry2TestCase = new OperationsTestCase( + "validateEMSDispatchSectionEntry2", + operationsForOCL.getOCLValue("VALIDATE_EMS_DISPATCH_SECTION_ENTRY2__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSDispatchSection target) { + + } + + @Override + protected void updateToPass(EMSDispatchSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSDispatchSectionOperations.validateEMSDispatchSectionEntry2( + (EMSDispatchSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSDispatchSectionEntry2TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + private static class OperationsForOCL extends EMSDispatchSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public EMSDispatchSection create() { + return EmspcrFactory.eINSTANCE.createEMSDispatchSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends EMSDispatchSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // EMSDispatchSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSDispositionSectionTest.java b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSDispositionSectionTest.java new file mode 100644 index 000000000..06e9f2e0d --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSDispositionSectionTest.java @@ -0,0 +1,946 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.emspcr.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; + +import org.eclipse.emf.ecore.EObject; + +import org.junit.Test; + +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; + +import org.openhealthtools.mdht.uml.cda.emspcr.EMSDispositionSection; +import org.openhealthtools.mdht.uml.cda.emspcr.EmspcrFactory; + +import org.openhealthtools.mdht.uml.cda.emspcr.operations.EMSDispositionSectionOperations; + +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'EMS Disposition Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSDispositionSection#validateEMSDispositionSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Disposition Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSDispositionSection#validateEMSDispositionSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Disposition Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSDispositionSection#validateEMSDispositionSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Disposition Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSDispositionSection#validateEMSDispositionSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Disposition Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSDispositionSection#validateEMSDispositionSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Disposition Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSDispositionSection#validateEMSDispositionSectionEntry1(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Disposition Section Entry1}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSDispositionSection#validateEMSDispositionSectionEntry2(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Disposition Section Entry2}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSDispositionSection#validateEMSDispositionSectionEntry3(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Disposition Section Entry3}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSDispositionSection#validateEMSDispositionSectionEntry5(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Disposition Section Entry5}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSDispositionSection#validateEMSDispositionSectionEntry7(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Disposition Section Entry7}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSDispositionSection#validateEMSDispositionSectionEntry6(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Disposition Section Entry6}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSDispositionSection#validateEMSDispositionSectionEntry4(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Disposition Section Entry4}
  • + *
+ *

+ * + * @generated + */ + +public class EMSDispositionSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateEMSDispositionSectionTemplateId() { + OperationsTestCase validateEMSDispositionSectionTemplateIdTestCase = new OperationsTestCase( + "validateEMSDispositionSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_EMS_DISPOSITION_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSDispositionSection target) { + + } + + @Override + protected void updateToPass(EMSDispositionSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSDispositionSectionOperations.validateEMSDispositionSectionTemplateId( + (EMSDispositionSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSDispositionSectionTemplateIdTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSDispositionSectionCode() { + OperationsTestCase validateEMSDispositionSectionCodeTestCase = new OperationsTestCase( + "validateEMSDispositionSectionCode", + operationsForOCL.getOCLValue("VALIDATE_EMS_DISPOSITION_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSDispositionSection target) { + + } + + @Override + protected void updateToPass(EMSDispositionSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSDispositionSectionOperations.validateEMSDispositionSectionCode( + (EMSDispositionSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSDispositionSectionCodeTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSDispositionSectionCodeP() { + OperationsTestCase validateEMSDispositionSectionCodePTestCase = new OperationsTestCase( + "validateEMSDispositionSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_EMS_DISPOSITION_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSDispositionSection target) { + + } + + @Override + protected void updateToPass(EMSDispositionSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSDispositionSectionOperations.validateEMSDispositionSectionCodeP( + (EMSDispositionSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSDispositionSectionCodePTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSDispositionSectionTitle() { + OperationsTestCase validateEMSDispositionSectionTitleTestCase = new OperationsTestCase( + "validateEMSDispositionSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_EMS_DISPOSITION_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSDispositionSection target) { + + } + + @Override + protected void updateToPass(EMSDispositionSection target) { + target.init(); + + + + + + + + + + + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title ); + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSDispositionSectionOperations.validateEMSDispositionSectionTitle( + (EMSDispositionSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSDispositionSectionTitleTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSDispositionSectionText() { + OperationsTestCase validateEMSDispositionSectionTextTestCase = new OperationsTestCase( + "validateEMSDispositionSectionText", + operationsForOCL.getOCLValue("VALIDATE_EMS_DISPOSITION_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSDispositionSection target) { + + } + + @Override + protected void updateToPass(EMSDispositionSection target) { + target.init(); + + + + + + + + + + + + + + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text ); + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSDispositionSectionOperations.validateEMSDispositionSectionText( + (EMSDispositionSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSDispositionSectionTextTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSDispositionSectionEntry1() { + OperationsTestCase validateEMSDispositionSectionEntry1TestCase = new OperationsTestCase( + "validateEMSDispositionSectionEntry1", + operationsForOCL.getOCLValue("VALIDATE_EMS_DISPOSITION_SECTION_ENTRY1__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSDispositionSection target) { + + } + + @Override + protected void updateToPass(EMSDispositionSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSDispositionSectionOperations.validateEMSDispositionSectionEntry1( + (EMSDispositionSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSDispositionSectionEntry1TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSDispositionSectionEntry2() { + OperationsTestCase validateEMSDispositionSectionEntry2TestCase = new OperationsTestCase( + "validateEMSDispositionSectionEntry2", + operationsForOCL.getOCLValue("VALIDATE_EMS_DISPOSITION_SECTION_ENTRY2__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSDispositionSection target) { + + } + + @Override + protected void updateToPass(EMSDispositionSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSDispositionSectionOperations.validateEMSDispositionSectionEntry2( + (EMSDispositionSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSDispositionSectionEntry2TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSDispositionSectionEntry3() { + OperationsTestCase validateEMSDispositionSectionEntry3TestCase = new OperationsTestCase( + "validateEMSDispositionSectionEntry3", + operationsForOCL.getOCLValue("VALIDATE_EMS_DISPOSITION_SECTION_ENTRY3__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSDispositionSection target) { + + } + + @Override + protected void updateToPass(EMSDispositionSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSDispositionSectionOperations.validateEMSDispositionSectionEntry3( + (EMSDispositionSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSDispositionSectionEntry3TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSDispositionSectionEntry5() { + OperationsTestCase validateEMSDispositionSectionEntry5TestCase = new OperationsTestCase( + "validateEMSDispositionSectionEntry5", + operationsForOCL.getOCLValue("VALIDATE_EMS_DISPOSITION_SECTION_ENTRY5__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSDispositionSection target) { + + } + + @Override + protected void updateToPass(EMSDispositionSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSDispositionSectionOperations.validateEMSDispositionSectionEntry5( + (EMSDispositionSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSDispositionSectionEntry5TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSDispositionSectionEntry7() { + OperationsTestCase validateEMSDispositionSectionEntry7TestCase = new OperationsTestCase( + "validateEMSDispositionSectionEntry7", + operationsForOCL.getOCLValue("VALIDATE_EMS_DISPOSITION_SECTION_ENTRY7__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSDispositionSection target) { + + } + + @Override + protected void updateToPass(EMSDispositionSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSDispositionSectionOperations.validateEMSDispositionSectionEntry7( + (EMSDispositionSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSDispositionSectionEntry7TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSDispositionSectionEntry6() { + OperationsTestCase validateEMSDispositionSectionEntry6TestCase = new OperationsTestCase( + "validateEMSDispositionSectionEntry6", + operationsForOCL.getOCLValue("VALIDATE_EMS_DISPOSITION_SECTION_ENTRY6__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSDispositionSection target) { + + } + + @Override + protected void updateToPass(EMSDispositionSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSDispositionSectionOperations.validateEMSDispositionSectionEntry6( + (EMSDispositionSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSDispositionSectionEntry6TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSDispositionSectionEntry4() { + OperationsTestCase validateEMSDispositionSectionEntry4TestCase = new OperationsTestCase( + "validateEMSDispositionSectionEntry4", + operationsForOCL.getOCLValue("VALIDATE_EMS_DISPOSITION_SECTION_ENTRY4__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSDispositionSection target) { + + } + + @Override + protected void updateToPass(EMSDispositionSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSDispositionSectionOperations.validateEMSDispositionSectionEntry4( + (EMSDispositionSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSDispositionSectionEntry4TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + private static class OperationsForOCL extends EMSDispositionSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public EMSDispositionSection create() { + return EmspcrFactory.eINSTANCE.createEMSDispositionSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends EMSDispositionSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // EMSDispositionSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSInjuryIncidentDescriptionSectionTest.java b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSInjuryIncidentDescriptionSectionTest.java new file mode 100644 index 000000000..d7f122822 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSInjuryIncidentDescriptionSectionTest.java @@ -0,0 +1,1084 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.emspcr.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; + +import org.eclipse.emf.ecore.EObject; + +import org.junit.Test; + +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; + +import org.openhealthtools.mdht.uml.cda.emspcr.EMSInjuryIncidentDescriptionSection; +import org.openhealthtools.mdht.uml.cda.emspcr.EmspcrFactory; + +import org.openhealthtools.mdht.uml.cda.emspcr.operations.EMSInjuryIncidentDescriptionSectionOperations; + +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'EMS Injury Incident Description Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSInjuryIncidentDescriptionSection#validateEMSInjuryIncidentDescriptionSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Injury Incident Description Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSInjuryIncidentDescriptionSection#validateEMSInjuryIncidentDescriptionSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Injury Incident Description Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSInjuryIncidentDescriptionSection#validateEMSInjuryIncidentDescriptionSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Injury Incident Description Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSInjuryIncidentDescriptionSection#validateEMSInjuryIncidentDescriptionSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Injury Incident Description Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSInjuryIncidentDescriptionSection#validateEMSInjuryIncidentDescriptionSectionEntry3(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Injury Incident Description Section Entry3}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSInjuryIncidentDescriptionSection#validateEMSInjuryIncidentDescriptionSectionEntry4(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Injury Incident Description Section Entry4}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSInjuryIncidentDescriptionSection#validateEMSInjuryIncidentDescriptionSectionEntry5(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Injury Incident Description Section Entry5}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSInjuryIncidentDescriptionSection#validateEMSInjuryIncidentDescriptionSectionEntry6(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Injury Incident Description Section Entry6}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSInjuryIncidentDescriptionSection#validateEMSInjuryIncidentDescriptionSectionEntry7(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Injury Incident Description Section Entry7}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSInjuryIncidentDescriptionSection#validateEMSInjuryIncidentDescriptionSectionEntry8(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Injury Incident Description Section Entry8}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSInjuryIncidentDescriptionSection#validateEMSInjuryIncidentDescriptionSectionEntry9(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Injury Incident Description Section Entry9}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSInjuryIncidentDescriptionSection#validateEMSInjuryIncidentDescriptionSectionEntry10(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Injury Incident Description Section Entry10}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSInjuryIncidentDescriptionSection#validateEMSInjuryIncidentDescriptionSectionEntry11(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Injury Incident Description Section Entry11}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSInjuryIncidentDescriptionSection#validateEMSInjuryIncidentDescriptionSectionEntry12(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Injury Incident Description Section Entry12}
  • + *
+ *

+ * + * @generated + */ + +public class EMSInjuryIncidentDescriptionSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateEMSInjuryIncidentDescriptionSectionTemplateId() { + OperationsTestCase validateEMSInjuryIncidentDescriptionSectionTemplateIdTestCase = new OperationsTestCase( + "validateEMSInjuryIncidentDescriptionSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_EMS_INJURY_INCIDENT_DESCRIPTION_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSInjuryIncidentDescriptionSection target) { + + } + + @Override + protected void updateToPass(EMSInjuryIncidentDescriptionSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSInjuryIncidentDescriptionSectionOperations.validateEMSInjuryIncidentDescriptionSectionTemplateId( + (EMSInjuryIncidentDescriptionSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSInjuryIncidentDescriptionSectionTemplateIdTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSInjuryIncidentDescriptionSectionCode() { + OperationsTestCase validateEMSInjuryIncidentDescriptionSectionCodeTestCase = new OperationsTestCase( + "validateEMSInjuryIncidentDescriptionSectionCode", + operationsForOCL.getOCLValue("VALIDATE_EMS_INJURY_INCIDENT_DESCRIPTION_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSInjuryIncidentDescriptionSection target) { + + } + + @Override + protected void updateToPass(EMSInjuryIncidentDescriptionSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSInjuryIncidentDescriptionSectionOperations.validateEMSInjuryIncidentDescriptionSectionCode( + (EMSInjuryIncidentDescriptionSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSInjuryIncidentDescriptionSectionCodeTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSInjuryIncidentDescriptionSectionTitle() { + OperationsTestCase validateEMSInjuryIncidentDescriptionSectionTitleTestCase = new OperationsTestCase( + "validateEMSInjuryIncidentDescriptionSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_EMS_INJURY_INCIDENT_DESCRIPTION_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSInjuryIncidentDescriptionSection target) { + + } + + @Override + protected void updateToPass(EMSInjuryIncidentDescriptionSection target) { + target.init(); + + + + + + + + + + + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title ); + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSInjuryIncidentDescriptionSectionOperations.validateEMSInjuryIncidentDescriptionSectionTitle( + (EMSInjuryIncidentDescriptionSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSInjuryIncidentDescriptionSectionTitleTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSInjuryIncidentDescriptionSectionText() { + OperationsTestCase validateEMSInjuryIncidentDescriptionSectionTextTestCase = new OperationsTestCase( + "validateEMSInjuryIncidentDescriptionSectionText", + operationsForOCL.getOCLValue("VALIDATE_EMS_INJURY_INCIDENT_DESCRIPTION_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSInjuryIncidentDescriptionSection target) { + + } + + @Override + protected void updateToPass(EMSInjuryIncidentDescriptionSection target) { + target.init(); + + + + + + + + + + + + + + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text ); + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSInjuryIncidentDescriptionSectionOperations.validateEMSInjuryIncidentDescriptionSectionText( + (EMSInjuryIncidentDescriptionSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSInjuryIncidentDescriptionSectionTextTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSInjuryIncidentDescriptionSectionEntry3() { + OperationsTestCase validateEMSInjuryIncidentDescriptionSectionEntry3TestCase = new OperationsTestCase( + "validateEMSInjuryIncidentDescriptionSectionEntry3", + operationsForOCL.getOCLValue("VALIDATE_EMS_INJURY_INCIDENT_DESCRIPTION_SECTION_ENTRY3__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSInjuryIncidentDescriptionSection target) { + + } + + @Override + protected void updateToPass(EMSInjuryIncidentDescriptionSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSInjuryIncidentDescriptionSectionOperations.validateEMSInjuryIncidentDescriptionSectionEntry3( + (EMSInjuryIncidentDescriptionSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSInjuryIncidentDescriptionSectionEntry3TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSInjuryIncidentDescriptionSectionEntry4() { + OperationsTestCase validateEMSInjuryIncidentDescriptionSectionEntry4TestCase = new OperationsTestCase( + "validateEMSInjuryIncidentDescriptionSectionEntry4", + operationsForOCL.getOCLValue("VALIDATE_EMS_INJURY_INCIDENT_DESCRIPTION_SECTION_ENTRY4__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSInjuryIncidentDescriptionSection target) { + + } + + @Override + protected void updateToPass(EMSInjuryIncidentDescriptionSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSInjuryIncidentDescriptionSectionOperations.validateEMSInjuryIncidentDescriptionSectionEntry4( + (EMSInjuryIncidentDescriptionSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSInjuryIncidentDescriptionSectionEntry4TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSInjuryIncidentDescriptionSectionEntry5() { + OperationsTestCase validateEMSInjuryIncidentDescriptionSectionEntry5TestCase = new OperationsTestCase( + "validateEMSInjuryIncidentDescriptionSectionEntry5", + operationsForOCL.getOCLValue("VALIDATE_EMS_INJURY_INCIDENT_DESCRIPTION_SECTION_ENTRY5__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSInjuryIncidentDescriptionSection target) { + + } + + @Override + protected void updateToPass(EMSInjuryIncidentDescriptionSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSInjuryIncidentDescriptionSectionOperations.validateEMSInjuryIncidentDescriptionSectionEntry5( + (EMSInjuryIncidentDescriptionSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSInjuryIncidentDescriptionSectionEntry5TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSInjuryIncidentDescriptionSectionEntry6() { + OperationsTestCase validateEMSInjuryIncidentDescriptionSectionEntry6TestCase = new OperationsTestCase( + "validateEMSInjuryIncidentDescriptionSectionEntry6", + operationsForOCL.getOCLValue("VALIDATE_EMS_INJURY_INCIDENT_DESCRIPTION_SECTION_ENTRY6__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSInjuryIncidentDescriptionSection target) { + + } + + @Override + protected void updateToPass(EMSInjuryIncidentDescriptionSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSInjuryIncidentDescriptionSectionOperations.validateEMSInjuryIncidentDescriptionSectionEntry6( + (EMSInjuryIncidentDescriptionSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSInjuryIncidentDescriptionSectionEntry6TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSInjuryIncidentDescriptionSectionEntry7() { + OperationsTestCase validateEMSInjuryIncidentDescriptionSectionEntry7TestCase = new OperationsTestCase( + "validateEMSInjuryIncidentDescriptionSectionEntry7", + operationsForOCL.getOCLValue("VALIDATE_EMS_INJURY_INCIDENT_DESCRIPTION_SECTION_ENTRY7__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSInjuryIncidentDescriptionSection target) { + + } + + @Override + protected void updateToPass(EMSInjuryIncidentDescriptionSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSInjuryIncidentDescriptionSectionOperations.validateEMSInjuryIncidentDescriptionSectionEntry7( + (EMSInjuryIncidentDescriptionSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSInjuryIncidentDescriptionSectionEntry7TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSInjuryIncidentDescriptionSectionEntry8() { + OperationsTestCase validateEMSInjuryIncidentDescriptionSectionEntry8TestCase = new OperationsTestCase( + "validateEMSInjuryIncidentDescriptionSectionEntry8", + operationsForOCL.getOCLValue("VALIDATE_EMS_INJURY_INCIDENT_DESCRIPTION_SECTION_ENTRY8__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSInjuryIncidentDescriptionSection target) { + + } + + @Override + protected void updateToPass(EMSInjuryIncidentDescriptionSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSInjuryIncidentDescriptionSectionOperations.validateEMSInjuryIncidentDescriptionSectionEntry8( + (EMSInjuryIncidentDescriptionSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSInjuryIncidentDescriptionSectionEntry8TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSInjuryIncidentDescriptionSectionEntry9() { + OperationsTestCase validateEMSInjuryIncidentDescriptionSectionEntry9TestCase = new OperationsTestCase( + "validateEMSInjuryIncidentDescriptionSectionEntry9", + operationsForOCL.getOCLValue("VALIDATE_EMS_INJURY_INCIDENT_DESCRIPTION_SECTION_ENTRY9__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSInjuryIncidentDescriptionSection target) { + + } + + @Override + protected void updateToPass(EMSInjuryIncidentDescriptionSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSInjuryIncidentDescriptionSectionOperations.validateEMSInjuryIncidentDescriptionSectionEntry9( + (EMSInjuryIncidentDescriptionSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSInjuryIncidentDescriptionSectionEntry9TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSInjuryIncidentDescriptionSectionEntry10() { + OperationsTestCase validateEMSInjuryIncidentDescriptionSectionEntry10TestCase = new OperationsTestCase( + "validateEMSInjuryIncidentDescriptionSectionEntry10", + operationsForOCL.getOCLValue("VALIDATE_EMS_INJURY_INCIDENT_DESCRIPTION_SECTION_ENTRY10__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSInjuryIncidentDescriptionSection target) { + + } + + @Override + protected void updateToPass(EMSInjuryIncidentDescriptionSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSInjuryIncidentDescriptionSectionOperations.validateEMSInjuryIncidentDescriptionSectionEntry10( + (EMSInjuryIncidentDescriptionSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSInjuryIncidentDescriptionSectionEntry10TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSInjuryIncidentDescriptionSectionEntry11() { + OperationsTestCase validateEMSInjuryIncidentDescriptionSectionEntry11TestCase = new OperationsTestCase( + "validateEMSInjuryIncidentDescriptionSectionEntry11", + operationsForOCL.getOCLValue("VALIDATE_EMS_INJURY_INCIDENT_DESCRIPTION_SECTION_ENTRY11__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSInjuryIncidentDescriptionSection target) { + + } + + @Override + protected void updateToPass(EMSInjuryIncidentDescriptionSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSInjuryIncidentDescriptionSectionOperations.validateEMSInjuryIncidentDescriptionSectionEntry11( + (EMSInjuryIncidentDescriptionSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSInjuryIncidentDescriptionSectionEntry11TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSInjuryIncidentDescriptionSectionEntry12() { + OperationsTestCase validateEMSInjuryIncidentDescriptionSectionEntry12TestCase = new OperationsTestCase( + "validateEMSInjuryIncidentDescriptionSectionEntry12", + operationsForOCL.getOCLValue("VALIDATE_EMS_INJURY_INCIDENT_DESCRIPTION_SECTION_ENTRY12__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSInjuryIncidentDescriptionSection target) { + + } + + @Override + protected void updateToPass(EMSInjuryIncidentDescriptionSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSInjuryIncidentDescriptionSectionOperations.validateEMSInjuryIncidentDescriptionSectionEntry12( + (EMSInjuryIncidentDescriptionSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSInjuryIncidentDescriptionSectionEntry12TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + private static class OperationsForOCL extends EMSInjuryIncidentDescriptionSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public EMSInjuryIncidentDescriptionSection create() { + return EmspcrFactory.eINSTANCE.createEMSInjuryIncidentDescriptionSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends EMSInjuryIncidentDescriptionSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // EMSInjuryIncidentDescriptionSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSMedicationsAdministeredSectionTest.java b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSMedicationsAdministeredSectionTest.java new file mode 100644 index 000000000..94807fb1f --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSMedicationsAdministeredSectionTest.java @@ -0,0 +1,532 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.emspcr.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; + +import org.eclipse.emf.ecore.EObject; + +import org.junit.Test; + +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; + +import org.openhealthtools.mdht.uml.cda.emspcr.EMSMedicationsAdministeredSection; +import org.openhealthtools.mdht.uml.cda.emspcr.EmspcrFactory; + +import org.openhealthtools.mdht.uml.cda.emspcr.operations.EMSMedicationsAdministeredSectionOperations; + +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'EMS Medications Administered Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSMedicationsAdministeredSection#validateEMSMedicationsAdministeredSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Medications Administered Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSMedicationsAdministeredSection#validateEMSMedicationsAdministeredSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Medications Administered Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSMedicationsAdministeredSection#validateEMSMedicationsAdministeredSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Medications Administered Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSMedicationsAdministeredSection#validateEMSMedicationsAdministeredSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Medications Administered Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSMedicationsAdministeredSection#validateEMSMedicationsAdministeredSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Medications Administered Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSMedicationsAdministeredSection#validateEMSMedicationsAdministeredSectionEntry1(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Medications Administered Section Entry1}
  • + *
+ *

+ * + * @generated + */ + +public class EMSMedicationsAdministeredSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateEMSMedicationsAdministeredSectionTemplateId() { + OperationsTestCase validateEMSMedicationsAdministeredSectionTemplateIdTestCase = new OperationsTestCase( + "validateEMSMedicationsAdministeredSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_EMS_MEDICATIONS_ADMINISTERED_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSMedicationsAdministeredSection target) { + + } + + @Override + protected void updateToPass(EMSMedicationsAdministeredSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSMedicationsAdministeredSectionOperations.validateEMSMedicationsAdministeredSectionTemplateId( + (EMSMedicationsAdministeredSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSMedicationsAdministeredSectionTemplateIdTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSMedicationsAdministeredSectionCode() { + OperationsTestCase validateEMSMedicationsAdministeredSectionCodeTestCase = new OperationsTestCase( + "validateEMSMedicationsAdministeredSectionCode", + operationsForOCL.getOCLValue("VALIDATE_EMS_MEDICATIONS_ADMINISTERED_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSMedicationsAdministeredSection target) { + + } + + @Override + protected void updateToPass(EMSMedicationsAdministeredSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSMedicationsAdministeredSectionOperations.validateEMSMedicationsAdministeredSectionCode( + (EMSMedicationsAdministeredSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSMedicationsAdministeredSectionCodeTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSMedicationsAdministeredSectionCodeP() { + OperationsTestCase validateEMSMedicationsAdministeredSectionCodePTestCase = new OperationsTestCase( + "validateEMSMedicationsAdministeredSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_EMS_MEDICATIONS_ADMINISTERED_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSMedicationsAdministeredSection target) { + + } + + @Override + protected void updateToPass(EMSMedicationsAdministeredSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSMedicationsAdministeredSectionOperations.validateEMSMedicationsAdministeredSectionCodeP( + (EMSMedicationsAdministeredSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSMedicationsAdministeredSectionCodePTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSMedicationsAdministeredSectionTitle() { + OperationsTestCase validateEMSMedicationsAdministeredSectionTitleTestCase = new OperationsTestCase( + "validateEMSMedicationsAdministeredSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_EMS_MEDICATIONS_ADMINISTERED_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSMedicationsAdministeredSection target) { + + } + + @Override + protected void updateToPass(EMSMedicationsAdministeredSection target) { + target.init(); + + + + + + + + + + + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title ); + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSMedicationsAdministeredSectionOperations.validateEMSMedicationsAdministeredSectionTitle( + (EMSMedicationsAdministeredSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSMedicationsAdministeredSectionTitleTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSMedicationsAdministeredSectionText() { + OperationsTestCase validateEMSMedicationsAdministeredSectionTextTestCase = new OperationsTestCase( + "validateEMSMedicationsAdministeredSectionText", + operationsForOCL.getOCLValue("VALIDATE_EMS_MEDICATIONS_ADMINISTERED_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSMedicationsAdministeredSection target) { + + } + + @Override + protected void updateToPass(EMSMedicationsAdministeredSection target) { + target.init(); + + + + + + + + + + + + + + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text ); + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSMedicationsAdministeredSectionOperations.validateEMSMedicationsAdministeredSectionText( + (EMSMedicationsAdministeredSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSMedicationsAdministeredSectionTextTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSMedicationsAdministeredSectionEntry1() { + OperationsTestCase validateEMSMedicationsAdministeredSectionEntry1TestCase = new OperationsTestCase( + "validateEMSMedicationsAdministeredSectionEntry1", + operationsForOCL.getOCLValue("VALIDATE_EMS_MEDICATIONS_ADMINISTERED_SECTION_ENTRY1__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSMedicationsAdministeredSection target) { + + } + + @Override + protected void updateToPass(EMSMedicationsAdministeredSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSMedicationsAdministeredSectionOperations.validateEMSMedicationsAdministeredSectionEntry1( + (EMSMedicationsAdministeredSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSMedicationsAdministeredSectionEntry1TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + private static class OperationsForOCL extends EMSMedicationsAdministeredSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public EMSMedicationsAdministeredSection create() { + return EmspcrFactory.eINSTANCE.createEMSMedicationsAdministeredSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends EMSMedicationsAdministeredSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // EMSMedicationsAdministeredSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSPastMedicalHistorySectionTest.java b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSPastMedicalHistorySectionTest.java new file mode 100644 index 000000000..df058cf46 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSPastMedicalHistorySectionTest.java @@ -0,0 +1,601 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.emspcr.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; + +import org.eclipse.emf.ecore.EObject; + +import org.junit.Test; + +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; + +import org.openhealthtools.mdht.uml.cda.emspcr.EMSPastMedicalHistorySection; +import org.openhealthtools.mdht.uml.cda.emspcr.EmspcrFactory; + +import org.openhealthtools.mdht.uml.cda.emspcr.operations.EMSPastMedicalHistorySectionOperations; + +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'EMS Past Medical History Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSPastMedicalHistorySection#validateEMSPastMedicalHistorySectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Past Medical History Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSPastMedicalHistorySection#validateEMSPastMedicalHistorySectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Past Medical History Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSPastMedicalHistorySection#validateEMSPastMedicalHistorySectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Past Medical History Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSPastMedicalHistorySection#validateEMSPastMedicalHistorySectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Past Medical History Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSPastMedicalHistorySection#validateEMSPastMedicalHistorySectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Past Medical History Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSPastMedicalHistorySection#validateEMSPastMedicalHistorySectionEntry1(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Past Medical History Section Entry1}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSPastMedicalHistorySection#validateEMSPastMedicalHistorySectionEntry2(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Past Medical History Section Entry2}
  • + *
+ *

+ * + * @generated + */ + +public class EMSPastMedicalHistorySectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateEMSPastMedicalHistorySectionTemplateId() { + OperationsTestCase validateEMSPastMedicalHistorySectionTemplateIdTestCase = new OperationsTestCase( + "validateEMSPastMedicalHistorySectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_EMS_PAST_MEDICAL_HISTORY_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSPastMedicalHistorySection target) { + + } + + @Override + protected void updateToPass(EMSPastMedicalHistorySection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSPastMedicalHistorySectionOperations.validateEMSPastMedicalHistorySectionTemplateId( + (EMSPastMedicalHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateEMSPastMedicalHistorySectionTemplateIdTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSPastMedicalHistorySectionCode() { + OperationsTestCase validateEMSPastMedicalHistorySectionCodeTestCase = new OperationsTestCase( + "validateEMSPastMedicalHistorySectionCode", + operationsForOCL.getOCLValue("VALIDATE_EMS_PAST_MEDICAL_HISTORY_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSPastMedicalHistorySection target) { + + } + + @Override + protected void updateToPass(EMSPastMedicalHistorySection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSPastMedicalHistorySectionOperations.validateEMSPastMedicalHistorySectionCode( + (EMSPastMedicalHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateEMSPastMedicalHistorySectionCodeTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSPastMedicalHistorySectionCodeP() { + OperationsTestCase validateEMSPastMedicalHistorySectionCodePTestCase = new OperationsTestCase( + "validateEMSPastMedicalHistorySectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_EMS_PAST_MEDICAL_HISTORY_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSPastMedicalHistorySection target) { + + } + + @Override + protected void updateToPass(EMSPastMedicalHistorySection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSPastMedicalHistorySectionOperations.validateEMSPastMedicalHistorySectionCodeP( + (EMSPastMedicalHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateEMSPastMedicalHistorySectionCodePTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSPastMedicalHistorySectionTitle() { + OperationsTestCase validateEMSPastMedicalHistorySectionTitleTestCase = new OperationsTestCase( + "validateEMSPastMedicalHistorySectionTitle", + operationsForOCL.getOCLValue("VALIDATE_EMS_PAST_MEDICAL_HISTORY_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSPastMedicalHistorySection target) { + + } + + @Override + protected void updateToPass(EMSPastMedicalHistorySection target) { + target.init(); + + + + + + + + + + + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title ); + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSPastMedicalHistorySectionOperations.validateEMSPastMedicalHistorySectionTitle( + (EMSPastMedicalHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateEMSPastMedicalHistorySectionTitleTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSPastMedicalHistorySectionText() { + OperationsTestCase validateEMSPastMedicalHistorySectionTextTestCase = new OperationsTestCase( + "validateEMSPastMedicalHistorySectionText", + operationsForOCL.getOCLValue("VALIDATE_EMS_PAST_MEDICAL_HISTORY_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSPastMedicalHistorySection target) { + + } + + @Override + protected void updateToPass(EMSPastMedicalHistorySection target) { + target.init(); + + + + + + + + + + + + + + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text ); + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSPastMedicalHistorySectionOperations.validateEMSPastMedicalHistorySectionText( + (EMSPastMedicalHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateEMSPastMedicalHistorySectionTextTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSPastMedicalHistorySectionEntry1() { + OperationsTestCase validateEMSPastMedicalHistorySectionEntry1TestCase = new OperationsTestCase( + "validateEMSPastMedicalHistorySectionEntry1", + operationsForOCL.getOCLValue("VALIDATE_EMS_PAST_MEDICAL_HISTORY_SECTION_ENTRY1__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSPastMedicalHistorySection target) { + + } + + @Override + protected void updateToPass(EMSPastMedicalHistorySection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSPastMedicalHistorySectionOperations.validateEMSPastMedicalHistorySectionEntry1( + (EMSPastMedicalHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateEMSPastMedicalHistorySectionEntry1TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSPastMedicalHistorySectionEntry2() { + OperationsTestCase validateEMSPastMedicalHistorySectionEntry2TestCase = new OperationsTestCase( + "validateEMSPastMedicalHistorySectionEntry2", + operationsForOCL.getOCLValue("VALIDATE_EMS_PAST_MEDICAL_HISTORY_SECTION_ENTRY2__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSPastMedicalHistorySection target) { + + } + + @Override + protected void updateToPass(EMSPastMedicalHistorySection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSPastMedicalHistorySectionOperations.validateEMSPastMedicalHistorySectionEntry2( + (EMSPastMedicalHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateEMSPastMedicalHistorySectionEntry2TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + private static class OperationsForOCL extends EMSPastMedicalHistorySectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public EMSPastMedicalHistorySection create() { + return EmspcrFactory.eINSTANCE.createEMSPastMedicalHistorySection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends EMSPastMedicalHistorySectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // EMSPastMedicalHistorySectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSPatientCareNarrativeSectionTest.java b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSPatientCareNarrativeSectionTest.java new file mode 100644 index 000000000..29469fce2 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSPatientCareNarrativeSectionTest.java @@ -0,0 +1,463 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.emspcr.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; + +import org.eclipse.emf.ecore.EObject; + +import org.junit.Test; + +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; + +import org.openhealthtools.mdht.uml.cda.emspcr.EMSPatientCareNarrativeSection; +import org.openhealthtools.mdht.uml.cda.emspcr.EmspcrFactory; + +import org.openhealthtools.mdht.uml.cda.emspcr.operations.EMSPatientCareNarrativeSectionOperations; + +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'EMS Patient Care Narrative Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSPatientCareNarrativeSection#validateEMSPatientCareNarrativeSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Patient Care Narrative Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSPatientCareNarrativeSection#validateEMSPatientCareNarrativeSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Patient Care Narrative Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSPatientCareNarrativeSection#validateEMSPatientCareNarrativeSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Patient Care Narrative Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSPatientCareNarrativeSection#validateEMSPatientCareNarrativeSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Patient Care Narrative Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSPatientCareNarrativeSection#validateEMSPatientCareNarrativeSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Patient Care Narrative Section Text}
  • + *
+ *

+ * + * @generated + */ + +public class EMSPatientCareNarrativeSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateEMSPatientCareNarrativeSectionTemplateId() { + OperationsTestCase validateEMSPatientCareNarrativeSectionTemplateIdTestCase = new OperationsTestCase( + "validateEMSPatientCareNarrativeSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_EMS_PATIENT_CARE_NARRATIVE_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSPatientCareNarrativeSection target) { + + } + + @Override + protected void updateToPass(EMSPatientCareNarrativeSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSPatientCareNarrativeSectionOperations.validateEMSPatientCareNarrativeSectionTemplateId( + (EMSPatientCareNarrativeSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSPatientCareNarrativeSectionTemplateIdTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSPatientCareNarrativeSectionCode() { + OperationsTestCase validateEMSPatientCareNarrativeSectionCodeTestCase = new OperationsTestCase( + "validateEMSPatientCareNarrativeSectionCode", + operationsForOCL.getOCLValue("VALIDATE_EMS_PATIENT_CARE_NARRATIVE_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSPatientCareNarrativeSection target) { + + } + + @Override + protected void updateToPass(EMSPatientCareNarrativeSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSPatientCareNarrativeSectionOperations.validateEMSPatientCareNarrativeSectionCode( + (EMSPatientCareNarrativeSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSPatientCareNarrativeSectionCodeTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSPatientCareNarrativeSectionCodeP() { + OperationsTestCase validateEMSPatientCareNarrativeSectionCodePTestCase = new OperationsTestCase( + "validateEMSPatientCareNarrativeSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_EMS_PATIENT_CARE_NARRATIVE_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSPatientCareNarrativeSection target) { + + } + + @Override + protected void updateToPass(EMSPatientCareNarrativeSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSPatientCareNarrativeSectionOperations.validateEMSPatientCareNarrativeSectionCodeP( + (EMSPatientCareNarrativeSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSPatientCareNarrativeSectionCodePTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSPatientCareNarrativeSectionTitle() { + OperationsTestCase validateEMSPatientCareNarrativeSectionTitleTestCase = new OperationsTestCase( + "validateEMSPatientCareNarrativeSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_EMS_PATIENT_CARE_NARRATIVE_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSPatientCareNarrativeSection target) { + + } + + @Override + protected void updateToPass(EMSPatientCareNarrativeSection target) { + target.init(); + + + + + + + + + + + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title ); + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSPatientCareNarrativeSectionOperations.validateEMSPatientCareNarrativeSectionTitle( + (EMSPatientCareNarrativeSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSPatientCareNarrativeSectionTitleTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSPatientCareNarrativeSectionText() { + OperationsTestCase validateEMSPatientCareNarrativeSectionTextTestCase = new OperationsTestCase( + "validateEMSPatientCareNarrativeSectionText", + operationsForOCL.getOCLValue("VALIDATE_EMS_PATIENT_CARE_NARRATIVE_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSPatientCareNarrativeSection target) { + + } + + @Override + protected void updateToPass(EMSPatientCareNarrativeSection target) { + target.init(); + + + + + + + + + + + + + + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text ); + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSPatientCareNarrativeSectionOperations.validateEMSPatientCareNarrativeSectionText( + (EMSPatientCareNarrativeSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSPatientCareNarrativeSectionTextTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + private static class OperationsForOCL extends EMSPatientCareNarrativeSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public EMSPatientCareNarrativeSection create() { + return EmspcrFactory.eINSTANCE.createEMSPatientCareNarrativeSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends EMSPatientCareNarrativeSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // EMSPatientCareNarrativeSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSPersonnelAdverseEventSectionTest.java b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSPersonnelAdverseEventSectionTest.java new file mode 100644 index 000000000..3f221bec1 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSPersonnelAdverseEventSectionTest.java @@ -0,0 +1,601 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.emspcr.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; + +import org.eclipse.emf.ecore.EObject; + +import org.junit.Test; + +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; + +import org.openhealthtools.mdht.uml.cda.emspcr.EMSPersonnelAdverseEventSection; +import org.openhealthtools.mdht.uml.cda.emspcr.EmspcrFactory; + +import org.openhealthtools.mdht.uml.cda.emspcr.operations.EMSPersonnelAdverseEventSectionOperations; + +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'EMS Personnel Adverse Event Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSPersonnelAdverseEventSection#validateEMSPersonnelAdverseEventSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Personnel Adverse Event Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSPersonnelAdverseEventSection#validateEMSPersonnelAdverseEventSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Personnel Adverse Event Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSPersonnelAdverseEventSection#validateEMSPersonnelAdverseEventSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Personnel Adverse Event Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSPersonnelAdverseEventSection#validateEMSPersonnelAdverseEventSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Personnel Adverse Event Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSPersonnelAdverseEventSection#validateEMSPersonnelAdverseEventSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Personnel Adverse Event Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSPersonnelAdverseEventSection#validateEMSPersonnelAdverseEventSectionEntry1(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Personnel Adverse Event Section Entry1}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSPersonnelAdverseEventSection#validateEMSPersonnelAdverseEventSectionEntry2(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Personnel Adverse Event Section Entry2}
  • + *
+ *

+ * + * @generated + */ + +public class EMSPersonnelAdverseEventSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateEMSPersonnelAdverseEventSectionTemplateId() { + OperationsTestCase validateEMSPersonnelAdverseEventSectionTemplateIdTestCase = new OperationsTestCase( + "validateEMSPersonnelAdverseEventSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_EMS_PERSONNEL_ADVERSE_EVENT_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSPersonnelAdverseEventSection target) { + + } + + @Override + protected void updateToPass(EMSPersonnelAdverseEventSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSPersonnelAdverseEventSectionOperations.validateEMSPersonnelAdverseEventSectionTemplateId( + (EMSPersonnelAdverseEventSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSPersonnelAdverseEventSectionTemplateIdTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSPersonnelAdverseEventSectionCode() { + OperationsTestCase validateEMSPersonnelAdverseEventSectionCodeTestCase = new OperationsTestCase( + "validateEMSPersonnelAdverseEventSectionCode", + operationsForOCL.getOCLValue("VALIDATE_EMS_PERSONNEL_ADVERSE_EVENT_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSPersonnelAdverseEventSection target) { + + } + + @Override + protected void updateToPass(EMSPersonnelAdverseEventSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSPersonnelAdverseEventSectionOperations.validateEMSPersonnelAdverseEventSectionCode( + (EMSPersonnelAdverseEventSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSPersonnelAdverseEventSectionCodeTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSPersonnelAdverseEventSectionCodeP() { + OperationsTestCase validateEMSPersonnelAdverseEventSectionCodePTestCase = new OperationsTestCase( + "validateEMSPersonnelAdverseEventSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_EMS_PERSONNEL_ADVERSE_EVENT_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSPersonnelAdverseEventSection target) { + + } + + @Override + protected void updateToPass(EMSPersonnelAdverseEventSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSPersonnelAdverseEventSectionOperations.validateEMSPersonnelAdverseEventSectionCodeP( + (EMSPersonnelAdverseEventSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSPersonnelAdverseEventSectionCodePTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSPersonnelAdverseEventSectionTitle() { + OperationsTestCase validateEMSPersonnelAdverseEventSectionTitleTestCase = new OperationsTestCase( + "validateEMSPersonnelAdverseEventSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_EMS_PERSONNEL_ADVERSE_EVENT_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSPersonnelAdverseEventSection target) { + + } + + @Override + protected void updateToPass(EMSPersonnelAdverseEventSection target) { + target.init(); + + + + + + + + + + + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title ); + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSPersonnelAdverseEventSectionOperations.validateEMSPersonnelAdverseEventSectionTitle( + (EMSPersonnelAdverseEventSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSPersonnelAdverseEventSectionTitleTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSPersonnelAdverseEventSectionText() { + OperationsTestCase validateEMSPersonnelAdverseEventSectionTextTestCase = new OperationsTestCase( + "validateEMSPersonnelAdverseEventSectionText", + operationsForOCL.getOCLValue("VALIDATE_EMS_PERSONNEL_ADVERSE_EVENT_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSPersonnelAdverseEventSection target) { + + } + + @Override + protected void updateToPass(EMSPersonnelAdverseEventSection target) { + target.init(); + + + + + + + + + + + + + + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text ); + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSPersonnelAdverseEventSectionOperations.validateEMSPersonnelAdverseEventSectionText( + (EMSPersonnelAdverseEventSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSPersonnelAdverseEventSectionTextTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSPersonnelAdverseEventSectionEntry1() { + OperationsTestCase validateEMSPersonnelAdverseEventSectionEntry1TestCase = new OperationsTestCase( + "validateEMSPersonnelAdverseEventSectionEntry1", + operationsForOCL.getOCLValue("VALIDATE_EMS_PERSONNEL_ADVERSE_EVENT_SECTION_ENTRY1__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSPersonnelAdverseEventSection target) { + + } + + @Override + protected void updateToPass(EMSPersonnelAdverseEventSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSPersonnelAdverseEventSectionOperations.validateEMSPersonnelAdverseEventSectionEntry1( + (EMSPersonnelAdverseEventSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSPersonnelAdverseEventSectionEntry1TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSPersonnelAdverseEventSectionEntry2() { + OperationsTestCase validateEMSPersonnelAdverseEventSectionEntry2TestCase = new OperationsTestCase( + "validateEMSPersonnelAdverseEventSectionEntry2", + operationsForOCL.getOCLValue("VALIDATE_EMS_PERSONNEL_ADVERSE_EVENT_SECTION_ENTRY2__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSPersonnelAdverseEventSection target) { + + } + + @Override + protected void updateToPass(EMSPersonnelAdverseEventSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSPersonnelAdverseEventSectionOperations.validateEMSPersonnelAdverseEventSectionEntry2( + (EMSPersonnelAdverseEventSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSPersonnelAdverseEventSectionEntry2TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + private static class OperationsForOCL extends EMSPersonnelAdverseEventSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public EMSPersonnelAdverseEventSection create() { + return EmspcrFactory.eINSTANCE.createEMSPersonnelAdverseEventSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends EMSPersonnelAdverseEventSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // EMSPersonnelAdverseEventSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSPhysicalAssessmentSectionTest.java b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSPhysicalAssessmentSectionTest.java new file mode 100644 index 000000000..eb88f073e --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSPhysicalAssessmentSectionTest.java @@ -0,0 +1,877 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.emspcr.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; + +import org.eclipse.emf.ecore.EObject; + +import org.junit.Test; + +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; + +import org.openhealthtools.mdht.uml.cda.emspcr.EMSPhysicalAssessmentSection; +import org.openhealthtools.mdht.uml.cda.emspcr.EmspcrFactory; + +import org.openhealthtools.mdht.uml.cda.emspcr.operations.EMSPhysicalAssessmentSectionOperations; + +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'EMS Physical Assessment Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSPhysicalAssessmentSection#validateEMSPhysicalAssessmentSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Physical Assessment Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSPhysicalAssessmentSection#validateEMSPhysicalAssessmentSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Physical Assessment Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSPhysicalAssessmentSection#validateEMSPhysicalAssessmentSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Physical Assessment Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSPhysicalAssessmentSection#validateEMSPhysicalAssessmentSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Physical Assessment Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSPhysicalAssessmentSection#validateEMSPhysicalAssessmentSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Physical Assessment Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSPhysicalAssessmentSection#validateEMSPhysicalAssessmentSectionEntry1(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Physical Assessment Section Entry1}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSPhysicalAssessmentSection#validateEMSPhysicalAssessmentSectionEntry2(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Physical Assessment Section Entry2}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSPhysicalAssessmentSection#validateEMSPhysicalAssessmentSectionEntry3(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Physical Assessment Section Entry3}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSPhysicalAssessmentSection#validateEMSPhysicalAssessmentSectionEntry4(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Physical Assessment Section Entry4}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSPhysicalAssessmentSection#validateEMSPhysicalAssessmentSectionEntry5(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Physical Assessment Section Entry5}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSPhysicalAssessmentSection#validateEMSPhysicalAssessmentSectionEntry6(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Physical Assessment Section Entry6}
  • + *
+ *

+ * + * @generated + */ + +public class EMSPhysicalAssessmentSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateEMSPhysicalAssessmentSectionTemplateId() { + OperationsTestCase validateEMSPhysicalAssessmentSectionTemplateIdTestCase = new OperationsTestCase( + "validateEMSPhysicalAssessmentSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_EMS_PHYSICAL_ASSESSMENT_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSPhysicalAssessmentSection target) { + + } + + @Override + protected void updateToPass(EMSPhysicalAssessmentSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSPhysicalAssessmentSectionOperations.validateEMSPhysicalAssessmentSectionTemplateId( + (EMSPhysicalAssessmentSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSPhysicalAssessmentSectionTemplateIdTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSPhysicalAssessmentSectionCode() { + OperationsTestCase validateEMSPhysicalAssessmentSectionCodeTestCase = new OperationsTestCase( + "validateEMSPhysicalAssessmentSectionCode", + operationsForOCL.getOCLValue("VALIDATE_EMS_PHYSICAL_ASSESSMENT_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSPhysicalAssessmentSection target) { + + } + + @Override + protected void updateToPass(EMSPhysicalAssessmentSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSPhysicalAssessmentSectionOperations.validateEMSPhysicalAssessmentSectionCode( + (EMSPhysicalAssessmentSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSPhysicalAssessmentSectionCodeTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSPhysicalAssessmentSectionCodeP() { + OperationsTestCase validateEMSPhysicalAssessmentSectionCodePTestCase = new OperationsTestCase( + "validateEMSPhysicalAssessmentSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_EMS_PHYSICAL_ASSESSMENT_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSPhysicalAssessmentSection target) { + + } + + @Override + protected void updateToPass(EMSPhysicalAssessmentSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSPhysicalAssessmentSectionOperations.validateEMSPhysicalAssessmentSectionCodeP( + (EMSPhysicalAssessmentSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSPhysicalAssessmentSectionCodePTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSPhysicalAssessmentSectionTitle() { + OperationsTestCase validateEMSPhysicalAssessmentSectionTitleTestCase = new OperationsTestCase( + "validateEMSPhysicalAssessmentSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_EMS_PHYSICAL_ASSESSMENT_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSPhysicalAssessmentSection target) { + + } + + @Override + protected void updateToPass(EMSPhysicalAssessmentSection target) { + target.init(); + + + + + + + + + + + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title ); + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSPhysicalAssessmentSectionOperations.validateEMSPhysicalAssessmentSectionTitle( + (EMSPhysicalAssessmentSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSPhysicalAssessmentSectionTitleTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSPhysicalAssessmentSectionText() { + OperationsTestCase validateEMSPhysicalAssessmentSectionTextTestCase = new OperationsTestCase( + "validateEMSPhysicalAssessmentSectionText", + operationsForOCL.getOCLValue("VALIDATE_EMS_PHYSICAL_ASSESSMENT_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSPhysicalAssessmentSection target) { + + } + + @Override + protected void updateToPass(EMSPhysicalAssessmentSection target) { + target.init(); + + + + + + + + + + + + + + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text ); + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSPhysicalAssessmentSectionOperations.validateEMSPhysicalAssessmentSectionText( + (EMSPhysicalAssessmentSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSPhysicalAssessmentSectionTextTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSPhysicalAssessmentSectionEntry1() { + OperationsTestCase validateEMSPhysicalAssessmentSectionEntry1TestCase = new OperationsTestCase( + "validateEMSPhysicalAssessmentSectionEntry1", + operationsForOCL.getOCLValue("VALIDATE_EMS_PHYSICAL_ASSESSMENT_SECTION_ENTRY1__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSPhysicalAssessmentSection target) { + + } + + @Override + protected void updateToPass(EMSPhysicalAssessmentSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSPhysicalAssessmentSectionOperations.validateEMSPhysicalAssessmentSectionEntry1( + (EMSPhysicalAssessmentSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSPhysicalAssessmentSectionEntry1TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSPhysicalAssessmentSectionEntry2() { + OperationsTestCase validateEMSPhysicalAssessmentSectionEntry2TestCase = new OperationsTestCase( + "validateEMSPhysicalAssessmentSectionEntry2", + operationsForOCL.getOCLValue("VALIDATE_EMS_PHYSICAL_ASSESSMENT_SECTION_ENTRY2__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSPhysicalAssessmentSection target) { + + } + + @Override + protected void updateToPass(EMSPhysicalAssessmentSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSPhysicalAssessmentSectionOperations.validateEMSPhysicalAssessmentSectionEntry2( + (EMSPhysicalAssessmentSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSPhysicalAssessmentSectionEntry2TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSPhysicalAssessmentSectionEntry3() { + OperationsTestCase validateEMSPhysicalAssessmentSectionEntry3TestCase = new OperationsTestCase( + "validateEMSPhysicalAssessmentSectionEntry3", + operationsForOCL.getOCLValue("VALIDATE_EMS_PHYSICAL_ASSESSMENT_SECTION_ENTRY3__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSPhysicalAssessmentSection target) { + + } + + @Override + protected void updateToPass(EMSPhysicalAssessmentSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSPhysicalAssessmentSectionOperations.validateEMSPhysicalAssessmentSectionEntry3( + (EMSPhysicalAssessmentSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSPhysicalAssessmentSectionEntry3TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSPhysicalAssessmentSectionEntry4() { + OperationsTestCase validateEMSPhysicalAssessmentSectionEntry4TestCase = new OperationsTestCase( + "validateEMSPhysicalAssessmentSectionEntry4", + operationsForOCL.getOCLValue("VALIDATE_EMS_PHYSICAL_ASSESSMENT_SECTION_ENTRY4__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSPhysicalAssessmentSection target) { + + } + + @Override + protected void updateToPass(EMSPhysicalAssessmentSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSPhysicalAssessmentSectionOperations.validateEMSPhysicalAssessmentSectionEntry4( + (EMSPhysicalAssessmentSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSPhysicalAssessmentSectionEntry4TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSPhysicalAssessmentSectionEntry5() { + OperationsTestCase validateEMSPhysicalAssessmentSectionEntry5TestCase = new OperationsTestCase( + "validateEMSPhysicalAssessmentSectionEntry5", + operationsForOCL.getOCLValue("VALIDATE_EMS_PHYSICAL_ASSESSMENT_SECTION_ENTRY5__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSPhysicalAssessmentSection target) { + + } + + @Override + protected void updateToPass(EMSPhysicalAssessmentSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSPhysicalAssessmentSectionOperations.validateEMSPhysicalAssessmentSectionEntry5( + (EMSPhysicalAssessmentSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSPhysicalAssessmentSectionEntry5TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSPhysicalAssessmentSectionEntry6() { + OperationsTestCase validateEMSPhysicalAssessmentSectionEntry6TestCase = new OperationsTestCase( + "validateEMSPhysicalAssessmentSectionEntry6", + operationsForOCL.getOCLValue("VALIDATE_EMS_PHYSICAL_ASSESSMENT_SECTION_ENTRY6__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSPhysicalAssessmentSection target) { + + } + + @Override + protected void updateToPass(EMSPhysicalAssessmentSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSPhysicalAssessmentSectionOperations.validateEMSPhysicalAssessmentSectionEntry6( + (EMSPhysicalAssessmentSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSPhysicalAssessmentSectionEntry6TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + private static class OperationsForOCL extends EMSPhysicalAssessmentSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public EMSPhysicalAssessmentSection create() { + return EmspcrFactory.eINSTANCE.createEMSPhysicalAssessmentSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends EMSPhysicalAssessmentSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // EMSPhysicalAssessmentSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSProceduresPerformedSectionTest.java b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSProceduresPerformedSectionTest.java new file mode 100644 index 000000000..261023334 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSProceduresPerformedSectionTest.java @@ -0,0 +1,532 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.emspcr.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; + +import org.eclipse.emf.ecore.EObject; + +import org.junit.Test; + +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; + +import org.openhealthtools.mdht.uml.cda.emspcr.EMSProceduresPerformedSection; +import org.openhealthtools.mdht.uml.cda.emspcr.EmspcrFactory; + +import org.openhealthtools.mdht.uml.cda.emspcr.operations.EMSProceduresPerformedSectionOperations; + +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'EMS Procedures Performed Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSProceduresPerformedSection#validateEMSProceduresPerformedSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Procedures Performed Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSProceduresPerformedSection#validateEMSProceduresPerformedSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Procedures Performed Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSProceduresPerformedSection#validateEMSProceduresPerformedSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Procedures Performed Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSProceduresPerformedSection#validateEMSProceduresPerformedSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Procedures Performed Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSProceduresPerformedSection#validateEMSProceduresPerformedSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Procedures Performed Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSProceduresPerformedSection#validateEMSProceduresPerformedSectionEntry1(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Procedures Performed Section Entry1}
  • + *
+ *

+ * + * @generated + */ + +public class EMSProceduresPerformedSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateEMSProceduresPerformedSectionTemplateId() { + OperationsTestCase validateEMSProceduresPerformedSectionTemplateIdTestCase = new OperationsTestCase( + "validateEMSProceduresPerformedSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_EMS_PROCEDURES_PERFORMED_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSProceduresPerformedSection target) { + + } + + @Override + protected void updateToPass(EMSProceduresPerformedSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSProceduresPerformedSectionOperations.validateEMSProceduresPerformedSectionTemplateId( + (EMSProceduresPerformedSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSProceduresPerformedSectionTemplateIdTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSProceduresPerformedSectionCode() { + OperationsTestCase validateEMSProceduresPerformedSectionCodeTestCase = new OperationsTestCase( + "validateEMSProceduresPerformedSectionCode", + operationsForOCL.getOCLValue("VALIDATE_EMS_PROCEDURES_PERFORMED_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSProceduresPerformedSection target) { + + } + + @Override + protected void updateToPass(EMSProceduresPerformedSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSProceduresPerformedSectionOperations.validateEMSProceduresPerformedSectionCode( + (EMSProceduresPerformedSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSProceduresPerformedSectionCodeTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSProceduresPerformedSectionCodeP() { + OperationsTestCase validateEMSProceduresPerformedSectionCodePTestCase = new OperationsTestCase( + "validateEMSProceduresPerformedSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_EMS_PROCEDURES_PERFORMED_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSProceduresPerformedSection target) { + + } + + @Override + protected void updateToPass(EMSProceduresPerformedSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSProceduresPerformedSectionOperations.validateEMSProceduresPerformedSectionCodeP( + (EMSProceduresPerformedSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSProceduresPerformedSectionCodePTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSProceduresPerformedSectionTitle() { + OperationsTestCase validateEMSProceduresPerformedSectionTitleTestCase = new OperationsTestCase( + "validateEMSProceduresPerformedSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_EMS_PROCEDURES_PERFORMED_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSProceduresPerformedSection target) { + + } + + @Override + protected void updateToPass(EMSProceduresPerformedSection target) { + target.init(); + + + + + + + + + + + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title ); + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSProceduresPerformedSectionOperations.validateEMSProceduresPerformedSectionTitle( + (EMSProceduresPerformedSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSProceduresPerformedSectionTitleTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSProceduresPerformedSectionText() { + OperationsTestCase validateEMSProceduresPerformedSectionTextTestCase = new OperationsTestCase( + "validateEMSProceduresPerformedSectionText", + operationsForOCL.getOCLValue("VALIDATE_EMS_PROCEDURES_PERFORMED_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSProceduresPerformedSection target) { + + } + + @Override + protected void updateToPass(EMSProceduresPerformedSection target) { + target.init(); + + + + + + + + + + + + + + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text ); + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSProceduresPerformedSectionOperations.validateEMSProceduresPerformedSectionText( + (EMSProceduresPerformedSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSProceduresPerformedSectionTextTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSProceduresPerformedSectionEntry1() { + OperationsTestCase validateEMSProceduresPerformedSectionEntry1TestCase = new OperationsTestCase( + "validateEMSProceduresPerformedSectionEntry1", + operationsForOCL.getOCLValue("VALIDATE_EMS_PROCEDURES_PERFORMED_SECTION_ENTRY1__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSProceduresPerformedSection target) { + + } + + @Override + protected void updateToPass(EMSProceduresPerformedSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSProceduresPerformedSectionOperations.validateEMSProceduresPerformedSectionEntry1( + (EMSProceduresPerformedSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSProceduresPerformedSectionEntry1TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + private static class OperationsForOCL extends EMSProceduresPerformedSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public EMSProceduresPerformedSection create() { + return EmspcrFactory.eINSTANCE.createEMSProceduresPerformedSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends EMSProceduresPerformedSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // EMSProceduresPerformedSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSProtocolSectionTest.java b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSProtocolSectionTest.java new file mode 100644 index 000000000..53abb7963 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSProtocolSectionTest.java @@ -0,0 +1,601 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.emspcr.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; + +import org.eclipse.emf.ecore.EObject; + +import org.junit.Test; + +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; + +import org.openhealthtools.mdht.uml.cda.emspcr.EMSProtocolSection; +import org.openhealthtools.mdht.uml.cda.emspcr.EmspcrFactory; + +import org.openhealthtools.mdht.uml.cda.emspcr.operations.EMSProtocolSectionOperations; + +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'EMS Protocol Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSProtocolSection#validateEMSProtocolSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Protocol Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSProtocolSection#validateEMSProtocolSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Protocol Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSProtocolSection#validateEMSProtocolSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Protocol Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSProtocolSection#validateEMSProtocolSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Protocol Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSProtocolSection#validateEMSProtocolSectionEntry1(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Protocol Section Entry1}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSProtocolSection#validateEMSProtocolSectionEntry2(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Protocol Section Entry2}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSProtocolSection#validateEMSProtocolSectionEntry3(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Protocol Section Entry3}
  • + *
+ *

+ * + * @generated + */ + +public class EMSProtocolSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateEMSProtocolSectionTemplateId() { + OperationsTestCase validateEMSProtocolSectionTemplateIdTestCase = new OperationsTestCase( + "validateEMSProtocolSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_EMS_PROTOCOL_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSProtocolSection target) { + + } + + @Override + protected void updateToPass(EMSProtocolSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSProtocolSectionOperations.validateEMSProtocolSectionTemplateId( + (EMSProtocolSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSProtocolSectionTemplateIdTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSProtocolSectionCode() { + OperationsTestCase validateEMSProtocolSectionCodeTestCase = new OperationsTestCase( + "validateEMSProtocolSectionCode", + operationsForOCL.getOCLValue("VALIDATE_EMS_PROTOCOL_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSProtocolSection target) { + + } + + @Override + protected void updateToPass(EMSProtocolSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSProtocolSectionOperations.validateEMSProtocolSectionCode( + (EMSProtocolSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSProtocolSectionCodeTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSProtocolSectionTitle() { + OperationsTestCase validateEMSProtocolSectionTitleTestCase = new OperationsTestCase( + "validateEMSProtocolSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_EMS_PROTOCOL_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSProtocolSection target) { + + } + + @Override + protected void updateToPass(EMSProtocolSection target) { + target.init(); + + + + + + + + + + + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title ); + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSProtocolSectionOperations.validateEMSProtocolSectionTitle( + (EMSProtocolSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSProtocolSectionTitleTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSProtocolSectionText() { + OperationsTestCase validateEMSProtocolSectionTextTestCase = new OperationsTestCase( + "validateEMSProtocolSectionText", + operationsForOCL.getOCLValue("VALIDATE_EMS_PROTOCOL_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSProtocolSection target) { + + } + + @Override + protected void updateToPass(EMSProtocolSection target) { + target.init(); + + + + + + + + + + + + + + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text ); + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSProtocolSectionOperations.validateEMSProtocolSectionText( + (EMSProtocolSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSProtocolSectionTextTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSProtocolSectionEntry1() { + OperationsTestCase validateEMSProtocolSectionEntry1TestCase = new OperationsTestCase( + "validateEMSProtocolSectionEntry1", + operationsForOCL.getOCLValue("VALIDATE_EMS_PROTOCOL_SECTION_ENTRY1__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSProtocolSection target) { + + } + + @Override + protected void updateToPass(EMSProtocolSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSProtocolSectionOperations.validateEMSProtocolSectionEntry1( + (EMSProtocolSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSProtocolSectionEntry1TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSProtocolSectionEntry2() { + OperationsTestCase validateEMSProtocolSectionEntry2TestCase = new OperationsTestCase( + "validateEMSProtocolSectionEntry2", + operationsForOCL.getOCLValue("VALIDATE_EMS_PROTOCOL_SECTION_ENTRY2__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSProtocolSection target) { + + } + + @Override + protected void updateToPass(EMSProtocolSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSProtocolSectionOperations.validateEMSProtocolSectionEntry2( + (EMSProtocolSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSProtocolSectionEntry2TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSProtocolSectionEntry3() { + OperationsTestCase validateEMSProtocolSectionEntry3TestCase = new OperationsTestCase( + "validateEMSProtocolSectionEntry3", + operationsForOCL.getOCLValue("VALIDATE_EMS_PROTOCOL_SECTION_ENTRY3__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSProtocolSection target) { + + } + + @Override + protected void updateToPass(EMSProtocolSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSProtocolSectionOperations.validateEMSProtocolSectionEntry3( + (EMSProtocolSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSProtocolSectionEntry3TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + private static class OperationsForOCL extends EMSProtocolSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public EMSProtocolSection create() { + return EmspcrFactory.eINSTANCE.createEMSProtocolSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends EMSProtocolSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // EMSProtocolSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSResponseSectionTest.java b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSResponseSectionTest.java new file mode 100644 index 000000000..4f95fd41d --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSResponseSectionTest.java @@ -0,0 +1,739 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.emspcr.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; + +import org.eclipse.emf.ecore.EObject; + +import org.junit.Test; + +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; + +import org.openhealthtools.mdht.uml.cda.emspcr.EMSResponseSection; +import org.openhealthtools.mdht.uml.cda.emspcr.EmspcrFactory; + +import org.openhealthtools.mdht.uml.cda.emspcr.operations.EMSResponseSectionOperations; + +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'EMS Response Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSResponseSection#validateEMSResponseSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Response Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSResponseSection#validateEMSResponseSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Response Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSResponseSection#validateEMSResponseSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Response Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSResponseSection#validateEMSResponseSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Response Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSResponseSection#validateEMSResponseSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Response Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSResponseSection#validateEMSResponseSectionEntry1(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Response Section Entry1}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSResponseSection#validateEMSResponseSectionEntry2(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Response Section Entry2}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSResponseSection#validateEMSResponseSectionEntry3(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Response Section Entry3}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSResponseSection#validateEMSResponseSectionEntry4(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Response Section Entry4}
  • + *
+ *

+ * + * @generated + */ + +public class EMSResponseSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateEMSResponseSectionTemplateId() { + OperationsTestCase validateEMSResponseSectionTemplateIdTestCase = new OperationsTestCase( + "validateEMSResponseSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_EMS_RESPONSE_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSResponseSection target) { + + } + + @Override + protected void updateToPass(EMSResponseSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSResponseSectionOperations.validateEMSResponseSectionTemplateId( + (EMSResponseSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSResponseSectionTemplateIdTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSResponseSectionCode() { + OperationsTestCase validateEMSResponseSectionCodeTestCase = new OperationsTestCase( + "validateEMSResponseSectionCode", + operationsForOCL.getOCLValue("VALIDATE_EMS_RESPONSE_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSResponseSection target) { + + } + + @Override + protected void updateToPass(EMSResponseSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSResponseSectionOperations.validateEMSResponseSectionCode( + (EMSResponseSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSResponseSectionCodeTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSResponseSectionCodeP() { + OperationsTestCase validateEMSResponseSectionCodePTestCase = new OperationsTestCase( + "validateEMSResponseSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_EMS_RESPONSE_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSResponseSection target) { + + } + + @Override + protected void updateToPass(EMSResponseSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSResponseSectionOperations.validateEMSResponseSectionCodeP( + (EMSResponseSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSResponseSectionCodePTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSResponseSectionTitle() { + OperationsTestCase validateEMSResponseSectionTitleTestCase = new OperationsTestCase( + "validateEMSResponseSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_EMS_RESPONSE_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSResponseSection target) { + + } + + @Override + protected void updateToPass(EMSResponseSection target) { + target.init(); + + + + + + + + + + + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title ); + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSResponseSectionOperations.validateEMSResponseSectionTitle( + (EMSResponseSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSResponseSectionTitleTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSResponseSectionText() { + OperationsTestCase validateEMSResponseSectionTextTestCase = new OperationsTestCase( + "validateEMSResponseSectionText", + operationsForOCL.getOCLValue("VALIDATE_EMS_RESPONSE_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSResponseSection target) { + + } + + @Override + protected void updateToPass(EMSResponseSection target) { + target.init(); + + + + + + + + + + + + + + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text ); + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSResponseSectionOperations.validateEMSResponseSectionText( + (EMSResponseSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSResponseSectionTextTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSResponseSectionEntry1() { + OperationsTestCase validateEMSResponseSectionEntry1TestCase = new OperationsTestCase( + "validateEMSResponseSectionEntry1", + operationsForOCL.getOCLValue("VALIDATE_EMS_RESPONSE_SECTION_ENTRY1__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSResponseSection target) { + + } + + @Override + protected void updateToPass(EMSResponseSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSResponseSectionOperations.validateEMSResponseSectionEntry1( + (EMSResponseSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSResponseSectionEntry1TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSResponseSectionEntry2() { + OperationsTestCase validateEMSResponseSectionEntry2TestCase = new OperationsTestCase( + "validateEMSResponseSectionEntry2", + operationsForOCL.getOCLValue("VALIDATE_EMS_RESPONSE_SECTION_ENTRY2__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSResponseSection target) { + + } + + @Override + protected void updateToPass(EMSResponseSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSResponseSectionOperations.validateEMSResponseSectionEntry2( + (EMSResponseSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSResponseSectionEntry2TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSResponseSectionEntry3() { + OperationsTestCase validateEMSResponseSectionEntry3TestCase = new OperationsTestCase( + "validateEMSResponseSectionEntry3", + operationsForOCL.getOCLValue("VALIDATE_EMS_RESPONSE_SECTION_ENTRY3__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSResponseSection target) { + + } + + @Override + protected void updateToPass(EMSResponseSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSResponseSectionOperations.validateEMSResponseSectionEntry3( + (EMSResponseSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSResponseSectionEntry3TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSResponseSectionEntry4() { + OperationsTestCase validateEMSResponseSectionEntry4TestCase = new OperationsTestCase( + "validateEMSResponseSectionEntry4", + operationsForOCL.getOCLValue("VALIDATE_EMS_RESPONSE_SECTION_ENTRY4__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSResponseSection target) { + + } + + @Override + protected void updateToPass(EMSResponseSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSResponseSectionOperations.validateEMSResponseSectionEntry4( + (EMSResponseSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSResponseSectionEntry4TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + private static class OperationsForOCL extends EMSResponseSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public EMSResponseSection create() { + return EmspcrFactory.eINSTANCE.createEMSResponseSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends EMSResponseSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // EMSResponseSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSSceneSectionTest.java b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSSceneSectionTest.java new file mode 100644 index 000000000..90f374db9 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSSceneSectionTest.java @@ -0,0 +1,670 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.emspcr.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; + +import org.eclipse.emf.ecore.EObject; + +import org.junit.Test; + +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; + +import org.openhealthtools.mdht.uml.cda.emspcr.EMSSceneSection; +import org.openhealthtools.mdht.uml.cda.emspcr.EmspcrFactory; + +import org.openhealthtools.mdht.uml.cda.emspcr.operations.EMSSceneSectionOperations; + +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'EMS Scene Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSSceneSection#validateEMSSceneSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Scene Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSSceneSection#validateEMSSceneSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Scene Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSSceneSection#validateEMSSceneSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Scene Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSSceneSection#validateEMSSceneSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Scene Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSSceneSection#validateEMSSceneSectionEntry1(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Scene Section Entry1}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSSceneSection#validateEMSSceneSectionEntry2(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Scene Section Entry2}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSSceneSection#validateEMSSceneSectionEntry3(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Scene Section Entry3}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSSceneSection#validateEMSSceneSectionEntry4(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Scene Section Entry4}
  • + *
+ *

+ * + * @generated + */ + +public class EMSSceneSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateEMSSceneSectionTemplateId() { + OperationsTestCase validateEMSSceneSectionTemplateIdTestCase = new OperationsTestCase( + "validateEMSSceneSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_EMS_SCENE_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSSceneSection target) { + + } + + @Override + protected void updateToPass(EMSSceneSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSSceneSectionOperations.validateEMSSceneSectionTemplateId( + (EMSSceneSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSSceneSectionTemplateIdTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSSceneSectionCode() { + OperationsTestCase validateEMSSceneSectionCodeTestCase = new OperationsTestCase( + "validateEMSSceneSectionCode", + operationsForOCL.getOCLValue("VALIDATE_EMS_SCENE_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSSceneSection target) { + + } + + @Override + protected void updateToPass(EMSSceneSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSSceneSectionOperations.validateEMSSceneSectionCode( + (EMSSceneSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSSceneSectionCodeTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSSceneSectionTitle() { + OperationsTestCase validateEMSSceneSectionTitleTestCase = new OperationsTestCase( + "validateEMSSceneSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_EMS_SCENE_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSSceneSection target) { + + } + + @Override + protected void updateToPass(EMSSceneSection target) { + target.init(); + + + + + + + + + + + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title ); + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSSceneSectionOperations.validateEMSSceneSectionTitle( + (EMSSceneSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSSceneSectionTitleTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSSceneSectionText() { + OperationsTestCase validateEMSSceneSectionTextTestCase = new OperationsTestCase( + "validateEMSSceneSectionText", + operationsForOCL.getOCLValue("VALIDATE_EMS_SCENE_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSSceneSection target) { + + } + + @Override + protected void updateToPass(EMSSceneSection target) { + target.init(); + + + + + + + + + + + + + + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text ); + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSSceneSectionOperations.validateEMSSceneSectionText( + (EMSSceneSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSSceneSectionTextTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSSceneSectionEntry1() { + OperationsTestCase validateEMSSceneSectionEntry1TestCase = new OperationsTestCase( + "validateEMSSceneSectionEntry1", + operationsForOCL.getOCLValue("VALIDATE_EMS_SCENE_SECTION_ENTRY1__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSSceneSection target) { + + } + + @Override + protected void updateToPass(EMSSceneSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSSceneSectionOperations.validateEMSSceneSectionEntry1( + (EMSSceneSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSSceneSectionEntry1TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSSceneSectionEntry2() { + OperationsTestCase validateEMSSceneSectionEntry2TestCase = new OperationsTestCase( + "validateEMSSceneSectionEntry2", + operationsForOCL.getOCLValue("VALIDATE_EMS_SCENE_SECTION_ENTRY2__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSSceneSection target) { + + } + + @Override + protected void updateToPass(EMSSceneSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSSceneSectionOperations.validateEMSSceneSectionEntry2( + (EMSSceneSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSSceneSectionEntry2TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSSceneSectionEntry3() { + OperationsTestCase validateEMSSceneSectionEntry3TestCase = new OperationsTestCase( + "validateEMSSceneSectionEntry3", + operationsForOCL.getOCLValue("VALIDATE_EMS_SCENE_SECTION_ENTRY3__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSSceneSection target) { + + } + + @Override + protected void updateToPass(EMSSceneSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSSceneSectionOperations.validateEMSSceneSectionEntry3( + (EMSSceneSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSSceneSectionEntry3TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSSceneSectionEntry4() { + OperationsTestCase validateEMSSceneSectionEntry4TestCase = new OperationsTestCase( + "validateEMSSceneSectionEntry4", + operationsForOCL.getOCLValue("VALIDATE_EMS_SCENE_SECTION_ENTRY4__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSSceneSection target) { + + } + + @Override + protected void updateToPass(EMSSceneSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSSceneSectionOperations.validateEMSSceneSectionEntry4( + (EMSSceneSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSSceneSectionEntry4TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + private static class OperationsForOCL extends EMSSceneSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public EMSSceneSection create() { + return EmspcrFactory.eINSTANCE.createEMSSceneSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends EMSSceneSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // EMSSceneSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSSituationSectionTest.java b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSSituationSectionTest.java new file mode 100644 index 000000000..35fe24fa7 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSSituationSectionTest.java @@ -0,0 +1,1015 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.emspcr.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; + +import org.eclipse.emf.ecore.EObject; + +import org.junit.Test; + +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; + +import org.openhealthtools.mdht.uml.cda.emspcr.EMSSituationSection; +import org.openhealthtools.mdht.uml.cda.emspcr.EmspcrFactory; + +import org.openhealthtools.mdht.uml.cda.emspcr.operations.EMSSituationSectionOperations; + +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'EMS Situation Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSSituationSection#validateEMSSituationSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Situation Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSSituationSection#validateEMSSituationSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Situation Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSSituationSection#validateEMSSituationSectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Situation Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSSituationSection#validateEMSSituationSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Situation Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSSituationSection#validateEMSSituationSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Situation Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSSituationSection#validateEMSSituationSectionEntry1(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Situation Section Entry1}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSSituationSection#validateEMSSituationSectionEntry2(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Situation Section Entry2}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSSituationSection#validateEMSSituationSectionEntry3(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Situation Section Entry3}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSSituationSection#validateEMSSituationSectionEntry4(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Situation Section Entry4}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSSituationSection#validateEMSSituationSectionEntry5(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Situation Section Entry5}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSSituationSection#validateEMSSituationSectionEntry6(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Situation Section Entry6}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSSituationSection#validateEMSSituationSectionEntry7(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Situation Section Entry7}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSSituationSection#validateEMSSituationSectionEntry8(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Situation Section Entry8}
  • + *
+ *

+ * + * @generated + */ + +public class EMSSituationSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateEMSSituationSectionTemplateId() { + OperationsTestCase validateEMSSituationSectionTemplateIdTestCase = new OperationsTestCase( + "validateEMSSituationSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_EMS_SITUATION_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSSituationSection target) { + + } + + @Override + protected void updateToPass(EMSSituationSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSSituationSectionOperations.validateEMSSituationSectionTemplateId( + (EMSSituationSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSSituationSectionTemplateIdTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSSituationSectionCode() { + OperationsTestCase validateEMSSituationSectionCodeTestCase = new OperationsTestCase( + "validateEMSSituationSectionCode", + operationsForOCL.getOCLValue("VALIDATE_EMS_SITUATION_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSSituationSection target) { + + } + + @Override + protected void updateToPass(EMSSituationSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSSituationSectionOperations.validateEMSSituationSectionCode( + (EMSSituationSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSSituationSectionCodeTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSSituationSectionCodeP() { + OperationsTestCase validateEMSSituationSectionCodePTestCase = new OperationsTestCase( + "validateEMSSituationSectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_EMS_SITUATION_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSSituationSection target) { + + } + + @Override + protected void updateToPass(EMSSituationSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSSituationSectionOperations.validateEMSSituationSectionCodeP( + (EMSSituationSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSSituationSectionCodePTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSSituationSectionTitle() { + OperationsTestCase validateEMSSituationSectionTitleTestCase = new OperationsTestCase( + "validateEMSSituationSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_EMS_SITUATION_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSSituationSection target) { + + } + + @Override + protected void updateToPass(EMSSituationSection target) { + target.init(); + + + + + + + + + + + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title ); + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSSituationSectionOperations.validateEMSSituationSectionTitle( + (EMSSituationSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSSituationSectionTitleTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSSituationSectionText() { + OperationsTestCase validateEMSSituationSectionTextTestCase = new OperationsTestCase( + "validateEMSSituationSectionText", + operationsForOCL.getOCLValue("VALIDATE_EMS_SITUATION_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSSituationSection target) { + + } + + @Override + protected void updateToPass(EMSSituationSection target) { + target.init(); + + + + + + + + + + + + + + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text ); + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSSituationSectionOperations.validateEMSSituationSectionText( + (EMSSituationSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSSituationSectionTextTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSSituationSectionEntry1() { + OperationsTestCase validateEMSSituationSectionEntry1TestCase = new OperationsTestCase( + "validateEMSSituationSectionEntry1", + operationsForOCL.getOCLValue("VALIDATE_EMS_SITUATION_SECTION_ENTRY1__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSSituationSection target) { + + } + + @Override + protected void updateToPass(EMSSituationSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSSituationSectionOperations.validateEMSSituationSectionEntry1( + (EMSSituationSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSSituationSectionEntry1TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSSituationSectionEntry2() { + OperationsTestCase validateEMSSituationSectionEntry2TestCase = new OperationsTestCase( + "validateEMSSituationSectionEntry2", + operationsForOCL.getOCLValue("VALIDATE_EMS_SITUATION_SECTION_ENTRY2__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSSituationSection target) { + + } + + @Override + protected void updateToPass(EMSSituationSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSSituationSectionOperations.validateEMSSituationSectionEntry2( + (EMSSituationSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSSituationSectionEntry2TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSSituationSectionEntry3() { + OperationsTestCase validateEMSSituationSectionEntry3TestCase = new OperationsTestCase( + "validateEMSSituationSectionEntry3", + operationsForOCL.getOCLValue("VALIDATE_EMS_SITUATION_SECTION_ENTRY3__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSSituationSection target) { + + } + + @Override + protected void updateToPass(EMSSituationSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSSituationSectionOperations.validateEMSSituationSectionEntry3( + (EMSSituationSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSSituationSectionEntry3TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSSituationSectionEntry4() { + OperationsTestCase validateEMSSituationSectionEntry4TestCase = new OperationsTestCase( + "validateEMSSituationSectionEntry4", + operationsForOCL.getOCLValue("VALIDATE_EMS_SITUATION_SECTION_ENTRY4__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSSituationSection target) { + + } + + @Override + protected void updateToPass(EMSSituationSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSSituationSectionOperations.validateEMSSituationSectionEntry4( + (EMSSituationSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSSituationSectionEntry4TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSSituationSectionEntry5() { + OperationsTestCase validateEMSSituationSectionEntry5TestCase = new OperationsTestCase( + "validateEMSSituationSectionEntry5", + operationsForOCL.getOCLValue("VALIDATE_EMS_SITUATION_SECTION_ENTRY5__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSSituationSection target) { + + } + + @Override + protected void updateToPass(EMSSituationSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSSituationSectionOperations.validateEMSSituationSectionEntry5( + (EMSSituationSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSSituationSectionEntry5TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSSituationSectionEntry6() { + OperationsTestCase validateEMSSituationSectionEntry6TestCase = new OperationsTestCase( + "validateEMSSituationSectionEntry6", + operationsForOCL.getOCLValue("VALIDATE_EMS_SITUATION_SECTION_ENTRY6__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSSituationSection target) { + + } + + @Override + protected void updateToPass(EMSSituationSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSSituationSectionOperations.validateEMSSituationSectionEntry6( + (EMSSituationSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSSituationSectionEntry6TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSSituationSectionEntry7() { + OperationsTestCase validateEMSSituationSectionEntry7TestCase = new OperationsTestCase( + "validateEMSSituationSectionEntry7", + operationsForOCL.getOCLValue("VALIDATE_EMS_SITUATION_SECTION_ENTRY7__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSSituationSection target) { + + } + + @Override + protected void updateToPass(EMSSituationSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSSituationSectionOperations.validateEMSSituationSectionEntry7( + (EMSSituationSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSSituationSectionEntry7TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSSituationSectionEntry8() { + OperationsTestCase validateEMSSituationSectionEntry8TestCase = new OperationsTestCase( + "validateEMSSituationSectionEntry8", + operationsForOCL.getOCLValue("VALIDATE_EMS_SITUATION_SECTION_ENTRY8__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSSituationSection target) { + + } + + @Override + protected void updateToPass(EMSSituationSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSSituationSectionOperations.validateEMSSituationSectionEntry8( + (EMSSituationSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSSituationSectionEntry8TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + private static class OperationsForOCL extends EMSSituationSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public EMSSituationSection create() { + return EmspcrFactory.eINSTANCE.createEMSSituationSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends EMSSituationSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // EMSSituationSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSSocialHistorySectionTest.java b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSSocialHistorySectionTest.java new file mode 100644 index 000000000..2ee261ba7 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSSocialHistorySectionTest.java @@ -0,0 +1,601 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.emspcr.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; + +import org.eclipse.emf.ecore.EObject; + +import org.junit.Test; + +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; + +import org.openhealthtools.mdht.uml.cda.emspcr.EMSSocialHistorySection; +import org.openhealthtools.mdht.uml.cda.emspcr.EmspcrFactory; + +import org.openhealthtools.mdht.uml.cda.emspcr.operations.EMSSocialHistorySectionOperations; + +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'EMS Social History Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSSocialHistorySection#validateEMSSocialHistorySectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Social History Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSSocialHistorySection#validateEMSSocialHistorySectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Social History Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSSocialHistorySection#validateEMSSocialHistorySectionCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Social History Section Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSSocialHistorySection#validateEMSSocialHistorySectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Social History Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSSocialHistorySection#validateEMSSocialHistorySectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Social History Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSSocialHistorySection#validateEMSSocialHistorySectionEntry1(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Social History Section Entry1}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSSocialHistorySection#validateEMSSocialHistorySectionEntry2(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Social History Section Entry2}
  • + *
+ *

+ * + * @generated + */ + +public class EMSSocialHistorySectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateEMSSocialHistorySectionTemplateId() { + OperationsTestCase validateEMSSocialHistorySectionTemplateIdTestCase = new OperationsTestCase( + "validateEMSSocialHistorySectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_EMS_SOCIAL_HISTORY_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSSocialHistorySection target) { + + } + + @Override + protected void updateToPass(EMSSocialHistorySection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSSocialHistorySectionOperations.validateEMSSocialHistorySectionTemplateId( + (EMSSocialHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateEMSSocialHistorySectionTemplateIdTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSSocialHistorySectionCode() { + OperationsTestCase validateEMSSocialHistorySectionCodeTestCase = new OperationsTestCase( + "validateEMSSocialHistorySectionCode", + operationsForOCL.getOCLValue("VALIDATE_EMS_SOCIAL_HISTORY_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSSocialHistorySection target) { + + } + + @Override + protected void updateToPass(EMSSocialHistorySection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSSocialHistorySectionOperations.validateEMSSocialHistorySectionCode( + (EMSSocialHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateEMSSocialHistorySectionCodeTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSSocialHistorySectionCodeP() { + OperationsTestCase validateEMSSocialHistorySectionCodePTestCase = new OperationsTestCase( + "validateEMSSocialHistorySectionCodeP", + operationsForOCL.getOCLValue("VALIDATE_EMS_SOCIAL_HISTORY_SECTION_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSSocialHistorySection target) { + + } + + @Override + protected void updateToPass(EMSSocialHistorySection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSSocialHistorySectionOperations.validateEMSSocialHistorySectionCodeP( + (EMSSocialHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateEMSSocialHistorySectionCodePTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSSocialHistorySectionTitle() { + OperationsTestCase validateEMSSocialHistorySectionTitleTestCase = new OperationsTestCase( + "validateEMSSocialHistorySectionTitle", + operationsForOCL.getOCLValue("VALIDATE_EMS_SOCIAL_HISTORY_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSSocialHistorySection target) { + + } + + @Override + protected void updateToPass(EMSSocialHistorySection target) { + target.init(); + + + + + + + + + + + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title ); + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSSocialHistorySectionOperations.validateEMSSocialHistorySectionTitle( + (EMSSocialHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateEMSSocialHistorySectionTitleTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSSocialHistorySectionText() { + OperationsTestCase validateEMSSocialHistorySectionTextTestCase = new OperationsTestCase( + "validateEMSSocialHistorySectionText", + operationsForOCL.getOCLValue("VALIDATE_EMS_SOCIAL_HISTORY_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSSocialHistorySection target) { + + } + + @Override + protected void updateToPass(EMSSocialHistorySection target) { + target.init(); + + + + + + + + + + + + + + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text ); + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSSocialHistorySectionOperations.validateEMSSocialHistorySectionText( + (EMSSocialHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateEMSSocialHistorySectionTextTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSSocialHistorySectionEntry1() { + OperationsTestCase validateEMSSocialHistorySectionEntry1TestCase = new OperationsTestCase( + "validateEMSSocialHistorySectionEntry1", + operationsForOCL.getOCLValue("VALIDATE_EMS_SOCIAL_HISTORY_SECTION_ENTRY1__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSSocialHistorySection target) { + + } + + @Override + protected void updateToPass(EMSSocialHistorySection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSSocialHistorySectionOperations.validateEMSSocialHistorySectionEntry1( + (EMSSocialHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateEMSSocialHistorySectionEntry1TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSSocialHistorySectionEntry2() { + OperationsTestCase validateEMSSocialHistorySectionEntry2TestCase = new OperationsTestCase( + "validateEMSSocialHistorySectionEntry2", + operationsForOCL.getOCLValue("VALIDATE_EMS_SOCIAL_HISTORY_SECTION_ENTRY2__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSSocialHistorySection target) { + + } + + @Override + protected void updateToPass(EMSSocialHistorySection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSSocialHistorySectionOperations.validateEMSSocialHistorySectionEntry2( + (EMSSocialHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateEMSSocialHistorySectionEntry2TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + private static class OperationsForOCL extends EMSSocialHistorySectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public EMSSocialHistorySection create() { + return EmspcrFactory.eINSTANCE.createEMSSocialHistorySection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends EMSSocialHistorySectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // EMSSocialHistorySectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSTimesSectionTest.java b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSTimesSectionTest.java new file mode 100644 index 000000000..e0453bc49 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSTimesSectionTest.java @@ -0,0 +1,1015 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.emspcr.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; + +import org.eclipse.emf.ecore.EObject; + +import org.junit.Test; + +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; + +import org.openhealthtools.mdht.uml.cda.emspcr.EMSTimesSection; +import org.openhealthtools.mdht.uml.cda.emspcr.EmspcrFactory; + +import org.openhealthtools.mdht.uml.cda.emspcr.operations.EMSTimesSectionOperations; + +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'EMS Times Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSTimesSection#validateEMSTimesSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Times Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSTimesSection#validateEMSTimesSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Times Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSTimesSection#validateEMSTimesSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Times Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSTimesSection#validateEMSTimesSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Times Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSTimesSection#validateEMSTimesSectionEntry1(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Times Section Entry1}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSTimesSection#validateEMSTimesSectionEntry2(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Times Section Entry2}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSTimesSection#validateEMSTimesSectionEntry3(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Times Section Entry3}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSTimesSection#validateEMSTimesSectionEntry4(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Times Section Entry4}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSTimesSection#validateEMSTimesSectionEntry5(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Times Section Entry5}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSTimesSection#validateEMSTimesSectionEntry6(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Times Section Entry6}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSTimesSection#validateEMSTimesSectionEntry7(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Times Section Entry7}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSTimesSection#validateEMSTimesSectionEntry8(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Times Section Entry8}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSTimesSection#validateEMSTimesSectionEntry9(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Times Section Entry9}
  • + *
+ *

+ * + * @generated + */ + +public class EMSTimesSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateEMSTimesSectionTemplateId() { + OperationsTestCase validateEMSTimesSectionTemplateIdTestCase = new OperationsTestCase( + "validateEMSTimesSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_EMS_TIMES_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSTimesSection target) { + + } + + @Override + protected void updateToPass(EMSTimesSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSTimesSectionOperations.validateEMSTimesSectionTemplateId( + (EMSTimesSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSTimesSectionTemplateIdTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSTimesSectionCode() { + OperationsTestCase validateEMSTimesSectionCodeTestCase = new OperationsTestCase( + "validateEMSTimesSectionCode", + operationsForOCL.getOCLValue("VALIDATE_EMS_TIMES_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSTimesSection target) { + + } + + @Override + protected void updateToPass(EMSTimesSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSTimesSectionOperations.validateEMSTimesSectionCode( + (EMSTimesSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSTimesSectionCodeTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSTimesSectionTitle() { + OperationsTestCase validateEMSTimesSectionTitleTestCase = new OperationsTestCase( + "validateEMSTimesSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_EMS_TIMES_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSTimesSection target) { + + } + + @Override + protected void updateToPass(EMSTimesSection target) { + target.init(); + + + + + + + + + + + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title ); + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSTimesSectionOperations.validateEMSTimesSectionTitle( + (EMSTimesSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSTimesSectionTitleTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSTimesSectionText() { + OperationsTestCase validateEMSTimesSectionTextTestCase = new OperationsTestCase( + "validateEMSTimesSectionText", + operationsForOCL.getOCLValue("VALIDATE_EMS_TIMES_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSTimesSection target) { + + } + + @Override + protected void updateToPass(EMSTimesSection target) { + target.init(); + + + + + + + + + + + + + + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text ); + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSTimesSectionOperations.validateEMSTimesSectionText( + (EMSTimesSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSTimesSectionTextTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSTimesSectionEntry1() { + OperationsTestCase validateEMSTimesSectionEntry1TestCase = new OperationsTestCase( + "validateEMSTimesSectionEntry1", + operationsForOCL.getOCLValue("VALIDATE_EMS_TIMES_SECTION_ENTRY1__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSTimesSection target) { + + } + + @Override + protected void updateToPass(EMSTimesSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSTimesSectionOperations.validateEMSTimesSectionEntry1( + (EMSTimesSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSTimesSectionEntry1TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSTimesSectionEntry2() { + OperationsTestCase validateEMSTimesSectionEntry2TestCase = new OperationsTestCase( + "validateEMSTimesSectionEntry2", + operationsForOCL.getOCLValue("VALIDATE_EMS_TIMES_SECTION_ENTRY2__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSTimesSection target) { + + } + + @Override + protected void updateToPass(EMSTimesSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSTimesSectionOperations.validateEMSTimesSectionEntry2( + (EMSTimesSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSTimesSectionEntry2TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSTimesSectionEntry3() { + OperationsTestCase validateEMSTimesSectionEntry3TestCase = new OperationsTestCase( + "validateEMSTimesSectionEntry3", + operationsForOCL.getOCLValue("VALIDATE_EMS_TIMES_SECTION_ENTRY3__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSTimesSection target) { + + } + + @Override + protected void updateToPass(EMSTimesSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSTimesSectionOperations.validateEMSTimesSectionEntry3( + (EMSTimesSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSTimesSectionEntry3TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSTimesSectionEntry4() { + OperationsTestCase validateEMSTimesSectionEntry4TestCase = new OperationsTestCase( + "validateEMSTimesSectionEntry4", + operationsForOCL.getOCLValue("VALIDATE_EMS_TIMES_SECTION_ENTRY4__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSTimesSection target) { + + } + + @Override + protected void updateToPass(EMSTimesSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSTimesSectionOperations.validateEMSTimesSectionEntry4( + (EMSTimesSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSTimesSectionEntry4TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSTimesSectionEntry5() { + OperationsTestCase validateEMSTimesSectionEntry5TestCase = new OperationsTestCase( + "validateEMSTimesSectionEntry5", + operationsForOCL.getOCLValue("VALIDATE_EMS_TIMES_SECTION_ENTRY5__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSTimesSection target) { + + } + + @Override + protected void updateToPass(EMSTimesSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSTimesSectionOperations.validateEMSTimesSectionEntry5( + (EMSTimesSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSTimesSectionEntry5TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSTimesSectionEntry6() { + OperationsTestCase validateEMSTimesSectionEntry6TestCase = new OperationsTestCase( + "validateEMSTimesSectionEntry6", + operationsForOCL.getOCLValue("VALIDATE_EMS_TIMES_SECTION_ENTRY6__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSTimesSection target) { + + } + + @Override + protected void updateToPass(EMSTimesSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSTimesSectionOperations.validateEMSTimesSectionEntry6( + (EMSTimesSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSTimesSectionEntry6TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSTimesSectionEntry7() { + OperationsTestCase validateEMSTimesSectionEntry7TestCase = new OperationsTestCase( + "validateEMSTimesSectionEntry7", + operationsForOCL.getOCLValue("VALIDATE_EMS_TIMES_SECTION_ENTRY7__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSTimesSection target) { + + } + + @Override + protected void updateToPass(EMSTimesSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSTimesSectionOperations.validateEMSTimesSectionEntry7( + (EMSTimesSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSTimesSectionEntry7TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSTimesSectionEntry8() { + OperationsTestCase validateEMSTimesSectionEntry8TestCase = new OperationsTestCase( + "validateEMSTimesSectionEntry8", + operationsForOCL.getOCLValue("VALIDATE_EMS_TIMES_SECTION_ENTRY8__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSTimesSection target) { + + } + + @Override + protected void updateToPass(EMSTimesSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSTimesSectionOperations.validateEMSTimesSectionEntry8( + (EMSTimesSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSTimesSectionEntry8TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSTimesSectionEntry9() { + OperationsTestCase validateEMSTimesSectionEntry9TestCase = new OperationsTestCase( + "validateEMSTimesSectionEntry9", + operationsForOCL.getOCLValue("VALIDATE_EMS_TIMES_SECTION_ENTRY9__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSTimesSection target) { + + } + + @Override + protected void updateToPass(EMSTimesSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSTimesSectionOperations.validateEMSTimesSectionEntry9( + (EMSTimesSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSTimesSectionEntry9TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + private static class OperationsForOCL extends EMSTimesSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public EMSTimesSection create() { + return EmspcrFactory.eINSTANCE.createEMSTimesSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends EMSTimesSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // EMSTimesSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSVitalSignsSectionTest.java b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSVitalSignsSectionTest.java new file mode 100644 index 000000000..ccd91aa5a --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EMSVitalSignsSectionTest.java @@ -0,0 +1,463 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.emspcr.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; + +import org.eclipse.emf.ecore.EObject; + +import org.junit.Test; + +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; + +import org.openhealthtools.mdht.uml.cda.emspcr.EMSVitalSignsSection; +import org.openhealthtools.mdht.uml.cda.emspcr.EmspcrFactory; + +import org.openhealthtools.mdht.uml.cda.emspcr.operations.EMSVitalSignsSectionOperations; + +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'EMS Vital Signs Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSVitalSignsSection#validateEMSVitalSignsSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Vital Signs Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSVitalSignsSection#validateEMSVitalSignsSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Vital Signs Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSVitalSignsSection#validateEMSVitalSignsSectionTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Vital Signs Section Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSVitalSignsSection#validateEMSVitalSignsSectionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Vital Signs Section Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.EMSVitalSignsSection#validateEMSVitalSignsSectionEntry1(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate EMS Vital Signs Section Entry1}
  • + *
+ *

+ * + * @generated + */ + +public class EMSVitalSignsSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateEMSVitalSignsSectionTemplateId() { + OperationsTestCase validateEMSVitalSignsSectionTemplateIdTestCase = new OperationsTestCase( + "validateEMSVitalSignsSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_EMS_VITAL_SIGNS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSVitalSignsSection target) { + + } + + @Override + protected void updateToPass(EMSVitalSignsSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSVitalSignsSectionOperations.validateEMSVitalSignsSectionTemplateId( + (EMSVitalSignsSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSVitalSignsSectionTemplateIdTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSVitalSignsSectionCode() { + OperationsTestCase validateEMSVitalSignsSectionCodeTestCase = new OperationsTestCase( + "validateEMSVitalSignsSectionCode", + operationsForOCL.getOCLValue("VALIDATE_EMS_VITAL_SIGNS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSVitalSignsSection target) { + + } + + @Override + protected void updateToPass(EMSVitalSignsSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSVitalSignsSectionOperations.validateEMSVitalSignsSectionCode( + (EMSVitalSignsSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSVitalSignsSectionCodeTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSVitalSignsSectionTitle() { + OperationsTestCase validateEMSVitalSignsSectionTitleTestCase = new OperationsTestCase( + "validateEMSVitalSignsSectionTitle", + operationsForOCL.getOCLValue("VALIDATE_EMS_VITAL_SIGNS_SECTION_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSVitalSignsSection target) { + + } + + @Override + protected void updateToPass(EMSVitalSignsSection target) { + target.init(); + + + + + + + + + + + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title ); + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSVitalSignsSectionOperations.validateEMSVitalSignsSectionTitle( + (EMSVitalSignsSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSVitalSignsSectionTitleTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSVitalSignsSectionText() { + OperationsTestCase validateEMSVitalSignsSectionTextTestCase = new OperationsTestCase( + "validateEMSVitalSignsSectionText", + operationsForOCL.getOCLValue("VALIDATE_EMS_VITAL_SIGNS_SECTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSVitalSignsSection target) { + + } + + @Override + protected void updateToPass(EMSVitalSignsSection target) { + target.init(); + + + + + + + + + + + + + + + StrucDocText text = CDAFactory.eINSTANCE.createStrucDocText(); + target.setText(text ); + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSVitalSignsSectionOperations.validateEMSVitalSignsSectionText( + (EMSVitalSignsSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSVitalSignsSectionTextTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidateEMSVitalSignsSectionEntry1() { + OperationsTestCase validateEMSVitalSignsSectionEntry1TestCase = new OperationsTestCase( + "validateEMSVitalSignsSectionEntry1", + operationsForOCL.getOCLValue("VALIDATE_EMS_VITAL_SIGNS_SECTION_ENTRY1__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(EMSVitalSignsSection target) { + + } + + @Override + protected void updateToPass(EMSVitalSignsSection target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return EMSVitalSignsSectionOperations.validateEMSVitalSignsSectionEntry1( + (EMSVitalSignsSection) objectToTest, diagnostician, map); + } + + }; + + validateEMSVitalSignsSectionEntry1TestCase.doValidationTest(); +} + + /** + * + * @generated + */ + private static class OperationsForOCL extends EMSVitalSignsSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public EMSVitalSignsSection create() { + return EmspcrFactory.eINSTANCE.createEMSVitalSignsSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends EMSVitalSignsSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // EMSVitalSignsSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EmspcrExample.java b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EmspcrExample.java new file mode 100644 index 000000000..91986924c --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EmspcrExample.java @@ -0,0 +1,135 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.emspcr.tests; + +import java.io.File; +import java.io.IOException; + +import org.eclipse.emf.common.util.Diagnostic; +import org.eclipse.emf.common.util.URI; + +import org.eclipse.emf.ecore.EObject; + +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; + +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; + +import org.eclipse.emf.ecore.util.Diagnostician; + +import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl; + +import org.openhealthtools.mdht.uml.cda.emspcr.EmspcrFactory; +import org.openhealthtools.mdht.uml.cda.emspcr.EmspcrPackage; +import org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport; + +/** + * + * A sample utility for the 'emspcr' package. + * + * @generated + */ +public class EmspcrExample { + /** + * + * Load all the argument file paths or URIs as instances of the model. + * + * @param args the file paths or URIs. + * @generated + */ + public static void main(String[] args) { + // Create a resource set to hold the resources. + // + ResourceSet resourceSet = new ResourceSetImpl(); + + // Register the appropriate resource factory to handle all file extensions. + // + resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put + (Resource.Factory.Registry.DEFAULT_EXTENSION, + new XMIResourceFactoryImpl()); + + // Register the package to ensure it is available during loading. + // + resourceSet.getPackageRegistry().put + (EmspcrPackage.eNS_URI, + EmspcrPackage.eINSTANCE); + + // If there are no arguments, emit an appropriate usage message. + // + if (args.length == 0) + { + System.out.println("Enter a list of file paths or URIs that have content like this:"); + try + { + Resource resource = resourceSet.createResource(URI.createURI("http:///My.emspcr")); + PatientCareReport root = EmspcrFactory.eINSTANCE.createPatientCareReport(); + resource.getContents().add(root); + resource.save(System.out, null); + } + catch (IOException exception) + { + exception.printStackTrace(); + } + } + else + { + // Iterate over all the arguments. + // + for (int i = 0; i < args.length; ++i) + { + // Construct the URI for the instance file. + // The argument is treated as a file path only if it denotes an existing file. + // Otherwise, it's directly treated as a URL. + // + File file = new File(args[i]); + URI uri = file.isFile() ? URI.createFileURI(file.getAbsolutePath()): URI.createURI(args[i]); + + try + { + // Demand load resource for this file. + // + Resource resource = resourceSet.getResource(uri, true); + System.out.println("Loaded " + uri); + + // Validate the contents of the loaded resource. + // + for (EObject eObject : resource.getContents()) + { + Diagnostic diagnostic = Diagnostician.INSTANCE.validate(eObject); + if (diagnostic.getSeverity() != Diagnostic.OK) + { + printDiagnostic(diagnostic, ""); + } + } + } + catch (RuntimeException exception) + { + System.out.println("Problem loading " + uri); + exception.printStackTrace(); + } + } + } + } + + /** + * + * Prints diagnostics with indentation. + * + * @param diagnostic the diagnostic to print. + * @param indent the indentation for printing. + * @generated + */ + protected static void printDiagnostic(Diagnostic diagnostic, String indent) { + System.out.print(indent); + System.out.println(diagnostic.getMessage()); + for (Diagnostic child : diagnostic.getChildren()) + { + printDiagnostic(child, indent + " "); + } + } + +} // EmspcrExample diff --git a/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EmspcrTests.java b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EmspcrTests.java new file mode 100644 index 000000000..f85a5de59 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/EmspcrTests.java @@ -0,0 +1,43 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.emspcr.tests; + +import junit.framework.JUnit4TestAdapter; +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +/** + * + * A test suite for the 'emspcr' package. + * + * + + * @generated + */ +@RunWith(Suite.class) +@Suite.SuiteClasses({ + PatientCareReportTest.class, EMSBillingSectionTest.class, EMSInjuryIncidentDescriptionSectionTest.class, + EMSCurrentMedicationSectionTest.class, EMSCardiacArrestEventSectionTest.class, + EMSAdvanceDirectivesSectionTest.class, EMSAllergiesAndAdverseReactionsSectionTest.class, + EMSPastMedicalHistorySectionTest.class, EMSSocialHistorySectionTest.class, + EMSPhysicalAssessmentSectionTest.class, EMSMedicationsAdministeredSectionTest.class, + EMSProceduresPerformedSectionTest.class, EMSPatientCareNarrativeSectionTest.class, EMSSceneSectionTest.class, + EMSDispatchSectionTest.class, EMSDispositionSectionTest.class, EMSPersonnelAdverseEventSectionTest.class, + EMSProtocolSectionTest.class, EMSResponseSectionTest.class, EMSSituationSectionTest.class, + EMSTimesSectionTest.class, EMSVitalSignsSectionTest.class, DerivedEntryTest.class }) +public class EmspcrTests { + + /** + * + * + * @generated + */ + public static junit.framework.Test suite() { + return new JUnit4TestAdapter( EmspcrTests.class); + } + +} // EmspcrTests diff --git a/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/PatientCareReportTest.java b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/PatientCareReportTest.java new file mode 100644 index 000000000..305d33168 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/PatientCareReportTest.java @@ -0,0 +1,3172 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.emspcr.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Section; +import org.openhealthtools.mdht.uml.cda.emspcr.EMSAllergiesAndAdverseReactionsSection; +import org.openhealthtools.mdht.uml.cda.emspcr.EMSDispatchSection; +import org.openhealthtools.mdht.uml.cda.emspcr.EMSDispositionSection; +import org.openhealthtools.mdht.uml.cda.emspcr.EMSMedicationsAdministeredSection; +import org.openhealthtools.mdht.uml.cda.emspcr.EMSPersonnelAdverseEventSection; +import org.openhealthtools.mdht.uml.cda.emspcr.EMSPhysicalAssessmentSection; +import org.openhealthtools.mdht.uml.cda.emspcr.EMSProceduresPerformedSection; +import org.openhealthtools.mdht.uml.cda.emspcr.EMSProtocolSection; +import org.openhealthtools.mdht.uml.cda.emspcr.EMSResponseSection; +import org.openhealthtools.mdht.uml.cda.emspcr.EMSSceneSection; +import org.openhealthtools.mdht.uml.cda.emspcr.EMSSituationSection; +import org.openhealthtools.mdht.uml.cda.emspcr.EMSTimesSection; +import org.openhealthtools.mdht.uml.cda.emspcr.EMSVitalSignsSection; +import org.openhealthtools.mdht.uml.cda.emspcr.EmspcrFactory; +import org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport; +import org.openhealthtools.mdht.uml.cda.emspcr.operations.PatientCareReportOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; + +/** + * + * A static utility class that provides operations related to 'Patient Care Report' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#validatePatientCareReportClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Care Report Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#validatePatientCareReportMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Care Report Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#validatePatientCareReportCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Care Report Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#validatePatientCareReportCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Care Report Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#validatePatientCareReportTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Care Report Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#validatePatientCareReportVersionNumber(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Care Report Version Number}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#validatePatientCareReportId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Care Report Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#validatePatientCareReportAuthor(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Care Report Author}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#validatePatientCareReportRecordTarget(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Care Report Record Target}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#validatePatientCareReportHumanAuthor(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Care Report Human Author}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#validatePatientCareReportBilling(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Care Report Billing}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#validatePatientCareReportSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Care Report Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#validatePatientCareReportEMSCurrentMedication(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Care Report EMS Current Medication}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#validatePatientCareReportEMSCardiacArrestEvent(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Care Report EMS Cardiac Arrest Event}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#validatePatientCareReportEMSAdvanceDirectives(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Care Report EMS Advance Directives}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#validatePatientCareReportEMSAllergiesAndAdverseReactionsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Care Report EMS Allergies And Adverse Reactions Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#validatePatientCareReportEMSPastMedicalHistory(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Care Report EMS Past Medical History}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#validatePatientCareReportEMSSocialHistory(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Care Report EMS Social History}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#validatePatientCareReportEMSPhysicalAssessmentSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Care Report EMS Physical Assessment Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#validatePatientCareReportEMSMedicationsAdministeredSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Care Report EMS Medications Administered Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#validatePatientCareReportEMSProceduresPerformedSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Care Report EMS Procedures Performed Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#validatePatientCareReportEMSPatientCareNarrative(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Care Report EMS Patient Care Narrative}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#validatePatientCareReportEMSSceneSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Care Report EMS Scene Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#validatePatientCareReportComponentOf(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Care Report Component Of}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#validatePatientCareReportEMSDispatchSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Care Report EMS Dispatch Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#validatePatientCareReportEMSDispositionSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Care Report EMS Disposition Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#validatePatientCareReportEMSPersonnelAdverseEventSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Care Report EMS Personnel Adverse Event Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#validatePatientCareReportEMSProtocolSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Care Report EMS Protocol Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#validatePatientCareReportEMSResponseSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Care Report EMS Response Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#validatePatientCareReportEMSSituationSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Care Report EMS Situation Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#validatePatientCareReportEMSTimesSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Care Report EMS Times Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#validatePatientCareReportEMSVitalSignsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Care Report EMS Vital Signs Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#validatePatientCareReportEMSHumanAuthorParticipation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Care Report EMS Human Author Participation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#validatePatientCareReportCustodian(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Care Report Custodian}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#validatePatientCareReportDocumentationOf(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Care Report Documentation Of}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#validatePatientCareReportRelatedDocument(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Care Report Related Document}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#validatePatientCareReportParticipant(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Care Report Participant}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#getBilling() Get Billing}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#getSection() Get Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#getEMSCurrentMedication() Get EMS Current Medication}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#getEMSCardiacArrestEvent() Get EMS Cardiac Arrest Event}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#getEMSAdvanceDirectives() Get EMS Advance Directives}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#getEMSAllergiesAndAdverseReactionsSection() Get EMS Allergies And Adverse Reactions Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#getEMSPastMedicalHistory() Get EMS Past Medical History}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#getEMSSocialHistory() Get EMS Social History}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#getEMSPhysicalAssessmentSection() Get EMS Physical Assessment Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#getEMSMedicationsAdministeredSection() Get EMS Medications Administered Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#getEMSProceduresPerformedSection() Get EMS Procedures Performed Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#getEMSPatientCareNarrative() Get EMS Patient Care Narrative}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#getEMSSceneSection() Get EMS Scene Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#getEMSDispatchSection() Get EMS Dispatch Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#getEMSDispositionSection() Get EMS Disposition Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#getEMSPersonnelAdverseEventSection() Get EMS Personnel Adverse Event Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#getEMSProtocolSection() Get EMS Protocol Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#getEMSResponseSection() Get EMS Response Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#getEMSSituationSection() Get EMS Situation Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#getEMSTimesSection() Get EMS Times Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#getEMSVitalSignsSection() Get EMS Vital Signs Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.emspcr.PatientCareReport#validateGeneralHeaderConstraintsTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class PatientCareReportTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidatePatientCareReportClassCode() { + OperationsTestCase validatePatientCareReportClassCodeTestCase = new OperationsTestCase( + "validatePatientCareReportClassCode", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_CARE_REPORT_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(PatientCareReport target) { + + } + + @Override + protected void updateToPass(PatientCareReport target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return PatientCareReportOperations.validatePatientCareReportClassCode( + (PatientCareReport) objectToTest, diagnostician, map); + } + + }; + + validatePatientCareReportClassCodeTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidatePatientCareReportMoodCode() { + OperationsTestCase validatePatientCareReportMoodCodeTestCase = new OperationsTestCase( + "validatePatientCareReportMoodCode", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_CARE_REPORT_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(PatientCareReport target) { + + } + + @Override + protected void updateToPass(PatientCareReport target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return PatientCareReportOperations.validatePatientCareReportMoodCode( + (PatientCareReport) objectToTest, diagnostician, map); + } + + }; + + validatePatientCareReportMoodCodeTestCase.doValidationTest(); +} + + /** +* +* @generated +*/ +@Test + + + +public void testValidatePatientCareReportCodeP() { + OperationsTestCase validatePatientCareReportCodePTestCase = new OperationsTestCase( + "validatePatientCareReportCodeP", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_CARE_REPORT_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(PatientCareReport target) { + + } + + @Override + protected void updateToPass(PatientCareReport target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return PatientCareReportOperations.validatePatientCareReportCodeP( + (PatientCareReport) objectToTest, diagnostician, map); + } + + }; + + validatePatientCareReportCodePTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidatePatientCareReportCode() { + OperationsTestCase validatePatientCareReportCodeTestCase = new OperationsTestCase( + "validatePatientCareReportCode", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_CARE_REPORT_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(PatientCareReport target) { + + } + + @Override + protected void updateToPass(PatientCareReport target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return PatientCareReportOperations.validatePatientCareReportCode( + (PatientCareReport) objectToTest, diagnostician, map); + } + + }; + + validatePatientCareReportCodeTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidatePatientCareReportTitle() { + OperationsTestCase validatePatientCareReportTitleTestCase = new OperationsTestCase( + "validatePatientCareReportTitle", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_CARE_REPORT_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(PatientCareReport target) { + + } + + @Override + protected void updateToPass(PatientCareReport target) { + target.init(); + + + + + + + + + + + + ST title = DatatypesFactory.eINSTANCE.createST("title"); + target.setTitle(title ); + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return PatientCareReportOperations.validatePatientCareReportTitle( + (PatientCareReport) objectToTest, diagnostician, map); + } + + }; + + validatePatientCareReportTitleTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidatePatientCareReportVersionNumber() { + OperationsTestCase validatePatientCareReportVersionNumberTestCase = new OperationsTestCase( + "validatePatientCareReportVersionNumber", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_CARE_REPORT_VERSION_NUMBER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(PatientCareReport target) { + + } + + @Override + protected void updateToPass(PatientCareReport target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return PatientCareReportOperations.validatePatientCareReportVersionNumber( + (PatientCareReport) objectToTest, diagnostician, map); + } + + }; + + validatePatientCareReportVersionNumberTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidatePatientCareReportId() { + OperationsTestCase validatePatientCareReportIdTestCase = new OperationsTestCase( + "validatePatientCareReportId", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_CARE_REPORT_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(PatientCareReport target) { + + } + + @Override + protected void updateToPass(PatientCareReport target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return PatientCareReportOperations.validatePatientCareReportId( + (PatientCareReport) objectToTest, diagnostician, map); + } + + }; + + validatePatientCareReportIdTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidatePatientCareReportAuthor() { + OperationsTestCase validatePatientCareReportAuthorTestCase = new OperationsTestCase( + "validatePatientCareReportAuthor", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_CARE_REPORT_AUTHOR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(PatientCareReport target) { + + } + + @Override + protected void updateToPass(PatientCareReport target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return PatientCareReportOperations.validatePatientCareReportAuthor( + (PatientCareReport) objectToTest, diagnostician, map); + } + + }; + + validatePatientCareReportAuthorTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidatePatientCareReportRecordTarget() { + OperationsTestCase validatePatientCareReportRecordTargetTestCase = new OperationsTestCase( + "validatePatientCareReportRecordTarget", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_CARE_REPORT_RECORD_TARGET__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(PatientCareReport target) { + + } + + @Override + protected void updateToPass(PatientCareReport target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return PatientCareReportOperations.validatePatientCareReportRecordTarget( + (PatientCareReport) objectToTest, diagnostician, map); + } + + }; + + validatePatientCareReportRecordTargetTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidatePatientCareReportHumanAuthor() { + OperationsTestCase validatePatientCareReportHumanAuthorTestCase = new OperationsTestCase( + "validatePatientCareReportHumanAuthor", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_CARE_REPORT_HUMAN_AUTHOR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(PatientCareReport target) { + + } + + @Override + protected void updateToPass(PatientCareReport target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return PatientCareReportOperations.validatePatientCareReportHumanAuthor( + (PatientCareReport) objectToTest, diagnostician, map); + } + + }; + + validatePatientCareReportHumanAuthorTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidatePatientCareReportBilling() { + OperationsTestCase validatePatientCareReportBillingTestCase = new OperationsTestCase( + "validatePatientCareReportBilling", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_CARE_REPORT_BILLING__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(PatientCareReport target) { + + } + + @Override + protected void updateToPass(PatientCareReport target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return PatientCareReportOperations.validatePatientCareReportBilling( + (PatientCareReport) objectToTest, diagnostician, map); + } + + }; + + validatePatientCareReportBillingTestCase.doValidationTest(); +} + + /** + * + * @generated NOT + */ + @Test + public void testValidatePatientCareReportSection() { + OperationsTestCase validatePatientCareReportSectionTestCase = new OperationsTestCase( + "validatePatientCareReportSection", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_CARE_REPORT_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PatientCareReport target) { + + } + + @Override + protected void updateToPass(PatientCareReport target) { + target.init(); + + /* Section */ + Section section = + + CDAFactory.eINSTANCE.createSection(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PatientCareReportOperations.validatePatientCareReportSection( + (PatientCareReport) objectToTest, diagnostician, map); + } + + }; + + validatePatientCareReportSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePatientCareReportEMSCurrentMedication() { + OperationsTestCase validatePatientCareReportEMSCurrentMedicationTestCase = new OperationsTestCase( + "validatePatientCareReportEMSCurrentMedication", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_CARE_REPORT_EMS_CURRENT_MEDICATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(PatientCareReport target) { + + } + + @Override + protected void updateToPass(PatientCareReport target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return PatientCareReportOperations.validatePatientCareReportEMSCurrentMedication( + (PatientCareReport) objectToTest, diagnostician, map); + } + + }; + + validatePatientCareReportEMSCurrentMedicationTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidatePatientCareReportEMSCardiacArrestEvent() { + OperationsTestCase validatePatientCareReportEMSCardiacArrestEventTestCase = new OperationsTestCase( + "validatePatientCareReportEMSCardiacArrestEvent", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_CARE_REPORT_EMS_CARDIAC_ARREST_EVENT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(PatientCareReport target) { + + } + + @Override + protected void updateToPass(PatientCareReport target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return PatientCareReportOperations.validatePatientCareReportEMSCardiacArrestEvent( + (PatientCareReport) objectToTest, diagnostician, map); + } + + }; + + validatePatientCareReportEMSCardiacArrestEventTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidatePatientCareReportEMSAdvanceDirectives() { + OperationsTestCase validatePatientCareReportEMSAdvanceDirectivesTestCase = new OperationsTestCase( + "validatePatientCareReportEMSAdvanceDirectives", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_CARE_REPORT_EMS_ADVANCE_DIRECTIVES__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(PatientCareReport target) { + + } + + @Override + protected void updateToPass(PatientCareReport target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return PatientCareReportOperations.validatePatientCareReportEMSAdvanceDirectives( + (PatientCareReport) objectToTest, diagnostician, map); + } + + }; + + validatePatientCareReportEMSAdvanceDirectivesTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidatePatientCareReportEMSAllergiesAndAdverseReactionsSection() { + OperationsTestCase validatePatientCareReportEMSAllergiesAndAdverseReactionsSectionTestCase = new OperationsTestCase( + "validatePatientCareReportEMSAllergiesAndAdverseReactionsSection", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_CARE_REPORT_EMS_ALLERGIES_AND_ADVERSE_REACTIONS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(PatientCareReport target) { + + } + + @Override + protected void updateToPass(PatientCareReport target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + /* EMSAllergiesAndAdverseReactionsSection */ + EMSAllergiesAndAdverseReactionsSection section = + + EmspcrFactory.eINSTANCE.createEMSAllergiesAndAdverseReactionsSection().init(); + + + target.addSection(section); + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return PatientCareReportOperations.validatePatientCareReportEMSAllergiesAndAdverseReactionsSection( + (PatientCareReport) objectToTest, diagnostician, map); + } + + }; + + validatePatientCareReportEMSAllergiesAndAdverseReactionsSectionTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidatePatientCareReportEMSPastMedicalHistory() { + OperationsTestCase validatePatientCareReportEMSPastMedicalHistoryTestCase = new OperationsTestCase( + "validatePatientCareReportEMSPastMedicalHistory", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_CARE_REPORT_EMS_PAST_MEDICAL_HISTORY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(PatientCareReport target) { + + } + + @Override + protected void updateToPass(PatientCareReport target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return PatientCareReportOperations.validatePatientCareReportEMSPastMedicalHistory( + (PatientCareReport) objectToTest, diagnostician, map); + } + + }; + + validatePatientCareReportEMSPastMedicalHistoryTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidatePatientCareReportEMSSocialHistory() { + OperationsTestCase validatePatientCareReportEMSSocialHistoryTestCase = new OperationsTestCase( + "validatePatientCareReportEMSSocialHistory", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_CARE_REPORT_EMS_SOCIAL_HISTORY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(PatientCareReport target) { + + } + + @Override + protected void updateToPass(PatientCareReport target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return PatientCareReportOperations.validatePatientCareReportEMSSocialHistory( + (PatientCareReport) objectToTest, diagnostician, map); + } + + }; + + validatePatientCareReportEMSSocialHistoryTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidatePatientCareReportEMSPhysicalAssessmentSection() { + OperationsTestCase validatePatientCareReportEMSPhysicalAssessmentSectionTestCase = new OperationsTestCase( + "validatePatientCareReportEMSPhysicalAssessmentSection", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_CARE_REPORT_EMS_PHYSICAL_ASSESSMENT_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(PatientCareReport target) { + + } + + @Override + protected void updateToPass(PatientCareReport target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + /* EMSPhysicalAssessmentSection */ + EMSPhysicalAssessmentSection section = + + EmspcrFactory.eINSTANCE.createEMSPhysicalAssessmentSection().init(); + + + target.addSection(section); + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return PatientCareReportOperations.validatePatientCareReportEMSPhysicalAssessmentSection( + (PatientCareReport) objectToTest, diagnostician, map); + } + + }; + + validatePatientCareReportEMSPhysicalAssessmentSectionTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidatePatientCareReportEMSMedicationsAdministeredSection() { + OperationsTestCase validatePatientCareReportEMSMedicationsAdministeredSectionTestCase = new OperationsTestCase( + "validatePatientCareReportEMSMedicationsAdministeredSection", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_CARE_REPORT_EMS_MEDICATIONS_ADMINISTERED_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(PatientCareReport target) { + + } + + @Override + protected void updateToPass(PatientCareReport target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + /* EMSMedicationsAdministeredSection */ + EMSMedicationsAdministeredSection section = + + EmspcrFactory.eINSTANCE.createEMSMedicationsAdministeredSection().init(); + + + target.addSection(section); + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return PatientCareReportOperations.validatePatientCareReportEMSMedicationsAdministeredSection( + (PatientCareReport) objectToTest, diagnostician, map); + } + + }; + + validatePatientCareReportEMSMedicationsAdministeredSectionTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidatePatientCareReportEMSProceduresPerformedSection() { + OperationsTestCase validatePatientCareReportEMSProceduresPerformedSectionTestCase = new OperationsTestCase( + "validatePatientCareReportEMSProceduresPerformedSection", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_CARE_REPORT_EMS_PROCEDURES_PERFORMED_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(PatientCareReport target) { + + } + + @Override + protected void updateToPass(PatientCareReport target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + /* EMSProceduresPerformedSection */ + EMSProceduresPerformedSection section = + + EmspcrFactory.eINSTANCE.createEMSProceduresPerformedSection().init(); + + + target.addSection(section); + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return PatientCareReportOperations.validatePatientCareReportEMSProceduresPerformedSection( + (PatientCareReport) objectToTest, diagnostician, map); + } + + }; + + validatePatientCareReportEMSProceduresPerformedSectionTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidatePatientCareReportEMSPatientCareNarrative() { + OperationsTestCase validatePatientCareReportEMSPatientCareNarrativeTestCase = new OperationsTestCase( + "validatePatientCareReportEMSPatientCareNarrative", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_CARE_REPORT_EMS_PATIENT_CARE_NARRATIVE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(PatientCareReport target) { + + } + + @Override + protected void updateToPass(PatientCareReport target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return PatientCareReportOperations.validatePatientCareReportEMSPatientCareNarrative( + (PatientCareReport) objectToTest, diagnostician, map); + } + + }; + + validatePatientCareReportEMSPatientCareNarrativeTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidatePatientCareReportEMSSceneSection() { + OperationsTestCase validatePatientCareReportEMSSceneSectionTestCase = new OperationsTestCase( + "validatePatientCareReportEMSSceneSection", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_CARE_REPORT_EMS_SCENE_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(PatientCareReport target) { + + } + + @Override + protected void updateToPass(PatientCareReport target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + /* EMSSceneSection */ + EMSSceneSection section = + + EmspcrFactory.eINSTANCE.createEMSSceneSection().init(); + + + target.addSection(section); + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return PatientCareReportOperations.validatePatientCareReportEMSSceneSection( + (PatientCareReport) objectToTest, diagnostician, map); + } + + }; + + validatePatientCareReportEMSSceneSectionTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidatePatientCareReportComponentOf() { + OperationsTestCase validatePatientCareReportComponentOfTestCase = new OperationsTestCase( + "validatePatientCareReportComponentOf", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_CARE_REPORT_COMPONENT_OF__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(PatientCareReport target) { + + } + + @Override + protected void updateToPass(PatientCareReport target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return PatientCareReportOperations.validatePatientCareReportComponentOf( + (PatientCareReport) objectToTest, diagnostician, map); + } + + }; + + validatePatientCareReportComponentOfTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidatePatientCareReportEMSDispatchSection() { + OperationsTestCase validatePatientCareReportEMSDispatchSectionTestCase = new OperationsTestCase( + "validatePatientCareReportEMSDispatchSection", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_CARE_REPORT_EMS_DISPATCH_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(PatientCareReport target) { + + } + + @Override + protected void updateToPass(PatientCareReport target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + /* EMSDispatchSection */ + EMSDispatchSection section = + + EmspcrFactory.eINSTANCE.createEMSDispatchSection().init(); + + + target.addSection(section); + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return PatientCareReportOperations.validatePatientCareReportEMSDispatchSection( + (PatientCareReport) objectToTest, diagnostician, map); + } + + }; + + validatePatientCareReportEMSDispatchSectionTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidatePatientCareReportEMSDispositionSection() { + OperationsTestCase validatePatientCareReportEMSDispositionSectionTestCase = new OperationsTestCase( + "validatePatientCareReportEMSDispositionSection", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_CARE_REPORT_EMS_DISPOSITION_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(PatientCareReport target) { + + } + + @Override + protected void updateToPass(PatientCareReport target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + /* EMSDispositionSection */ + EMSDispositionSection section = + + EmspcrFactory.eINSTANCE.createEMSDispositionSection().init(); + + + target.addSection(section); + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return PatientCareReportOperations.validatePatientCareReportEMSDispositionSection( + (PatientCareReport) objectToTest, diagnostician, map); + } + + }; + + validatePatientCareReportEMSDispositionSectionTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidatePatientCareReportEMSPersonnelAdverseEventSection() { + OperationsTestCase validatePatientCareReportEMSPersonnelAdverseEventSectionTestCase = new OperationsTestCase( + "validatePatientCareReportEMSPersonnelAdverseEventSection", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_CARE_REPORT_EMS_PERSONNEL_ADVERSE_EVENT_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(PatientCareReport target) { + + } + + @Override + protected void updateToPass(PatientCareReport target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + /* EMSPersonnelAdverseEventSection */ + EMSPersonnelAdverseEventSection section = + + EmspcrFactory.eINSTANCE.createEMSPersonnelAdverseEventSection().init(); + + + target.addSection(section); + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return PatientCareReportOperations.validatePatientCareReportEMSPersonnelAdverseEventSection( + (PatientCareReport) objectToTest, diagnostician, map); + } + + }; + + validatePatientCareReportEMSPersonnelAdverseEventSectionTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidatePatientCareReportEMSProtocolSection() { + OperationsTestCase validatePatientCareReportEMSProtocolSectionTestCase = new OperationsTestCase( + "validatePatientCareReportEMSProtocolSection", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_CARE_REPORT_EMS_PROTOCOL_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(PatientCareReport target) { + + } + + @Override + protected void updateToPass(PatientCareReport target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + /* EMSProtocolSection */ + EMSProtocolSection section = + + EmspcrFactory.eINSTANCE.createEMSProtocolSection().init(); + + + target.addSection(section); + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return PatientCareReportOperations.validatePatientCareReportEMSProtocolSection( + (PatientCareReport) objectToTest, diagnostician, map); + } + + }; + + validatePatientCareReportEMSProtocolSectionTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidatePatientCareReportEMSResponseSection() { + OperationsTestCase validatePatientCareReportEMSResponseSectionTestCase = new OperationsTestCase( + "validatePatientCareReportEMSResponseSection", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_CARE_REPORT_EMS_RESPONSE_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(PatientCareReport target) { + + } + + @Override + protected void updateToPass(PatientCareReport target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + /* EMSResponseSection */ + EMSResponseSection section = + + EmspcrFactory.eINSTANCE.createEMSResponseSection().init(); + + + target.addSection(section); + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return PatientCareReportOperations.validatePatientCareReportEMSResponseSection( + (PatientCareReport) objectToTest, diagnostician, map); + } + + }; + + validatePatientCareReportEMSResponseSectionTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidatePatientCareReportEMSSituationSection() { + OperationsTestCase validatePatientCareReportEMSSituationSectionTestCase = new OperationsTestCase( + "validatePatientCareReportEMSSituationSection", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_CARE_REPORT_EMS_SITUATION_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(PatientCareReport target) { + + } + + @Override + protected void updateToPass(PatientCareReport target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + /* EMSSituationSection */ + EMSSituationSection section = + + EmspcrFactory.eINSTANCE.createEMSSituationSection().init(); + + + target.addSection(section); + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return PatientCareReportOperations.validatePatientCareReportEMSSituationSection( + (PatientCareReport) objectToTest, diagnostician, map); + } + + }; + + validatePatientCareReportEMSSituationSectionTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidatePatientCareReportEMSTimesSection() { + OperationsTestCase validatePatientCareReportEMSTimesSectionTestCase = new OperationsTestCase( + "validatePatientCareReportEMSTimesSection", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_CARE_REPORT_EMS_TIMES_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(PatientCareReport target) { + + } + + @Override + protected void updateToPass(PatientCareReport target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + /* EMSTimesSection */ + EMSTimesSection section = + + EmspcrFactory.eINSTANCE.createEMSTimesSection().init(); + + + target.addSection(section); + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return PatientCareReportOperations.validatePatientCareReportEMSTimesSection( + (PatientCareReport) objectToTest, diagnostician, map); + } + + }; + + validatePatientCareReportEMSTimesSectionTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidatePatientCareReportEMSVitalSignsSection() { + OperationsTestCase validatePatientCareReportEMSVitalSignsSectionTestCase = new OperationsTestCase( + "validatePatientCareReportEMSVitalSignsSection", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_CARE_REPORT_EMS_VITAL_SIGNS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(PatientCareReport target) { + + } + + @Override + protected void updateToPass(PatientCareReport target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + /* EMSVitalSignsSection */ + EMSVitalSignsSection section = + + EmspcrFactory.eINSTANCE.createEMSVitalSignsSection().init(); + + + target.addSection(section); + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return PatientCareReportOperations.validatePatientCareReportEMSVitalSignsSection( + (PatientCareReport) objectToTest, diagnostician, map); + } + + }; + + validatePatientCareReportEMSVitalSignsSectionTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidatePatientCareReportEMSHumanAuthorParticipation() { + OperationsTestCase validatePatientCareReportEMSHumanAuthorParticipationTestCase = new OperationsTestCase( + "validatePatientCareReportEMSHumanAuthorParticipation", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_CARE_REPORT_EMS_HUMAN_AUTHOR_PARTICIPATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(PatientCareReport target) { + + } + + @Override + protected void updateToPass(PatientCareReport target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return PatientCareReportOperations.validatePatientCareReportEMSHumanAuthorParticipation( + (PatientCareReport) objectToTest, diagnostician, map); + } + + }; + + validatePatientCareReportEMSHumanAuthorParticipationTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidatePatientCareReportCustodian() { + OperationsTestCase validatePatientCareReportCustodianTestCase = new OperationsTestCase( + "validatePatientCareReportCustodian", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_CARE_REPORT_CUSTODIAN__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(PatientCareReport target) { + + } + + @Override + protected void updateToPass(PatientCareReport target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return PatientCareReportOperations.validatePatientCareReportCustodian( + (PatientCareReport) objectToTest, diagnostician, map); + } + + }; + + validatePatientCareReportCustodianTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidatePatientCareReportDocumentationOf() { + OperationsTestCase validatePatientCareReportDocumentationOfTestCase = new OperationsTestCase( + "validatePatientCareReportDocumentationOf", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_CARE_REPORT_DOCUMENTATION_OF__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(PatientCareReport target) { + + } + + @Override + protected void updateToPass(PatientCareReport target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return PatientCareReportOperations.validatePatientCareReportDocumentationOf( + (PatientCareReport) objectToTest, diagnostician, map); + } + + }; + + validatePatientCareReportDocumentationOfTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidatePatientCareReportRelatedDocument() { + OperationsTestCase validatePatientCareReportRelatedDocumentTestCase = new OperationsTestCase( + "validatePatientCareReportRelatedDocument", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_CARE_REPORT_RELATED_DOCUMENT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(PatientCareReport target) { + + } + + @Override + protected void updateToPass(PatientCareReport target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return PatientCareReportOperations.validatePatientCareReportRelatedDocument( + (PatientCareReport) objectToTest, diagnostician, map); + } + + }; + + validatePatientCareReportRelatedDocumentTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testValidatePatientCareReportParticipant() { + OperationsTestCase validatePatientCareReportParticipantTestCase = new OperationsTestCase( + "validatePatientCareReportParticipant", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_CARE_REPORT_PARTICIPANT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(PatientCareReport target) { + + } + + @Override + protected void updateToPass(PatientCareReport target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return PatientCareReportOperations.validatePatientCareReportParticipant( + (PatientCareReport) objectToTest, diagnostician, map); + } + + }; + + validatePatientCareReportParticipantTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + @Test + public void testGetBilling() { + + +PatientCareReport target = objectFactory.create(); +target.getBilling(); + + + +} + + /** + * + * @generated + */ + @Test + public void testGetSection() { + + +PatientCareReport target = objectFactory.create(); +target.getSection(); + + + +} + + /** + * + * @generated + */ + @Test + public void testGetEMSCurrentMedication() { + + +PatientCareReport target = objectFactory.create(); +target.getEMSCurrentMedication(); + + + +} + + /** + * + * @generated + */ + @Test + public void testGetEMSCardiacArrestEvent() { + + +PatientCareReport target = objectFactory.create(); +target.getEMSCardiacArrestEvent(); + + + +} + + /** + * + * @generated + */ + @Test + public void testGetEMSAdvanceDirectives() { + + +PatientCareReport target = objectFactory.create(); +target.getEMSAdvanceDirectives(); + + + +} + + /** + * + * @generated + */ + @Test + public void testGetEMSAllergiesAndAdverseReactionsSection() { + + +PatientCareReport target = objectFactory.create(); +target.getEMSAllergiesAndAdverseReactionsSection(); + + + +} + + /** + * + * @generated + */ + @Test + public void testGetEMSPastMedicalHistory() { + + +PatientCareReport target = objectFactory.create(); +target.getEMSPastMedicalHistory(); + + + +} + + /** + * + * @generated + */ + @Test + public void testGetEMSSocialHistory() { + + +PatientCareReport target = objectFactory.create(); +target.getEMSSocialHistory(); + + + +} + + /** + * + * @generated + */ + @Test + public void testGetEMSPhysicalAssessmentSection() { + + +PatientCareReport target = objectFactory.create(); +target.getEMSPhysicalAssessmentSection(); + + + +} + + /** + * + * @generated + */ + @Test + public void testGetEMSMedicationsAdministeredSection() { + + +PatientCareReport target = objectFactory.create(); +target.getEMSMedicationsAdministeredSection(); + + + +} + + /** + * + * @generated + */ + @Test + public void testGetEMSProceduresPerformedSection() { + + +PatientCareReport target = objectFactory.create(); +target.getEMSProceduresPerformedSection(); + + + +} + + /** + * + * @generated + */ + @Test + public void testGetEMSPatientCareNarrative() { + + +PatientCareReport target = objectFactory.create(); +target.getEMSPatientCareNarrative(); + + + +} + + /** + * + * @generated + */ + @Test + public void testGetEMSSceneSection() { + + +PatientCareReport target = objectFactory.create(); +target.getEMSSceneSection(); + + + +} + + /** + * + * @generated + */ + @Test + public void testGetEMSDispatchSection() { + + +PatientCareReport target = objectFactory.create(); +target.getEMSDispatchSection(); + + + +} + + /** + * + * @generated + */ + @Test + public void testGetEMSDispositionSection() { + + +PatientCareReport target = objectFactory.create(); +target.getEMSDispositionSection(); + + + +} + + /** + * + * @generated + */ + @Test + public void testGetEMSPersonnelAdverseEventSection() { + + +PatientCareReport target = objectFactory.create(); +target.getEMSPersonnelAdverseEventSection(); + + + +} + + /** + * + * @generated + */ + @Test + public void testGetEMSProtocolSection() { + + +PatientCareReport target = objectFactory.create(); +target.getEMSProtocolSection(); + + + +} + + /** + * + * @generated + */ + @Test + public void testGetEMSResponseSection() { + + +PatientCareReport target = objectFactory.create(); +target.getEMSResponseSection(); + + + +} + + /** + * + * @generated + */ + @Test + public void testGetEMSSituationSection() { + + +PatientCareReport target = objectFactory.create(); +target.getEMSSituationSection(); + + + +} + + /** + * + * @generated + */ + @Test + public void testGetEMSTimesSection() { + + +PatientCareReport target = objectFactory.create(); +target.getEMSTimesSection(); + + + +} + + /** + * + * @generated + */ + @Test + public void testGetEMSVitalSignsSection() { + + +PatientCareReport target = objectFactory.create(); +target.getEMSVitalSignsSection(); + + + +} + + /** + * + * @generated + */ + @Test + public void testValidateGeneralHeaderConstraintsTemplateId() { + OperationsTestCase validateGeneralHeaderConstraintsTemplateIdTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsTemplateId", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP") + ,objectFactory) { + + @Override + protected void updateToFail(PatientCareReport target) { + + } + + @Override + protected void updateToPass(PatientCareReport target) { + target.init(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + + + return PatientCareReportOperations.validateGeneralHeaderConstraintsTemplateId( + (PatientCareReport) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsTemplateIdTestCase.doValidationTest(); +} + + /** + * + * @generated + */ + private static class OperationsForOCL extends PatientCareReportOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public PatientCareReport create() { + return EmspcrFactory.eINSTANCE.createPatientCareReport(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PatientCareReportOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PatientCareReportOperations diff --git a/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/emspcr_EcoreAllTests.java b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/emspcr_EcoreAllTests.java new file mode 100644 index 000000000..3910cec2a --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.emspcr.tests/src/org/openhealthtools/mdht/uml/cda/emspcr/tests/emspcr_EcoreAllTests.java @@ -0,0 +1,51 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.emspcr.tests; + +import junit.framework.Test; +import junit.framework.TestSuite; + +import junit.textui.TestRunner; + +/** + * + * A test suite for the 'emspcr_Ecore' model. + * + * @generated + */ +public class emspcr_EcoreAllTests extends TestSuite { + + /** + * + * + * @generated + */ + public static void main(String[] args) { + TestRunner.run(suite()); + } + + /** + * + * + * @generated + */ + public static Test suite() { + TestSuite suite = new emspcr_EcoreAllTests("emspcr_Ecore Tests"); + suite.addTest(EmspcrTests.suite()); + return suite; + } + + /** + * + * + * @generated + */ + public emspcr_EcoreAllTests(String name) { + super(name); + } + +} // emspcr_EcoreAllTests diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/.classpath b/org.openhealthtools.mdht.uml.cda.hitsp.tests/.classpath new file mode 100644 index 000000000..ed2bc1287 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/.project b/org.openhealthtools.mdht.uml.cda.hitsp.tests/.project new file mode 100644 index 000000000..29deb07aa --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/.project @@ -0,0 +1,28 @@ + + + org.openhealthtools.mdht.uml.cda.hitsp.tests + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.pde.PluginNature + + diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/.settings/org.eclipse.jdt.core.prefs b/org.openhealthtools.mdht.uml.cda.hitsp.tests/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..fd79a3e6c --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,355 @@ +#Mon May 16 10:24:25 EDT 2011 +eclipse.preferences.version=1 +org.eclipse.jdt.core.codeComplete.argumentPrefixes= +org.eclipse.jdt.core.codeComplete.argumentSuffixes= +org.eclipse.jdt.core.codeComplete.fieldPrefixes= +org.eclipse.jdt.core.codeComplete.fieldSuffixes= +org.eclipse.jdt.core.codeComplete.localPrefixes= +org.eclipse.jdt.core.codeComplete.localSuffixes= +org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.5 +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.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning +org.eclipse.jdt.core.compiler.problem.deadCode=warning +org.eclipse.jdt.core.compiler.problem.deprecation=warning +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore +org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=error +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore +org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning +org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +org.eclipse.jdt.core.compiler.problem.nullReference=warning +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore +org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=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 +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedImport=warning +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +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.5 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=36 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=36 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=36 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=36 +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_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=49 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=32 +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_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=0 +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 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=1 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=150 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@fmtOff +org.eclipse.jdt.core.formatter.enabling_tag=@fmtOn +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +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=true +org.eclipse.jdt.core.formatter.indentation.size=4 +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_parameter=do not 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=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +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_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_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 +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +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_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 +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +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_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not 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_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 +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +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_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 +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +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_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_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 +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=false +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=120 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +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=false +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/.settings/org.eclipse.jdt.ui.prefs b/org.openhealthtools.mdht.uml.cda.hitsp.tests/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 000000000..6245d2099 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,120 @@ +#Tue Mar 29 22:38:51 EDT 2011 +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=false +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=false +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=false +cleanup.format_source_code=true +cleanup.format_source_code_changes_only=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=false +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=true +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=true +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=true +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_blocks=true +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_parentheses_in_expressions=false +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup_profile=_MDHT +cleanup_settings_version=2 +eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true +formatter_profile=_MDHT +formatter_settings_version=11 +org.eclipse.jdt.ui.exception.name=e +org.eclipse.jdt.ui.gettersetter.use.is=true +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com; +org.eclipse.jdt.ui.javadoc=true +org.eclipse.jdt.ui.keywordthis=false +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.overrideannotation=true +org.eclipse.jdt.ui.staticondemandthreshold=99 +org.eclipse.jdt.ui.text.custom_code_templates= +sp_cleanup.add_default_serial_version_id=true +sp_cleanup.add_generated_serial_version_id=false +sp_cleanup.add_missing_annotations=true +sp_cleanup.add_missing_deprecated_annotations=true +sp_cleanup.add_missing_methods=false +sp_cleanup.add_missing_nls_tags=false +sp_cleanup.add_missing_override_annotations=true +sp_cleanup.add_missing_override_annotations_interface_methods=false +sp_cleanup.add_serial_version_id=false +sp_cleanup.always_use_blocks=true +sp_cleanup.always_use_parentheses_in_expressions=false +sp_cleanup.always_use_this_for_non_static_field_access=false +sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.convert_to_enhanced_for_loop=false +sp_cleanup.correct_indentation=false +sp_cleanup.format_source_code=true +sp_cleanup.format_source_code_changes_only=false +sp_cleanup.make_local_variable_final=false +sp_cleanup.make_parameters_final=false +sp_cleanup.make_private_fields_final=true +sp_cleanup.make_type_abstract_if_missing_method=false +sp_cleanup.make_variable_declarations_final=false +sp_cleanup.never_use_blocks=false +sp_cleanup.never_use_parentheses_in_expressions=true +sp_cleanup.on_save_use_additional_actions=true +sp_cleanup.organize_imports=true +sp_cleanup.qualify_static_field_accesses_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_with_declaring_class=false +sp_cleanup.qualify_static_method_accesses_with_declaring_class=false +sp_cleanup.remove_private_constructors=true +sp_cleanup.remove_trailing_whitespaces=true +sp_cleanup.remove_trailing_whitespaces_all=true +sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +sp_cleanup.remove_unnecessary_casts=true +sp_cleanup.remove_unnecessary_nls_tags=false +sp_cleanup.remove_unused_imports=false +sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_private_fields=true +sp_cleanup.remove_unused_private_members=false +sp_cleanup.remove_unused_private_methods=true +sp_cleanup.remove_unused_private_types=true +sp_cleanup.sort_members=false +sp_cleanup.sort_members_all=false +sp_cleanup.use_blocks=false +sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_parentheses_in_expressions=false +sp_cleanup.use_this_for_non_static_field_access=false +sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true +sp_cleanup.use_this_for_non_static_method_access=false +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/META-INF/MANIFEST.MF b/org.openhealthtools.mdht.uml.cda.hitsp.tests/META-INF/MANIFEST.MF new file mode 100644 index 000000000..5ff582976 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/META-INF/MANIFEST.MF @@ -0,0 +1,24 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: org.openhealthtools.mdht.uml.cda.hitsp.tests;singleton:=true +Bundle-Version: 1.1.0.qualifier +Bundle-ClassPath: . +Bundle-Vendor: %providerName +Bundle-Localization: plugin +Bundle-RequiredExecutionEnvironment: J2SE-1.5 +Export-Package: org.openhealthtools.mdht.uml.cda.hitsp.tests +Require-Bundle: org.eclipse.core.runtime, + org.openhealthtools.mdht.uml.cda.hitsp;visibility:=reexport, + org.openhealthtools.mdht.uml.cda.ihe;visibility:=reexport, + org.openhealthtools.mdht.uml.cda.ccd;visibility:=reexport, + org.openhealthtools.mdht.uml.cda;visibility:=reexport, + org.openhealthtools.mdht.uml.hl7.datatypes;visibility:=reexport, + org.openhealthtools.mdht.uml.hl7.vocab;visibility:=reexport, + org.eclipse.emf.ecore;visibility:=reexport, + org.openhealthtools.mdht.uml.hl7.rim;visibility:=reexport, + org.openhealthtools.mdht.uml.cda.cdt;visibility:=reexport, + org.eclipse.emf.ecore.xmi;visibility:=reexport, + org.junit;visibility:=reexport, + org.openhealthtools.mdht.uml.cda.test;visibility:=reexport +Bundle-ActivationPolicy: lazy diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/build.properties b/org.openhealthtools.mdht.uml.cda.hitsp.tests/build.properties new file mode 100644 index 000000000..1b51b5a37 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/build.properties @@ -0,0 +1,17 @@ +############################################################################### +# Copyright (c) 2011, 2012 Sean Muir and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Sean Muir (JKM Software) - initial API and implementation +############################################################################### + +bin.includes = .,\ + META-INF/,\ + plugin.properties +jars.compile.order = . +source.. = src/ +output.. = bin/ diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/plugin.properties b/org.openhealthtools.mdht.uml.cda.hitsp.tests/plugin.properties new file mode 100644 index 000000000..e7d99361b --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/plugin.properties @@ -0,0 +1,14 @@ +############################################################################### +# Copyright (c) 2011, 2012 Sean Muir and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Sean Muir (JKM Software) - initial API and implementation +############################################################################### + +pluginName = HITSP Tests +providerName = www.example.org + diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/AdmissionMedicationHistorySectionTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/AdmissionMedicationHistorySectionTest.java new file mode 100644 index 000000000..9eed38eb8 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/AdmissionMedicationHistorySectionTest.java @@ -0,0 +1,144 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.hitsp.AdmissionMedicationHistorySection; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.AdmissionMedicationHistorySectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Admission Medication History Section' model + * objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.AdmissionMedicationHistorySection#validateHITSPAdmissionMedicationHistorySectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Admission Medication History Section Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class AdmissionMedicationHistorySectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHITSPAdmissionMedicationHistorySectionTemplateId() { + OperationsTestCase validateHITSPAdmissionMedicationHistorySectionTemplateIdTestCase = new OperationsTestCase( + "validateHITSPAdmissionMedicationHistorySectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HITSP_ADMISSION_MEDICATION_HISTORY_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdmissionMedicationHistorySection target) { + + } + + @Override + protected void updateToPass(AdmissionMedicationHistorySection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdmissionMedicationHistorySectionOperations.validateHITSPAdmissionMedicationHistorySectionTemplateId( + (AdmissionMedicationHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPAdmissionMedicationHistorySectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends AdmissionMedicationHistorySectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public AdmissionMedicationHistorySection create() { + return HITSPFactory.eINSTANCE.createAdmissionMedicationHistorySection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends AdmissionMedicationHistorySectionOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // AdmissionMedicationHistorySectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/AdvanceDirectiveTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/AdvanceDirectiveTest.java new file mode 100644 index 000000000..573f05d20 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/AdvanceDirectiveTest.java @@ -0,0 +1,584 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Participant2; +import org.openhealthtools.mdht.uml.cda.ParticipantRole; +import org.openhealthtools.mdht.uml.cda.PlayingEntity; +import org.openhealthtools.mdht.uml.cda.ccd.operations.AdvanceDirectiveObservationOperations; +import org.openhealthtools.mdht.uml.cda.hitsp.AdvanceDirective; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.AdvanceDirectiveOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVXB_TS; +import org.openhealthtools.mdht.uml.hl7.vocab.ParticipationType; +import org.openhealthtools.mdht.uml.hl7.vocab.RoleClassRoot; + +/** + * + * A static utility class that provides operations related to 'Advance Directive' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.AdvanceDirective#validateAdvanceDirectiveHasStartingTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directive Has Starting Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.AdvanceDirective#validateAdvanceDirectiveHasEndingTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directive Has Ending Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.AdvanceDirective#validateAdvanceDirectiveHasCustodian(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directive Has Custodian}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.AdvanceDirective#validateAdvanceDirectiveParticipantTypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directive Participant Type Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.AdvanceDirective#validateAdvanceDirectiveParticipantRoleClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directive Participant Role Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.AdvanceDirective#validateAdvanceDirectiveHasAddress(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directive Has Address}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.AdvanceDirective#validateAdvanceDirectiveHasTelecom(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directive Has Telecom}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.AdvanceDirective#validateAdvanceDirectiveHasNameOfAgent(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directive Has Name Of Agent}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.AdvanceDirective#validateAdvanceDirectiveTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directive Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.AdvanceDirective#validateAdvanceDirectiveCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directive Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.AdvanceDirective#validateAdvanceDirectiveEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Advance Directive Effective Time}
  • + *
+ *

+ * + * @generated + */ + +public class AdvanceDirectiveTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateAdvanceDirectiveHasStartingTime() { + OperationsTestCase validateAdvanceDirectiveHasStartingTimeTestCase = new OperationsTestCase( + "validateAdvanceDirectiveHasStartingTime", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_HAS_STARTING_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirective target) { + target.init(); + IVL_TS ef = DatatypesFactory.eINSTANCE.createIVL_TS(); + + target.setEffectiveTime(ef); + } + + @Override + protected void updateToPass(AdvanceDirective target) { + + IVL_TS ef = DatatypesFactory.eINSTANCE.createIVL_TS(); + IVXB_TS low = DatatypesFactory.eINSTANCE.createIVXB_TS(); + low.setValue("high"); + ef.setLow(low); + target.setEffectiveTime(ef); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveOperations.validateAdvanceDirectiveHasStartingTime( + (AdvanceDirective) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveHasStartingTimeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAdvanceDirectiveHasEndingTime() { + OperationsTestCase validateAdvanceDirectiveHasEndingTimeTestCase = new OperationsTestCase( + "validateAdvanceDirectiveHasEndingTime", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_HAS_ENDING_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirective target) { + target.init(); + IVL_TS ef = DatatypesFactory.eINSTANCE.createIVL_TS(); + + target.setEffectiveTime(ef); + } + + @Override + protected void updateToPass(AdvanceDirective target) { + + IVL_TS ef = DatatypesFactory.eINSTANCE.createIVL_TS(); + IVXB_TS high = DatatypesFactory.eINSTANCE.createIVXB_TS(); + high.setValue("high"); + ef.setHigh(high); + target.setEffectiveTime(ef); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveOperations.validateAdvanceDirectiveHasEndingTime( + (AdvanceDirective) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveHasEndingTimeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAdvanceDirectiveHasCustodian() { + OperationsTestCase validateAdvanceDirectiveHasCustodianTestCase = new OperationsTestCase( + "validateAdvanceDirectiveHasCustodian", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_HAS_CUSTODIAN__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirective target) { + + } + + @Override + protected void updateToPass(AdvanceDirective target) { + target.init(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + par.setParticipantRole(pr); + target.getParticipants().add(par); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveOperations.validateAdvanceDirectiveHasCustodian( + (AdvanceDirective) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveHasCustodianTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAdvanceDirectiveParticipantTypeCode() { + OperationsTestCase validateAdvanceDirectiveParticipantTypeCodeTestCase = new OperationsTestCase( + "validateAdvanceDirectiveParticipantTypeCode", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_PARTICIPANT_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirective target) { + + } + + @Override + protected void updateToPass(AdvanceDirective target) { + target.init(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setTypeCode(ParticipationType.CST); + target.getParticipants().add(par); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveOperations.validateAdvanceDirectiveParticipantTypeCode( + (AdvanceDirective) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveParticipantTypeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAdvanceDirectiveParticipantRoleClassCode() { + OperationsTestCase validateAdvanceDirectiveParticipantRoleClassCodeTestCase = new OperationsTestCase( + "validateAdvanceDirectiveParticipantRoleClassCode", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_PARTICIPANT_ROLE_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirective target) { + + } + + @Override + protected void updateToPass(AdvanceDirective target) { + target.init(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + pr.setClassCode(RoleClassRoot.AGNT); + par.setParticipantRole(pr); + target.getParticipants().add(par); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveOperations.validateAdvanceDirectiveParticipantRoleClassCode( + (AdvanceDirective) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveParticipantRoleClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAdvanceDirectiveHasAddress() { + OperationsTestCase validateAdvanceDirectiveHasAddressTestCase = new OperationsTestCase( + "validateAdvanceDirectiveHasAddress", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_HAS_ADDRESS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirective target) { + + } + + @Override + protected void updateToPass(AdvanceDirective target) { + target.init(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + pr.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + par.setParticipantRole(pr); + target.getParticipants().add(par); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveOperations.validateAdvanceDirectiveHasAddress( + (AdvanceDirective) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveHasAddressTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAdvanceDirectiveHasTelecom() { + OperationsTestCase validateAdvanceDirectiveHasTelecomTestCase = new OperationsTestCase( + "validateAdvanceDirectiveHasTelecom", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_HAS_TELECOM__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirective target) { + + } + + @Override + protected void updateToPass(AdvanceDirective target) { + target.init(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + pr.getTelecoms().add(DatatypesFactory.eINSTANCE.createTEL()); + par.setParticipantRole(pr); + target.getParticipants().add(par); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveOperations.validateAdvanceDirectiveHasTelecom( + (AdvanceDirective) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveHasTelecomTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAdvanceDirectiveHasNameOfAgent() { + OperationsTestCase validateAdvanceDirectiveHasNameOfAgentTestCase = new OperationsTestCase( + "validateAdvanceDirectiveHasNameOfAgent", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_HAS_NAME_OF_AGENT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirective target) { + + } + + @Override + protected void updateToPass(AdvanceDirective target) { + target.init(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + pe.getNames().add(DatatypesFactory.eINSTANCE.createPN()); + pr.setPlayingEntity(pe); + par.setParticipantRole(pr); + target.getParticipants().add(par); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveOperations.validateAdvanceDirectiveHasNameOfAgent( + (AdvanceDirective) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveHasNameOfAgentTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAdvanceDirectiveTemplateId() { + OperationsTestCase validateAdvanceDirectiveTemplateIdTestCase = new OperationsTestCase( + "validateAdvanceDirectiveTemplateId", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirective target) { + + } + + @Override + protected void updateToPass(AdvanceDirective target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveOperations.validateAdvanceDirectiveTemplateId( + (AdvanceDirective) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAdvanceDirectiveCode() { + OperationsTestCase validateAdvanceDirectiveCodeTestCase = new OperationsTestCase( + "validateAdvanceDirectiveCode", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirective target) { + + } + + @Override + protected void updateToPass(AdvanceDirective target) { + target.init(); + CD cd = DatatypesFactory.eINSTANCE.createCD(); + cd.setCode("281789004"); + cd.setCodeSystem("2.16.840.1.113883.6.96"); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveOperations.validateAdvanceDirectiveCode( + (AdvanceDirective) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAdvanceDirectiveEffectiveTime() { + OperationsTestCase validateAdvanceDirectiveEffectiveTimeTestCase = new OperationsTestCase( + "validateAdvanceDirectiveEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirective target) { + + } + + @Override + protected void updateToPass(AdvanceDirective target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveOperations.validateAdvanceDirectiveEffectiveTime( + (AdvanceDirective) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAdvanceDirectiveObservationCode() { + OperationsTestCase validateAdvanceDirectiveObservationCodeTestCase = new OperationsTestCase( + "validateAdvanceDirectiveObservationCode", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirective target) { + + } + + @Override + protected void updateToPass(AdvanceDirective target) { + target.init(); + + CD cd = DatatypesFactory.eINSTANCE.createCD(); + cd.setCodeSystem("2.16.840.1.113883.6.96"); + cd.setCode("225204009"); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveObservationOperations.validateAdvanceDirectiveObservationCode( + (AdvanceDirective) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends AdvanceDirectiveOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public AdvanceDirective create() { + return HITSPFactory.eINSTANCE.createAdvanceDirective(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends AdvanceDirectiveOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // AdvanceDirectiveOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/AdvanceDirectivesSectionTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/AdvanceDirectivesSectionTest.java new file mode 100644 index 000000000..5f27a7ab0 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/AdvanceDirectivesSectionTest.java @@ -0,0 +1,195 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.hitsp.AdvanceDirective; +import org.openhealthtools.mdht.uml.cda.hitsp.AdvanceDirectivesSection; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.AdvanceDirectivesSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Advance Directives Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.AdvanceDirectivesSection#validateHITSPAdvanceDirectivesSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Advance Directives Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.AdvanceDirectivesSection#validateHITSPAdvanceDirectivesSectionAdvanceDirective(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Advance Directives Section Advance Directive}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.AdvanceDirectivesSection#getAdvanceDirectives() Get Advance Directives}
  • + *
+ *

+ * + * @generated + */ + +public class AdvanceDirectivesSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHITSPAdvanceDirectivesSectionTemplateId() { + OperationsTestCase validateHITSPAdvanceDirectivesSectionTemplateIdTestCase = new OperationsTestCase( + "validateHITSPAdvanceDirectivesSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HITSP_ADVANCE_DIRECTIVES_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectivesSection target) { + + } + + @Override + protected void updateToPass(AdvanceDirectivesSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectivesSectionOperations.validateHITSPAdvanceDirectivesSectionTemplateId( + (AdvanceDirectivesSection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPAdvanceDirectivesSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHITSPAdvanceDirectivesSectionAdvanceDirective() { + OperationsTestCase validateHITSPAdvanceDirectivesSectionAdvanceDirectiveTestCase = new OperationsTestCase( + "validateHITSPAdvanceDirectivesSectionAdvanceDirective", + operationsForOCL.getOCLValue("VALIDATE_HITSP_ADVANCE_DIRECTIVES_SECTION_ADVANCE_DIRECTIVE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectivesSection target) { + + } + + @Override + protected void updateToPass(AdvanceDirectivesSection target) { + target.init(); + AdvanceDirective advanceDirective = HITSPFactory.eINSTANCE.createAdvanceDirective().init(); + target.addObservation(advanceDirective); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectivesSectionOperations.validateHITSPAdvanceDirectivesSectionAdvanceDirective( + (AdvanceDirectivesSection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPAdvanceDirectivesSectionAdvanceDirectiveTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetAdvanceDirectives() { + + AdvanceDirectivesSection target = objectFactory.create(); + target.getAdvanceDirectives(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends AdvanceDirectivesSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public AdvanceDirectivesSection create() { + return HITSPFactory.eINSTANCE.createAdvanceDirectivesSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends AdvanceDirectivesSectionOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // AdvanceDirectivesSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/AllergiesReactionsSectionTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/AllergiesReactionsSectionTest.java new file mode 100644 index 000000000..0c9b68fe1 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/AllergiesReactionsSectionTest.java @@ -0,0 +1,195 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.hitsp.AllergiesReactionsSection; +import org.openhealthtools.mdht.uml.cda.hitsp.AllergyDrugSensitivity; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.AllergiesReactionsSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Allergies Reactions Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.AllergiesReactionsSection#validateHITSPAllergiesReactionsSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Allergies Reactions Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.AllergiesReactionsSection#validateHITSPAllergiesReactionsSectionAllergyDrugSensitivity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Allergies Reactions Section Allergy Drug Sensitivity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.AllergiesReactionsSection#getAllergyDrugSensitivities() Get Allergy Drug Sensitivities}
  • + *
+ *

+ * + * @generated + */ + +public class AllergiesReactionsSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHITSPAllergiesReactionsSectionTemplateId() { + OperationsTestCase validateHITSPAllergiesReactionsSectionTemplateIdTestCase = new OperationsTestCase( + "validateHITSPAllergiesReactionsSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HITSP_ALLERGIES_REACTIONS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergiesReactionsSection target) { + + } + + @Override + protected void updateToPass(AllergiesReactionsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergiesReactionsSectionOperations.validateHITSPAllergiesReactionsSectionTemplateId( + (AllergiesReactionsSection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPAllergiesReactionsSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHITSPAllergiesReactionsSectionAllergyDrugSensitivity() { + OperationsTestCase validateHITSPAllergiesReactionsSectionAllergyDrugSensitivityTestCase = new OperationsTestCase( + "validateHITSPAllergiesReactionsSectionAllergyDrugSensitivity", + operationsForOCL.getOCLValue("VALIDATE_HITSP_ALLERGIES_REACTIONS_SECTION_ALLERGY_DRUG_SENSITIVITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergiesReactionsSection target) { + + } + + @Override + protected void updateToPass(AllergiesReactionsSection target) { + target.init(); + AllergyDrugSensitivity ads = HITSPFactory.eINSTANCE.createAllergyDrugSensitivity().init(); + target.addAct(ads); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergiesReactionsSectionOperations.validateHITSPAllergiesReactionsSectionAllergyDrugSensitivity( + (AllergiesReactionsSection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPAllergiesReactionsSectionAllergyDrugSensitivityTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetAllergyDrugSensitivities() { + + AllergiesReactionsSection target = objectFactory.create(); + target.getAllergyDrugSensitivities(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends AllergiesReactionsSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public AllergiesReactionsSection create() { + return HITSPFactory.eINSTANCE.createAllergiesReactionsSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends AllergiesReactionsSectionOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // AllergiesReactionsSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/AllergyDrugSensitivityTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/AllergyDrugSensitivityTest.java new file mode 100644 index 000000000..91f94ce68 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/AllergyDrugSensitivityTest.java @@ -0,0 +1,1053 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Observation; +import org.openhealthtools.mdht.uml.cda.Participant2; +import org.openhealthtools.mdht.uml.cda.ParticipantRole; +import org.openhealthtools.mdht.uml.cda.PlayingEntity; +import org.openhealthtools.mdht.uml.cda.ccd.AlertObservation; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.ReactionObservation; +import org.openhealthtools.mdht.uml.cda.ccd.SeverityObservation; +import org.openhealthtools.mdht.uml.cda.hitsp.AllergyDrugSensitivity; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.AllergyDrugSensitivityOperations; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.PN; +import org.openhealthtools.mdht.uml.hl7.vocab.EntityClassRoot; +import org.openhealthtools.mdht.uml.hl7.vocab.ParticipationType; +import org.openhealthtools.mdht.uml.hl7.vocab.RoleClassRoot; + +/** + * A static utility class that provides operations + * related to 'Allergy Drug Sensitivity' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.AllergyDrugSensitivity#validateAllergyDrugSensitivityAdverseEventDate(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Drug Sensitivity Adverse Event Date}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.AllergyDrugSensitivity#validateAllergyDrugSensitivityAdverseEventType(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Drug Sensitivity Adverse Event Type}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.AllergyDrugSensitivity#validateAllergyDrugSensitivityAdverseEventTypeVocab(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Drug Sensitivity Adverse Event Type Vocab}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.AllergyDrugSensitivity#validateAllergyDrugSensitivityAllergyProduct(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Drug Sensitivity Allergy Product}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.AllergyDrugSensitivity#validateAllergyDrugSensitivityAllergyProductTypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Drug Sensitivity Allergy Product Type Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.AllergyDrugSensitivity#validateAllergyDrugSensitivityProductDetailParticipantRole(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Drug Sensitivity Product Detail Participant Role}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.AllergyDrugSensitivity#validateAllergyDrugSensitivityProductDetailParticipantRoleClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Drug Sensitivity Product Detail Participant Role Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.AllergyDrugSensitivity#validateAllergyDrugSensitivityProductDetailPlayingEntity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Drug Sensitivity Product Detail Playing Entity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.AllergyDrugSensitivity#validateAllergyDrugSensitivityProductDetailPlayingEntityClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Drug Sensitivity Product Detail Playing Entity Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.AllergyDrugSensitivity#validateAllergyDrugSensitivityProductDetailName(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Drug Sensitivity Product Detail Name}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.AllergyDrugSensitivity#validateAllergyDrugSensitivityProductCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Drug Sensitivity Product Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.AllergyDrugSensitivity#validateAllergyDrugSensitivityAllergyProductFoodVocab(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Drug Sensitivity Allergy Product Food Vocab}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.AllergyDrugSensitivity#validateAllergyDrugSensitivityAllergyProductMedClassVocab(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Drug Sensitivity Allergy Product Med Class Vocab}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.AllergyDrugSensitivity#validateAllergyDrugSensitivityAllergyProductSpecificMedVocab(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Drug Sensitivity Allergy Product Specific Med Vocab}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.AllergyDrugSensitivity#validateAllergyDrugSensitivityReactionText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Drug Sensitivity Reaction Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.AllergyDrugSensitivity#validateAllergyDrugSensitivityReactionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Drug Sensitivity Reaction Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.AllergyDrugSensitivity#validateAllergyDrugSensitivityReactionCodeVocab(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Drug Sensitivity Reaction Code Vocab}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.AllergyDrugSensitivity#validateAllergyDrugSensitivitySeverityText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Drug Sensitivity Severity Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.AllergyDrugSensitivity#validateAllergyDrugSensitivitySeverityCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Drug Sensitivity Severity Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.AllergyDrugSensitivity#validateAllergyDrugSensitivitySeverityCodeVocab(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Drug Sensitivity Severity Code Vocab}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.AllergyDrugSensitivity#validateAllergyDrugSensitivityTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Drug Sensitivity Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class AllergyDrugSensitivityTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyDrugSensitivityAdverseEventDate() { + OperationsTestCase validateAllergyDrugSensitivityAdverseEventDateTestCase = new OperationsTestCase( + "validateAllergyDrugSensitivityAdverseEventDate", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_DRUG_SENSITIVITY_Adverse_EVENT_DATE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyDrugSensitivity target) { + + } + + @Override + protected void updateToPass(AllergyDrugSensitivity target) { + target.init(); + AlertObservation obs = CCDFactory.eINSTANCE.createAlertObservation(); + obs.setEffectiveTime(DatatypesFactory.eINSTANCE.createIVL_TS()); + target.addObservation(obs); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyDrugSensitivityOperations.validateAllergyDrugSensitivityAdverseEventDate( + (AllergyDrugSensitivity) objectToTest, diagnostician, map); + } + + }; + + validateAllergyDrugSensitivityAdverseEventDateTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyDrugSensitivityAdverseEventType() { + OperationsTestCase validateAllergyDrugSensitivityAdverseEventTypeTestCase = new OperationsTestCase( + "validateAllergyDrugSensitivityAdverseEventType", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_DRUG_SENSITIVITY_Adverse_EVENT_TYPE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyDrugSensitivity target) { + + } + + @Override + protected void updateToPass(AllergyDrugSensitivity target) { + target.init(); + AlertObservation obs = CCDFactory.eINSTANCE.createAlertObservation(); + CD code = DatatypesFactory.eINSTANCE.createCD(); + obs.setCode(code); + target.addObservation(obs); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyDrugSensitivityOperations.validateAllergyDrugSensitivityAdverseEventType( + (AllergyDrugSensitivity) objectToTest, diagnostician, map); + } + + }; + + validateAllergyDrugSensitivityAdverseEventTypeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyDrugSensitivityAdverseEventTypeVocab() { + OperationsTestCase validateAllergyDrugSensitivityAdverseEventTypeVocabTestCase = new OperationsTestCase( + "validateAllergyDrugSensitivityAdverseEventTypeVocab", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_DRUG_SENSITIVITY_Adverse_EVENT_TYPE_VOCAB__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyDrugSensitivity target) { + + } + + @Override + protected void updateToPass(AllergyDrugSensitivity target) { + target.init(); + AlertObservation obs = CCDFactory.eINSTANCE.createAlertObservation(); + CD code = DatatypesFactory.eINSTANCE.createCD(); + code.setCodeSystem("2.16.840.1.113883.6.96"); + code.setCode("416098002"); + obs.setCode(code); + target.addObservation(obs); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyDrugSensitivityOperations.validateAllergyDrugSensitivityAdverseEventTypeVocab( + (AllergyDrugSensitivity) objectToTest, diagnostician, map); + } + + }; + + validateAllergyDrugSensitivityAdverseEventTypeVocabTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyDrugSensitivityAllergyProduct() { + OperationsTestCase validateAllergyDrugSensitivityAllergyProductTestCase = new OperationsTestCase( + "validateAllergyDrugSensitivityAllergyProduct", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_DRUG_SENSITIVITY_ALLERGY_PRODUCT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyDrugSensitivity target) { + + } + + @Override + protected void updateToPass(AllergyDrugSensitivity target) { + target.init(); + AlertObservation obs = CCDFactory.eINSTANCE.createAlertObservation(); + obs.getParticipants().add(CDAFactory.eINSTANCE.createParticipant2()); + target.addObservation(obs); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyDrugSensitivityOperations.validateAllergyDrugSensitivityAllergyProduct( + (AllergyDrugSensitivity) objectToTest, diagnostician, map); + } + + }; + + validateAllergyDrugSensitivityAllergyProductTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyDrugSensitivityAllergyProductTypeCode() { + OperationsTestCase validateAllergyDrugSensitivityAllergyProductTypeCodeTestCase = new OperationsTestCase( + "validateAllergyDrugSensitivityAllergyProductTypeCode", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_DRUG_SENSITIVITY_ALLERGY_PRODUCT_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyDrugSensitivity target) { + + } + + @Override + protected void updateToPass(AllergyDrugSensitivity target) { + target.init(); + AlertObservation obs = CCDFactory.eINSTANCE.createAlertObservation(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setTypeCode(ParticipationType.CSM); + obs.getParticipants().add(par); + target.addObservation(obs); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyDrugSensitivityOperations.validateAllergyDrugSensitivityAllergyProductTypeCode( + (AllergyDrugSensitivity) objectToTest, diagnostician, map); + } + + }; + + validateAllergyDrugSensitivityAllergyProductTypeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyDrugSensitivityProductDetailParticipantRole() { + OperationsTestCase validateAllergyDrugSensitivityProductDetailParticipantRoleTestCase = new OperationsTestCase( + "validateAllergyDrugSensitivityProductDetailParticipantRole", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_DRUG_SENSITIVITY_PRODUCT_DETAIL_PARTICIPANT_ROLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyDrugSensitivity target) { + + } + + @Override + protected void updateToPass(AllergyDrugSensitivity target) { + target.init(); + AlertObservation obs = CCDFactory.eINSTANCE.createAlertObservation(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setTypeCode(ParticipationType.CSM); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + par.setParticipantRole(pr); + obs.getParticipants().add(par); + target.addObservation(obs); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyDrugSensitivityOperations.validateAllergyDrugSensitivityProductDetailParticipantRole( + (AllergyDrugSensitivity) objectToTest, diagnostician, map); + } + + }; + + validateAllergyDrugSensitivityProductDetailParticipantRoleTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyDrugSensitivityProductDetailParticipantRoleClassCode() { + OperationsTestCase validateAllergyDrugSensitivityProductDetailParticipantRoleClassCodeTestCase = new OperationsTestCase( + "validateAllergyDrugSensitivityProductDetailParticipantRoleClassCode", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_DRUG_SENSITIVITY_PRODUCT_DETAIL_PARTICIPANT_ROLE_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyDrugSensitivity target) { + + } + + @Override + protected void updateToPass(AllergyDrugSensitivity target) { + target.init(); + AlertObservation obs = CCDFactory.eINSTANCE.createAlertObservation(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setTypeCode(ParticipationType.CSM); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + pr.setClassCode(RoleClassRoot.MANU); + par.setParticipantRole(pr); + obs.getParticipants().add(par); + target.addObservation(obs); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyDrugSensitivityOperations.validateAllergyDrugSensitivityProductDetailParticipantRoleClassCode( + (AllergyDrugSensitivity) objectToTest, diagnostician, map); + } + + }; + + validateAllergyDrugSensitivityProductDetailParticipantRoleClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyDrugSensitivityProductDetailPlayingEntity() { + OperationsTestCase validateAllergyDrugSensitivityProductDetailPlayingEntityTestCase = new OperationsTestCase( + "validateAllergyDrugSensitivityProductDetailPlayingEntity", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_DRUG_SENSITIVITY_PRODUCT_DETAIL_PLAYING_ENTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyDrugSensitivity target) { + + } + + @Override + protected void updateToPass(AllergyDrugSensitivity target) { + target.init(); + AlertObservation obs = CCDFactory.eINSTANCE.createAlertObservation(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setTypeCode(ParticipationType.CSM); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + pr.setClassCode(RoleClassRoot.MANU); + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + pe.setClassCode(EntityClassRoot.MMAT); + pr.setPlayingEntity(pe); + par.setParticipantRole(pr); + obs.getParticipants().add(par); + target.addObservation(obs); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyDrugSensitivityOperations.validateAllergyDrugSensitivityProductDetailPlayingEntity( + (AllergyDrugSensitivity) objectToTest, diagnostician, map); + } + + }; + + validateAllergyDrugSensitivityProductDetailPlayingEntityTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyDrugSensitivityProductDetailPlayingEntityClassCode() { + OperationsTestCase validateAllergyDrugSensitivityProductDetailPlayingEntityClassCodeTestCase = new OperationsTestCase( + "validateAllergyDrugSensitivityProductDetailPlayingEntityClassCode", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_DRUG_SENSITIVITY_PRODUCT_DETAIL_PLAYING_ENTITY_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyDrugSensitivity target) { + + } + + @Override + protected void updateToPass(AllergyDrugSensitivity target) { + target.init(); + AlertObservation obs = CCDFactory.eINSTANCE.createAlertObservation(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setTypeCode(ParticipationType.CSM); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + pr.setClassCode(RoleClassRoot.MANU); + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + pe.setClassCode(EntityClassRoot.MMAT); + pr.setPlayingEntity(pe); + par.setParticipantRole(pr); + obs.getParticipants().add(par); + target.addObservation(obs); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyDrugSensitivityOperations.validateAllergyDrugSensitivityProductDetailPlayingEntityClassCode( + (AllergyDrugSensitivity) objectToTest, diagnostician, map); + } + + }; + + validateAllergyDrugSensitivityProductDetailPlayingEntityClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyDrugSensitivityProductDetailName() { + OperationsTestCase validateAllergyDrugSensitivityProductDetailNameTestCase = new OperationsTestCase( + "validateAllergyDrugSensitivityProductDetailName", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_DRUG_SENSITIVITY_PRODUCT_DETAIL_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyDrugSensitivity target) { + + } + + @Override + protected void updateToPass(AllergyDrugSensitivity target) { + target.init(); + AlertObservation obs = CCDFactory.eINSTANCE.createAlertObservation(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setTypeCode(ParticipationType.CSM); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + pr.setClassCode(RoleClassRoot.MANU); + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + pe.setClassCode(EntityClassRoot.MMAT); + PN name = DatatypesFactory.eINSTANCE.createPN(); + + pe.getNames().add(name); + pr.setPlayingEntity(pe); + par.setParticipantRole(pr); + obs.getParticipants().add(par); + target.addObservation(obs); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyDrugSensitivityOperations.validateAllergyDrugSensitivityProductDetailName( + (AllergyDrugSensitivity) objectToTest, diagnostician, map); + } + + }; + + validateAllergyDrugSensitivityProductDetailNameTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyDrugSensitivityProductCode() { + OperationsTestCase validateAllergyDrugSensitivityProductCodeTestCase = new OperationsTestCase( + "validateAllergyDrugSensitivityProductCode", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_DRUG_SENSITIVITY_PRODUCT_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyDrugSensitivity target) { + + } + + @Override + protected void updateToPass(AllergyDrugSensitivity target) { + target.init(); + AlertObservation obs = CCDFactory.eINSTANCE.createAlertObservation(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setTypeCode(ParticipationType.CSM); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + pr.setClassCode(RoleClassRoot.MANU); + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + pe.setClassCode(EntityClassRoot.MMAT); + CE code = DatatypesFactory.eINSTANCE.createCE(); + pe.setCode(code); + pr.setPlayingEntity(pe); + par.setParticipantRole(pr); + obs.getParticipants().add(par); + target.addObservation(obs); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyDrugSensitivityOperations.validateAllergyDrugSensitivityProductCode( + (AllergyDrugSensitivity) objectToTest, diagnostician, map); + } + + }; + + validateAllergyDrugSensitivityProductCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyDrugSensitivityAllergyProductFoodVocab() { + OperationsTestCase validateAllergyDrugSensitivityAllergyProductFoodVocabTestCase = new OperationsTestCase( + "validateAllergyDrugSensitivityAllergyProductFoodVocab", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_DRUG_SENSITIVITY_ALLERGY_PRODUCT_FOOD_VOCAB__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyDrugSensitivity target) { + + } + + @Override + protected void updateToPass(AllergyDrugSensitivity target) { + target.init(); + AlertObservation obs = CCDFactory.eINSTANCE.createAlertObservation(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setTypeCode(ParticipationType.CSM); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + pr.setClassCode(RoleClassRoot.MANU); + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + pe.setClassCode(EntityClassRoot.MMAT); + CE code = DatatypesFactory.eINSTANCE.createCE(); + code.setCodeSystem("2.16.840.1.113883.4.9"); + pe.setCode(code); + pr.setPlayingEntity(pe); + par.setParticipantRole(pr); + obs.getParticipants().add(par); + target.addObservation(obs); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyDrugSensitivityOperations.validateAllergyDrugSensitivityAllergyProductFoodVocab( + (AllergyDrugSensitivity) objectToTest, diagnostician, map); + } + + }; + + validateAllergyDrugSensitivityAllergyProductFoodVocabTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyDrugSensitivityAllergyProductMedClassVocab() { + OperationsTestCase validateAllergyDrugSensitivityAllergyProductMedClassVocabTestCase = new OperationsTestCase( + "validateAllergyDrugSensitivityAllergyProductMedClassVocab", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_DRUG_SENSITIVITY_ALLERGY_PRODUCT_MED_CLASS_VOCAB__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyDrugSensitivity target) { + + } + + @Override + protected void updateToPass(AllergyDrugSensitivity target) { + target.init(); + Observation obs = IHEFactory.eINSTANCE.createAllergyIntolerance().init(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setTypeCode(ParticipationType.CSM); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + pr.setClassCode(RoleClassRoot.MANU); + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + pe.setClassCode(EntityClassRoot.MMAT); + CE code = DatatypesFactory.eINSTANCE.createCE(); + code.setCodeSystem("2.16.840.1.113883.6.88"); // "2.16.840.1.113883.3.26.1.5"); + // code.setCode("1191"); + // code.setDisplayName("Aspirin"); + // + pe.setCode(code); + pr.setPlayingEntity(pe); + par.setParticipantRole(pr); + obs.getParticipants().add(par); + target.addObservation(obs); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyDrugSensitivityOperations.validateAllergyDrugSensitivityAllergyProductMedClassVocab( + (AllergyDrugSensitivity) objectToTest, diagnostician, map); + } + + }; + + validateAllergyDrugSensitivityAllergyProductMedClassVocabTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyDrugSensitivityAllergyProductSpecificMedVocab() { + OperationsTestCase validateAllergyDrugSensitivityAllergyProductSpecificMedVocabTestCase = new OperationsTestCase( + "validateAllergyDrugSensitivityAllergyProductSpecificMedVocab", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_DRUG_SENSITIVITY_ALLERGY_PRODUCT_SPECIFIC_MED_VOCAB__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyDrugSensitivity target) { + + } + + @Override + protected void updateToPass(AllergyDrugSensitivity target) { + target.init(); + AlertObservation obs = CCDFactory.eINSTANCE.createAlertObservation(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setTypeCode(ParticipationType.CSM); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + pr.setClassCode(RoleClassRoot.MANU); + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + pe.setClassCode(EntityClassRoot.MMAT); + CE code = DatatypesFactory.eINSTANCE.createCE(); + code.setCodeSystem("2.16.840.1.113883.6.88"); + pe.setCode(code); + pr.setPlayingEntity(pe); + par.setParticipantRole(pr); + obs.getParticipants().add(par); + target.addObservation(obs); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyDrugSensitivityOperations.validateAllergyDrugSensitivityAllergyProductSpecificMedVocab( + (AllergyDrugSensitivity) objectToTest, diagnostician, map); + } + + }; + + validateAllergyDrugSensitivityAllergyProductSpecificMedVocabTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyDrugSensitivityReactionText() { + OperationsTestCase validateAllergyDrugSensitivityReactionTextTestCase = new OperationsTestCase( + "validateAllergyDrugSensitivityReactionText", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_DRUG_SENSITIVITY_REACTION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyDrugSensitivity target) { + + target.init(); + AlertObservation obs = CCDFactory.eINSTANCE.createAlertObservation().init(); + ReactionObservation ro = CCDFactory.eINSTANCE.createReactionObservation().init(); + + // ro.setText(DatatypesFactory.eINSTANCE.createED()); + obs.addObservation(ro); + obs.addObservation(CCDFactory.eINSTANCE.createStatusObservation().init()); + target.addObservation(obs); + + } + + @Override + protected void updateToPass(AllergyDrugSensitivity target) { + + for (Observation observation : target.getObservations()) { + for (Observation observation2 : observation.getObservations()) { + observation2.setText(DatatypesFactory.eINSTANCE.createED("somecontent")); + } + + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyDrugSensitivityOperations.validateAllergyDrugSensitivityReactionText( + (AllergyDrugSensitivity) objectToTest, diagnostician, map); + } + + }; + + validateAllergyDrugSensitivityReactionTextTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyDrugSensitivityReactionCode() { + OperationsTestCase validateAllergyDrugSensitivityReactionCodeTestCase = new OperationsTestCase( + "validateAllergyDrugSensitivityReactionCode", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_DRUG_SENSITIVITY_REACTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyDrugSensitivity target) { + target.init(); + AlertObservation obs = CCDFactory.eINSTANCE.createAlertObservation(); + ReactionObservation ro = CCDFactory.eINSTANCE.createReactionObservation(); + // CD code = DatatypesFactory.eINSTANCE.createCD(); + // ro.setCode(code); + obs.addObservation(ro); + target.addObservation(obs); + } + + @Override + protected void updateToPass(AllergyDrugSensitivity target) { + target.getEntryRelationships().clear(); + AlertObservation obs = CCDFactory.eINSTANCE.createAlertObservation(); + ReactionObservation ro = CCDFactory.eINSTANCE.createReactionObservation(); + CD code = DatatypesFactory.eINSTANCE.createCD(); + ro.setCode(code); + obs.addObservation(ro); + target.addObservation(obs); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyDrugSensitivityOperations.validateAllergyDrugSensitivityReactionCode( + (AllergyDrugSensitivity) objectToTest, diagnostician, map); + } + + }; + + validateAllergyDrugSensitivityReactionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyDrugSensitivityReactionCodeVocab() { + OperationsTestCase validateAllergyDrugSensitivityReactionCodeVocabTestCase = new OperationsTestCase( + "validateAllergyDrugSensitivityReactionCodeVocab", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_DRUG_SENSITIVITY_REACTION_CODE_VOCAB__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyDrugSensitivity target) { + target.init(); + AlertObservation obs = CCDFactory.eINSTANCE.createAlertObservation(); + ReactionObservation ro = CCDFactory.eINSTANCE.createReactionObservation(); + CD code = DatatypesFactory.eINSTANCE.createCD(); + // code.setCodeSystem("2.16.840.1.113883.6.96"); + // code.setCode("243796009"); + ro.setCode(code); + obs.addObservation(ro); + target.addObservation(obs); + } + + @Override + protected void updateToPass(AllergyDrugSensitivity target) { + target.getEntryRelationships().clear(); + AlertObservation obs = CCDFactory.eINSTANCE.createAlertObservation(); + ReactionObservation ro = CCDFactory.eINSTANCE.createReactionObservation(); + CD code = DatatypesFactory.eINSTANCE.createCD(); + code.setCodeSystem("2.16.840.1.113883.6.96"); + code.setCode("243796009"); + ro.setCode(code); + obs.addObservation(ro); + target.addObservation(obs); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyDrugSensitivityOperations.validateAllergyDrugSensitivityReactionCodeVocab( + (AllergyDrugSensitivity) objectToTest, diagnostician, map); + } + + }; + + validateAllergyDrugSensitivityReactionCodeVocabTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyDrugSensitivitySeverityText() { + OperationsTestCase validateAllergyDrugSensitivitySeverityTextTestCase = new OperationsTestCase( + "validateAllergyDrugSensitivitySeverityText", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_DRUG_SENSITIVITY_SEVERITY_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyDrugSensitivity target) { + target.init(); + AlertObservation obs = CCDFactory.eINSTANCE.createAlertObservation(); + SeverityObservation so = CCDFactory.eINSTANCE.createSeverityObservation().init(); + // so.setText(DatatypesFactory.eINSTANCE.createED()); + obs.addObservation(so); + target.addObservation(obs); + } + + @Override + protected void updateToPass(AllergyDrugSensitivity target) { + target.getEntryRelationships().clear(); + AlertObservation obs = CCDFactory.eINSTANCE.createAlertObservation(); + SeverityObservation so = CCDFactory.eINSTANCE.createSeverityObservation().init(); + so.setText(DatatypesFactory.eINSTANCE.createED()); + obs.addObservation(so); + target.addObservation(obs); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyDrugSensitivityOperations.validateAllergyDrugSensitivitySeverityText( + (AllergyDrugSensitivity) objectToTest, diagnostician, map); + } + + }; + + validateAllergyDrugSensitivitySeverityTextTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyDrugSensitivitySeverityCode() { + OperationsTestCase validateAllergyDrugSensitivitySeverityCodeTestCase = new OperationsTestCase( + "validateAllergyDrugSensitivitySeverityCode", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_DRUG_SENSITIVITY_SEVERITY_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyDrugSensitivity target) { + target.init(); + AlertObservation obs = CCDFactory.eINSTANCE.createAlertObservation(); + SeverityObservation so = CCDFactory.eINSTANCE.createSeverityObservation(); + DatatypesFactory.eINSTANCE.createCD(); + // so.setCode(code); + obs.addObservation(so); + target.addObservation(obs); + } + + @Override + protected void updateToPass(AllergyDrugSensitivity target) { + target.getEntryRelationships().clear(); + AlertObservation obs = CCDFactory.eINSTANCE.createAlertObservation(); + SeverityObservation so = CCDFactory.eINSTANCE.createSeverityObservation(); + CD code = DatatypesFactory.eINSTANCE.createCD(); + so.setCode(code); + obs.addObservation(so); + target.addObservation(obs); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyDrugSensitivityOperations.validateAllergyDrugSensitivitySeverityCode( + (AllergyDrugSensitivity) objectToTest, diagnostician, map); + } + + }; + + validateAllergyDrugSensitivitySeverityCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyDrugSensitivitySeverityCodeVocab() { + OperationsTestCase validateAllergyDrugSensitivitySeverityCodeVocabTestCase = new OperationsTestCase( + "validateAllergyDrugSensitivitySeverityCodeVocab", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_DRUG_SENSITIVITY_SEVERITY_CODE_VOCAB__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyDrugSensitivity target) { + target.init(); + AlertObservation obs = CCDFactory.eINSTANCE.createAlertObservation(); + SeverityObservation so = CCDFactory.eINSTANCE.createSeverityObservation(); + CD code = DatatypesFactory.eINSTANCE.createCD(); + code.setCodeSystem("2.16.840.1.113883.6.96"); + code.setCode("371923003"); + // so.setCode(code); + obs.addObservation(so); + target.addObservation(obs); + } + + @Override + protected void updateToPass(AllergyDrugSensitivity target) { + target.getEntryRelationships().clear(); + AlertObservation obs = CCDFactory.eINSTANCE.createAlertObservation(); + SeverityObservation so = CCDFactory.eINSTANCE.createSeverityObservation(); + CD code = DatatypesFactory.eINSTANCE.createCD(); + code.setCodeSystem("2.16.840.1.113883.6.96"); + code.setCode("371923003"); + so.setCode(code); + obs.addObservation(so); + target.addObservation(obs); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyDrugSensitivityOperations.validateAllergyDrugSensitivitySeverityCodeVocab( + (AllergyDrugSensitivity) objectToTest, diagnostician, map); + } + + }; + + validateAllergyDrugSensitivitySeverityCodeVocabTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAllergyDrugSensitivityTemplateId() { + OperationsTestCase validateAllergyDrugSensitivityTemplateIdTestCase = new OperationsTestCase( + "validateAllergyDrugSensitivityTemplateId", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_DRUG_SENSITIVITY_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyDrugSensitivity target) { + + } + + @Override + protected void updateToPass(AllergyDrugSensitivity target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyDrugSensitivityOperations.validateAllergyDrugSensitivityTemplateId( + (AllergyDrugSensitivity) objectToTest, diagnostician, map); + } + + }; + + validateAllergyDrugSensitivityTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends AllergyDrugSensitivityOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public AllergyDrugSensitivity create() { + return HITSPFactory.eINSTANCE.createAllergyDrugSensitivity(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends AllergyDrugSensitivityOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // AllergyDrugSensitivityOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/AssessmentAndPlanSectionTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/AssessmentAndPlanSectionTest.java new file mode 100644 index 000000000..76024730e --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/AssessmentAndPlanSectionTest.java @@ -0,0 +1,332 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.hitsp.AssessmentAndPlanSection; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.AssessmentAndPlanSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Assessment And Plan Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.AssessmentAndPlanSection#validateHITSPAssessmentAndPlanSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Assessment And Plan Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.AssessmentAndPlanSection#validateHITSPAssessmentAndPlanSectionMedication(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Assessment And Plan Section Medication}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.AssessmentAndPlanSection#validateHITSPAssessmentAndPlanSectionImmunization(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Assessment And Plan Section Immunization}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.AssessmentAndPlanSection#validateHITSPAssessmentAndPlanSectionEncounterEntry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Assessment And Plan Section Encounter Entry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.AssessmentAndPlanSection#validateHITSPAssessmentAndPlanSectionProcedureEntry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Assessment And Plan Section Procedure Entry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.AssessmentAndPlanSection#getMedications() Get Medications}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.AssessmentAndPlanSection#getImmunizations() Get Immunizations}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.AssessmentAndPlanSection#getEncounterEntries() Get Encounter Entries}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.AssessmentAndPlanSection#getProcedureEntries() Get Procedure Entries}
  • + *
+ *

+ * + * @generated + */ + +public class AssessmentAndPlanSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHITSPAssessmentAndPlanSectionTemplateId() { + OperationsTestCase validateHITSPAssessmentAndPlanSectionTemplateIdTestCase = new OperationsTestCase( + "validateHITSPAssessmentAndPlanSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HITSP_ASSESSMENT_AND_PLAN_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentAndPlanSection target) { + + } + + @Override + protected void updateToPass(AssessmentAndPlanSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentAndPlanSectionOperations.validateHITSPAssessmentAndPlanSectionTemplateId( + (AssessmentAndPlanSection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPAssessmentAndPlanSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateHITSPAssessmentAndPlanSectionMedication() { + OperationsTestCase validateHITSPAssessmentAndPlanSectionMedicationTestCase = new OperationsTestCase( + "validateHITSPAssessmentAndPlanSectionMedication", + operationsForOCL.getOCLValue("VALIDATE_HITSP_ASSESSMENT_AND_PLAN_SECTION_MEDICATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentAndPlanSection target) { + target.init(); + } + + @Override + protected void updateToPass(AssessmentAndPlanSection target) { + target.addSubstanceAdministration(HITSPFactory.eINSTANCE.createMedication().init()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentAndPlanSectionOperations.validateHITSPAssessmentAndPlanSectionMedication( + (AssessmentAndPlanSection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPAssessmentAndPlanSectionMedicationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateHITSPAssessmentAndPlanSectionImmunization() { + OperationsTestCase validateHITSPAssessmentAndPlanSectionImmunizationTestCase = new OperationsTestCase( + "validateHITSPAssessmentAndPlanSectionImmunization", + operationsForOCL.getOCLValue("VALIDATE_HITSP_ASSESSMENT_AND_PLAN_SECTION_IMMUNIZATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentAndPlanSection target) { + target.init(); + } + + @Override + protected void updateToPass(AssessmentAndPlanSection target) { + + target.addSubstanceAdministration(HITSPFactory.eINSTANCE.createImmunization().init()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentAndPlanSectionOperations.validateHITSPAssessmentAndPlanSectionImmunization( + (AssessmentAndPlanSection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPAssessmentAndPlanSectionImmunizationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateHITSPAssessmentAndPlanSectionEncounterEntry() { + OperationsTestCase validateHITSPAssessmentAndPlanSectionEncounterEntryTestCase = new OperationsTestCase( + "validateHITSPAssessmentAndPlanSectionEncounterEntry", + operationsForOCL.getOCLValue("VALIDATE_HITSP_ASSESSMENT_AND_PLAN_SECTION_ENCOUNTER_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentAndPlanSection target) { + target.init(); + } + + @Override + protected void updateToPass(AssessmentAndPlanSection target) { + + target.addEncounter(HITSPFactory.eINSTANCE.createEncounter().init()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentAndPlanSectionOperations.validateHITSPAssessmentAndPlanSectionEncounterEntry( + (AssessmentAndPlanSection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPAssessmentAndPlanSectionEncounterEntryTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateHITSPAssessmentAndPlanSectionProcedureEntry() { + OperationsTestCase validateHITSPAssessmentAndPlanSectionProcedureEntryTestCase = new OperationsTestCase( + "validateHITSPAssessmentAndPlanSectionProcedureEntry", + operationsForOCL.getOCLValue("VALIDATE_HITSP_ASSESSMENT_AND_PLAN_SECTION_PROCEDURE_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentAndPlanSection target) { + target.init(); + } + + @Override + protected void updateToPass(AssessmentAndPlanSection target) { + + target.addProcedure(HITSPFactory.eINSTANCE.createPastProcedure().init()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentAndPlanSectionOperations.validateHITSPAssessmentAndPlanSectionProcedureEntry( + (AssessmentAndPlanSection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPAssessmentAndPlanSectionProcedureEntryTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetMedications() { + + AssessmentAndPlanSection target = objectFactory.create(); + target.getMedications(); + + } + + /** + * + * @generated + */ + @Test + public void testGetImmunizations() { + + AssessmentAndPlanSection target = objectFactory.create(); + target.getImmunizations(); + + } + + /** + * + * @generated + */ + @Test + public void testGetEncounterEntries() { + + AssessmentAndPlanSection target = objectFactory.create(); + target.getEncounterEntries(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProcedureEntries() { + + AssessmentAndPlanSection target = objectFactory.create(); + target.getProcedureEntries(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends AssessmentAndPlanSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public AssessmentAndPlanSection create() { + return HITSPFactory.eINSTANCE.createAssessmentAndPlanSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends AssessmentAndPlanSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // AssessmentAndPlanSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/ChiefComplaintSectionTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/ChiefComplaintSectionTest.java new file mode 100644 index 000000000..07ac569be --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/ChiefComplaintSectionTest.java @@ -0,0 +1,197 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.hitsp.ChiefComplaintSection; +import org.openhealthtools.mdht.uml.cda.hitsp.Condition; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.ChiefComplaintSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Chief Complaint Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.ChiefComplaintSection#validateHITSPChiefComplaintSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Chief Complaint Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.ChiefComplaintSection#validateHITSPChiefComplaintSectionCondition(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Chief Complaint Section Condition}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.ChiefComplaintSection#getCondition() Get Condition}
  • + *
+ *

+ * + * @generated + */ + +public class ChiefComplaintSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHITSPChiefComplaintSectionTemplateId() { + OperationsTestCase validateHITSPChiefComplaintSectionTemplateIdTestCase = new OperationsTestCase( + "validateHITSPChiefComplaintSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HITSP_CHIEF_COMPLAINT_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ChiefComplaintSection target) { + + } + + @Override + protected void updateToPass(ChiefComplaintSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ChiefComplaintSectionOperations.validateHITSPChiefComplaintSectionTemplateId( + (ChiefComplaintSection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPChiefComplaintSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHITSPChiefComplaintSectionCondition() { + OperationsTestCase validateHITSPChiefComplaintSectionConditionTestCase = new OperationsTestCase( + "validateHITSPChiefComplaintSectionCondition", + operationsForOCL.getOCLValue("VALIDATE_HITSP_CHIEF_COMPLAINT_SECTION_CONDITION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ChiefComplaintSection target) { + + } + + @Override + protected void updateToPass(ChiefComplaintSection target) { + target.init(); + + Condition condition = HITSPFactory.eINSTANCE.createCondition().init(); + + target.addAct(condition); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ChiefComplaintSectionOperations.validateHITSPChiefComplaintSectionCondition( + (ChiefComplaintSection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPChiefComplaintSectionConditionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetCondition() { + + ChiefComplaintSection target = objectFactory.create(); + target.getCondition(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ChiefComplaintSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public ChiefComplaintSection create() { + return HITSPFactory.eINSTANCE.createChiefComplaintSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends ChiefComplaintSectionOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ChiefComplaintSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/CommentTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/CommentTest.java new file mode 100644 index 000000000..6d9e83c80 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/CommentTest.java @@ -0,0 +1,177 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.Comment; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.CommentOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Comment' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Comment#validateHITSPCommentTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Comment Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Comment#validateHITSPCommentAuthor(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Comment Author}
  • + *
+ *

+ * + * @generated + */ + +public class CommentTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHITSPCommentTemplateId() { + OperationsTestCase validateHITSPCommentTemplateIdTestCase = new OperationsTestCase( + "validateHITSPCommentTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HITSP_COMMENT_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Comment target) { + + } + + @Override + protected void updateToPass(Comment target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CommentOperations.validateHITSPCommentTemplateId((Comment) objectToTest, diagnostician, map); + } + + }; + + validateHITSPCommentTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateHITSPCommentAuthor() { + OperationsTestCase validateHITSPCommentAuthorTestCase = new OperationsTestCase( + "validateHITSPCommentAuthor", + operationsForOCL.getOCLValue("VALIDATE_HITSP_COMMENT_AUTHOR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Comment target) { + target.init(); + } + + @Override + protected void updateToPass(Comment target) { + + target.getAuthors().add(CDAFactory.eINSTANCE.createAuthor()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CommentOperations.validateHITSPCommentAuthor((Comment) objectToTest, diagnostician, map); + } + + }; + + validateHITSPCommentAuthorTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends CommentOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public Comment create() { + return HITSPFactory.eINSTANCE.createComment(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends CommentOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // CommentOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/ConditionEntryTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/ConditionEntryTest.java new file mode 100644 index 000000000..aeb7838d1 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/ConditionEntryTest.java @@ -0,0 +1,584 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.ccd.AgeObservation; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.CauseOfDeathObservation; +import org.openhealthtools.mdht.uml.cda.hitsp.ConditionEntry; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.ConditionEntryOperations; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.ProblemStatusObservation; +import org.openhealthtools.mdht.uml.cda.ihe.operations.ProblemEntryOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * A static utility class that provides operations + * related to 'Condition Entry' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • + * {@link org.openhealthtools.mdht.uml.cda.hitsp.ConditionEntry#validateConditionEntryHasOnsetDate(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Condition Entry Has Onset Date}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.hitsp.ConditionEntry#validateConditionEntryHasResolutionDate(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Condition Entry Has Resolution Date}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.hitsp.ConditionEntry#validateConditionEntryHasUnknownResolutionDate(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Condition Entry Has Unknown Resolution Date}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.hitsp.ConditionEntry#validateConditionEntryCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Condition Entry Code}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.hitsp.ConditionEntry#validateProblemEntryValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Problem Entry Value}
  • + *
+ *

+ * + * @generated + */ + +public class ConditionEntryTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateConditionEntryHasOnsetDate() { + OperationsTestCase validateConditionEntryHasOnsetDateTestCase = new OperationsTestCase( + "validateConditionEntryHasOnsetDate", + operationsForOCL.getOCLValue("VALIDATE_CONDITION_ENTRY_HAS_ONSET_DATE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConditionEntry target) { + + } + + @Override + protected void updateToPass(ConditionEntry target) { + target.init(); + IVL_TS time = DatatypesFactory.eINSTANCE.createIVL_TS("low", "high"); + target.setEffectiveTime(time); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConditionEntryOperations.validateConditionEntryHasOnsetDate( + (ConditionEntry) objectToTest, diagnostician, map); + } + + }; + + validateConditionEntryHasOnsetDateTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConditionEntryHasResolutionDate() { + OperationsTestCase validateConditionEntryHasResolutionDateTestCase = new OperationsTestCase( + "validateConditionEntryHasResolutionDate", + operationsForOCL.getOCLValue("VALIDATE_CONDITION_ENTRY_HAS_RESOLUTION_DATE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConditionEntry target) { + + } + + @Override + protected void updateToPass(ConditionEntry target) { + target.init(); + IVL_TS time = DatatypesFactory.eINSTANCE.createIVL_TS("low", "high"); + target.setEffectiveTime(time); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConditionEntryOperations.validateConditionEntryHasResolutionDate( + (ConditionEntry) objectToTest, diagnostician, map); + } + + }; + + validateConditionEntryHasResolutionDateTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConditionEntryHasUnknownResolutionDate() { + OperationsTestCase validateConditionEntryHasUnknownResolutionDateTestCase = new OperationsTestCase( + "validateConditionEntryHasUnknownResolutionDate", + operationsForOCL.getOCLValue("VALIDATE_CONDITION_ENTRY_HAS_UNKNOWN_RESOLUTION_DATE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConditionEntry target) { + + } + + @Override + protected void updateToPass(ConditionEntry target) { + target.init(); + IVL_TS time = DatatypesFactory.eINSTANCE.createIVL_TS("low", "high"); + target.setEffectiveTime(time); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConditionEntryOperations.validateConditionEntryHasUnknownResolutionDate( + (ConditionEntry) objectToTest, diagnostician, map); + } + + }; + + validateConditionEntryHasUnknownResolutionDateTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateConditionEntryCodeP() { + OperationsTestCase validateConditionEntryCodePTestCase = new OperationsTestCase( + "validateConditionEntryCodeP", + operationsForOCL.getOCLValue("VALIDATE_CONDITION_ENTRY_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConditionEntry target) { + + } + + @Override + protected void updateToPass(ConditionEntry target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConditionEntryOperations.validateConditionEntryCodeP( + (ConditionEntry) objectToTest, diagnostician, map); + } + + }; + + validateConditionEntryCodePTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConditionEntryCode() { + OperationsTestCase validateConditionEntryCodeTestCase = new OperationsTestCase( + "validateConditionEntryCode", + operationsForOCL.getOCLValue("VALIDATE_CONDITION_ENTRY_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConditionEntry target) { + + } + + @Override + protected void updateToPass(ConditionEntry target) { + target.init(); + target.getCode().setCode("404684003"); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConditionEntryOperations.validateConditionEntryCode( + (ConditionEntry) objectToTest, diagnostician, map); + } + + }; + + validateConditionEntryCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConditionEntryText() { + OperationsTestCase validateConditionEntryTextTestCase = new OperationsTestCase( + "validateConditionEntryText", + operationsForOCL.getOCLValue("VALIDATE_CONDITION_ENTRY_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConditionEntry target) { + + } + + @Override + protected void updateToPass(ConditionEntry target) { + target.init(); + ED text = DatatypesFactory.eINSTANCE.createED(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConditionEntryOperations.validateConditionEntryText( + (ConditionEntry) objectToTest, diagnostician, map); + } + + }; + + validateConditionEntryTextTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateConditionEntryValue() { + OperationsTestCase validateConditionEntryValueTestCase = new OperationsTestCase( + "validateConditionEntryValue", + operationsForOCL.getOCLValue("VALIDATE_CONDITION_ENTRY_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConditionEntry target) { + + } + + @Override + protected void updateToPass(ConditionEntry target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD(); + value.setCodeSystem("2.16.840.1.113883.6.96"); + value.setCode("aaaa"); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConditionEntryOperations.validateConditionEntryValue( + (ConditionEntry) objectToTest, diagnostician, map); + } + + }; + + validateConditionEntryValueTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConditionEntryAgeObservation() { + OperationsTestCase validateConditionEntryAgeObservationTestCase = new OperationsTestCase( + "validateConditionEntryAgeObservation", + operationsForOCL.getOCLValue("VALIDATE_CONDITION_ENTRY_AGE_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConditionEntry target) { + + } + + @Override + protected void updateToPass(ConditionEntry target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + AgeObservation ob = CCDFactory.eINSTANCE.createAgeObservation().init(); + er.setObservation(ob); + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConditionEntryOperations.validateConditionEntryAgeObservation( + (ConditionEntry) objectToTest, diagnostician, map); + } + + }; + + validateConditionEntryAgeObservationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConditionEntryProblemStatusObservation() { + OperationsTestCase validateConditionEntryProblemStatusObservationTestCase = new OperationsTestCase( + "validateConditionEntryProblemStatusObservation", + operationsForOCL.getOCLValue("VALIDATE_CONDITION_ENTRY_PROBLEM_STATUS_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConditionEntry target) { + + } + + @Override + protected void updateToPass(ConditionEntry target) { + + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + ProblemStatusObservation ob = IHEFactory.eINSTANCE.createProblemStatusObservation().init(); + er.setObservation(ob); + er.setTypeCode(x_ActRelationshipEntryRelationship.REFR); + + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConditionEntryOperations.validateConditionEntryProblemStatusObservation( + (ConditionEntry) objectToTest, diagnostician, map); + } + + }; + + validateConditionEntryProblemStatusObservationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConditionEntryCauseOfDeathObservation() { + OperationsTestCase validateConditionEntryCauseOfDeathObservationTestCase = new OperationsTestCase( + "validateConditionEntryCauseOfDeathObservation", + operationsForOCL.getOCLValue("VALIDATE_CONDITION_ENTRY_CAUSE_OF_DEATH_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConditionEntry target) { + + } + + @Override + protected void updateToPass(ConditionEntry target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + CauseOfDeathObservation codo = CCDFactory.eINSTANCE.createCauseOfDeathObservation().init(); + er.setObservation(codo); + er.setTypeCode(x_ActRelationshipEntryRelationship.CAUS); + + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConditionEntryOperations.validateConditionEntryCauseOfDeathObservation( + (ConditionEntry) objectToTest, diagnostician, map); + } + + }; + + validateConditionEntryCauseOfDeathObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetHITSPAgeObservation() { + + ConditionEntry target = objectFactory.create(); + target.getHITSPAgeObservation(); + + } + + /** + * + * @generated + */ + @Test + public void testGetHITSPProblemStatusObservation() { + + ConditionEntry target = objectFactory.create(); + target.getHITSPProblemStatusObservation(); + + } + + /** + * + * @generated + */ + @Test + public void testGetCauseOfDeathObservation() { + + ConditionEntry target = objectFactory.create(); + target.getCauseOfDeathObservation(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProblemEntryValue() { + OperationsTestCase validateProblemEntryValueTestCase = new OperationsTestCase( + "validateProblemEntryValue", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_ENTRY_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(ConditionEntry target) { + + } + + @Override + protected void updateToPass(ConditionEntry target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD(); + value.setCode("111"); + value.setCodeSystem("2.16.840.1.113883.6.96"); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemEntryOperations.validateProblemEntryValue( + (ConditionEntry) objectToTest, diagnostician, map); + } + + }; + + validateProblemEntryValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ConditionEntryOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public ConditionEntry create() { + return HITSPFactory.eINSTANCE.createConditionEntry(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends ConditionEntryOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ConditionEntryOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/ConditionTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/ConditionTest.java new file mode 100644 index 000000000..47c1b4338 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/ConditionTest.java @@ -0,0 +1,328 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.AssignedEntity; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.Performer2; +import org.openhealthtools.mdht.uml.cda.hitsp.Condition; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.ConditionOperations; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.ProblemEntry; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * A static utility class that provides operations + * related to 'Condition' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Condition#validateConditionHasTreatingProvider(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Condition Has Treating Provider}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Condition#validateConditionHasProviderId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Condition Has Provider Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Condition#validateConditionHasProviderTreatmentTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Condition Has Provider Treatment Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Condition#validateConditionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Condition Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Condition#validateConditionConditionEntry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Condition Condition Entry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Condition#createConditionEntry() Create Condition Entry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Condition#getConditionEntries() Get Condition Entries}
  • + *
+ *

+ * + * @generated + */ + +public class ConditionTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateConditionHasTreatingProvider() { + OperationsTestCase validateConditionHasTreatingProviderTestCase = new OperationsTestCase( + "validateConditionHasTreatingProvider", + operationsForOCL.getOCLValue("VALIDATE_CONDITION_HAS_TREATING_PROVIDER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Condition target) { + + } + + @Override + protected void updateToPass(Condition target) { + target.init(); + + Performer2 p2 = CDAFactory.eINSTANCE.createPerformer2(); + target.getPerformers().add(p2); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConditionOperations.validateConditionHasTreatingProvider( + (Condition) objectToTest, diagnostician, map); + } + + }; + + validateConditionHasTreatingProviderTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConditionHasProviderId() { + OperationsTestCase validateConditionHasProviderIdTestCase = new OperationsTestCase( + "validateConditionHasProviderId", + operationsForOCL.getOCLValue("VALIDATE_CONDITION_HAS_PROVIDER_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Condition target) { + + } + + @Override + protected void updateToPass(Condition target) { + target.init(); + + Performer2 p2 = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + II ii = DatatypesFactory.eINSTANCE.createII(); + ae.getIds().add(ii); + p2.setAssignedEntity(ae); + target.getPerformers().add(p2); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConditionOperations.validateConditionHasProviderId((Condition) objectToTest, diagnostician, map); + } + + }; + + validateConditionHasProviderIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConditionHasProviderTreatmentTime() { + OperationsTestCase validateConditionHasProviderTreatmentTimeTestCase = new OperationsTestCase( + "validateConditionHasProviderTreatmentTime", + operationsForOCL.getOCLValue("VALIDATE_CONDITION_HAS_PROVIDER_TREATMENT_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Condition target) { + + } + + @Override + protected void updateToPass(Condition target) { + target.init(); + + Performer2 p2 = CDAFactory.eINSTANCE.createPerformer2(); + target.getPerformers().add(p2); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConditionOperations.validateConditionHasProviderTreatmentTime( + (Condition) objectToTest, diagnostician, map); + } + + }; + + validateConditionHasProviderTreatmentTimeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateConditionTemplateId() { + OperationsTestCase validateConditionTemplateIdTestCase = new OperationsTestCase( + "validateConditionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_CONDITION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Condition target) { + + } + + @Override + protected void updateToPass(Condition target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConditionOperations.validateConditionTemplateId((Condition) objectToTest, diagnostician, map); + } + + }; + + validateConditionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConditionConditionEntry() { + OperationsTestCase validateConditionConditionEntryTestCase = new OperationsTestCase( + "validateConditionConditionEntry", + operationsForOCL.getOCLValue("VALIDATE_CONDITION_CONDITION_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Condition target) { + + } + + @Override + protected void updateToPass(Condition target) { + target.init(); + + // ConditionEntry obv = HITSPFactory.eINSTANCE.createConditionEntry().init(); + + ProblemEntry obv = IHEFactory.eINSTANCE.createProblemEntry().init(); + + target.addObservation(obv); + + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + er.setInversionInd(false); + + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConditionOperations.validateConditionConditionEntry((Condition) objectToTest, diagnostician, map); + } + + }; + + validateConditionConditionEntryTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetConditionEntries() { + + Condition target = objectFactory.create(); + target.getConditionEntries(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ConditionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public Condition create() { + return HITSPFactory.eINSTANCE.createCondition(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends ConditionOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ConditionOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/DiagnosticResultsSectionTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/DiagnosticResultsSectionTest.java new file mode 100644 index 000000000..6f36285a4 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/DiagnosticResultsSectionTest.java @@ -0,0 +1,316 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.hitsp.DiagnosticResultsSection; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.DiagnosticResultsSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Diagnostic Results Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DiagnosticResultsSection#validateDiagnosticResultsSectionHasResult(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Diagnostic Results Section Has Result}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DiagnosticResultsSection#validateDiagnosticResultsSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Diagnostic Results Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DiagnosticResultsSection#validateDiagnosticResultsSectionDiagnosticProcedure(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Diagnostic Results Section Diagnostic Procedure}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DiagnosticResultsSection#validateDiagnosticResultsSectionResult(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Diagnostic Results Section Result}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DiagnosticResultsSection#validateDiagnosticResultsSectionResultOrganizer(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Diagnostic Results Section Result Organizer}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DiagnosticResultsSection#getDiagnosticProcedures() Get Diagnostic Procedures}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DiagnosticResultsSection#getResults() Get Results}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DiagnosticResultsSection#getResultOrganizers() Get Result Organizers}
  • + *
+ *

+ * + * @generated + */ + +public class DiagnosticResultsSectionTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateDiagnosticResultsSectionHasResult() { + OperationsTestCase validateDiagnosticResultsSectionHasResultTestCase = new OperationsTestCase( + "validateDiagnosticResultsSectionHasResult", + operationsForOCL.getOCLValue("VALIDATE_DIAGNOSTIC_RESULTS_SECTION_HAS_RESULT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DiagnosticResultsSection target) { + target.init(); + } + + @Override + protected void updateToPass(DiagnosticResultsSection target) { + target.addObservation(HITSPFactory.eINSTANCE.createResult().init()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DiagnosticResultsSectionOperations.validateDiagnosticResultsSectionHasResult( + (DiagnosticResultsSection) objectToTest, diagnostician, map); + } + + }; + + validateDiagnosticResultsSectionHasResultTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDiagnosticResultsSectionTemplateId() { + OperationsTestCase validateDiagnosticResultsSectionTemplateIdTestCase = new OperationsTestCase( + "validateDiagnosticResultsSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_DIAGNOSTIC_RESULTS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DiagnosticResultsSection target) { + + } + + @Override + protected void updateToPass(DiagnosticResultsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DiagnosticResultsSectionOperations.validateDiagnosticResultsSectionTemplateId( + (DiagnosticResultsSection) objectToTest, diagnostician, map); + } + + }; + + validateDiagnosticResultsSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDiagnosticResultsSectionDiagnosticProcedure() { + OperationsTestCase validateDiagnosticResultsSectionDiagnosticProcedureTestCase = new OperationsTestCase( + "validateDiagnosticResultsSectionDiagnosticProcedure", + operationsForOCL.getOCLValue("VALIDATE_DIAGNOSTIC_RESULTS_SECTION_DIAGNOSTIC_PROCEDURE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DiagnosticResultsSection target) { + target.init(); + } + + @Override + protected void updateToPass(DiagnosticResultsSection target) { + target.addProcedure(HITSPFactory.eINSTANCE.createPastProcedure().init()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DiagnosticResultsSectionOperations.validateDiagnosticResultsSectionDiagnosticProcedure( + (DiagnosticResultsSection) objectToTest, diagnostician, map); + } + + }; + + validateDiagnosticResultsSectionDiagnosticProcedureTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDiagnosticResultsSectionResult() { + OperationsTestCase validateDiagnosticResultsSectionResultTestCase = new OperationsTestCase( + "validateDiagnosticResultsSectionResult", + operationsForOCL.getOCLValue("VALIDATE_DIAGNOSTIC_RESULTS_SECTION_RESULT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DiagnosticResultsSection target) { + target.init(); + } + + @Override + protected void updateToPass(DiagnosticResultsSection target) { + target.addObservation(HITSPFactory.eINSTANCE.createResult().init()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DiagnosticResultsSectionOperations.validateDiagnosticResultsSectionResult( + (DiagnosticResultsSection) objectToTest, diagnostician, map); + } + + }; + + validateDiagnosticResultsSectionResultTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateDiagnosticResultsSectionResultOrganizer() { + OperationsTestCase validateDiagnosticResultsSectionResultOrganizerTestCase = new OperationsTestCase( + "validateDiagnosticResultsSectionResultOrganizer", + operationsForOCL.getOCLValue("VALIDATE_DIAGNOSTIC_RESULTS_SECTION_RESULT_ORGANIZER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DiagnosticResultsSection target) { + target.init(); + } + + @Override + protected void updateToPass(DiagnosticResultsSection target) { + target.addOrganizer(HITSPFactory.eINSTANCE.createResultOrganizer().init()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DiagnosticResultsSectionOperations.validateDiagnosticResultsSectionResultOrganizer( + (DiagnosticResultsSection) objectToTest, diagnostician, map); + } + + }; + + validateDiagnosticResultsSectionResultOrganizerTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetDiagnosticProcedures() { + + DiagnosticResultsSection target = objectFactory.create(); + target.getDiagnosticProcedures(); + + } + + /** + * + * @generated + */ + @Test + public void testGetResults() { + + DiagnosticResultsSection target = objectFactory.create(); + target.getResults(); + + } + + /** + * + * @generated + */ + @Test + public void testGetResultOrganizers() { + + DiagnosticResultsSection target = objectFactory.create(); + target.getResultOrganizers(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends DiagnosticResultsSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public DiagnosticResultsSection create() { + return HITSPFactory.eINSTANCE.createDiagnosticResultsSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends DiagnosticResultsSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // DiagnosticResultsSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/DischargeDiagnosisSectionTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/DischargeDiagnosisSectionTest.java new file mode 100644 index 000000000..23e84a99c --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/DischargeDiagnosisSectionTest.java @@ -0,0 +1,196 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.hitsp.Condition; +import org.openhealthtools.mdht.uml.cda.hitsp.DischargeDiagnosisSection; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.DischargeDiagnosisSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Discharge Diagnosis Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DischargeDiagnosisSection#validateHITSPDischargeDiagnosisSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Discharge Diagnosis Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DischargeDiagnosisSection#validateHITSPDischargeDiagnosisSectionCondition(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Discharge Diagnosis Section Condition}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DischargeDiagnosisSection#getCondition() Get Condition}
  • + *
+ *

+ * + * @generated + */ + +public class DischargeDiagnosisSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHITSPDischargeDiagnosisSectionTemplateId() { + OperationsTestCase validateHITSPDischargeDiagnosisSectionTemplateIdTestCase = new OperationsTestCase( + "validateHITSPDischargeDiagnosisSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HITSP_DISCHARGE_DIAGNOSIS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeDiagnosisSection target) { + + } + + @Override + protected void updateToPass(DischargeDiagnosisSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeDiagnosisSectionOperations.validateHITSPDischargeDiagnosisSectionTemplateId( + (DischargeDiagnosisSection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPDischargeDiagnosisSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHITSPDischargeDiagnosisSectionCondition() { + OperationsTestCase validateHITSPDischargeDiagnosisSectionConditionTestCase = new OperationsTestCase( + "validateHITSPDischargeDiagnosisSectionCondition", + operationsForOCL.getOCLValue("VALIDATE_HITSP_DISCHARGE_DIAGNOSIS_SECTION_CONDITION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeDiagnosisSection target) { + + } + + @Override + protected void updateToPass(DischargeDiagnosisSection target) { + target.init(); + + Condition condition = HITSPFactory.eINSTANCE.createCondition().init(); + target.addAct(condition); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeDiagnosisSectionOperations.validateHITSPDischargeDiagnosisSectionCondition( + (DischargeDiagnosisSection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPDischargeDiagnosisSectionConditionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetCondition() { + + DischargeDiagnosisSection target = objectFactory.create(); + target.getCondition(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends DischargeDiagnosisSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public DischargeDiagnosisSection create() { + return HITSPFactory.eINSTANCE.createDischargeDiagnosisSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends DischargeDiagnosisSectionOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // DischargeDiagnosisSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/DischargeSummaryTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/DischargeSummaryTest.java new file mode 100644 index 000000000..e2cebcafe --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/DischargeSummaryTest.java @@ -0,0 +1,1189 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.hitsp.AdmissionMedicationHistorySection; +import org.openhealthtools.mdht.uml.cda.hitsp.AdvanceDirectivesSection; +import org.openhealthtools.mdht.uml.cda.hitsp.AllergiesReactionsSection; +import org.openhealthtools.mdht.uml.cda.hitsp.DiagnosticResultsSection; +import org.openhealthtools.mdht.uml.cda.hitsp.DischargeDiagnosisSection; +import org.openhealthtools.mdht.uml.cda.hitsp.DischargeSummary; +import org.openhealthtools.mdht.uml.cda.hitsp.FunctionalStatusSection; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.HistoryOfPastIllnessSection; +import org.openhealthtools.mdht.uml.cda.hitsp.HospitalAdmissionDiagnosisSection; +import org.openhealthtools.mdht.uml.cda.hitsp.HospitalCourseSection; +import org.openhealthtools.mdht.uml.cda.hitsp.HospitalDischargeMedicationsSection; +import org.openhealthtools.mdht.uml.cda.hitsp.MedicalEquipmentSection; +import org.openhealthtools.mdht.uml.cda.hitsp.MedicationsAdministeredSection; +import org.openhealthtools.mdht.uml.cda.hitsp.PhysicalExamSection; +import org.openhealthtools.mdht.uml.cda.hitsp.PlanOfCareSection; +import org.openhealthtools.mdht.uml.cda.hitsp.ProblemListSection; +import org.openhealthtools.mdht.uml.cda.hitsp.ReviewOfSystemsSection; +import org.openhealthtools.mdht.uml.cda.hitsp.VitalSignsSection; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.DischargeSummaryOperations; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Discharge Summary' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DischargeSummary#validateDischargeSummaryProblemListSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Problem List Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DischargeSummary#validateDischargeSummaryAdmissionMedicationHistorySection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Admission Medication History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DischargeSummary#validateDischargeSummaryHospitalAdmissionDiagnosisSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Hospital Admission Diagnosis Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DischargeSummary#validateDischargeSummaryAdvanceDirectivesSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Advance Directives Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DischargeSummary#validateDischargeSummaryAllergiesReactionsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Allergies Reactions Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DischargeSummary#validateDischargeSummaryDischargeDiagnosisSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Discharge Diagnosis Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DischargeSummary#validateDischargeSummaryDischargeDiet(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Discharge Diet}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DischargeSummary#validateDischargeSummaryHospitalDischargeMedicationsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Hospital Discharge Medications Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DischargeSummary#validateDischargeSummaryDiagnosticResultsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Diagnostic Results Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DischargeSummary#validateDischargeSummaryFunctionalStatusSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Functional Status Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DischargeSummary#validateDischargeSummaryHistoryOfPresentIllness(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary History Of Present Illness}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DischargeSummary#validateDischargeSummaryHospitalCourseSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Hospital Course Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DischargeSummary#validateDischargeSummaryMedicalEquipmentSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Medical Equipment Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DischargeSummary#validateDischargeSummaryPhysicalExamSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Physical Exam Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DischargeSummary#validateDischargeSummaryPlanOfCareSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Plan Of Care Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DischargeSummary#validateDischargeSummaryHistoryOfPastIllnessSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary History Of Past Illness Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DischargeSummary#validateDischargeSummaryReviewOfSystemsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Review Of Systems Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DischargeSummary#validateDischargeSummaryMedicationsAdministeredSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Medications Administered Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DischargeSummary#validateDischargeSummaryVitalSignsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Vital Signs Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DischargeSummary#getProblemListSection() Get Problem List Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DischargeSummary#getAdmissionMedicationHistorySection() Get Admission Medication History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DischargeSummary#getHospitalAdmissionDiagnosisSection() Get Hospital Admission Diagnosis Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DischargeSummary#getAdvanceDirectivesSection() Get Advance Directives Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DischargeSummary#getAllergiesReactionsSection() Get Allergies Reactions Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DischargeSummary#getDischargeDiagnosisSection() Get Discharge Diagnosis Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DischargeSummary#getDischargeDiet() Get Discharge Diet}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DischargeSummary#getHospitalDischargeMedicationsSection() Get Hospital Discharge Medications Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DischargeSummary#getDiagnosticResultsSection() Get Diagnostic Results Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DischargeSummary#getFunctionalStatusSection() Get Functional Status Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DischargeSummary#getHistoryOfPresentIllness() Get History Of Present Illness}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DischargeSummary#getHospitalCourseSection() Get Hospital Course Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DischargeSummary#getMedicalEquipmentSection() Get Medical Equipment Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DischargeSummary#getPhysicalExamSection() Get Physical Exam Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DischargeSummary#getPlanOfCareSection() Get Plan Of Care Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DischargeSummary#getHistoryOfPastIllnessSection() Get History Of Past Illness Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DischargeSummary#getReviewOfSystemsSection() Get Review Of Systems Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DischargeSummary#getMedicationsAdministeredSection() Get Medications Administered Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DischargeSummary#getVitalSignsSection() Get Vital Signs Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.DischargeSummary#validateMedicalSummaryTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medical Summary Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class DischargeSummaryTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryProblemListSection() { + OperationsTestCase validateDischargeSummaryProblemListSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryProblemListSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_PROBLEM_LIST_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* ProblemListSection */ + ProblemListSection section = + + HITSPFactory.eINSTANCE.createProblemListSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryProblemListSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryProblemListSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryAdmissionMedicationHistorySection() { + OperationsTestCase validateDischargeSummaryAdmissionMedicationHistorySectionTestCase = new OperationsTestCase( + "validateDischargeSummaryAdmissionMedicationHistorySection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_ADMISSION_MEDICATION_HISTORY_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* AdmissionMedicationHistorySection */ + AdmissionMedicationHistorySection section = + + HITSPFactory.eINSTANCE.createAdmissionMedicationHistorySection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryAdmissionMedicationHistorySection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryAdmissionMedicationHistorySectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryHospitalAdmissionDiagnosisSection() { + OperationsTestCase validateDischargeSummaryHospitalAdmissionDiagnosisSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryHospitalAdmissionDiagnosisSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_HOSPITAL_ADMISSION_DIAGNOSIS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* HospitalAdmissionDiagnosisSection */ + HospitalAdmissionDiagnosisSection section = + + HITSPFactory.eINSTANCE.createHospitalAdmissionDiagnosisSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryHospitalAdmissionDiagnosisSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryHospitalAdmissionDiagnosisSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryAdvanceDirectivesSection() { + OperationsTestCase validateDischargeSummaryAdvanceDirectivesSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryAdvanceDirectivesSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_ADVANCE_DIRECTIVES_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* AdvanceDirectivesSection */ + AdvanceDirectivesSection section = + + HITSPFactory.eINSTANCE.createAdvanceDirectivesSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryAdvanceDirectivesSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryAdvanceDirectivesSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryAllergiesReactionsSection() { + OperationsTestCase validateDischargeSummaryAllergiesReactionsSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryAllergiesReactionsSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_ALLERGIES_REACTIONS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* AllergiesReactionsSection */ + AllergiesReactionsSection section = + + HITSPFactory.eINSTANCE.createAllergiesReactionsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryAllergiesReactionsSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryAllergiesReactionsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryDischargeDiagnosisSection() { + OperationsTestCase validateDischargeSummaryDischargeDiagnosisSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryDischargeDiagnosisSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_DISCHARGE_DIAGNOSIS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* DischargeDiagnosisSection */ + DischargeDiagnosisSection section = + + HITSPFactory.eINSTANCE.createDischargeDiagnosisSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryDischargeDiagnosisSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryDischargeDiagnosisSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateDischargeSummaryDischargeDiet() { + OperationsTestCase validateDischargeSummaryDischargeDietTestCase = new OperationsTestCase( + "validateDischargeSummaryDischargeDiet", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_DISCHARGE_DIET__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + target.addSection(IHEFactory.eINSTANCE.createDischargeDiet()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryDischargeDiet( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryDischargeDietTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryHospitalDischargeMedicationsSection() { + OperationsTestCase validateDischargeSummaryHospitalDischargeMedicationsSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryHospitalDischargeMedicationsSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_HOSPITAL_DISCHARGE_MEDICATIONS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* HospitalDischargeMedicationsSection */ + HospitalDischargeMedicationsSection section = + + HITSPFactory.eINSTANCE.createHospitalDischargeMedicationsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryHospitalDischargeMedicationsSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryHospitalDischargeMedicationsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryDiagnosticResultsSection() { + OperationsTestCase validateDischargeSummaryDiagnosticResultsSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryDiagnosticResultsSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_DIAGNOSTIC_RESULTS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* DiagnosticResultsSection */ + DiagnosticResultsSection section = + + HITSPFactory.eINSTANCE.createDiagnosticResultsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryDiagnosticResultsSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryDiagnosticResultsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryFunctionalStatusSection() { + OperationsTestCase validateDischargeSummaryFunctionalStatusSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryFunctionalStatusSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_FUNCTIONAL_STATUS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* FunctionalStatusSection */ + FunctionalStatusSection section = + + HITSPFactory.eINSTANCE.createFunctionalStatusSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryFunctionalStatusSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryFunctionalStatusSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateDischargeSummaryHistoryOfPresentIllness() { + OperationsTestCase validateDischargeSummaryHistoryOfPresentIllnessTestCase = new OperationsTestCase( + "validateDischargeSummaryHistoryOfPresentIllness", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_HISTORY_OF_PRESENT_ILLNESS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + target.addSection(HITSPFactory.eINSTANCE.createHistoryOfPresentIllness()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryHistoryOfPresentIllness( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryHistoryOfPresentIllnessTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryHospitalCourseSection() { + OperationsTestCase validateDischargeSummaryHospitalCourseSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryHospitalCourseSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_HOSPITAL_COURSE_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* HospitalCourseSection */ + HospitalCourseSection section = + + HITSPFactory.eINSTANCE.createHospitalCourseSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryHospitalCourseSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryHospitalCourseSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryMedicalEquipmentSection() { + OperationsTestCase validateDischargeSummaryMedicalEquipmentSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryMedicalEquipmentSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_MEDICAL_EQUIPMENT_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* MedicalEquipmentSection */ + MedicalEquipmentSection section = + + HITSPFactory.eINSTANCE.createMedicalEquipmentSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryMedicalEquipmentSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryMedicalEquipmentSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryPhysicalExamSection() { + OperationsTestCase validateDischargeSummaryPhysicalExamSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryPhysicalExamSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_PHYSICAL_EXAM_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* PhysicalExamSection */ + PhysicalExamSection section = + + HITSPFactory.eINSTANCE.createPhysicalExamSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryPhysicalExamSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryPhysicalExamSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryPlanOfCareSection() { + OperationsTestCase validateDischargeSummaryPlanOfCareSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryPlanOfCareSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_PLAN_OF_CARE_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* PlanOfCareSection */ + PlanOfCareSection section = + + HITSPFactory.eINSTANCE.createPlanOfCareSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryPlanOfCareSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryPlanOfCareSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryHistoryOfPastIllnessSection() { + OperationsTestCase validateDischargeSummaryHistoryOfPastIllnessSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryHistoryOfPastIllnessSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_HISTORY_OF_PAST_ILLNESS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* HistoryOfPastIllnessSection */ + HistoryOfPastIllnessSection section = + + HITSPFactory.eINSTANCE.createHistoryOfPastIllnessSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryHistoryOfPastIllnessSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryHistoryOfPastIllnessSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryReviewOfSystemsSection() { + OperationsTestCase validateDischargeSummaryReviewOfSystemsSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryReviewOfSystemsSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_REVIEW_OF_SYSTEMS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* ReviewOfSystemsSection */ + ReviewOfSystemsSection section = + + HITSPFactory.eINSTANCE.createReviewOfSystemsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryReviewOfSystemsSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryReviewOfSystemsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryMedicationsAdministeredSection() { + OperationsTestCase validateDischargeSummaryMedicationsAdministeredSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryMedicationsAdministeredSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_MEDICATIONS_ADMINISTERED_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* MedicationsAdministeredSection */ + MedicationsAdministeredSection section = + + HITSPFactory.eINSTANCE.createMedicationsAdministeredSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryMedicationsAdministeredSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryMedicationsAdministeredSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryVitalSignsSection() { + OperationsTestCase validateDischargeSummaryVitalSignsSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryVitalSignsSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_VITAL_SIGNS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* VitalSignsSection */ + VitalSignsSection section = + + HITSPFactory.eINSTANCE.createVitalSignsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryVitalSignsSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryVitalSignsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemListSection() { + + DischargeSummary target = objectFactory.create(); + target.getProblemListSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetAdmissionMedicationHistorySection() { + + DischargeSummary target = objectFactory.create(); + target.getAdmissionMedicationHistorySection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetHospitalAdmissionDiagnosisSection() { + + DischargeSummary target = objectFactory.create(); + target.getHospitalAdmissionDiagnosisSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetAdvanceDirectivesSection() { + + DischargeSummary target = objectFactory.create(); + target.getAdvanceDirectivesSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetAllergiesReactionsSection() { + + DischargeSummary target = objectFactory.create(); + target.getAllergiesReactionsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetDischargeDiagnosisSection() { + + DischargeSummary target = objectFactory.create(); + target.getDischargeDiagnosisSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetDischargeDiet() { + + DischargeSummary target = objectFactory.create(); + target.getDischargeDiet(); + + } + + /** + * + * @generated + */ + @Test + public void testGetHospitalDischargeMedicationsSection() { + + DischargeSummary target = objectFactory.create(); + target.getHospitalDischargeMedicationsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetDiagnosticResultsSection() { + + DischargeSummary target = objectFactory.create(); + target.getDiagnosticResultsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetFunctionalStatusSection() { + + DischargeSummary target = objectFactory.create(); + target.getFunctionalStatusSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetHistoryOfPresentIllness() { + + DischargeSummary target = objectFactory.create(); + target.getHistoryOfPresentIllness(); + + } + + /** + * + * @generated + */ + @Test + public void testGetHospitalCourseSection() { + + DischargeSummary target = objectFactory.create(); + target.getHospitalCourseSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetMedicalEquipmentSection() { + + DischargeSummary target = objectFactory.create(); + target.getMedicalEquipmentSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPhysicalExamSection() { + + DischargeSummary target = objectFactory.create(); + target.getPhysicalExamSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPlanOfCareSection() { + + DischargeSummary target = objectFactory.create(); + target.getPlanOfCareSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetHistoryOfPastIllnessSection() { + + DischargeSummary target = objectFactory.create(); + target.getHistoryOfPastIllnessSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetReviewOfSystemsSection() { + + DischargeSummary target = objectFactory.create(); + target.getReviewOfSystemsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetMedicationsAdministeredSection() { + + DischargeSummary target = objectFactory.create(); + target.getMedicationsAdministeredSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetVitalSignsSection() { + + DischargeSummary target = objectFactory.create(); + target.getVitalSignsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicalSummaryTemplateId() { + OperationsTestCase validateMedicalSummaryTemplateIdTestCase = new OperationsTestCase( + "validateMedicalSummaryTemplateId", + operationsForOCL.getOCLValue("VALIDATE_MEDICAL_SUMMARY_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateMedicalSummaryTemplateId( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateMedicalSummaryTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends DischargeSummaryOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public DischargeSummary create() { + return HITSPFactory.eINSTANCE.createDischargeSummary(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends DischargeSummaryOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // DischargeSummaryOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/EncounterTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/EncounterTest.java new file mode 100644 index 000000000..33307674a --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/EncounterTest.java @@ -0,0 +1,241 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Participant2; +import org.openhealthtools.mdht.uml.cda.ParticipantRole; +import org.openhealthtools.mdht.uml.cda.hitsp.Encounter; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.EncounterOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.vocab.ParticipationType; + +/** + * A static utility class that provides operations + * related to 'Encounter' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Encounter#validateHITSPEncounterAdmissionSourceValueSet(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Encounter Admission Source Value Set}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Encounter#validateHITSPEncounterTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Encounter Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Encounter#validateHITSPEncounterCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Encounter Code}
  • + *
+ *

+ * + * @generated + */ + +public class EncounterTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateHITSPEncounterAdmissionSourceValueSet() { + OperationsTestCase validateHITSPEncounterAdmissionSourceValueSetTestCase = new OperationsTestCase( + "validateHITSPEncounterAdmissionSourceValueSet", + operationsForOCL.getOCLValue("VALIDATE_HITSP_ENCOUNTER_ADMISSION_SOURCE_VALUE_SET__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Encounter target) { + + target.init(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setTypeCode(ParticipationType.ORG); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + + par.setParticipantRole(pr); + target.getParticipants().add(par); + + } + + @Override + protected void updateToPass(Encounter target) { + + for (Participant2 par : target.getParticipants()) + + { + + CE code = DatatypesFactory.eINSTANCE.createCE(); + code.setCodeSystem("2.16.840.1.113883.3.88.12.80.33"); + + par.getParticipantRole().setCode(code); + + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncounterOperations.validateHITSPEncounterAdmissionSourceValueSet( + (Encounter) objectToTest, diagnostician, map); + } + + }; + + validateHITSPEncounterAdmissionSourceValueSetTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHITSPEncounterTemplateId() { + OperationsTestCase validateHITSPEncounterTemplateIdTestCase = new OperationsTestCase( + "validateHITSPEncounterTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HITSP_ENCOUNTER_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Encounter target) { + + } + + @Override + protected void updateToPass(Encounter target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncounterOperations.validateHITSPEncounterTemplateId( + (Encounter) objectToTest, diagnostician, map); + } + + }; + + validateHITSPEncounterTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHITSPEncounterCode() { + OperationsTestCase validateHITSPEncounterCodeTestCase = new OperationsTestCase( + "validateHITSPEncounterCode", + operationsForOCL.getOCLValue("VALIDATE_HITSP_ENCOUNTER_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Encounter target) { + target.init(); + + } + + @Override + protected void updateToPass(Encounter target) { + CD cd = DatatypesFactory.eINSTANCE.createCD(); + cd.setCode("8310-5"); + cd.setCodeSystem("2.16.840.1.113883.6.12"); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncounterOperations.validateHITSPEncounterCode((Encounter) objectToTest, diagnostician, map); + } + + }; + + validateHITSPEncounterCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends EncounterOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public Encounter create() { + return HITSPFactory.eINSTANCE.createEncounter(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends EncounterOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // EncounterOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/EncountersSectionTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/EncountersSectionTest.java new file mode 100644 index 000000000..b3819c854 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/EncountersSectionTest.java @@ -0,0 +1,195 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.hitsp.Encounter; +import org.openhealthtools.mdht.uml.cda.hitsp.EncountersSection; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.EncountersSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Encounters Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.EncountersSection#validateHITSPEncountersSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Encounters Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.EncountersSection#validateHITSPEncountersSectionEncounterEntry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Encounters Section Encounter Entry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.EncountersSection#getHITSPEncounterEntries() Get HITSP Encounter Entries}
  • + *
+ *

+ * + * @generated + */ + +public class EncountersSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHITSPEncountersSectionTemplateId() { + OperationsTestCase validateHITSPEncountersSectionTemplateIdTestCase = new OperationsTestCase( + "validateHITSPEncountersSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HITSP_ENCOUNTERS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncountersSection target) { + + } + + @Override + protected void updateToPass(EncountersSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncountersSectionOperations.validateHITSPEncountersSectionTemplateId( + (EncountersSection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPEncountersSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHITSPEncountersSectionEncounterEntry() { + OperationsTestCase validateHITSPEncountersSectionEncounterEntryTestCase = new OperationsTestCase( + "validateHITSPEncountersSectionEncounterEntry", + operationsForOCL.getOCLValue("VALIDATE_HITSP_ENCOUNTERS_SECTION_ENCOUNTER_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncountersSection target) { + + } + + @Override + protected void updateToPass(EncountersSection target) { + target.init(); + Encounter encounter = HITSPFactory.eINSTANCE.createEncounter().init(); + target.addEncounter(encounter); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncountersSectionOperations.validateHITSPEncountersSectionEncounterEntry( + (EncountersSection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPEncountersSectionEncounterEntryTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetHITSPEncounterEntries() { + + EncountersSection target = objectFactory.create(); + target.getHITSPEncounterEntries(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends EncountersSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public EncountersSection create() { + return HITSPFactory.eINSTANCE.createEncountersSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends EncountersSectionOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // EncountersSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/FamilyHistorySectionTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/FamilyHistorySectionTest.java new file mode 100644 index 000000000..32e685087 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/FamilyHistorySectionTest.java @@ -0,0 +1,196 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.hitsp.FamilyHistory; +import org.openhealthtools.mdht.uml.cda.hitsp.FamilyHistorySection; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.FamilyHistorySectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Family History Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.FamilyHistorySection#validateHITSPFamilyHistorySectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Family History Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.FamilyHistorySection#validateHITSPFamilyHistorySectionFamilyHistory(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Family History Section Family History}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.FamilyHistorySection#getFamilyHistories() Get Family Histories}
  • + *
+ *

+ * + * @generated + */ + +public class FamilyHistorySectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHITSPFamilyHistorySectionTemplateId() { + OperationsTestCase validateHITSPFamilyHistorySectionTemplateIdTestCase = new OperationsTestCase( + "validateHITSPFamilyHistorySectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HITSP_FAMILY_HISTORY_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistorySection target) { + + } + + @Override + protected void updateToPass(FamilyHistorySection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistorySectionOperations.validateHITSPFamilyHistorySectionTemplateId( + (FamilyHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPFamilyHistorySectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHITSPFamilyHistorySectionFamilyHistory() { + OperationsTestCase validateHITSPFamilyHistorySectionFamilyHistoryTestCase = new OperationsTestCase( + "validateHITSPFamilyHistorySectionFamilyHistory", + operationsForOCL.getOCLValue("VALIDATE_HITSP_FAMILY_HISTORY_SECTION_FAMILY_HISTORY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistorySection target) { + + } + + @Override + protected void updateToPass(FamilyHistorySection target) { + target.init(); + + FamilyHistory familyHistory = HITSPFactory.eINSTANCE.createFamilyHistory().init(); + target.addOrganizer(familyHistory); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistorySectionOperations.validateHITSPFamilyHistorySectionFamilyHistory( + (FamilyHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPFamilyHistorySectionFamilyHistoryTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetFamilyHistories() { + + FamilyHistorySection target = objectFactory.create(); + target.getFamilyHistories(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends FamilyHistorySectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public FamilyHistorySection create() { + return HITSPFactory.eINSTANCE.createFamilyHistorySection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends FamilyHistorySectionOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // FamilyHistorySectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/FamilyHistoryTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/FamilyHistoryTest.java new file mode 100644 index 000000000..a70fec19a --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/FamilyHistoryTest.java @@ -0,0 +1,408 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.RelatedSubject; +import org.openhealthtools.mdht.uml.cda.Subject; +import org.openhealthtools.mdht.uml.cda.SubjectPerson; +import org.openhealthtools.mdht.uml.cda.hitsp.FamilyHistory; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.FamilyHistoryOperations; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; + +/** + * + * A static utility class that provides operations related to 'Family History' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.FamilyHistory#validateFamilyHistoryRelatedSubjectCodeValueSet(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Related Subject Code Value Set}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.FamilyHistory#validateFamilyHistoryHasSDTCid(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Has SDT Cid}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.FamilyHistory#validateFamilyHistoryHasFamilyName(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Has Family Name}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.FamilyHistory#validateFamilyHistoryHasGenderCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Has Gender Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.FamilyHistory#validateFamilyHistoryFamilyMemberCondition(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Family Member Condition}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.FamilyHistory#validateFamilyHistoryTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.FamilyHistory#validateFamilyHistoryProblemStatusObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family History Problem Status Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.FamilyHistory#getProblemStatusObservations() Get Problem Status Observations}
  • + *
+ *

+ * + * @generated + */ + +public class FamilyHistoryTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateFamilyHistoryRelatedSubjectCodeValueSet() { + OperationsTestCase validateFamilyHistoryRelatedSubjectCodeValueSetTestCase = new OperationsTestCase( + "validateFamilyHistoryRelatedSubjectCodeValueSet", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_RELATED_SUBJECT_CODE_VALUE_SET__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistory target) { + + } + + @Override + protected void updateToPass(FamilyHistory target) { + target.init(); + Subject sub = CDAFactory.eINSTANCE.createSubject(); + target.setSubject(sub); + RelatedSubject rs = CDAFactory.eINSTANCE.createRelatedSubject(); + CE code = DatatypesFactory.eINSTANCE.createCE(); + code.setCodeSystem("2.16.840.1.113883.5.111"); + rs.setCode(code); + sub.setRelatedSubject(rs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryOperations.validateFamilyHistoryRelatedSubjectCodeValueSet( + (FamilyHistory) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryRelatedSubjectCodeValueSetTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateFamilyHistoryHasSDTCid() { + OperationsTestCase validateFamilyHistoryHasSDTCidTestCase = new OperationsTestCase( + "validateFamilyHistoryHasSDTCid", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_HAS_SDT_CID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistory target) { + target.init(); + } + + @Override + protected void updateToPass(FamilyHistory target) { + Subject subject = CDAFactory.eINSTANCE.createSubject(); + RelatedSubject rs = CDAFactory.eINSTANCE.createRelatedSubject(); + SubjectPerson sp = CDAFactory.eINSTANCE.createSubjectPerson(); + sp.getSDTCIds().add(DatatypesFactory.eINSTANCE.createII()); + rs.setSubject(sp); + subject.setRelatedSubject(rs); + + target.setSubject(subject); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryOperations.validateFamilyHistoryHasSDTCid( + (FamilyHistory) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryHasSDTCidTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateFamilyHistoryHasFamilyName() { + OperationsTestCase validateFamilyHistoryHasFamilyNameTestCase = new OperationsTestCase( + "validateFamilyHistoryHasFamilyName", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_HAS_FAMILY_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistory target) { + + } + + @Override + protected void updateToPass(FamilyHistory target) { + target.init(); + + Subject sub = CDAFactory.eINSTANCE.createSubject(); + SubjectPerson sp = CDAFactory.eINSTANCE.createSubjectPerson(); + + target.setSubject(sub); + RelatedSubject rs = CDAFactory.eINSTANCE.createRelatedSubject(); + + rs.setSubject(sp); + sp.getNames().add(DatatypesFactory.eINSTANCE.createPN()); + sub.setRelatedSubject(rs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryOperations.validateFamilyHistoryHasFamilyName( + (FamilyHistory) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryHasFamilyNameTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateFamilyHistoryHasGenderCode() { + OperationsTestCase validateFamilyHistoryHasGenderCodeTestCase = new OperationsTestCase( + "validateFamilyHistoryHasGenderCode", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_HAS_GENDER_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistory target) { + + } + + @Override + protected void updateToPass(FamilyHistory target) { + target.init(); + + Subject sub = CDAFactory.eINSTANCE.createSubject(); + SubjectPerson sp = CDAFactory.eINSTANCE.createSubjectPerson(); + CE agc = DatatypesFactory.eINSTANCE.createCE(); + agc.setCodeSystem("2.16.840.1.113883.5.1"); + agc.setCode("F"); + sp.setAdministrativeGenderCode(agc); + sp.getNames().add(DatatypesFactory.eINSTANCE.createPN()); + + RelatedSubject rs = CDAFactory.eINSTANCE.createRelatedSubject(); + + rs.setSubject(sp); + + sub.setRelatedSubject(rs); + target.setSubject(sub); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryOperations.validateFamilyHistoryHasGenderCode( + (FamilyHistory) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryHasGenderCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateFamilyHistoryFamilyMemberCondition() { + OperationsTestCase validateFamilyHistoryFamilyMemberConditionTestCase = new OperationsTestCase( + "validateFamilyHistoryFamilyMemberCondition", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_FAMILY_MEMBER_CONDITION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistory target) { + + } + + @Override + protected void updateToPass(FamilyHistory target) { + target.init(); + target.addObservation(IHEFactory.eINSTANCE.createFamilyHistoryObservation()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryOperations.validateFamilyHistoryFamilyMemberCondition( + (FamilyHistory) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryFamilyMemberConditionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateFamilyHistoryTemplateId() { + OperationsTestCase validateFamilyHistoryTemplateIdTestCase = new OperationsTestCase( + "validateFamilyHistoryTemplateId", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistory target) { + + } + + @Override + protected void updateToPass(FamilyHistory target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryOperations.validateFamilyHistoryTemplateId( + (FamilyHistory) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateFamilyHistoryProblemStatusObservation() { + OperationsTestCase validateFamilyHistoryProblemStatusObservationTestCase = new OperationsTestCase( + "validateFamilyHistoryProblemStatusObservation", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_HISTORY_PROBLEM_STATUS_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistory target) { + + } + + @Override + protected void updateToPass(FamilyHistory target) { + target.init(); + target.addObservation(IHEFactory.eINSTANCE.createProblemStatusObservation()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryOperations.validateFamilyHistoryProblemStatusObservation( + (FamilyHistory) objectToTest, diagnostician, map); + } + + }; + + validateFamilyHistoryProblemStatusObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemStatusObservations() { + + FamilyHistory target = objectFactory.create(); + target.getProblemStatusObservations(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends FamilyHistoryOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public FamilyHistory create() { + return HITSPFactory.eINSTANCE.createFamilyHistory(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends FamilyHistoryOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // FamilyHistoryOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/FunctionalStatusSectionTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/FunctionalStatusSectionTest.java new file mode 100644 index 000000000..f21ec8a30 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/FunctionalStatusSectionTest.java @@ -0,0 +1,144 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.hitsp.FunctionalStatusSection; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.FunctionalStatusSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Functional Status Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.FunctionalStatusSection#validateHITSPFunctionalStatusSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Functional Status Section Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class FunctionalStatusSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHITSPFunctionalStatusSectionTemplateId() { + OperationsTestCase validateHITSPFunctionalStatusSectionTemplateIdTestCase = new OperationsTestCase( + "validateHITSPFunctionalStatusSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HITSP_FUNCTIONAL_STATUS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusSection target) { + + } + + @Override + protected void updateToPass(FunctionalStatusSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusSectionOperations.validateHITSPFunctionalStatusSectionTemplateId( + (FunctionalStatusSection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPFunctionalStatusSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends FunctionalStatusSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public FunctionalStatusSection create() { + return HITSPFactory.eINSTANCE.createFunctionalStatusSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends FunctionalStatusSectionOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // FunctionalStatusSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/HITSPAllTests.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/HITSPAllTests.java new file mode 100644 index 000000000..f0256d0c5 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/HITSPAllTests.java @@ -0,0 +1,54 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import junit.framework.Test; +import junit.framework.TestSuite; +import junit.textui.TestRunner; + +/** + * + * A test suite for the 'HITSP' model. + * + * @generated + */ +public class HITSPAllTests extends TestSuite { + + /** + * + * + * @generated + */ + public static void main(String[] args) { + TestRunner.run(suite()); + } + + /** + * + * + * @generated + */ + public static Test suite() { + TestSuite suite = new HITSPAllTests("HITSP Tests"); + suite.addTest(HITSPTests.suite()); + return suite; + } + + /** + * + * + * @generated + */ + public HITSPAllTests(String name) { + super(name); + } + +} // HITSPAllTests diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/HITSPExample.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/HITSPExample.java new file mode 100644 index 000000000..926964562 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/HITSPExample.java @@ -0,0 +1,116 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.io.File; +import java.io.IOException; + +import org.eclipse.emf.common.util.Diagnostic; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; +import org.eclipse.emf.ecore.util.Diagnostician; +import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl; +import org.openhealthtools.mdht.uml.cda.hitsp.AllergyDrugSensitivity; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPPackage; + +/** + * A sample utility for the 'hitsp' + * package. + * @generated + */ +public class HITSPExample { + /** + * Load all the argument file paths or URIs as + * instances of the model. + * @param args the file paths or URIs. + * @generated + */ + public static void main(String[] args) { + // Create a resource set to hold the resources. + // + ResourceSet resourceSet = new ResourceSetImpl(); + + // Register the appropriate resource factory to handle all file extensions. + // + resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put( + Resource.Factory.Registry.DEFAULT_EXTENSION, new XMIResourceFactoryImpl()); + + // Register the package to ensure it is available during loading. + // + resourceSet.getPackageRegistry().put(HITSPPackage.eNS_URI, HITSPPackage.eINSTANCE); + + // If there are no arguments, emit an appropriate usage message. + // + if (args.length == 0) { + System.out.println("Enter a list of file paths or URIs that have content like this:"); + try { + Resource resource = resourceSet.createResource(URI.createURI("http:///My.hitsp")); + AllergyDrugSensitivity root = HITSPFactory.eINSTANCE.createAllergyDrugSensitivity(); + resource.getContents().add(root); + resource.save(System.out, null); + } catch (IOException exception) { + exception.printStackTrace(); + } + } else { + // Iterate over all the arguments. + // + for (int i = 0; i < args.length; ++i) { + // Construct the URI for the instance file. + // The argument is treated as a file path only if it denotes an existing file. + // Otherwise, it's directly treated as a URL. + // + File file = new File(args[i]); + URI uri = file.isFile() + ? URI.createFileURI(file.getAbsolutePath()) + : URI.createURI(args[i]); + + try { + // Demand load resource for this file. + // + Resource resource = resourceSet.getResource(uri, true); + System.out.println("Loaded " + uri); + + // Validate the contents of the loaded resource. + // + for (EObject eObject : resource.getContents()) { + Diagnostic diagnostic = Diagnostician.INSTANCE.validate(eObject); + if (diagnostic.getSeverity() != Diagnostic.OK) { + printDiagnostic(diagnostic, ""); + } + } + } catch (RuntimeException exception) { + System.out.println("Problem loading " + uri); + exception.printStackTrace(); + } + } + } + } + + /** + * Prints diagnostics with indentation. + * @param diagnostic the diagnostic to print. + * @param indent the indentation for printing. + * @generated + */ + protected static void printDiagnostic(Diagnostic diagnostic, String indent) { + System.out.print(indent); + System.out.println(diagnostic.getMessage()); + for (Diagnostic child : diagnostic.getChildren()) { + printDiagnostic(child, indent + " "); + } + } + +} // HITSPExample diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/HITSPRegistryDelegateTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/HITSPRegistryDelegateTest.java new file mode 100644 index 000000000..f65e00bad --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/HITSPRegistryDelegateTest.java @@ -0,0 +1,116 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPRegistryDelegate; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.HITSPRegistryDelegateOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Registry Delegate' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.RegistryDelegate#getEClass(java.lang.String, java.lang.Object) Get EClass}
  • + *
+ *

+ * + * @generated + */ + +public class HITSPRegistryDelegateTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testGetEClass() { + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends HITSPRegistryDelegateOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public HITSPRegistryDelegate create() { + return HITSPFactory.eINSTANCE.createHITSPRegistryDelegate(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends HITSPRegistryDelegateOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // HITSPRegistryDelegateOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/HITSPTests.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/HITSPTests.java new file mode 100644 index 000000000..9909e40e5 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/HITSPTests.java @@ -0,0 +1,59 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import junit.framework.JUnit4TestAdapter; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +/** + * + * A test suite for the 'hitsp' package. + * + * + + * @generated + */ +@RunWith(Suite.class) +@Suite.SuiteClasses({ + AllergyDrugSensitivityTest.class, MedicationTest.class, MedicationTypeTest.class, + MedicationOrderInformationTest.class, ConditionTest.class, ConditionEntryTest.class, PatientSummaryTest.class, + ProblemListSectionTest.class, MedicationsSectionTest.class, AdvanceDirectivesSectionTest.class, + AdvanceDirectiveTest.class, AllergiesReactionsSectionTest.class, EncountersSectionTest.class, + EncounterTest.class, ImmunizationsSectionTest.class, ImmunizationTest.class, PayersSectionTest.class, + InsuranceProviderTest.class, SurgeriesSectionTest.class, PlanOfCareSectionTest.class, + VitalSignsSectionTest.class, DiagnosticResultsSectionTest.class, ResultTest.class, ResultOrganizerTest.class, + VitalSignTest.class, HistoryOfPastIllnessSectionTest.class, ChiefComplaintSectionTest.class, + ReasonForReferralSectionTest.class, HistoryOfPresentIllnessTest.class, FunctionalStatusSectionTest.class, + HospitalAdmissionDiagnosisSectionTest.class, DischargeDiagnosisSectionTest.class, + AdmissionMedicationHistorySectionTest.class, HospitalDischargeMedicationsSectionTest.class, + MedicationsAdministeredSectionTest.class, PhysicalExamSectionTest.class, ReviewOfSystemsSectionTest.class, + HospitalCourseSectionTest.class, AssessmentAndPlanSectionTest.class, FamilyHistorySectionTest.class, + FamilyHistoryTest.class, SocialHistorySectionTest.class, SocialHistoryTest.class, + MedicalEquipmentSectionTest.class, LanguageSpokenTest.class, HealthcareProviderTest.class, CommentTest.class, + MedicationNormalDoseTest.class, MedicationSplitDoseTest.class, MedicationTaperedDoseTest.class, + MedicationConditionalDoseTest.class, MedicationCombinationMedicationTest.class, SupportGuardianTest.class, + SupportParticipantTest.class, UnstructuredDocumentTest.class, MedicationInformationTest.class, + UnstructuredOrScannedDocumentTest.class, ReferralSummaryTest.class, DischargeSummaryTest.class, + PlannedProcedureTest.class, PastProcedureTest.class, HITSPRegistryDelegateTest.class }) +public class HITSPTests { + + /** + * + * + * @generated + */ + public static junit.framework.Test suite() { + return new JUnit4TestAdapter(HITSPTests.class); + } + +} // HITSPTests diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/HealthcareProviderTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/HealthcareProviderTest.java new file mode 100644 index 000000000..97ae4cec2 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/HealthcareProviderTest.java @@ -0,0 +1,144 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.HealthcareProvider; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.HealthcareProviderOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Healthcare Provider' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.HealthcareProvider#validateHealthcareProviderTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Healthcare Provider Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class HealthcareProviderTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHealthcareProviderTemplateId() { + OperationsTestCase validateHealthcareProviderTemplateIdTestCase = new OperationsTestCase( + "validateHealthcareProviderTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HEALTHCARE_PROVIDER_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HealthcareProvider target) { + + } + + @Override + protected void updateToPass(HealthcareProvider target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HealthcareProviderOperations.validateHealthcareProviderTemplateId( + (HealthcareProvider) objectToTest, diagnostician, map); + } + + }; + + validateHealthcareProviderTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends HealthcareProviderOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public HealthcareProvider create() { + return HITSPFactory.eINSTANCE.createHealthcareProvider(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends HealthcareProviderOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // HealthcareProviderOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/HistoryOfPastIllnessSectionTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/HistoryOfPastIllnessSectionTest.java new file mode 100644 index 000000000..86594c7a1 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/HistoryOfPastIllnessSectionTest.java @@ -0,0 +1,197 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.hitsp.Condition; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.HistoryOfPastIllnessSection; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.HistoryOfPastIllnessSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'History Of Past Illness Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.HistoryOfPastIllnessSection#validateHITSPHistoryOfPastIllnessSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP History Of Past Illness Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.HistoryOfPastIllnessSection#validateHITSPHistoryOfPastIllnessSectionCondition(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP History Of Past Illness Section Condition}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.HistoryOfPastIllnessSection#getCondition() Get Condition}
  • + *
+ *

+ * + * @generated + */ + +public class HistoryOfPastIllnessSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHITSPHistoryOfPastIllnessSectionTemplateId() { + OperationsTestCase validateHITSPHistoryOfPastIllnessSectionTemplateIdTestCase = new OperationsTestCase( + "validateHITSPHistoryOfPastIllnessSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HITSP_HISTORY_OF_PAST_ILLNESS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryOfPastIllnessSection target) { + + } + + @Override + protected void updateToPass(HistoryOfPastIllnessSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryOfPastIllnessSectionOperations.validateHITSPHistoryOfPastIllnessSectionTemplateId( + (HistoryOfPastIllnessSection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPHistoryOfPastIllnessSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHITSPHistoryOfPastIllnessSectionCondition() { + OperationsTestCase validateHITSPHistoryOfPastIllnessSectionConditionTestCase = new OperationsTestCase( + "validateHITSPHistoryOfPastIllnessSectionCondition", + operationsForOCL.getOCLValue("VALIDATE_HITSP_HISTORY_OF_PAST_ILLNESS_SECTION_CONDITION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryOfPastIllnessSection target) { + + } + + @Override + protected void updateToPass(HistoryOfPastIllnessSection target) { + target.init(); + + Condition condition = HITSPFactory.eINSTANCE.createCondition().init(); + + target.addAct(condition); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryOfPastIllnessSectionOperations.validateHITSPHistoryOfPastIllnessSectionCondition( + (HistoryOfPastIllnessSection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPHistoryOfPastIllnessSectionConditionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetCondition() { + + HistoryOfPastIllnessSection target = objectFactory.create(); + target.getCondition(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends HistoryOfPastIllnessSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public HistoryOfPastIllnessSection create() { + return HITSPFactory.eINSTANCE.createHistoryOfPastIllnessSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends HistoryOfPastIllnessSectionOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // HistoryOfPastIllnessSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/HistoryOfPresentIllnessTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/HistoryOfPresentIllnessTest.java new file mode 100644 index 000000000..d6e55e02f --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/HistoryOfPresentIllnessTest.java @@ -0,0 +1,144 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.HistoryOfPresentIllness; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.HistoryOfPresentIllnessOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'History Of Present Illness' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.HistoryOfPresentIllness#validateHITSPHistoryOfPresentIllnessTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP History Of Present Illness Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class HistoryOfPresentIllnessTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHITSPHistoryOfPresentIllnessTemplateId() { + OperationsTestCase validateHITSPHistoryOfPresentIllnessTemplateIdTestCase = new OperationsTestCase( + "validateHITSPHistoryOfPresentIllnessTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HITSP_HISTORY_OF_PRESENT_ILLNESS_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryOfPresentIllness target) { + + } + + @Override + protected void updateToPass(HistoryOfPresentIllness target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryOfPresentIllnessOperations.validateHITSPHistoryOfPresentIllnessTemplateId( + (HistoryOfPresentIllness) objectToTest, diagnostician, map); + } + + }; + + validateHITSPHistoryOfPresentIllnessTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends HistoryOfPresentIllnessOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public HistoryOfPresentIllness create() { + return HITSPFactory.eINSTANCE.createHistoryOfPresentIllness(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends HistoryOfPresentIllnessOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // HistoryOfPresentIllnessOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/HospitalAdmissionDiagnosisSectionTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/HospitalAdmissionDiagnosisSectionTest.java new file mode 100644 index 000000000..053b8b4be --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/HospitalAdmissionDiagnosisSectionTest.java @@ -0,0 +1,195 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.hitsp.Condition; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.HospitalAdmissionDiagnosisSection; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.HospitalAdmissionDiagnosisSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Hospital Admission Diagnosis Section' model + * objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.HospitalAdmissionDiagnosisSection#validateHITSPHospitalAdmissionDiagnosisSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Hospital Admission Diagnosis Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.HospitalAdmissionDiagnosisSection#validateHITSPHospitalAdmissionDiagnosisSectionCondition(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Hospital Admission Diagnosis Section Condition}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.HospitalAdmissionDiagnosisSection#getCondition() Get Condition}
  • + *
+ *

+ * + * @generated + */ + +public class HospitalAdmissionDiagnosisSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHITSPHospitalAdmissionDiagnosisSectionTemplateId() { + OperationsTestCase validateHITSPHospitalAdmissionDiagnosisSectionTemplateIdTestCase = new OperationsTestCase( + "validateHITSPHospitalAdmissionDiagnosisSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HITSP_HOSPITAL_ADMISSION_DIAGNOSIS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalAdmissionDiagnosisSection target) { + + } + + @Override + protected void updateToPass(HospitalAdmissionDiagnosisSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalAdmissionDiagnosisSectionOperations.validateHITSPHospitalAdmissionDiagnosisSectionTemplateId( + (HospitalAdmissionDiagnosisSection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPHospitalAdmissionDiagnosisSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHITSPHospitalAdmissionDiagnosisSectionCondition() { + OperationsTestCase validateHITSPHospitalAdmissionDiagnosisSectionConditionTestCase = new OperationsTestCase( + "validateHITSPHospitalAdmissionDiagnosisSectionCondition", + operationsForOCL.getOCLValue("VALIDATE_HITSP_HOSPITAL_ADMISSION_DIAGNOSIS_SECTION_CONDITION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalAdmissionDiagnosisSection target) { + + } + + @Override + protected void updateToPass(HospitalAdmissionDiagnosisSection target) { + target.init(); + Condition condition = HITSPFactory.eINSTANCE.createCondition().init(); + target.addAct(condition); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalAdmissionDiagnosisSectionOperations.validateHITSPHospitalAdmissionDiagnosisSectionCondition( + (HospitalAdmissionDiagnosisSection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPHospitalAdmissionDiagnosisSectionConditionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetCondition() { + + HospitalAdmissionDiagnosisSection target = objectFactory.create(); + target.getCondition(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends HospitalAdmissionDiagnosisSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public HospitalAdmissionDiagnosisSection create() { + return HITSPFactory.eINSTANCE.createHospitalAdmissionDiagnosisSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends HospitalAdmissionDiagnosisSectionOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // HospitalAdmissionDiagnosisSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/HospitalCourseSectionTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/HospitalCourseSectionTest.java new file mode 100644 index 000000000..22d9411c0 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/HospitalCourseSectionTest.java @@ -0,0 +1,144 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.HospitalCourseSection; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.HospitalCourseSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Hospital Course Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.HospitalCourseSection#validateHITSPHospitalCourseSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Hospital Course Section Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class HospitalCourseSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHITSPHospitalCourseSectionTemplateId() { + OperationsTestCase validateHITSPHospitalCourseSectionTemplateIdTestCase = new OperationsTestCase( + "validateHITSPHospitalCourseSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HITSP_HOSPITAL_COURSE_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalCourseSection target) { + + } + + @Override + protected void updateToPass(HospitalCourseSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalCourseSectionOperations.validateHITSPHospitalCourseSectionTemplateId( + (HospitalCourseSection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPHospitalCourseSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends HospitalCourseSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public HospitalCourseSection create() { + return HITSPFactory.eINSTANCE.createHospitalCourseSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends HospitalCourseSectionOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // HospitalCourseSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/HospitalDischargeMedicationsSectionTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/HospitalDischargeMedicationsSectionTest.java new file mode 100644 index 000000000..9233246bc --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/HospitalDischargeMedicationsSectionTest.java @@ -0,0 +1,196 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.HospitalDischargeMedicationsSection; +import org.openhealthtools.mdht.uml.cda.hitsp.Medication; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.HospitalDischargeMedicationsSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Hospital Discharge Medications Section' model + * objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.HospitalDischargeMedicationsSection#validateHITSPHospitalDischargeMedicationsSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Hospital Discharge Medications Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.HospitalDischargeMedicationsSection#validateHITSPHospitalDischargeMedicationsSectionMedication(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Hospital Discharge Medications Section Medication}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.HospitalDischargeMedicationsSection#getHITSPMedication() Get HITSP Medication}
  • + *
+ *

+ * + * @generated + */ + +public class HospitalDischargeMedicationsSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHITSPHospitalDischargeMedicationsSectionTemplateId() { + OperationsTestCase validateHITSPHospitalDischargeMedicationsSectionTemplateIdTestCase = new OperationsTestCase( + "validateHITSPHospitalDischargeMedicationsSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HITSP_HOSPITAL_DISCHARGE_MEDICATIONS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalDischargeMedicationsSection target) { + + } + + @Override + protected void updateToPass(HospitalDischargeMedicationsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalDischargeMedicationsSectionOperations.validateHITSPHospitalDischargeMedicationsSectionTemplateId( + (HospitalDischargeMedicationsSection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPHospitalDischargeMedicationsSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHITSPHospitalDischargeMedicationsSectionMedication() { + OperationsTestCase validateHITSPHospitalDischargeMedicationsSectionMedicationTestCase = new OperationsTestCase( + "validateHITSPHospitalDischargeMedicationsSectionMedication", + operationsForOCL.getOCLValue("VALIDATE_HITSP_HOSPITAL_DISCHARGE_MEDICATIONS_SECTION_MEDICATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalDischargeMedicationsSection target) { + + } + + @Override + protected void updateToPass(HospitalDischargeMedicationsSection target) { + target.init(); + + Medication medication = HITSPFactory.eINSTANCE.createMedication().init(); + target.addSubstanceAdministration(medication); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalDischargeMedicationsSectionOperations.validateHITSPHospitalDischargeMedicationsSectionMedication( + (HospitalDischargeMedicationsSection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPHospitalDischargeMedicationsSectionMedicationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetHITSPMedication() { + + HospitalDischargeMedicationsSection target = objectFactory.create(); + target.getHITSPMedication(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends HospitalDischargeMedicationsSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public HospitalDischargeMedicationsSection create() { + return HITSPFactory.eINSTANCE.createHospitalDischargeMedicationsSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends HospitalDischargeMedicationsSectionOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // HospitalDischargeMedicationsSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/ImmunizationTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/ImmunizationTest.java new file mode 100644 index 000000000..b4155d744 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/ImmunizationTest.java @@ -0,0 +1,280 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Consumable; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.ManufacturedProduct; +import org.openhealthtools.mdht.uml.cda.Material; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.ProblemAct; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.Immunization; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.ImmunizationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.vocab.RoleClassManufacturedProduct; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * A static utility class that provides operations + * related to 'Immunization' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • + * {@link org.openhealthtools.mdht.uml.cda.hitsp.Immunization#validateHITSPImmunizationRefusalReason(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate HITSP Immunization Refusal Reason}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.hitsp.Immunization#validateHITSPImmunizationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate HITSP Immunization Template Id}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.hitsp.Immunization#validateImmunizationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Immunization Code}
  • + *
+ *

+ * + * @generated + */ + +public class ImmunizationTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateHITSPImmunizationRefusalReason() { + OperationsTestCase validateHITSPImmunizationRefusalReasonTestCase = new OperationsTestCase( + "validateHITSPImmunizationRefusalReason", + operationsForOCL.getOCLValue("VALIDATE_HITSP_IMMUNIZATION_REFUSAL_REASON__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Immunization target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + + er.setTypeCode(x_ActRelationshipEntryRelationship.RSON); + target.getEntryRelationships().add(er); + + } + + @Override + protected void updateToPass(Immunization target) { + + for (EntryRelationship er : target.getEntryRelationships()) { + ProblemAct pa = CCDFactory.eINSTANCE.createProblemAct(); + CD code = DatatypesFactory.eINSTANCE.createCD(); + code.setCodeSystem("2.16.840.1.113883.1.11.19717"); + pa.setCode(code); + er.setAct(pa); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationOperations.validateHITSPImmunizationRefusalReason( + (Immunization) objectToTest, diagnostician, map); + } + + }; + + validateHITSPImmunizationRefusalReasonTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHITSPImmunizationCodedProductName() { + OperationsTestCase validateHITSPImmunizationCodedProductNameTestCase = new OperationsTestCase( + "validateHITSPImmunizationCodedProductName", + operationsForOCL.getOCLValue("VALIDATE_HITSP_IMMUNIZATION_CODED_PRODUCT_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Immunization target) { + target.init(); + Consumable consumable = createConsumableForVaccine(); + consumable.getManufacturedProduct().getManufacturedMaterial().getCode().setCodeSystem( + "INVALID CODESYSTEM"); + target.setConsumable(consumable); + } + + @Override + protected void updateToPass(Immunization target) { + target.init(); + Consumable consumable = createConsumableForVaccine(); + target.setConsumable(consumable); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationOperations.validateHITSPImmunizationCodedProductName( + (Immunization) objectToTest, diagnostician, map); + } + + }; + + validateHITSPImmunizationCodedProductNameTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHITSPImmunizationTemplateId() { + OperationsTestCase validateHITSPImmunizationTemplateIdTestCase = new OperationsTestCase( + "validateHITSPImmunizationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HITSP_IMMUNIZATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Immunization target) { + + } + + @Override + protected void updateToPass(Immunization target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationOperations.validateHITSPImmunizationTemplateId( + (Immunization) objectToTest, diagnostician, map); + } + + }; + + validateHITSPImmunizationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ImmunizationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public Immunization create() { + return HITSPFactory.eINSTANCE.createImmunization(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends ImmunizationOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + + /** + * Create a valid Consumable for a Hepatitis Vaccine + * @return consumable + */ + protected Consumable createConsumableForVaccine() { + + Consumable consumable = CDAFactory.eINSTANCE.createConsumable(); + + ManufacturedProduct mProduct = CDAFactory.eINSTANCE.createManufacturedProduct(); + mProduct.setClassCode(RoleClassManufacturedProduct.MANU); + + II ccdTemplateId = DatatypesFactory.eINSTANCE.createII(); + ccdTemplateId.setRoot("2.16.840.1.113883.10.20.1.53"); + mProduct.getTemplateIds().add(ccdTemplateId); + + II iheTemplateId = DatatypesFactory.eINSTANCE.createII(); + iheTemplateId.setRoot("1.3.6.1.4.1.19376.1.5.3.1.4.7.2"); + mProduct.getTemplateIds().add(iheTemplateId); + + Material mMaterial = CDAFactory.eINSTANCE.createMaterial(); + CE code = DatatypesFactory.eINSTANCE.createCE("52", "2.16.840.1.113883.6.59"); + code.setDisplayName("Hepatitis A vaccine"); + mMaterial.setCode(code); + + mProduct.setManufacturedMaterial(mMaterial); + consumable.setManufacturedProduct(mProduct); + + return consumable; + } + +} // ImmunizationOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/ImmunizationsSectionTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/ImmunizationsSectionTest.java new file mode 100644 index 000000000..248ec93c6 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/ImmunizationsSectionTest.java @@ -0,0 +1,195 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.Immunization; +import org.openhealthtools.mdht.uml.cda.hitsp.ImmunizationsSection; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.ImmunizationsSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Immunizations Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.ImmunizationsSection#validateHITSPImmunizationsSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Immunizations Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.ImmunizationsSection#validateHITSPImmunizationsSectionImmunization(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Immunizations Section Immunization}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.ImmunizationsSection#getHITSPImmunizations() Get HITSP Immunizations}
  • + *
+ *

+ * + * @generated + */ + +public class ImmunizationsSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHITSPImmunizationsSectionTemplateId() { + OperationsTestCase validateHITSPImmunizationsSectionTemplateIdTestCase = new OperationsTestCase( + "validateHITSPImmunizationsSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HITSP_IMMUNIZATIONS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationsSection target) { + + } + + @Override + protected void updateToPass(ImmunizationsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationsSectionOperations.validateHITSPImmunizationsSectionTemplateId( + (ImmunizationsSection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPImmunizationsSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHITSPImmunizationsSectionImmunization() { + OperationsTestCase validateHITSPImmunizationsSectionImmunizationTestCase = new OperationsTestCase( + "validateHITSPImmunizationsSectionImmunization", + operationsForOCL.getOCLValue("VALIDATE_HITSP_IMMUNIZATIONS_SECTION_IMMUNIZATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationsSection target) { + + } + + @Override + protected void updateToPass(ImmunizationsSection target) { + target.init(); + Immunization immun = HITSPFactory.eINSTANCE.createImmunization().init(); + target.addSubstanceAdministration(immun); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationsSectionOperations.validateHITSPImmunizationsSectionImmunization( + (ImmunizationsSection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPImmunizationsSectionImmunizationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetHITSPImmunizations() { + + ImmunizationsSection target = objectFactory.create(); + target.getHITSPImmunizations(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ImmunizationsSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public ImmunizationsSection create() { + return HITSPFactory.eINSTANCE.createImmunizationsSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends ImmunizationsSectionOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ImmunizationsSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/InsuranceProviderTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/InsuranceProviderTest.java new file mode 100644 index 000000000..b0d41cb41 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/InsuranceProviderTest.java @@ -0,0 +1,1147 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.AssignedEntity; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Participant2; +import org.openhealthtools.mdht.uml.cda.ParticipantRole; +import org.openhealthtools.mdht.uml.cda.Performer2; +import org.openhealthtools.mdht.uml.cda.PlayingEntity; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.InsuranceProvider; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.InsuranceProviderOperations; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.PayerEntry; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVXB_TS; +import org.openhealthtools.mdht.uml.hl7.vocab.ParticipationPhysicalPerformer; +import org.openhealthtools.mdht.uml.hl7.vocab.ParticipationType; +import org.openhealthtools.mdht.uml.hl7.vocab.RoleClassRoot; + +/** + * A static utility class that provides operations + * related to 'Insurance Provider' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.InsuranceProvider#validateInsuranceProviderPaymentProviders(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Insurance Provider Payment Providers}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.InsuranceProvider#validateInsuranceProviderPayerEntryID(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Insurance Provider Payer Entry ID}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.InsuranceProvider#validateInsuranceProviderHealthInsuranceType(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Insurance Provider Health Insurance Type}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.InsuranceProvider#validateInsuranceProviderInsuranceInformation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Insurance Provider Insurance Information}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.InsuranceProvider#validateInsuranceProviderInsuranceInfoSourceID(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Insurance Provider Insurance Info Source ID}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.InsuranceProvider#validateInsuranceProviderInsuranceInfoSourceAddr(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Insurance Provider Insurance Info Source Addr}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.InsuranceProvider#validateInsuranceProviderHealthPlanCoverageStartTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Insurance Provider Health Plan Coverage Start Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.InsuranceProvider#validateInsuranceProviderHealthPlanCoverageStopTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Insurance Provider Health Plan Coverage Stop Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.InsuranceProvider#validateInsuranceProviderPatientInformation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Insurance Provider Patient Information}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.InsuranceProvider#validateInsuranceProviderMemberId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Insurance Provider Member Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.InsuranceProvider#validateInsuranceProviderMemberIdRoot(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Insurance Provider Member Id Root}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.InsuranceProvider#validateInsuranceProviderRelationshipToSubscriber(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Insurance Provider Relationship To Subscriber}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.InsuranceProvider#validateInsuranceProviderRelationshipToSubscriberCodeSystem(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Insurance Provider Relationship To Subscriber Code System}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.InsuranceProvider#validateInsuranceProviderPatientName(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Insurance Provider Patient Name}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.InsuranceProvider#validateInsuranceProviderSubscriberInformation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Insurance Provider Subscriber Information}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.InsuranceProvider#validateInsuranceProviderSubscriberId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Insurance Provider Subscriber Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.InsuranceProvider#validateInsuranceProviderSubscriberIdRoot(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Insurance Provider Subscriber Id Root}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.InsuranceProvider#validateInsuranceProviderSubscriberAddress(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Insurance Provider Subscriber Address}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.InsuranceProvider#validateInsuranceProviderFinancialResponsibilityPartyType(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Insurance Provider Financial Responsibility Party Type}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.InsuranceProvider#validateInsuranceProviderFinancialResponsibilityPartyTypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Insurance Provider Financial Responsibility Party Type Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.InsuranceProvider#validateInsuranceProviderFinancialResponsibilityPartyAddress(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Insurance Provider Financial Responsibility Party Address}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.InsuranceProvider#validateInsuranceProviderTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Insurance Provider Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.InsuranceProvider#validateInsuranceProviderCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Insurance Provider Code}
  • + *
+ *

+ * + * @generated + */ + +public class InsuranceProviderTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateInsuranceProviderPaymentProviders() { + OperationsTestCase validateInsuranceProviderPaymentProvidersTestCase = new OperationsTestCase( + "validateInsuranceProviderPaymentProviders", + operationsForOCL.getOCLValue("VALIDATE_INSURANCE_PROVIDER_PAYMENT_PROVIDERS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(InsuranceProvider target) { + + } + + @Override + protected void updateToPass(InsuranceProvider target) { + target.init(); + PayerEntry pe = IHEFactory.eINSTANCE.createPayerEntry(); + target.addAct(pe); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return InsuranceProviderOperations.validateInsuranceProviderPaymentProviders( + (InsuranceProvider) objectToTest, diagnostician, map); + } + + }; + + validateInsuranceProviderPaymentProvidersTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateInsuranceProviderPayerEntryID() { + OperationsTestCase validateInsuranceProviderPayerEntryIDTestCase = new OperationsTestCase( + "validateInsuranceProviderPayerEntryID", + operationsForOCL.getOCLValue("VALIDATE_INSURANCE_PROVIDER_PAYER_ENTRY_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(InsuranceProvider target) { + target.init(); + PayerEntry pe = IHEFactory.eINSTANCE.createPayerEntry(); + target.addAct(pe); + } + + @Override + protected void updateToPass(InsuranceProvider target) { + target.getEntryRelationships().clear(); + PayerEntry pe = IHEFactory.eINSTANCE.createPayerEntry(); + II id = DatatypesFactory.eINSTANCE.createII(); + id.setRoot("root"); + pe.getIds().add(id); + target.addAct(pe); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return InsuranceProviderOperations.validateInsuranceProviderPayerEntryID( + (InsuranceProvider) objectToTest, diagnostician, map); + } + + }; + + validateInsuranceProviderPayerEntryIDTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateInsuranceProviderHealthInsuranceType() { + OperationsTestCase validateInsuranceProviderHealthInsuranceTypeTestCase = new OperationsTestCase( + "validateInsuranceProviderHealthInsuranceType", + operationsForOCL.getOCLValue("VALIDATE_INSURANCE_PROVIDER_HEALTH_INSURANCE_TYPE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(InsuranceProvider target) { + target.init(); + PayerEntry pe = IHEFactory.eINSTANCE.createPayerEntry(); + target.addAct(pe); + } + + @Override + protected void updateToPass(InsuranceProvider target) { + target.getEntryRelationships().clear(); + PayerEntry pe = IHEFactory.eINSTANCE.createPayerEntry(); + CD code = DatatypesFactory.eINSTANCE.createCD(); + code.setCode("13"); + code.setCodeSystem("2.16.840.1.113883.6.255.1336"); + pe.setCode(code); + target.addAct(pe); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return InsuranceProviderOperations.validateInsuranceProviderHealthInsuranceType( + (InsuranceProvider) objectToTest, diagnostician, map); + } + + }; + + validateInsuranceProviderHealthInsuranceTypeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateInsuranceProviderInsuranceInformation() { + OperationsTestCase validateInsuranceProviderInsuranceInformationTestCase = new OperationsTestCase( + "validateInsuranceProviderInsuranceInformation", + operationsForOCL.getOCLValue("VALIDATE_INSURANCE_PROVIDER_INSURANCE_INFORMATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(InsuranceProvider target) { + target.init(); + PayerEntry pe = IHEFactory.eINSTANCE.createPayerEntry(); + target.addAct(pe); + } + + @Override + protected void updateToPass(InsuranceProvider target) { + target.getEntryRelationships().clear(); + PayerEntry pe = IHEFactory.eINSTANCE.createPayerEntry(); + Performer2 perm = CDAFactory.eINSTANCE.createPerformer2(); + perm.setTypeCode(ParticipationPhysicalPerformer.PRF); + perm.setAssignedEntity(CDAFactory.eINSTANCE.createAssignedEntity()); + pe.getPerformers().add(perm); + target.addAct(pe); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return InsuranceProviderOperations.validateInsuranceProviderInsuranceInformation( + (InsuranceProvider) objectToTest, diagnostician, map); + } + + }; + + validateInsuranceProviderInsuranceInformationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateInsuranceProviderInsuranceInfoSourceID() { + OperationsTestCase validateInsuranceProviderInsuranceInfoSourceIDTestCase = new OperationsTestCase( + "validateInsuranceProviderInsuranceInfoSourceID", + operationsForOCL.getOCLValue("VALIDATE_INSURANCE_PROVIDER_INSURANCE_INFO_SOURCE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(InsuranceProvider target) { + target.init(); + PayerEntry pe = IHEFactory.eINSTANCE.createPayerEntry(); + target.addAct(pe); + } + + @Override + protected void updateToPass(InsuranceProvider target) { + target.getEntryRelationships().clear(); + PayerEntry pe = IHEFactory.eINSTANCE.createPayerEntry(); + Performer2 perm = CDAFactory.eINSTANCE.createPerformer2(); + perm.setTypeCode(ParticipationPhysicalPerformer.PRF); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getIds().add(DatatypesFactory.eINSTANCE.createII()); + perm.setAssignedEntity(ae); + pe.getPerformers().add(perm); + target.addAct(pe); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return InsuranceProviderOperations.validateInsuranceProviderInsuranceInfoSourceID( + (InsuranceProvider) objectToTest, diagnostician, map); + } + + }; + + validateInsuranceProviderInsuranceInfoSourceIDTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateInsuranceProviderInsuranceInfoSourceAddr() { + OperationsTestCase validateInsuranceProviderInsuranceInfoSourceAddrTestCase = new OperationsTestCase( + "validateInsuranceProviderInsuranceInfoSourceAddr", + operationsForOCL.getOCLValue("VALIDATE_INSURANCE_PROVIDER_INSURANCE_INFO_SOURCE_ADDR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(InsuranceProvider target) { + target.init(); + PayerEntry pe = IHEFactory.eINSTANCE.createPayerEntry(); + target.addAct(pe); + } + + @Override + protected void updateToPass(InsuranceProvider target) { + target.getEntryRelationships().clear(); + PayerEntry pe = IHEFactory.eINSTANCE.createPayerEntry(); + Performer2 perm = CDAFactory.eINSTANCE.createPerformer2(); + perm.setTypeCode(ParticipationPhysicalPerformer.PRF); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + perm.setAssignedEntity(ae); + pe.getPerformers().add(perm); + target.addAct(pe); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return InsuranceProviderOperations.validateInsuranceProviderInsuranceInfoSourceAddr( + (InsuranceProvider) objectToTest, diagnostician, map); + } + + }; + + validateInsuranceProviderInsuranceInfoSourceAddrTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateInsuranceProviderHealthPlanCoverageStartTime() { + OperationsTestCase validateInsuranceProviderHealthPlanCoverageStartTimeTestCase = new OperationsTestCase( + "validateInsuranceProviderHealthPlanCoverageStartTime", + operationsForOCL.getOCLValue("VALIDATE_INSURANCE_PROVIDER_HEALTH_PLAN_COVERAGE_START_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(InsuranceProvider target) { + target.init(); + PayerEntry pe = IHEFactory.eINSTANCE.createPayerEntry(); + target.addAct(pe); + } + + @Override + protected void updateToPass(InsuranceProvider target) { + target.getEntryRelationships().clear(); + PayerEntry pe = IHEFactory.eINSTANCE.createPayerEntry(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setTypeCode(ParticipationType.COV); + + IVL_TS time = DatatypesFactory.eINSTANCE.createIVL_TS(); + IVXB_TS lw = DatatypesFactory.eINSTANCE.createIVXB_TS(); + time.setLow(lw); + par.setTime(time); + pe.getParticipants().add(par); + target.addAct(pe); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return InsuranceProviderOperations.validateInsuranceProviderHealthPlanCoverageStartTime( + (InsuranceProvider) objectToTest, diagnostician, map); + } + + }; + + validateInsuranceProviderHealthPlanCoverageStartTimeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateInsuranceProviderHealthPlanCoverageStopTime() { + OperationsTestCase validateInsuranceProviderHealthPlanCoverageStopTimeTestCase = new OperationsTestCase( + "validateInsuranceProviderHealthPlanCoverageStopTime", + operationsForOCL.getOCLValue("VALIDATE_INSURANCE_PROVIDER_HEALTH_PLAN_COVERAGE_STOP_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(InsuranceProvider target) { + target.init(); + PayerEntry pe = IHEFactory.eINSTANCE.createPayerEntry(); + target.addAct(pe); + } + + @Override + protected void updateToPass(InsuranceProvider target) { + target.getEntryRelationships().clear(); + PayerEntry pe = IHEFactory.eINSTANCE.createPayerEntry(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setTypeCode(ParticipationType.COV); + + IVL_TS time = DatatypesFactory.eINSTANCE.createIVL_TS(); + IVXB_TS high = DatatypesFactory.eINSTANCE.createIVXB_TS(); + time.setHigh(high); + par.setTime(time); + pe.getParticipants().add(par); + target.addAct(pe); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return InsuranceProviderOperations.validateInsuranceProviderHealthPlanCoverageStopTime( + (InsuranceProvider) objectToTest, diagnostician, map); + } + + }; + + validateInsuranceProviderHealthPlanCoverageStopTimeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateInsuranceProviderPatientInformation() { + OperationsTestCase validateInsuranceProviderPatientInformationTestCase = new OperationsTestCase( + "validateInsuranceProviderPatientInformation", + operationsForOCL.getOCLValue("VALIDATE_INSURANCE_PROVIDER_PATIENT_INFORMATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(InsuranceProvider target) { + target.init(); + PayerEntry pe = IHEFactory.eINSTANCE.createPayerEntry(); + target.addAct(pe); + } + + @Override + protected void updateToPass(InsuranceProvider target) { + target.getEntryRelationships().clear(); + PayerEntry pe = IHEFactory.eINSTANCE.createPayerEntry(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setTypeCode(ParticipationType.COV); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + pr.setClassCode(RoleClassRoot.PAT); + par.setParticipantRole(pr); + pe.getParticipants().add(par); + target.addAct(pe); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return InsuranceProviderOperations.validateInsuranceProviderPatientInformation( + (InsuranceProvider) objectToTest, diagnostician, map); + } + + }; + + validateInsuranceProviderPatientInformationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateInsuranceProviderMemberId() { + OperationsTestCase validateInsuranceProviderMemberIdTestCase = new OperationsTestCase( + "validateInsuranceProviderMemberId", + operationsForOCL.getOCLValue("VALIDATE_INSURANCE_PROVIDER_MEMBER_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(InsuranceProvider target) { + target.init(); + PayerEntry pe = IHEFactory.eINSTANCE.createPayerEntry(); + target.addAct(pe); + } + + @Override + protected void updateToPass(InsuranceProvider target) { + target.getEntryRelationships().clear(); + PayerEntry pe = IHEFactory.eINSTANCE.createPayerEntry(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setTypeCode(ParticipationType.COV); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + pr.getIds().add(DatatypesFactory.eINSTANCE.createII()); + pr.setClassCode(RoleClassRoot.PAT); + par.setParticipantRole(pr); + pe.getParticipants().add(par); + target.addAct(pe); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return InsuranceProviderOperations.validateInsuranceProviderMemberId( + (InsuranceProvider) objectToTest, diagnostician, map); + } + + }; + + validateInsuranceProviderMemberIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateInsuranceProviderMemberIdRoot() { + OperationsTestCase validateInsuranceProviderMemberIdRootTestCase = new OperationsTestCase( + "validateInsuranceProviderMemberIdRoot", + operationsForOCL.getOCLValue("VALIDATE_INSURANCE_PROVIDER_MEMBER_ID_ROOT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(InsuranceProvider target) { + target.init(); + PayerEntry pe = IHEFactory.eINSTANCE.createPayerEntry(); + target.addAct(pe); + } + + @Override + protected void updateToPass(InsuranceProvider target) { + target.getEntryRelationships().clear(); + PayerEntry pe = IHEFactory.eINSTANCE.createPayerEntry(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setTypeCode(ParticipationType.COV); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + II id = DatatypesFactory.eINSTANCE.createII(); + id.setRoot("root"); + pr.getIds().add(id); + pr.setClassCode(RoleClassRoot.PAT); + par.setParticipantRole(pr); + pe.getParticipants().add(par); + target.addAct(pe); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return InsuranceProviderOperations.validateInsuranceProviderMemberIdRoot( + (InsuranceProvider) objectToTest, diagnostician, map); + } + + }; + + validateInsuranceProviderMemberIdRootTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateInsuranceProviderRelationshipToSubscriber() { + OperationsTestCase validateInsuranceProviderRelationshipToSubscriberTestCase = new OperationsTestCase( + "validateInsuranceProviderRelationshipToSubscriber", + operationsForOCL.getOCLValue("VALIDATE_INSURANCE_PROVIDER_RELATIONSHIP_TO_SUBSCRIBER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(InsuranceProvider target) { + target.init(); + PayerEntry pe = IHEFactory.eINSTANCE.createPayerEntry(); + target.addAct(pe); + } + + @Override + protected void updateToPass(InsuranceProvider target) { + target.getEntryRelationships().clear(); + PayerEntry pe = IHEFactory.eINSTANCE.createPayerEntry(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setTypeCode(ParticipationType.COV); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + CE code = DatatypesFactory.eINSTANCE.createCE(); + pr.setCode(code); + pr.setClassCode(RoleClassRoot.PAT); + par.setParticipantRole(pr); + pe.getParticipants().add(par); + target.addAct(pe); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return InsuranceProviderOperations.validateInsuranceProviderRelationshipToSubscriber( + (InsuranceProvider) objectToTest, diagnostician, map); + } + + }; + + validateInsuranceProviderRelationshipToSubscriberTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateInsuranceProviderRelationshipToSubscriberCodeSystem() { + OperationsTestCase validateInsuranceProviderRelationshipToSubscriberCodeSystemTestCase = new OperationsTestCase( + "validateInsuranceProviderRelationshipToSubscriberCodeSystem", + operationsForOCL.getOCLValue("VALIDATE_INSURANCE_PROVIDER_RELATIONSHIP_TO_SUBSCRIBER_CODE_SYSTEM__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(InsuranceProvider target) { + target.init(); + PayerEntry pe = IHEFactory.eINSTANCE.createPayerEntry(); + target.addAct(pe); + } + + @Override + protected void updateToPass(InsuranceProvider target) { + target.getEntryRelationships().clear(); + PayerEntry pe = IHEFactory.eINSTANCE.createPayerEntry(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setTypeCode(ParticipationType.COV); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + CE code = DatatypesFactory.eINSTANCE.createCE(); + code.setCodeSystem("2.16.840.1.113883.5.111"); + code.setCode("FAMDEP"); + pr.setCode(code); + pr.setClassCode(RoleClassRoot.PAT); + par.setParticipantRole(pr); + pe.getParticipants().add(par); + target.addAct(pe); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return InsuranceProviderOperations.validateInsuranceProviderRelationshipToSubscriberCodeSystem( + (InsuranceProvider) objectToTest, diagnostician, map); + } + + }; + + validateInsuranceProviderRelationshipToSubscriberCodeSystemTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateInsuranceProviderPatientName() { + OperationsTestCase validateInsuranceProviderPatientNameTestCase = new OperationsTestCase( + "validateInsuranceProviderPatientName", + operationsForOCL.getOCLValue("VALIDATE_INSURANCE_PROVIDER_PATIENT_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(InsuranceProvider target) { + target.init(); + PayerEntry pe = IHEFactory.eINSTANCE.createPayerEntry(); + target.addAct(pe); + } + + @Override + protected void updateToPass(InsuranceProvider target) { + target.getEntryRelationships().clear(); + PayerEntry pe = IHEFactory.eINSTANCE.createPayerEntry(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setTypeCode(ParticipationType.COV); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + PlayingEntity pl = CDAFactory.eINSTANCE.createPlayingEntity(); + pl.getNames().add(DatatypesFactory.eINSTANCE.createPN()); + pr.setPlayingEntity(pl); + pr.setClassCode(RoleClassRoot.PAT); + par.setParticipantRole(pr); + pe.getParticipants().add(par); + target.addAct(pe); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return InsuranceProviderOperations.validateInsuranceProviderPatientName( + (InsuranceProvider) objectToTest, diagnostician, map); + } + + }; + + validateInsuranceProviderPatientNameTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateInsuranceProviderSubscriberInformation() { + OperationsTestCase validateInsuranceProviderSubscriberInformationTestCase = new OperationsTestCase( + "validateInsuranceProviderSubscriberInformation", + operationsForOCL.getOCLValue("VALIDATE_INSURANCE_PROVIDER_SUBSCRIBER_INFORMATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(InsuranceProvider target) { + target.init(); + PayerEntry pe = IHEFactory.eINSTANCE.createPayerEntry(); + target.addAct(pe); + } + + @Override + protected void updateToPass(InsuranceProvider target) { + target.getEntryRelationships().clear(); + PayerEntry pe = IHEFactory.eINSTANCE.createPayerEntry(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setTypeCode(ParticipationType.HLD); + pe.getParticipants().add(par); + target.addAct(pe); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return InsuranceProviderOperations.validateInsuranceProviderSubscriberInformation( + (InsuranceProvider) objectToTest, diagnostician, map); + } + + }; + + validateInsuranceProviderSubscriberInformationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateInsuranceProviderSubscriberId() { + OperationsTestCase validateInsuranceProviderSubscriberIdTestCase = new OperationsTestCase( + "validateInsuranceProviderSubscriberId", + operationsForOCL.getOCLValue("VALIDATE_INSURANCE_PROVIDER_SUBSCRIBER_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(InsuranceProvider target) { + target.init(); + PayerEntry pe = IHEFactory.eINSTANCE.createPayerEntry(); + target.addAct(pe); + } + + @Override + protected void updateToPass(InsuranceProvider target) { + target.getEntryRelationships().clear(); + PayerEntry pe = IHEFactory.eINSTANCE.createPayerEntry(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setTypeCode(ParticipationType.HLD); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + II id = DatatypesFactory.eINSTANCE.createII(); + id.setRoot("root"); + pr.getIds().add(id); + pr.setClassCode(RoleClassRoot.PAT); + par.setParticipantRole(pr); + pe.getParticipants().add(par); + target.addAct(pe); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return InsuranceProviderOperations.validateInsuranceProviderSubscriberId( + (InsuranceProvider) objectToTest, diagnostician, map); + } + + }; + + validateInsuranceProviderSubscriberIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateInsuranceProviderSubscriberIdRoot() { + OperationsTestCase validateInsuranceProviderSubscriberIdRootTestCase = new OperationsTestCase( + "validateInsuranceProviderSubscriberIdRoot", + operationsForOCL.getOCLValue("VALIDATE_INSURANCE_PROVIDER_SUBSCRIBER_ID_ROOT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(InsuranceProvider target) { + target.init(); + PayerEntry pe = IHEFactory.eINSTANCE.createPayerEntry(); + target.addAct(pe); + } + + @Override + protected void updateToPass(InsuranceProvider target) { + target.getEntryRelationships().clear(); + PayerEntry pe = IHEFactory.eINSTANCE.createPayerEntry(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setTypeCode(ParticipationType.HLD); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + II id = DatatypesFactory.eINSTANCE.createII(); + id.setRoot("root"); + pr.getIds().add(id); + pr.setClassCode(RoleClassRoot.PAT); + par.setParticipantRole(pr); + pe.getParticipants().add(par); + target.addAct(pe); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return InsuranceProviderOperations.validateInsuranceProviderSubscriberIdRoot( + (InsuranceProvider) objectToTest, diagnostician, map); + } + + }; + + validateInsuranceProviderSubscriberIdRootTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateInsuranceProviderSubscriberAddress() { + OperationsTestCase validateInsuranceProviderSubscriberAddressTestCase = new OperationsTestCase( + "validateInsuranceProviderSubscriberAddress", + operationsForOCL.getOCLValue("VALIDATE_INSURANCE_PROVIDER_SUBSCRIBER_ADDRESS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(InsuranceProvider target) { + target.init(); + PayerEntry pe = IHEFactory.eINSTANCE.createPayerEntry(); + target.addAct(pe); + } + + @Override + protected void updateToPass(InsuranceProvider target) { + target.getEntryRelationships().clear(); + PayerEntry pe = IHEFactory.eINSTANCE.createPayerEntry(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setTypeCode(ParticipationType.HLD); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + pr.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + pr.setClassCode(RoleClassRoot.PAT); + par.setParticipantRole(pr); + pe.getParticipants().add(par); + target.addAct(pe); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return InsuranceProviderOperations.validateInsuranceProviderSubscriberAddress( + (InsuranceProvider) objectToTest, diagnostician, map); + } + + }; + + validateInsuranceProviderSubscriberAddressTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateInsuranceProviderFinancialResponsibilityPartyType() { + OperationsTestCase validateInsuranceProviderFinancialResponsibilityPartyTypeTestCase = new OperationsTestCase( + "validateInsuranceProviderFinancialResponsibilityPartyType", + operationsForOCL.getOCLValue("VALIDATE_INSURANCE_PROVIDER_FINANCIAL_RESPONSIBILITY_PARTY_TYPE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(InsuranceProvider target) { + target.init(); + PayerEntry pe = IHEFactory.eINSTANCE.createPayerEntry(); + target.addAct(pe); + } + + @Override + protected void updateToPass(InsuranceProvider target) { + target.getEntryRelationships().clear(); + PayerEntry pe = IHEFactory.eINSTANCE.createPayerEntry(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + CE code = DatatypesFactory.eINSTANCE.createCE(); + ae.setCode(code); + per.setAssignedEntity(ae); + per.setTypeCode(ParticipationPhysicalPerformer.PRF); + pe.getPerformers().add(per); + target.addAct(pe); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return InsuranceProviderOperations.validateInsuranceProviderFinancialResponsibilityPartyType( + (InsuranceProvider) objectToTest, diagnostician, map); + } + + }; + + validateInsuranceProviderFinancialResponsibilityPartyTypeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateInsuranceProviderFinancialResponsibilityPartyTypeCode() { + OperationsTestCase validateInsuranceProviderFinancialResponsibilityPartyTypeCodeTestCase = new OperationsTestCase( + "validateInsuranceProviderFinancialResponsibilityPartyTypeCode", + operationsForOCL.getOCLValue("VALIDATE_INSURANCE_PROVIDER_FINANCIAL_RESPONSIBILITY_PARTY_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(InsuranceProvider target) { + target.init(); + PayerEntry pe = IHEFactory.eINSTANCE.createPayerEntry(); + target.addAct(pe); + } + + @Override + protected void updateToPass(InsuranceProvider target) { + target.getEntryRelationships().clear(); + PayerEntry pe = IHEFactory.eINSTANCE.createPayerEntry(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + CE code = DatatypesFactory.eINSTANCE.createCE(); + code.setCodeSystem("2.16.840.1.113883.5.110"); + ae.setCode(code); + per.setAssignedEntity(ae); + per.setTypeCode(ParticipationPhysicalPerformer.PRF); + pe.getPerformers().add(per); + target.addAct(pe); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return InsuranceProviderOperations.validateInsuranceProviderFinancialResponsibilityPartyTypeCode( + (InsuranceProvider) objectToTest, diagnostician, map); + } + + }; + + validateInsuranceProviderFinancialResponsibilityPartyTypeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateInsuranceProviderFinancialResponsibilityPartyAddress() { + OperationsTestCase validateInsuranceProviderFinancialResponsibilityPartyAddressTestCase = new OperationsTestCase( + "validateInsuranceProviderFinancialResponsibilityPartyAddress", + operationsForOCL.getOCLValue("VALIDATE_INSURANCE_PROVIDER_FINANCIAL_RESPONSIBILITY_PARTY_ADDRESS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(InsuranceProvider target) { + target.init(); + PayerEntry pe = IHEFactory.eINSTANCE.createPayerEntry(); + target.addAct(pe); + } + + @Override + protected void updateToPass(InsuranceProvider target) { + target.getEntryRelationships().clear(); + PayerEntry pe = IHEFactory.eINSTANCE.createPayerEntry(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getAddrs().add(DatatypesFactory.eINSTANCE.createAD()); + per.setAssignedEntity(ae); + per.setTypeCode(ParticipationPhysicalPerformer.PRF); + pe.getPerformers().add(per); + target.addAct(pe); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return InsuranceProviderOperations.validateInsuranceProviderFinancialResponsibilityPartyAddress( + (InsuranceProvider) objectToTest, diagnostician, map); + } + + }; + + validateInsuranceProviderFinancialResponsibilityPartyAddressTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateInsuranceProviderTemplateId() { + OperationsTestCase validateInsuranceProviderTemplateIdTestCase = new OperationsTestCase( + "validateInsuranceProviderTemplateId", + operationsForOCL.getOCLValue("VALIDATE_INSURANCE_PROVIDER_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(InsuranceProvider target) { + + } + + @Override + protected void updateToPass(InsuranceProvider target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return InsuranceProviderOperations.validateInsuranceProviderTemplateId( + (InsuranceProvider) objectToTest, diagnostician, map); + } + + }; + + validateInsuranceProviderTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateInsuranceProviderCode() { + OperationsTestCase validateInsuranceProviderCodeTestCase = new OperationsTestCase( + "validateInsuranceProviderCode", + operationsForOCL.getOCLValue("VALIDATE_INSURANCE_PROVIDER_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(InsuranceProvider target) { + + } + + @Override + protected void updateToPass(InsuranceProvider target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return InsuranceProviderOperations.validateInsuranceProviderCode( + (InsuranceProvider) objectToTest, diagnostician, map); + } + + }; + + validateInsuranceProviderCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends InsuranceProviderOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public InsuranceProvider create() { + return HITSPFactory.eINSTANCE.createInsuranceProvider(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends InsuranceProviderOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // InsuranceProviderOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/LanguageSpokenTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/LanguageSpokenTest.java new file mode 100644 index 000000000..08e367113 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/LanguageSpokenTest.java @@ -0,0 +1,227 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.LanguageSpoken; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.LanguageSpokenOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; + +/** + * A static utility class that provides operations + * related to 'Language Spoken' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • + * {@link org.openhealthtools.mdht.uml.cda.hitsp.LanguageSpoken#validateLanguageSpokenNoProficiencyLevelCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Language Spoken No Proficiency Level Code}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.hitsp.LanguageSpoken#validateLanguageSpokenTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Language Spoken Template Id}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.hitsp.LanguageSpoken#validateLanguageSpokenModeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Language Spoken Mode Code}
  • + *
+ *

+ * + * @generated + */ + +public class LanguageSpokenTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateLanguageSpokenNoProficiencyLevelCode() { + OperationsTestCase validateLanguageSpokenNoProficiencyLevelCodeTestCase = new OperationsTestCase( + "validateLanguageSpokenNoProficiencyLevelCode", + operationsForOCL.getOCLValue("VALIDATE_LANGUAGE_SPOKEN_NO_PROFICIENCY_LEVEL_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(LanguageSpoken target) { + target.init(); + target.setProficiencyLevelCode(DatatypesFactory.eINSTANCE.createCE()); + + } + + @Override + protected void updateToPass(LanguageSpoken target) { + target.setProficiencyLevelCode(null); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return LanguageSpokenOperations.validateLanguageSpokenNoProficiencyLevelCode( + (LanguageSpoken) objectToTest, diagnostician, map); + } + + }; + + validateLanguageSpokenNoProficiencyLevelCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateLanguageSpokenTemplateId() { + OperationsTestCase validateLanguageSpokenTemplateIdTestCase = new OperationsTestCase( + "validateLanguageSpokenTemplateId", + operationsForOCL.getOCLValue("VALIDATE_LANGUAGE_SPOKEN_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(LanguageSpoken target) { + + } + + @Override + protected void updateToPass(LanguageSpoken target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return LanguageSpokenOperations.validateLanguageSpokenTemplateId( + (LanguageSpoken) objectToTest, diagnostician, map); + } + + }; + + validateLanguageSpokenTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateLanguageSpokenModeCode() { + OperationsTestCase validateLanguageSpokenModeCodeTestCase = new OperationsTestCase( + "validateLanguageSpokenModeCode", + operationsForOCL.getOCLValue("VALIDATE_LANGUAGE_SPOKEN_MODE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(LanguageSpoken target) { + + } + + @Override + protected void updateToPass(LanguageSpoken target) { + target.init(); + // 2.16.840.1.113883.5.60' and (value.code = 'ESGN' or + CE ce = DatatypesFactory.eINSTANCE.createCE("ESGN", "2.16.840.1.113883.5.60"); + + target.setModeCode(ce); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return LanguageSpokenOperations.validateLanguageSpokenModeCode( + (LanguageSpoken) objectToTest, diagnostician, map); + } + + }; + + validateLanguageSpokenModeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends LanguageSpokenOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public LanguageSpoken create() { + return HITSPFactory.eINSTANCE.createLanguageSpoken(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends LanguageSpokenOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // LanguageSpokenOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/MedicalEquipmentSectionTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/MedicalEquipmentSectionTest.java new file mode 100644 index 000000000..c5c65cb73 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/MedicalEquipmentSectionTest.java @@ -0,0 +1,144 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.MedicalEquipmentSection; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.MedicalEquipmentSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Medical Equipment Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.MedicalEquipmentSection#validateHITSPMedicalEquipmentSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Medical Equipment Section Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class MedicalEquipmentSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHITSPMedicalEquipmentSectionTemplateId() { + OperationsTestCase validateHITSPMedicalEquipmentSectionTemplateIdTestCase = new OperationsTestCase( + "validateHITSPMedicalEquipmentSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HITSP_MEDICAL_EQUIPMENT_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicalEquipmentSection target) { + + } + + @Override + protected void updateToPass(MedicalEquipmentSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicalEquipmentSectionOperations.validateHITSPMedicalEquipmentSectionTemplateId( + (MedicalEquipmentSection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPMedicalEquipmentSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends MedicalEquipmentSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public MedicalEquipmentSection create() { + return HITSPFactory.eINSTANCE.createMedicalEquipmentSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends MedicalEquipmentSectionOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // MedicalEquipmentSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/MedicationCombinationMedicationTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/MedicationCombinationMedicationTest.java new file mode 100644 index 000000000..71a7b34f2 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/MedicationCombinationMedicationTest.java @@ -0,0 +1,47 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Medication Combination Medication' model objects. + * + * + * + * @generated + */ + +public class MedicationCombinationMedicationTest extends CDAValidationTest { + + /** + * No Operations Test + * + * @generated + */ + @Test + public void testNoOperations() { + } + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // MedicationCombinationMedicationOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/MedicationConditionalDoseTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/MedicationConditionalDoseTest.java new file mode 100644 index 000000000..cb2df1474 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/MedicationConditionalDoseTest.java @@ -0,0 +1,47 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Medication Conditional Dose' model objects. + * + * + * @generated + */ + +public class MedicationConditionalDoseTest extends CDAValidationTest { + + /** + * No Operations Test + * + * @generated + */ + @Test + public void testNoOperations() { + } + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // MedicationConditionalDoseOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/MedicationInformationTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/MedicationInformationTest.java new file mode 100644 index 000000000..99489c3f7 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/MedicationInformationTest.java @@ -0,0 +1,437 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Material; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.MedicationInformation; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.MedicationInformationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; +import org.openhealthtools.mdht.uml.hl7.datatypes.EN; + +/** + * A static utility class that provides operations + * related to 'Medication Information' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.MedicationInformation#validateMedicationInformationCodedProductName(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Information Coded Product Name}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.MedicationInformation#validateMedicationInformationCodedProductVocab(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Information Coded Product Vocab}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.MedicationInformation#validateMedicationInformationCodedIngredientVocab(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Information Coded Ingredient Vocab}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.MedicationInformation#validateMedicationInformationCodedBrandName(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Information Coded Brand Name}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.MedicationInformation#validateMedicationInformationCodedBrandNameVocab(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Information Coded Brand Name Vocab}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.MedicationInformation#validateMedicationInformationFreeTextProductName(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Information Free Text Product Name}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.MedicationInformation#validateMedicationInformationFreeTextBrandName(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Information Free Text Brand Name}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.MedicationInformation#validateMedicationInformationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Information Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class MedicationInformationTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationInformationCodedProductName() { + OperationsTestCase validateMedicationInformationCodedProductNameTestCase = new OperationsTestCase( + "validateMedicationInformationCodedProductName", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_INFORMATION_CODED_PRODUCT_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationInformation target) { + + } + + @Override + protected void updateToPass(MedicationInformation target) { + Material mm = CDAFactory.eINSTANCE.createMaterial(); + CE ce = DatatypesFactory.eINSTANCE.createCE(); + ce.setCodeSystem("2.16.840.1.113883.3.88.12.80.17"); + ce.setCode("111"); + mm.setCode(ce); + CD cd = DatatypesFactory.eINSTANCE.createCD(); + ce.getTranslations().add(cd); + target.setManufacturedMaterial(mm); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationInformationOperations.validateMedicationInformationCodedProductName( + (MedicationInformation) objectToTest, diagnostician, map); + } + + }; + + validateMedicationInformationCodedProductNameTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationInformationCodedProductVocab() { + OperationsTestCase validateMedicationInformationCodedProductVocabTestCase = new OperationsTestCase( + "validateMedicationInformationCodedProductVocab", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_INFORMATION_CODED_PRODUCT_VOCAB__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationInformation target) { + + } + + @Override + protected void updateToPass(MedicationInformation target) { + Material mm = CDAFactory.eINSTANCE.createMaterial(); + CE ce = DatatypesFactory.eINSTANCE.createCE(); + ce.setCodeSystem("2.16.840.1.113883.6.88"); + mm.setCode(ce); + CD cd = DatatypesFactory.eINSTANCE.createCD(); + ce.getTranslations().add(cd); + target.setManufacturedMaterial(mm); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationInformationOperations.validateMedicationInformationCodedProductVocab( + (MedicationInformation) objectToTest, diagnostician, map); + } + + }; + + validateMedicationInformationCodedProductVocabTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationInformationCodedIngredientVocab() { + OperationsTestCase validateMedicationInformationCodedIngredientVocabTestCase = new OperationsTestCase( + "validateMedicationInformationCodedIngredientVocab", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_INFORMATION_CODED_INGREDIENT_VOCAB__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationInformation target) { + + } + + @Override + protected void updateToPass(MedicationInformation target) { + Material mm = CDAFactory.eINSTANCE.createMaterial(); + CE ce = DatatypesFactory.eINSTANCE.createCE(); + ce.setCodeSystem("2.16.840.1.113883.4.9"); + mm.setCode(ce); + CD cd = DatatypesFactory.eINSTANCE.createCD(); + ce.getTranslations().add(cd); + target.setManufacturedMaterial(mm); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationInformationOperations.validateMedicationInformationCodedIngredientVocab( + (MedicationInformation) objectToTest, diagnostician, map); + } + + }; + + validateMedicationInformationCodedIngredientVocabTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationInformationCodedBrandName() { + OperationsTestCase validateMedicationInformationCodedBrandNameTestCase = new OperationsTestCase( + "validateMedicationInformationCodedBrandName", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_INFORMATION_CODED_BRAND_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationInformation target) { + + } + + @Override + protected void updateToPass(MedicationInformation target) { + Material mm = CDAFactory.eINSTANCE.createMaterial(); + CE ce = DatatypesFactory.eINSTANCE.createCE(); + ce.setCodeSystem("2.16.840.1.113883.6.88"); + mm.setCode(ce); + CD cd = DatatypesFactory.eINSTANCE.createCD(); + ce.getTranslations().add(cd); + target.setManufacturedMaterial(mm); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationInformationOperations.validateMedicationInformationCodedBrandName( + (MedicationInformation) objectToTest, diagnostician, map); + } + + }; + + validateMedicationInformationCodedBrandNameTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationInformationCodedBrandNameVocab() { + OperationsTestCase validateMedicationInformationCodedBrandNameVocabTestCase = new OperationsTestCase( + "validateMedicationInformationCodedBrandNameVocab", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_INFORMATION_CODED_BRAND_NAME_VOCAB__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationInformation target) { + + } + + @Override + protected void updateToPass(MedicationInformation target) { + Material mm = CDAFactory.eINSTANCE.createMaterial(); + CE ce = DatatypesFactory.eINSTANCE.createCE(); + ce.setCodeSystem("2.16.840.1.113883.6.88"); + mm.setCode(ce); + target.setManufacturedMaterial(mm); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationInformationOperations.validateMedicationInformationCodedBrandNameVocab( + (MedicationInformation) objectToTest, diagnostician, map); + } + + }; + + validateMedicationInformationCodedBrandNameVocabTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationInformationFreeTextProductName() { + OperationsTestCase validateMedicationInformationFreeTextProductNameTestCase = new OperationsTestCase( + "validateMedicationInformationFreeTextProductName", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_INFORMATION_FREE_TEXT_PRODUCT_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationInformation target) { + + } + + @Override + protected void updateToPass(MedicationInformation target) { + target.init(); + + Material mm = CDAFactory.eINSTANCE.createMaterial(); + CE ce = DatatypesFactory.eINSTANCE.createCE(); + ED ot = DatatypesFactory.eINSTANCE.createED(); + ce.setOriginalText(ot); + mm.setCode(ce); + target.setManufacturedMaterial(mm); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationInformationOperations.validateMedicationInformationFreeTextProductName( + (MedicationInformation) objectToTest, diagnostician, map); + } + + }; + + validateMedicationInformationFreeTextProductNameTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationInformationFreeTextBrandName() { + OperationsTestCase validateMedicationInformationFreeTextBrandNameTestCase = new OperationsTestCase( + "validateMedicationInformationFreeTextBrandName", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_INFORMATION_FREE_TEXT_BRAND_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationInformation target) { + + } + + @Override + protected void updateToPass(MedicationInformation target) { + target.init(); + + Material mm = CDAFactory.eINSTANCE.createMaterial(); + EN name = DatatypesFactory.eINSTANCE.createEN(); + + mm.setName(name); + target.setManufacturedMaterial(mm); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationInformationOperations.validateMedicationInformationFreeTextBrandName( + (MedicationInformation) objectToTest, diagnostician, map); + } + + }; + + validateMedicationInformationFreeTextBrandNameTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicationInformationTemplateId() { + OperationsTestCase validateMedicationInformationTemplateIdTestCase = new OperationsTestCase( + "validateMedicationInformationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_INFORMATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationInformation target) { + + } + + @Override + protected void updateToPass(MedicationInformation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationInformationOperations.validateMedicationInformationTemplateId( + (MedicationInformation) objectToTest, diagnostician, map); + } + + }; + + validateMedicationInformationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends MedicationInformationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public MedicationInformation create() { + return HITSPFactory.eINSTANCE.createMedicationInformation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends MedicationInformationOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // MedicationInformationOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/MedicationNormalDoseTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/MedicationNormalDoseTest.java new file mode 100644 index 000000000..6b7de58b4 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/MedicationNormalDoseTest.java @@ -0,0 +1,47 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Medication Normal Dose' model objects. + * + * + * @generated + */ + +public class MedicationNormalDoseTest extends CDAValidationTest { + + /** + * No Operations Test + * + * @generated + */ + @Test + public void testNoOperations() { + } + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // MedicationNormalDoseOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/MedicationOrderInformationTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/MedicationOrderInformationTest.java new file mode 100644 index 000000000..09a38ffd4 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/MedicationOrderInformationTest.java @@ -0,0 +1,664 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.math.BigDecimal; +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.AssignedEntity; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.Performer2; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.MedicationOrderInformation; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.MedicationOrderInformationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.AD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.datatypes.PQ; +import org.openhealthtools.mdht.uml.hl7.datatypes.SXCM_TS; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; +import org.openhealthtools.mdht.uml.hl7.vocab.x_DocumentSubstanceMood; + +/** + * A static utility class that provides operations + * related to 'Medication Order Information' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.MedicationOrderInformation#validateMedicationOrderInformationOrderNumber(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Order Information Order Number}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.MedicationOrderInformation#validateMedicationOrderInformationOrderExpiration(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Order Information Order Expiration}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.MedicationOrderInformation#validateMedicationOrderInformationQuantityOrdered(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Order Information Quantity Ordered}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.MedicationOrderInformation#validateMedicationOrderInformationQuantityUnit(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Order Information Quantity Unit}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.MedicationOrderInformation#validateMedicationOrderInformationPrescriptionNumber(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Order Information Prescription Number}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.MedicationOrderInformation#validateMedicationOrderInformationAssigningAuthority(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Order Information Assigning Authority}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.MedicationOrderInformation#validateMedicationOrderInformationDispenseDate(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Order Information Dispense Date}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.MedicationOrderInformation#validateMedicationOrderInformationDispensingPharmacyLocation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Order Information Dispensing Pharmacy Location}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.MedicationOrderInformation#validateMedicationOrderInformationQuantityDispensed(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Order Information Quantity Dispensed}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.MedicationOrderInformation#validateMedicationOrderInformationHasFillNumber(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Order Information Has Fill Number}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.MedicationOrderInformation#validateMedicationOrderInformationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Order Information Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.MedicationOrderInformation#validateMedicationOrderInformationRepeatNumber(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Order Information Repeat Number}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.MedicationOrderInformation#validateMedicationOrderInformationStatusCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Order Information Status Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.MedicationOrderInformation#validateMedicationOrderInformationStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Order Information Status Code}
  • + *
+ *

+ * + * @generated + */ + +public class MedicationOrderInformationTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationOrderInformationOrderNumber() { + OperationsTestCase validateMedicationOrderInformationOrderNumberTestCase = new OperationsTestCase( + "validateMedicationOrderInformationOrderNumber", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ORDER_INFORMATION_ORDER_NUMBER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationOrderInformation target) { + target.init(); + target.setMoodCode(x_DocumentSubstanceMood.INT); + } + + @Override + protected void updateToPass(MedicationOrderInformation target) { + target.setMoodCode(x_DocumentSubstanceMood.INT); + target.getIds().add(DatatypesFactory.eINSTANCE.createII()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOrderInformationOperations.validateMedicationOrderInformationOrderNumber( + (MedicationOrderInformation) objectToTest, diagnostician, map); + } + + }; + + validateMedicationOrderInformationOrderNumberTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationOrderInformationOrderExpiration() { + OperationsTestCase validateMedicationOrderInformationOrderExpirationTestCase = new OperationsTestCase( + "validateMedicationOrderInformationOrderExpiration", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ORDER_INFORMATION_ORDER_EXPIRATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationOrderInformation target) { + + target.init(); + target.setMoodCode(x_DocumentSubstanceMood.INT); + + } + + @Override + protected void updateToPass(MedicationOrderInformation target) { + + SXCM_TS ef = DatatypesFactory.eINSTANCE.createSXCM_TS(); + // ef. + // ef.setValue("value"); + target.getEffectiveTimes().add(ef); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOrderInformationOperations.validateMedicationOrderInformationOrderExpiration( + (MedicationOrderInformation) objectToTest, diagnostician, map); + } + + }; + + validateMedicationOrderInformationOrderExpirationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationOrderInformationQuantityOrdered() { + OperationsTestCase validateMedicationOrderInformationQuantityOrderedTestCase = new OperationsTestCase( + "validateMedicationOrderInformationQuantityOrdered", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ORDER_INFORMATION_QUANTITY_ORDERED__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationOrderInformation target) { + + } + + @Override + protected void updateToPass(MedicationOrderInformation target) { + target.init(); + PQ qt = DatatypesFactory.eINSTANCE.createPQ(); + BigDecimal value = new BigDecimal(0); + qt.setValue(value); + target.setQuantity(qt); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOrderInformationOperations.validateMedicationOrderInformationQuantityOrdered( + (MedicationOrderInformation) objectToTest, diagnostician, map); + } + + }; + + validateMedicationOrderInformationQuantityOrderedTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationOrderInformationQuantityUnit() { + OperationsTestCase validateMedicationOrderInformationQuantityUnitTestCase = new OperationsTestCase( + "validateMedicationOrderInformationQuantityUnit", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ORDER_INFORMATION_QUANTITY_UNIT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationOrderInformation target) { + PQ pq = DatatypesFactory.eINSTANCE.createPQ(); + pq.setUnit(null); + target.setQuantity(pq); + + } + + @Override + protected void updateToPass(MedicationOrderInformation target) { + target.init(); + target.getQuantity().setUnit("unit"); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOrderInformationOperations.validateMedicationOrderInformationQuantityUnit( + (MedicationOrderInformation) objectToTest, diagnostician, map); + } + + }; + + validateMedicationOrderInformationQuantityUnitTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationOrderInformationPrescriptionNumber() { + OperationsTestCase validateMedicationOrderInformationPrescriptionNumberTestCase = new OperationsTestCase( + "validateMedicationOrderInformationPrescriptionNumber", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ORDER_INFORMATION_PRESCRIPTION_NUMBER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationOrderInformation target) { + + } + + @Override + protected void updateToPass(MedicationOrderInformation target) { + target.init(); + II id = DatatypesFactory.eINSTANCE.createII(); + id.setExtension("1"); + target.getIds().add(id); + target.setMoodCode(x_DocumentSubstanceMood.EVN); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOrderInformationOperations.validateMedicationOrderInformationPrescriptionNumber( + (MedicationOrderInformation) objectToTest, diagnostician, map); + } + + }; + + validateMedicationOrderInformationPrescriptionNumberTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationOrderInformationAssigningAuthority() { + OperationsTestCase validateMedicationOrderInformationAssigningAuthorityTestCase = new OperationsTestCase( + "validateMedicationOrderInformationAssigningAuthority", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ORDER_INFORMATION_ASSIGNING_AUTHORITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationOrderInformation target) { + + } + + @Override + protected void updateToPass(MedicationOrderInformation target) { + target.init(); + II id = DatatypesFactory.eINSTANCE.createII(); + id.setRoot("1"); + target.getIds().add(id); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOrderInformationOperations.validateMedicationOrderInformationAssigningAuthority( + (MedicationOrderInformation) objectToTest, diagnostician, map); + } + + }; + + validateMedicationOrderInformationAssigningAuthorityTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationOrderInformationDispenseDate() { + OperationsTestCase validateMedicationOrderInformationDispenseDateTestCase = new OperationsTestCase( + "validateMedicationOrderInformationDispenseDate", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ORDER_INFORMATION_DISPENSE_DATE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationOrderInformation target) { + target.init(); + target.setMoodCode(x_DocumentSubstanceMood.EVN); + } + + @Override + protected void updateToPass(MedicationOrderInformation target) { + + target.getEffectiveTimes().add(DatatypesFactory.eINSTANCE.createSXCM_TS()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOrderInformationOperations.validateMedicationOrderInformationDispenseDate( + (MedicationOrderInformation) objectToTest, diagnostician, map); + } + + }; + + validateMedicationOrderInformationDispenseDateTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationOrderInformationDispensingPharmacyLocation() { + OperationsTestCase validateMedicationOrderInformationDispensingPharmacyLocationTestCase = new OperationsTestCase( + "validateMedicationOrderInformationDispensingPharmacyLocation", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ORDER_INFORMATION_DISPENSING_PHARMACY_LOCATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationOrderInformation target) { + target.init(); + Performer2 pr = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + pr.setAssignedEntity(ae); + target.setMoodCode(x_DocumentSubstanceMood.EVN); + target.getPerformers().add(pr); + + } + + @Override + protected void updateToPass(MedicationOrderInformation target) { + for (Performer2 p2 : target.getPerformers()) { + AD addr = DatatypesFactory.eINSTANCE.createAD(); + p2.getAssignedEntity().getAddrs().add(addr); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOrderInformationOperations.validateMedicationOrderInformationDispensingPharmacyLocation( + (MedicationOrderInformation) objectToTest, diagnostician, map); + } + + }; + + validateMedicationOrderInformationDispensingPharmacyLocationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationOrderInformationQuantityDispensed() { + OperationsTestCase validateMedicationOrderInformationQuantityDispensedTestCase = new OperationsTestCase( + "validateMedicationOrderInformationQuantityDispensed", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ORDER_INFORMATION_QUANTITY_DISPENSED__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationOrderInformation target) { + + target.setMoodCode(x_DocumentSubstanceMood.EVN); + + PQ pq = DatatypesFactory.eINSTANCE.createPQ(); + target.setQuantity(pq); + + } + + @Override + protected void updateToPass(MedicationOrderInformation target) { + target.init(); + target.setMoodCode(x_DocumentSubstanceMood.EVN); + + PQ pq = DatatypesFactory.eINSTANCE.createPQ(); + BigDecimal value = new BigDecimal(0); + pq.setValue(value); + target.setQuantity(pq); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOrderInformationOperations.validateMedicationOrderInformationQuantityDispensed( + (MedicationOrderInformation) objectToTest, diagnostician, map); + } + + }; + + validateMedicationOrderInformationQuantityDispensedTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationOrderInformationHasFillNumber() { + OperationsTestCase validateMedicationOrderInformationHasFillNumberTestCase = new OperationsTestCase( + "validateMedicationOrderInformationHasFillNumber", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ORDER_INFORMATION_HAS_FILL_NUMBER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationOrderInformation target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + target.getEntryRelationships().add(er); + } + + @Override + protected void updateToPass(MedicationOrderInformation target) { + + for (EntryRelationship er : target.getEntryRelationships()) { + er.setSequenceNumber(DatatypesFactory.eINSTANCE.createINT()); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOrderInformationOperations.validateMedicationOrderInformationHasFillNumber( + (MedicationOrderInformation) objectToTest, diagnostician, map); + } + + }; + + validateMedicationOrderInformationHasFillNumberTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicationOrderInformationTemplateId() { + OperationsTestCase validateMedicationOrderInformationTemplateIdTestCase = new OperationsTestCase( + "validateMedicationOrderInformationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ORDER_INFORMATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationOrderInformation target) { + + } + + @Override + protected void updateToPass(MedicationOrderInformation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOrderInformationOperations.validateMedicationOrderInformationTemplateId( + (MedicationOrderInformation) objectToTest, diagnostician, map); + } + + }; + + validateMedicationOrderInformationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationOrderInformationRepeatNumber() { + OperationsTestCase validateMedicationOrderInformationRepeatNumberTestCase = new OperationsTestCase( + "validateMedicationOrderInformationRepeatNumber", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ORDER_INFORMATION_REPEAT_NUMBER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationOrderInformation target) { + + } + + @Override + protected void updateToPass(MedicationOrderInformation target) { + target.init(); + target.setRepeatNumber(DatatypesFactory.eINSTANCE.createIVL_INT()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOrderInformationOperations.validateMedicationOrderInformationRepeatNumber( + (MedicationOrderInformation) objectToTest, diagnostician, map); + } + + }; + + validateMedicationOrderInformationRepeatNumberTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMedicationOrderInformationStatusCodeP() { + OperationsTestCase validateMedicationOrderInformationStatusCodePTestCase = new OperationsTestCase( + "validateMedicationOrderInformationStatusCodeP", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ORDER_INFORMATION_STATUS_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationOrderInformation target) { + target.init(); + } + + @Override + protected void updateToPass(MedicationOrderInformation target) { + CS cs = DatatypesFactory.eINSTANCE.createCS(); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOrderInformationOperations.validateMedicationOrderInformationStatusCodeP( + (MedicationOrderInformation) objectToTest, diagnostician, map); + } + + }; + + validateMedicationOrderInformationStatusCodePTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationOrderInformationStatusCode() { + OperationsTestCase validateMedicationOrderInformationStatusCodeTestCase = new OperationsTestCase( + "validateMedicationOrderInformationStatusCode", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_ORDER_INFORMATION_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationOrderInformation target) { + + } + + @Override + protected void updateToPass(MedicationOrderInformation target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + cs.setCodeSystem("2.16.840.1.113883.3.88.12.80.64"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOrderInformationOperations.validateMedicationOrderInformationStatusCode( + (MedicationOrderInformation) objectToTest, diagnostician, map); + } + + }; + + validateMedicationOrderInformationStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends MedicationOrderInformationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public MedicationOrderInformation create() { + return HITSPFactory.eINSTANCE.createMedicationOrderInformation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends MedicationOrderInformationOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // MedicationOrderInformationOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/MedicationSplitDoseTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/MedicationSplitDoseTest.java new file mode 100644 index 000000000..9c2664ec5 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/MedicationSplitDoseTest.java @@ -0,0 +1,47 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Medication Split Dose' model objects. + * + * + * @generated + */ + +public class MedicationSplitDoseTest extends CDAValidationTest { + + /** + * No Operations Test + * + * @generated + */ + @Test + public void testNoOperations() { + } + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // MedicationSplitDoseOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/MedicationTaperedDoseTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/MedicationTaperedDoseTest.java new file mode 100644 index 000000000..4d642bb2b --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/MedicationTaperedDoseTest.java @@ -0,0 +1,144 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.MedicationTaperedDose; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.MedicationTaperedDoseOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Medication Tapered Dose' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.MedicationTaperedDose#validateHITSPMedicationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Medication Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class MedicationTaperedDoseTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHITSPMedicationTemplateId() { + OperationsTestCase validateHITSPMedicationTemplateIdTestCase = new OperationsTestCase( + "validateHITSPMedicationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HITSP_MEDICATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationTaperedDose target) { + + } + + @Override + protected void updateToPass(MedicationTaperedDose target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationTaperedDoseOperations.validateHITSPMedicationTemplateId( + (MedicationTaperedDose) objectToTest, diagnostician, map); + } + + }; + + validateHITSPMedicationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends MedicationTaperedDoseOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public MedicationTaperedDose create() { + return HITSPFactory.eINSTANCE.createMedicationTaperedDose(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends MedicationTaperedDoseOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // MedicationTaperedDoseOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/MedicationTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/MedicationTest.java new file mode 100644 index 000000000..cab36276b --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/MedicationTest.java @@ -0,0 +1,1257 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Consumable; +import org.openhealthtools.mdht.uml.cda.Participant2; +import org.openhealthtools.mdht.uml.cda.ParticipantRole; +import org.openhealthtools.mdht.uml.cda.PlayingEntity; +import org.openhealthtools.mdht.uml.cda.SubstanceAdministration; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.MedicationStatusObservation; +import org.openhealthtools.mdht.uml.cda.ccd.ProblemObservation; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.Medication; +import org.openhealthtools.mdht.uml.cda.hitsp.MedicationInformation; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.MedicationOperations; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.PatientMedicalInstructions; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_PQ; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.datatypes.RTO_PQ_PQ; +import org.openhealthtools.mdht.uml.hl7.vocab.ParticipationType; +import org.openhealthtools.mdht.uml.hl7.vocab.RoleClassRoot; + +/** + * A static utility class that provides operations + * related to 'Medication' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Medication#validateHITSPMedicationFirstEffectiveTimeDatatype(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Medication First Effective Time Datatype}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Medication#validateHITSPMedicationDoseUnits(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Medication Dose Units}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Medication#validateHITSPMedicationDeliveryMethodDescription(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Medication Delivery Method Description}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Medication#validateHITSPMedicationHasMedicationInformation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Medication Has Medication Information}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Medication#validateHITSPMedicationHasStatusOfMedication(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Medication Has Status Of Medication}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Medication#validateHITSPMedicationHasIndication(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Medication Has Indication}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Medication#validateHITSPMedicationHasIndicationNarrativeText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Medication Has Indication Narrative Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Medication#validateHITSPMedicationHasIndicationVocab(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Medication Has Indication Vocab}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Medication#validateHITSPMedicationHasPatientInstructions(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Medication Has Patient Instructions}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Medication#validateHITSPMedicationHasMedicationVehicle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Medication Has Medication Vehicle}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Medication#validateHITSPMedicationMedicationVehicleType(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Medication Medication Vehicle Type}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Medication#validateHITSPMedicationMedicationVehicleClass(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Medication Medication Vehicle Class}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Medication#validateHITSPMedicationMedicationVehicleCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Medication Medication Vehicle Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Medication#validateHITSPMedicationMedicationVehicleName(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Medication Medication Vehicle Name}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Medication#validateHITSPMedicationMedicationVehicleCodedName(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Medication Medication Vehicle Coded Name}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Medication#validateHITSPMedicationMedicationVehicleCodedNameVocab(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Medication Medication Vehicle Coded Name Vocab}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Medication#validateHITSPMedicationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Medication Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Medication#validateHITSPMedicationEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Medication Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Medication#validateHITSPMedicationRouteCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Medication Route Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Medication#validateHITSPMedicationRouteCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Medication Route Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Medication#validateHITSPMedicationDoseQuantity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Medication Dose Quantity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Medication#validateHITSPMedicationAdministrationUnitCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Medication Administration Unit Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Medication#validateHITSPMedicationMaxDoseQuantity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Medication Max Dose Quantity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Medication#validateHITSPMedicationApproachSiteCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Medication Approach Site Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Medication#validateHITSPMedicationApproachSiteCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Medication Approach Site Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Medication#validateHITSPMedicationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Medication Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Medication#getMedicationType() Get Medication Type}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Medication#getMedicationOrderInformations() Get Medication Order Informations}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Medication#getHITSPReactionObservation() Get HITSP Reaction Observation}
  • + *
+ *

+ * + * @generated + */ + +public class MedicationTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateHITSPMedicationFirstEffectiveTimeDatatype() { + OperationsTestCase validateHITSPMedicationFirstEffectiveTimeDatatypeTestCase = new OperationsTestCase( + "validateHITSPMedicationFirstEffectiveTimeDatatype", + operationsForOCL.getOCLValue("VALIDATE_HITSP_MEDICATION_FIRST_EFFECTIVE_TIME_DATATYPE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Medication target) { + + } + + @Override + protected void updateToPass(Medication target) { + target.init(); + target.getEffectiveTimes().add(DatatypesFactory.eINSTANCE.createSXCM_TS()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOperations.validateHITSPMedicationFirstEffectiveTimeDatatype( + (Medication) objectToTest, diagnostician, map); + } + + }; + + validateHITSPMedicationFirstEffectiveTimeDatatypeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHITSPMedicationDoseUnits() { + OperationsTestCase validateHITSPMedicationDoseUnitsTestCase = new OperationsTestCase( + "validateHITSPMedicationDoseUnits", + operationsForOCL.getOCLValue("VALIDATE_HITSP_MEDICATION_DOSE_UNITS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Medication target) { + + } + + @Override + protected void updateToPass(Medication target) { + target.init(); + IVL_PQ dq = DatatypesFactory.eINSTANCE.createIVL_PQ(); + dq.setUnit("2.16.840.1.113883.3.88.12.80.29"); + target.setDoseQuantity(dq); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOperations.validateHITSPMedicationDoseUnits( + (Medication) objectToTest, diagnostician, map); + } + + }; + + validateHITSPMedicationDoseUnitsTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHITSPMedicationDeliveryMethodDescription() { + OperationsTestCase validateHITSPMedicationDeliveryMethodDescriptionTestCase = new OperationsTestCase( + "validateHITSPMedicationDeliveryMethodDescription", + operationsForOCL.getOCLValue("VALIDATE_HITSP_MEDICATION_DELIVERY_METHOD_DESCRIPTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Medication target) { + + } + + @Override + protected void updateToPass(Medication target) { + target.init(); + CD code = DatatypesFactory.eINSTANCE.createCD(); + code.setOriginalText(DatatypesFactory.eINSTANCE.createED()); + target.setCode(code); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOperations.validateHITSPMedicationDeliveryMethodDescription( + (Medication) objectToTest, diagnostician, map); + } + + }; + + validateHITSPMedicationDeliveryMethodDescriptionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHITSPMedicationHasMedicationInformation() { + OperationsTestCase validateHITSPMedicationHasMedicationInformationTestCase = new OperationsTestCase( + "validateHITSPMedicationHasMedicationInformation", + operationsForOCL.getOCLValue("VALIDATE_HITSP_MEDICATION_HAS_MEDICATION_INFORMATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Medication target) { + target.init(); + Consumable con = CDAFactory.eINSTANCE.createConsumable(); + target.setConsumable(con); + } + + @Override + protected void updateToPass(Medication target) { + Consumable con = CDAFactory.eINSTANCE.createConsumable(); + MedicationInformation mi = HITSPFactory.eINSTANCE.createMedicationInformation(); + con.setManufacturedProduct(mi); + target.setConsumable(con); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOperations.validateHITSPMedicationHasMedicationInformation( + (Medication) objectToTest, diagnostician, map); + } + + }; + + validateHITSPMedicationHasMedicationInformationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHITSPMedicationHasStatusOfMedication() { + OperationsTestCase validateHITSPMedicationHasStatusOfMedicationTestCase = new OperationsTestCase( + "validateHITSPMedicationHasStatusOfMedication", + operationsForOCL.getOCLValue("VALIDATE_HITSP_MEDICATION_HAS_STATUS_OF_MEDICATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Medication target) { + + } + + @Override + protected void updateToPass(Medication target) { + target.init(); + MedicationStatusObservation mso = CCDFactory.eINSTANCE.createMedicationStatusObservation(); + target.addObservation(mso); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOperations.validateHITSPMedicationHasStatusOfMedication( + (Medication) objectToTest, diagnostician, map); + } + + }; + + validateHITSPMedicationHasStatusOfMedicationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHITSPMedicationHasIndication() { + OperationsTestCase validateHITSPMedicationHasIndicationTestCase = new OperationsTestCase( + "validateHITSPMedicationHasIndication", + operationsForOCL.getOCLValue("VALIDATE_HITSP_MEDICATION_HAS_INDICATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Medication target) { + + } + + @Override + protected void updateToPass(Medication target) { + target.init(); + ProblemObservation po = CCDFactory.eINSTANCE.createProblemObservation(); + target.addObservation(po); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOperations.validateHITSPMedicationHasIndication( + (Medication) objectToTest, diagnostician, map); + } + + }; + + validateHITSPMedicationHasIndicationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHITSPMedicationHasIndicationNarrativeText() { + OperationsTestCase validateHITSPMedicationHasIndicationNarrativeTextTestCase = new OperationsTestCase( + "validateHITSPMedicationHasIndicationNarrativeText", + operationsForOCL.getOCLValue("VALIDATE_HITSP_MEDICATION_HAS_INDICATION_NARRATIVE_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Medication target) { + + } + + @Override + protected void updateToPass(Medication target) { + target.init(); + ProblemObservation po = CCDFactory.eINSTANCE.createProblemObservation(); + ED txt = DatatypesFactory.eINSTANCE.createED(); + txt.setReference(DatatypesFactory.eINSTANCE.createTEL()); + po.setText(txt); + target.addObservation(po); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOperations.validateHITSPMedicationHasIndicationNarrativeText( + (Medication) objectToTest, diagnostician, map); + } + + }; + + validateHITSPMedicationHasIndicationNarrativeTextTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHITSPMedicationHasIndicationVocab() { + OperationsTestCase validateHITSPMedicationHasIndicationVocabTestCase = new OperationsTestCase( + "validateHITSPMedicationHasIndicationVocab", + operationsForOCL.getOCLValue("VALIDATE_HITSP_MEDICATION_HAS_INDICATION_VOCAB__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Medication target) { + + } + + @Override + protected void updateToPass(Medication target) { + target.init(); + ProblemObservation po = CCDFactory.eINSTANCE.createProblemObservation(); + CD code = DatatypesFactory.eINSTANCE.createCD(); + code.setCodeSystem("2.16.840.1.113883.6.96"); + po.setCode(code); + target.addObservation(po); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOperations.validateHITSPMedicationHasIndicationVocab( + (Medication) objectToTest, diagnostician, map); + } + + }; + + validateHITSPMedicationHasIndicationVocabTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHITSPMedicationHasPatientInstructions() { + OperationsTestCase validateHITSPMedicationHasPatientInstructionsTestCase = new OperationsTestCase( + "validateHITSPMedicationHasPatientInstructions", + operationsForOCL.getOCLValue("VALIDATE_HITSP_MEDICATION_HAS_PATIENT_INSTRUCTIONS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Medication target) { + + } + + @Override + protected void updateToPass(Medication target) { + target.init(); + PatientMedicalInstructions pmi = IHEFactory.eINSTANCE.createPatientMedicalInstructions(); + target.addAct(pmi); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOperations.validateHITSPMedicationHasPatientInstructions( + (Medication) objectToTest, diagnostician, map); + } + + }; + + validateHITSPMedicationHasPatientInstructionsTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHITSPMedicationHasMedicationVehicle() { + OperationsTestCase validateHITSPMedicationHasMedicationVehicleTestCase = new OperationsTestCase( + "validateHITSPMedicationHasMedicationVehicle", + operationsForOCL.getOCLValue("VALIDATE_HITSP_MEDICATION_HAS_MEDICATION_VEHICLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Medication target) { + + } + + @Override + protected void updateToPass(Medication target) { + target.init(); + SubstanceAdministration sa = CDAFactory.eINSTANCE.createSubstanceAdministration(); + + Participant2 p2 = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + p2.setParticipantRole(pr); + sa.getParticipants().add(p2); + target.addSubstanceAdministration(sa); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOperations.validateHITSPMedicationHasMedicationVehicle( + (Medication) objectToTest, diagnostician, map); + } + + }; + + validateHITSPMedicationHasMedicationVehicleTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHITSPMedicationMedicationVehicleType() { + OperationsTestCase validateHITSPMedicationMedicationVehicleTypeTestCase = new OperationsTestCase( + "validateHITSPMedicationMedicationVehicleType", + operationsForOCL.getOCLValue("VALIDATE_HITSP_MEDICATION_MEDICATION_VEHICLE_TYPE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Medication target) { + + target.init(); + SubstanceAdministration sa = CDAFactory.eINSTANCE.createSubstanceAdministration(); + + Participant2 p2 = CDAFactory.eINSTANCE.createParticipant2(); + // p2.setTypeCode(ParticipationType.CSM); + sa.getParticipants().add(p2); + target.addSubstanceAdministration(sa); + } + + @Override + protected void updateToPass(Medication target) { + + for (SubstanceAdministration sa : target.getSubstanceAdministrations()) { + for (Participant2 p2 : sa.getParticipants()) { + p2.setTypeCode(ParticipationType.CSM); + } + + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOperations.validateHITSPMedicationMedicationVehicleType( + (Medication) objectToTest, diagnostician, map); + } + + }; + + validateHITSPMedicationMedicationVehicleTypeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHITSPMedicationMedicationVehicleClass() { + OperationsTestCase validateHITSPMedicationMedicationVehicleClassTestCase = new OperationsTestCase( + "validateHITSPMedicationMedicationVehicleClass", + operationsForOCL.getOCLValue("VALIDATE_HITSP_MEDICATION_MEDICATION_VEHICLE_CLASS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Medication target) { + + target.init(); + SubstanceAdministration sa = CDAFactory.eINSTANCE.createSubstanceAdministration(); + + Participant2 p2 = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + // p2.setTypeCode(ParticipationType.CSM); + // pr.setClassCode(RoleClassRoot.MANU); + p2.setParticipantRole(pr); + sa.getParticipants().add(p2); + target.addSubstanceAdministration(sa); + + } + + @Override + protected void updateToPass(Medication target) { + + for (SubstanceAdministration sa : target.getSubstanceAdministrations()) { + for (Participant2 p2 : sa.getParticipants()) { + p2.setTypeCode(ParticipationType.CSM); + p2.getParticipantRole().setClassCode(RoleClassRoot.MANU); + } + + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOperations.validateHITSPMedicationMedicationVehicleClass( + (Medication) objectToTest, diagnostician, map); + } + + }; + + validateHITSPMedicationMedicationVehicleClassTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHITSPMedicationMedicationVehicleCode() { + OperationsTestCase validateHITSPMedicationMedicationVehicleCodeTestCase = new OperationsTestCase( + "validateHITSPMedicationMedicationVehicleCode", + operationsForOCL.getOCLValue("VALIDATE_HITSP_MEDICATION_MEDICATION_VEHICLE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Medication target) { + + target.init(); + SubstanceAdministration sa = CDAFactory.eINSTANCE.createSubstanceAdministration(); + + Participant2 p2 = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + + p2.setParticipantRole(pr); + sa.getParticipants().add(p2); + target.addSubstanceAdministration(sa); + } + + @Override + protected void updateToPass(Medication target) { + + for (SubstanceAdministration sa : target.getSubstanceAdministrations()) { + for (Participant2 p2 : sa.getParticipants()) { + + p2.setTypeCode(ParticipationType.CSM); + p2.getParticipantRole().setClassCode(RoleClassRoot.MANU); + CE code = DatatypesFactory.eINSTANCE.createCE(); + code.setCode("412307009"); + code.setCodeSystem("2.16.840.1.113883.6.96"); + p2.getParticipantRole().setCode(code); + } + + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOperations.validateHITSPMedicationMedicationVehicleCode( + (Medication) objectToTest, diagnostician, map); + } + + }; + + validateHITSPMedicationMedicationVehicleCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHITSPMedicationMedicationVehicleName() { + OperationsTestCase validateHITSPMedicationMedicationVehicleNameTestCase = new OperationsTestCase( + "validateHITSPMedicationMedicationVehicleName", + operationsForOCL.getOCLValue("VALIDATE_HITSP_MEDICATION_MEDICATION_VEHICLE_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Medication target) { + + target.init(); + SubstanceAdministration sa = CDAFactory.eINSTANCE.createSubstanceAdministration(); + + Participant2 p2 = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + p2.setTypeCode(ParticipationType.CSM); + pr.setClassCode(RoleClassRoot.MANU); + CE code = DatatypesFactory.eINSTANCE.createCE(); + code.setCode("412307009"); + code.setCodeSystem("2.16.840.1.113883.6.96"); + pr.setCode(code); + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + + pr.setPlayingEntity(pe); + p2.setParticipantRole(pr); + sa.getParticipants().add(p2); + target.addSubstanceAdministration(sa); + } + + @Override + protected void updateToPass(Medication target) { + + for (SubstanceAdministration sa : target.getSubstanceAdministrations()) { + for (Participant2 p2 : sa.getParticipants()) { + + p2.getParticipantRole().getPlayingEntity().getNames().add(DatatypesFactory.eINSTANCE.createPN()); + + } + + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOperations.validateHITSPMedicationMedicationVehicleName( + (Medication) objectToTest, diagnostician, map); + } + + }; + + validateHITSPMedicationMedicationVehicleNameTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHITSPMedicationMedicationVehicleCodedName() { + OperationsTestCase validateHITSPMedicationMedicationVehicleCodedNameTestCase = new OperationsTestCase( + "validateHITSPMedicationMedicationVehicleCodedName", + operationsForOCL.getOCLValue("VALIDATE_HITSP_MEDICATION_MEDICATION_VEHICLE_CODED_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Medication target) { + + target.init(); + SubstanceAdministration sa = CDAFactory.eINSTANCE.createSubstanceAdministration(); + Participant2 p2 = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + + p2.setTypeCode(ParticipationType.CSM); + pr.setClassCode(RoleClassRoot.MANU); + + pr.setPlayingEntity(pe); + p2.setParticipantRole(pr); + sa.getParticipants().add(p2); + target.addSubstanceAdministration(sa); + + } + + @Override + protected void updateToPass(Medication target) { + + for (SubstanceAdministration sa : target.getSubstanceAdministrations()) { + for (Participant2 p2 : sa.getParticipants()) { + + CE ce = DatatypesFactory.eINSTANCE.createCE("412307009", "2.16.840.1.113883.6.96"); + CE ce2 = DatatypesFactory.eINSTANCE.createCE("12345", "2.16.840.1.113883.3.88.12.80.21"); + p2.getParticipantRole().setCode(ce); + p2.getParticipantRole().getPlayingEntity().setCode(ce2); + + p2.getParticipantRole().getPlayingEntity().getNames().add(DatatypesFactory.eINSTANCE.createPN()); + + } + + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOperations.validateHITSPMedicationMedicationVehicleCodedName( + (Medication) objectToTest, diagnostician, map); + } + + }; + + validateHITSPMedicationMedicationVehicleCodedNameTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHITSPMedicationMedicationVehicleCodedNameVocab() { + OperationsTestCase validateHITSPMedicationMedicationVehicleCodedNameVocabTestCase = new OperationsTestCase( + "validateHITSPMedicationMedicationVehicleCodedNameVocab", + operationsForOCL.getOCLValue("VALIDATE_HITSP_MEDICATION_MEDICATION_VEHICLE_CODED_NAME_VOCAB__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Medication target) { + + target.init(); + + SubstanceAdministration sa = CDAFactory.eINSTANCE.createSubstanceAdministration(); + Participant2 p2 = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + + p2.setTypeCode(ParticipationType.CSM); + pr.setClassCode(RoleClassRoot.MANU); + + pr.setPlayingEntity(pe); + p2.setParticipantRole(pr); + sa.getParticipants().add(p2); + target.addSubstanceAdministration(sa); + } + + @Override + protected void updateToPass(Medication target) { + + for (SubstanceAdministration sa : target.getSubstanceAdministrations()) { + for (Participant2 p2 : sa.getParticipants()) { + + CE ce = DatatypesFactory.eINSTANCE.createCE("412307009", "2.16.840.1.113883.6.96"); + CE ce2 = DatatypesFactory.eINSTANCE.createCE("12345", "2.16.840.1.113883.6.96"); + p2.getParticipantRole().setCode(ce); + p2.getParticipantRole().getPlayingEntity().setCode(ce2); + } + + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOperations.validateHITSPMedicationMedicationVehicleCodedNameVocab( + (Medication) objectToTest, diagnostician, map); + } + + }; + + validateHITSPMedicationMedicationVehicleCodedNameVocabTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHITSPMedicationTemplateId() { + OperationsTestCase validateHITSPMedicationTemplateIdTestCase = new OperationsTestCase( + "validateHITSPMedicationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HITSP_MEDICATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Medication target) { + + } + + @Override + protected void updateToPass(Medication target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOperations.validateHITSPMedicationTemplateId( + (Medication) objectToTest, diagnostician, map); + } + + }; + + validateHITSPMedicationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHITSPMedicationEffectiveTime() { + OperationsTestCase validateHITSPMedicationEffectiveTimeTestCase = new OperationsTestCase( + "validateHITSPMedicationEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_HITSP_MEDICATION_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Medication target) { + + } + + @Override + protected void updateToPass(Medication target) { + target.init(); + + IVL_TS s = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.getEffectiveTimes().add(s); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOperations.validateHITSPMedicationEffectiveTime( + (Medication) objectToTest, diagnostician, map); + } + + }; + + validateHITSPMedicationEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHITSPMedicationRouteCode() { + OperationsTestCase validateHITSPMedicationRouteCodeTestCase = new OperationsTestCase( + "validateHITSPMedicationRouteCode", + operationsForOCL.getOCLValue("VALIDATE_HITSP_MEDICATION_ROUTE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Medication target) { + target.init(); + } + + @Override + protected void updateToPass(Medication target) { + + CE ce = DatatypesFactory.eINSTANCE.createCE(); + ce.setCodeSystem("2.16.840.1.113883.3.26.1.1"); + ce.setCode("aaa"); + target.setRouteCode(ce); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOperations.validateHITSPMedicationRouteCode( + (Medication) objectToTest, diagnostician, map); + } + + }; + + validateHITSPMedicationRouteCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHITSPMedicationRouteCodeP() { + OperationsTestCase validateHITSPMedicationRouteCodePTestCase = new OperationsTestCase( + "validateHITSPMedicationRouteCodeP", + operationsForOCL.getOCLValue("VALIDATE_HITSP_MEDICATION_ROUTE_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Medication target) { + + } + + @Override + protected void updateToPass(Medication target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOperations.validateHITSPMedicationRouteCodeP( + (Medication) objectToTest, diagnostician, map); + } + + }; + + validateHITSPMedicationRouteCodePTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHITSPMedicationDoseQuantity() { + OperationsTestCase validateHITSPMedicationDoseQuantityTestCase = new OperationsTestCase( + "validateHITSPMedicationDoseQuantity", + operationsForOCL.getOCLValue("VALIDATE_HITSP_MEDICATION_DOSE_QUANTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Medication target) { + + } + + @Override + protected void updateToPass(Medication target) { + target.init(); + + IVL_PQ q = DatatypesFactory.eINSTANCE.createIVL_PQ(); + target.setDoseQuantity(q); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOperations.validateHITSPMedicationDoseQuantity( + (Medication) objectToTest, diagnostician, map); + } + + }; + + validateHITSPMedicationDoseQuantityTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHITSPMedicationAdministrationUnitCode() { + OperationsTestCase validateHITSPMedicationAdministrationUnitCodeTestCase = new OperationsTestCase( + "validateHITSPMedicationAdministrationUnitCode", + operationsForOCL.getOCLValue("VALIDATE_HITSP_MEDICATION_ADMINISTRATION_UNIT_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Medication target) { + + } + + @Override + protected void updateToPass(Medication target) { + target.init(); + CE ce = DatatypesFactory.eINSTANCE.createCE("code", "codeSystem"); + + target.setAdministrationUnitCode(ce); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOperations.validateHITSPMedicationAdministrationUnitCode( + (Medication) objectToTest, diagnostician, map); + } + + }; + + validateHITSPMedicationAdministrationUnitCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHITSPMedicationMaxDoseQuantity() { + OperationsTestCase validateHITSPMedicationMaxDoseQuantityTestCase = new OperationsTestCase( + "validateHITSPMedicationMaxDoseQuantity", + operationsForOCL.getOCLValue("VALIDATE_HITSP_MEDICATION_MAX_DOSE_QUANTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Medication target) { + + } + + @Override + protected void updateToPass(Medication target) { + target.init(); + + RTO_PQ_PQ q = DatatypesFactory.eINSTANCE.createRTO_PQ_PQ(); + target.setMaxDoseQuantity(q); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOperations.validateHITSPMedicationMaxDoseQuantity( + (Medication) objectToTest, diagnostician, map); + } + + }; + + validateHITSPMedicationMaxDoseQuantityTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHITSPMedicationApproachSiteCodeP() { + OperationsTestCase validateHITSPMedicationApproachSiteCodePTestCase = new OperationsTestCase( + "validateHITSPMedicationApproachSiteCodeP", + operationsForOCL.getOCLValue("VALIDATE_HITSP_MEDICATION_APPROACH_SITE_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Medication target) { + + } + + @Override + protected void updateToPass(Medication target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOperations.validateHITSPMedicationApproachSiteCodeP( + (Medication) objectToTest, diagnostician, map); + } + + }; + + validateHITSPMedicationApproachSiteCodePTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHITSPMedicationApproachSiteCode() { + OperationsTestCase validateHITSPMedicationApproachSiteCodeTestCase = new OperationsTestCase( + "validateHITSPMedicationApproachSiteCode", + operationsForOCL.getOCLValue("VALIDATE_HITSP_MEDICATION_APPROACH_SITE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Medication target) { + // target.init(); + CD cd = DatatypesFactory.eINSTANCE.createCD(); + target.getApproachSiteCodes().add(cd); + + } + + @Override + protected void updateToPass(Medication target) { + + for (CD cd : target.getApproachSiteCodes()) { + cd.setCode("aaa"); + cd.setCodeSystem("2.16.840.1.113883.6.96"); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOperations.validateHITSPMedicationApproachSiteCode( + (Medication) objectToTest, diagnostician, map); + } + + }; + + validateHITSPMedicationApproachSiteCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHITSPMedicationCode() { + OperationsTestCase validateHITSPMedicationCodeTestCase = new OperationsTestCase( + "validateHITSPMedicationCode", + operationsForOCL.getOCLValue("VALIDATE_HITSP_MEDICATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Medication target) { + + } + + @Override + protected void updateToPass(Medication target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOperations.validateHITSPMedicationCode((Medication) objectToTest, diagnostician, map); + } + + }; + + validateHITSPMedicationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetMedicationType() { + + Medication target = objectFactory.create(); + target.getMedicationType(); + + } + + /** + * + * @generated + */ + @Test + public void testGetMedicationOrderInformations() { + + Medication target = objectFactory.create(); + target.getMedicationOrderInformations(); + + } + + /** + * + * @generated + */ + @Test + public void testGetHITSPReactionObservation() { + + Medication target = objectFactory.create(); + target.getHITSPReactionObservation(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends MedicationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public Medication create() { + return HITSPFactory.eINSTANCE.createMedication(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends MedicationOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // MedicationOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/MedicationTypeTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/MedicationTypeTest.java new file mode 100644 index 000000000..637d4c0d2 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/MedicationTypeTest.java @@ -0,0 +1,184 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.MedicationType; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.MedicationTypeOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Medication Type' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • + * {@link org.openhealthtools.mdht.uml.cda.hitsp.MedicationType#validateMedicationTypeTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Medication Type Template Id}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.hitsp.MedicationType#validateMedicationTypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Medication Type Code}
  • + *
+ *

+ * + * @generated + */ + +public class MedicationTypeTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateMedicationTypeTemplateId() { + OperationsTestCase validateMedicationTypeTemplateIdTestCase = new OperationsTestCase( + "validateMedicationTypeTemplateId", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_TYPE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationType target) { + + } + + @Override + protected void updateToPass(MedicationType target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationTypeOperations.validateMedicationTypeTemplateId( + (MedicationType) objectToTest, diagnostician, map); + } + + }; + + validateMedicationTypeTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationTypeCode() { + OperationsTestCase validateMedicationTypeCodeTestCase = new OperationsTestCase( + "validateMedicationTypeCode", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationType target) { + + } + + @Override + protected void updateToPass(MedicationType target) { + target.init(); + target.getCode().setCode("329505003"); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationTypeOperations.validateMedicationTypeCode( + (MedicationType) objectToTest, diagnostician, map); + } + + }; + + validateMedicationTypeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends MedicationTypeOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public MedicationType create() { + return HITSPFactory.eINSTANCE.createMedicationType(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends MedicationTypeOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // MedicationTypeOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/MedicationsAdministeredSectionTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/MedicationsAdministeredSectionTest.java new file mode 100644 index 000000000..30ffb9003 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/MedicationsAdministeredSectionTest.java @@ -0,0 +1,144 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.MedicationsAdministeredSection; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.MedicationsAdministeredSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Medications Administered Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.MedicationsAdministeredSection#validateHITSPMedicationsAdministeredSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Medications Administered Section Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class MedicationsAdministeredSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHITSPMedicationsAdministeredSectionTemplateId() { + OperationsTestCase validateHITSPMedicationsAdministeredSectionTemplateIdTestCase = new OperationsTestCase( + "validateHITSPMedicationsAdministeredSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HITSP_MEDICATIONS_ADMINISTERED_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationsAdministeredSection target) { + + } + + @Override + protected void updateToPass(MedicationsAdministeredSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationsAdministeredSectionOperations.validateHITSPMedicationsAdministeredSectionTemplateId( + (MedicationsAdministeredSection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPMedicationsAdministeredSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends MedicationsAdministeredSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public MedicationsAdministeredSection create() { + return HITSPFactory.eINSTANCE.createMedicationsAdministeredSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends MedicationsAdministeredSectionOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // MedicationsAdministeredSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/MedicationsSectionTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/MedicationsSectionTest.java new file mode 100644 index 000000000..f9d00a28c --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/MedicationsSectionTest.java @@ -0,0 +1,196 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.Medication; +import org.openhealthtools.mdht.uml.cda.hitsp.MedicationsSection; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.MedicationsSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Medications Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.MedicationsSection#validateHITSPMedicationsSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Medications Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.MedicationsSection#validateHITSPMedicationsSectionMedication(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Medications Section Medication}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.MedicationsSection#getHITSPMedications() Get HITSP Medications}
  • + *
+ *

+ * + * @generated + */ + +public class MedicationsSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHITSPMedicationsSectionTemplateId() { + OperationsTestCase validateHITSPMedicationsSectionTemplateIdTestCase = new OperationsTestCase( + "validateHITSPMedicationsSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HITSP_MEDICATIONS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationsSection target) { + + } + + @Override + protected void updateToPass(MedicationsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationsSectionOperations.validateHITSPMedicationsSectionTemplateId( + (MedicationsSection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPMedicationsSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHITSPMedicationsSectionMedication() { + OperationsTestCase validateHITSPMedicationsSectionMedicationTestCase = new OperationsTestCase( + "validateHITSPMedicationsSectionMedication", + operationsForOCL.getOCLValue("VALIDATE_HITSP_MEDICATIONS_SECTION_MEDICATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationsSection target) { + + } + + @Override + protected void updateToPass(MedicationsSection target) { + target.init(); + + Medication sa = HITSPFactory.eINSTANCE.createMedication().init(); + target.addSubstanceAdministration(sa); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationsSectionOperations.validateHITSPMedicationsSectionMedication( + (MedicationsSection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPMedicationsSectionMedicationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetHITSPMedications() { + + MedicationsSection target = objectFactory.create(); + target.getHITSPMedications(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends MedicationsSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public MedicationsSection create() { + return HITSPFactory.eINSTANCE.createMedicationsSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends MedicationsSectionOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // MedicationsSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/PastProcedureTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/PastProcedureTest.java new file mode 100644 index 000000000..a62e6fbc8 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/PastProcedureTest.java @@ -0,0 +1,45 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Past Procedure' model objects. + * + * + * + * @generated + */ + +public class PastProcedureTest extends CDAValidationTest { + + /** + * No Operations Test + * @generated + */ + @Test + public void testNoOperations() { + } + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PastProcedureOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/PatientSummaryTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/PatientSummaryTest.java new file mode 100644 index 000000000..2149f8d73 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/PatientSummaryTest.java @@ -0,0 +1,921 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.DocumentationOf; +import org.openhealthtools.mdht.uml.cda.Performer1; +import org.openhealthtools.mdht.uml.cda.ServiceEvent; +import org.openhealthtools.mdht.uml.cda.hitsp.AdvanceDirectivesSection; +import org.openhealthtools.mdht.uml.cda.hitsp.AllergiesReactionsSection; +import org.openhealthtools.mdht.uml.cda.hitsp.DiagnosticResultsSection; +import org.openhealthtools.mdht.uml.cda.hitsp.EncountersSection; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.ImmunizationsSection; +import org.openhealthtools.mdht.uml.cda.hitsp.MedicationsSection; +import org.openhealthtools.mdht.uml.cda.hitsp.PatientSummary; +import org.openhealthtools.mdht.uml.cda.hitsp.PayersSection; +import org.openhealthtools.mdht.uml.cda.hitsp.PlanOfCareSection; +import org.openhealthtools.mdht.uml.cda.hitsp.ProblemListSection; +import org.openhealthtools.mdht.uml.cda.hitsp.SurgeriesSection; +import org.openhealthtools.mdht.uml.cda.hitsp.VitalSignsSection; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.PatientSummaryOperations; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.PregnancyHistorySection; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Patient Summary' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • + * {@link org.openhealthtools.mdht.uml.cda.hitsp.PatientSummary#validatePatientSummaryHealthcareProvider(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Patient Summary Healthcare Provider}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.hitsp.PatientSummary#validatePatientSummaryTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Patient Summary Template Id}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.hitsp.PatientSummary#validatePatientSummaryAdvanceDirectivesSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Patient Summary Advance Directives Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.hitsp.PatientSummary#validatePatientSummaryAllergiesReactionsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Patient Summary Allergies Reactions Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.hitsp.PatientSummary#validatePatientSummaryProblemListSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Patient Summary Problem List Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.hitsp.PatientSummary#validatePatientSummaryEncountersSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Patient Summary Encounters Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.hitsp.PatientSummary#validatePatientSummaryImmunizationsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Patient Summary Immunizations Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.hitsp.PatientSummary#validatePatientSummaryPayersSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Patient Summary Payers Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.hitsp.PatientSummary#validatePatientSummaryMedicationsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Patient Summary Medications Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.hitsp.PatientSummary#validatePatientSummarySurgeriesSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Patient Summary Surgeries Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.hitsp.PatientSummary#validatePatientSummaryPlanOfCareSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Patient Summary Plan Of Care Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.hitsp.PatientSummary#validatePatientSummaryPregnancyHistorySection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Patient Summary Pregnancy History Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.hitsp.PatientSummary#validatePatientSummaryVitalSignsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Patient Summary Vital Signs Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.hitsp.PatientSummary#validatePatientSummaryDiagnosticResultsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Patient Summary Diagnostic Results Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.hitsp.PatientSummary#createProblemListSection() + * Create Problem List Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.hitsp.PatientSummary#createMedicationsSection() + * Create Medications Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.hitsp.PatientSummary#getHITSPAdvanceDirectivesSection() + * Get HITSP Advance Directives Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.hitsp.PatientSummary#getAllergiesReactionsSection() + * Get Allergies Reactions Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.hitsp.PatientSummary#getProblemListSection() + * Get Problem List Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.hitsp.PatientSummary#getHITSPEncountersSection() + * Get HITSP Encounters Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.hitsp.PatientSummary#getHITSPImmunizationsSection() + * Get HITSP Immunizations Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.hitsp.PatientSummary#getHITSPPayersSection() + * Get HITSP Payers Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.hitsp.PatientSummary#getHITSPMedicationsSection() + * Get HITSP Medications Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.hitsp.PatientSummary#getSurgeriesSection() + * Get Surgeries Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.hitsp.PatientSummary#getHITSPPlanOfCareSection() + * Get HITSP Plan Of Care Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.hitsp.PatientSummary#getPregnancyHistorySection() + * Get Pregnancy History Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.hitsp.PatientSummary#getHITSPVitalSignsSection() + * Get HITSP Vital Signs Section}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.hitsp.PatientSummary#getDiagnosticResultsSection() + * Get Diagnostic Results Section}
  • + *
+ *

+ * + * @generated + */ + +public class PatientSummaryTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidatePatientSummaryHealthcareProvider() { + OperationsTestCase validatePatientSummaryHealthcareProviderTestCase = new OperationsTestCase( + "validatePatientSummaryHealthcareProvider", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_SUMMARY_HEALTHCARE_PROVIDER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PatientSummary target) { + + } + + @Override + protected void updateToPass(PatientSummary target) { + target.init(); + DocumentationOf dof = CDAFactory.eINSTANCE.createDocumentationOf(); + ; + ServiceEvent se = CDAFactory.eINSTANCE.createServiceEvent(); + Performer1 p = CDAFactory.eINSTANCE.createPerformer1(); + se.getPerformers().add(p); + dof.setServiceEvent(se); + target.getDocumentationOfs().add(dof); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PatientSummaryOperations.validatePatientSummaryHealthcareProvider( + (PatientSummary) objectToTest, diagnostician, map); + } + + }; + + validatePatientSummaryHealthcareProviderTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePatientSummaryTemplateId() { + OperationsTestCase validatePatientSummaryTemplateIdTestCase = new OperationsTestCase( + "validatePatientSummaryTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_SUMMARY_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PatientSummary target) { + + } + + @Override + protected void updateToPass(PatientSummary target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PatientSummaryOperations.validatePatientSummaryTemplateId( + (PatientSummary) objectToTest, diagnostician, map); + } + + }; + + validatePatientSummaryTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePatientSummaryAdvanceDirectivesSection() { + OperationsTestCase validatePatientSummaryAdvanceDirectivesSectionTestCase = new OperationsTestCase( + "validatePatientSummaryAdvanceDirectivesSection", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_SUMMARY_ADVANCE_DIRECTIVES_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PatientSummary target) { + + } + + @Override + protected void updateToPass(PatientSummary target) { + target.init(); + + /* AdvanceDirectivesSection */ + AdvanceDirectivesSection section = + + HITSPFactory.eINSTANCE.createAdvanceDirectivesSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PatientSummaryOperations.validatePatientSummaryAdvanceDirectivesSection( + (PatientSummary) objectToTest, diagnostician, map); + } + + }; + + validatePatientSummaryAdvanceDirectivesSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePatientSummaryAllergiesReactionsSection() { + OperationsTestCase validatePatientSummaryAllergiesReactionsSectionTestCase = new OperationsTestCase( + "validatePatientSummaryAllergiesReactionsSection", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_SUMMARY_ALLERGIES_REACTIONS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PatientSummary target) { + + } + + @Override + protected void updateToPass(PatientSummary target) { + target.init(); + + /* AllergiesReactionsSection */ + AllergiesReactionsSection section = + + HITSPFactory.eINSTANCE.createAllergiesReactionsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PatientSummaryOperations.validatePatientSummaryAllergiesReactionsSection( + (PatientSummary) objectToTest, diagnostician, map); + } + + }; + + validatePatientSummaryAllergiesReactionsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePatientSummaryProblemListSection() { + OperationsTestCase validatePatientSummaryProblemListSectionTestCase = new OperationsTestCase( + "validatePatientSummaryProblemListSection", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_SUMMARY_PROBLEM_LIST_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PatientSummary target) { + + } + + @Override + protected void updateToPass(PatientSummary target) { + target.init(); + + /* ProblemListSection */ + ProblemListSection section = + + HITSPFactory.eINSTANCE.createProblemListSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PatientSummaryOperations.validatePatientSummaryProblemListSection( + (PatientSummary) objectToTest, diagnostician, map); + } + + }; + + validatePatientSummaryProblemListSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePatientSummaryEncountersSection() { + OperationsTestCase validatePatientSummaryEncountersSectionTestCase = new OperationsTestCase( + "validatePatientSummaryEncountersSection", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_SUMMARY_ENCOUNTERS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PatientSummary target) { + + } + + @Override + protected void updateToPass(PatientSummary target) { + target.init(); + + /* EncountersSection */ + EncountersSection section = + + HITSPFactory.eINSTANCE.createEncountersSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PatientSummaryOperations.validatePatientSummaryEncountersSection( + (PatientSummary) objectToTest, diagnostician, map); + } + + }; + + validatePatientSummaryEncountersSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePatientSummaryImmunizationsSection() { + OperationsTestCase validatePatientSummaryImmunizationsSectionTestCase = new OperationsTestCase( + "validatePatientSummaryImmunizationsSection", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_SUMMARY_IMMUNIZATIONS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PatientSummary target) { + + } + + @Override + protected void updateToPass(PatientSummary target) { + target.init(); + + /* ImmunizationsSection */ + ImmunizationsSection section = + + HITSPFactory.eINSTANCE.createImmunizationsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PatientSummaryOperations.validatePatientSummaryImmunizationsSection( + (PatientSummary) objectToTest, diagnostician, map); + } + + }; + + validatePatientSummaryImmunizationsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePatientSummaryPayersSection() { + OperationsTestCase validatePatientSummaryPayersSectionTestCase = new OperationsTestCase( + "validatePatientSummaryPayersSection", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_SUMMARY_PAYERS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PatientSummary target) { + + } + + @Override + protected void updateToPass(PatientSummary target) { + target.init(); + + /* PayersSection */ + PayersSection section = + + HITSPFactory.eINSTANCE.createPayersSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PatientSummaryOperations.validatePatientSummaryPayersSection( + (PatientSummary) objectToTest, diagnostician, map); + } + + }; + + validatePatientSummaryPayersSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePatientSummaryMedicationsSection() { + OperationsTestCase validatePatientSummaryMedicationsSectionTestCase = new OperationsTestCase( + "validatePatientSummaryMedicationsSection", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_SUMMARY_MEDICATIONS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PatientSummary target) { + + } + + @Override + protected void updateToPass(PatientSummary target) { + target.init(); + + /* MedicationsSection */ + MedicationsSection section = + + HITSPFactory.eINSTANCE.createMedicationsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PatientSummaryOperations.validatePatientSummaryMedicationsSection( + (PatientSummary) objectToTest, diagnostician, map); + } + + }; + + validatePatientSummaryMedicationsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePatientSummarySurgeriesSection() { + OperationsTestCase validatePatientSummarySurgeriesSectionTestCase = new OperationsTestCase( + "validatePatientSummarySurgeriesSection", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_SUMMARY_SURGERIES_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PatientSummary target) { + + } + + @Override + protected void updateToPass(PatientSummary target) { + target.init(); + + /* SurgeriesSection */ + SurgeriesSection section = + + HITSPFactory.eINSTANCE.createSurgeriesSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PatientSummaryOperations.validatePatientSummarySurgeriesSection( + (PatientSummary) objectToTest, diagnostician, map); + } + + }; + + validatePatientSummarySurgeriesSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePatientSummaryPlanOfCareSection() { + OperationsTestCase validatePatientSummaryPlanOfCareSectionTestCase = new OperationsTestCase( + "validatePatientSummaryPlanOfCareSection", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_SUMMARY_PLAN_OF_CARE_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PatientSummary target) { + + } + + @Override + protected void updateToPass(PatientSummary target) { + target.init(); + + /* PlanOfCareSection */ + PlanOfCareSection section = + + HITSPFactory.eINSTANCE.createPlanOfCareSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PatientSummaryOperations.validatePatientSummaryPlanOfCareSection( + (PatientSummary) objectToTest, diagnostician, map); + } + + }; + + validatePatientSummaryPlanOfCareSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePatientSummaryPregnancyHistorySection() { + OperationsTestCase validatePatientSummaryPregnancyHistorySectionTestCase = new OperationsTestCase( + "validatePatientSummaryPregnancyHistorySection", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_SUMMARY_PREGNANCY_HISTORY_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PatientSummary target) { + + } + + @Override + protected void updateToPass(PatientSummary target) { + target.init(); + + /* PregnancyHistorySection */ + PregnancyHistorySection section = + + IHEFactory.eINSTANCE.createPregnancyHistorySection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PatientSummaryOperations.validatePatientSummaryPregnancyHistorySection( + (PatientSummary) objectToTest, diagnostician, map); + } + + }; + + validatePatientSummaryPregnancyHistorySectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePatientSummaryVitalSignsSection() { + OperationsTestCase validatePatientSummaryVitalSignsSectionTestCase = new OperationsTestCase( + "validatePatientSummaryVitalSignsSection", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_SUMMARY_VITAL_SIGNS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PatientSummary target) { + + } + + @Override + protected void updateToPass(PatientSummary target) { + target.init(); + + /* VitalSignsSection */ + VitalSignsSection section = + + HITSPFactory.eINSTANCE.createVitalSignsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PatientSummaryOperations.validatePatientSummaryVitalSignsSection( + (PatientSummary) objectToTest, diagnostician, map); + } + + }; + + validatePatientSummaryVitalSignsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePatientSummaryDiagnosticResultsSection() { + OperationsTestCase validatePatientSummaryDiagnosticResultsSectionTestCase = new OperationsTestCase( + "validatePatientSummaryDiagnosticResultsSection", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_SUMMARY_DIAGNOSTIC_RESULTS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PatientSummary target) { + + } + + @Override + protected void updateToPass(PatientSummary target) { + target.init(); + + /* DiagnosticResultsSection */ + DiagnosticResultsSection section = + + HITSPFactory.eINSTANCE.createDiagnosticResultsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PatientSummaryOperations.validatePatientSummaryDiagnosticResultsSection( + (PatientSummary) objectToTest, diagnostician, map); + } + + }; + + validatePatientSummaryDiagnosticResultsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetHITSPAdvanceDirectivesSection() { + + PatientSummary target = objectFactory.create(); + target.getHITSPAdvanceDirectivesSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetAllergiesReactionsSection() { + + PatientSummary target = objectFactory.create(); + target.getAllergiesReactionsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProblemListSection() { + + PatientSummary target = objectFactory.create(); + target.getProblemListSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetHITSPEncountersSection() { + + PatientSummary target = objectFactory.create(); + target.getHITSPEncountersSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetHITSPImmunizationsSection() { + + PatientSummary target = objectFactory.create(); + target.getHITSPImmunizationsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetHITSPPayersSection() { + + PatientSummary target = objectFactory.create(); + target.getHITSPPayersSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetHITSPMedicationsSection() { + + PatientSummary target = objectFactory.create(); + target.getHITSPMedicationsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetSurgeriesSection() { + + PatientSummary target = objectFactory.create(); + target.getSurgeriesSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetHITSPPlanOfCareSection() { + + PatientSummary target = objectFactory.create(); + target.getHITSPPlanOfCareSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPregnancyHistorySection() { + + PatientSummary target = objectFactory.create(); + target.getPregnancyHistorySection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetHITSPVitalSignsSection() { + + PatientSummary target = objectFactory.create(); + target.getHITSPVitalSignsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetDiagnosticResultsSection() { + + PatientSummary target = objectFactory.create(); + target.getDiagnosticResultsSection(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PatientSummaryOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public PatientSummary create() { + return HITSPFactory.eINSTANCE.createPatientSummary(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends PatientSummaryOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PatientSummaryOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/PayersSectionTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/PayersSectionTest.java new file mode 100644 index 000000000..bce375729 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/PayersSectionTest.java @@ -0,0 +1,196 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.InsuranceProvider; +import org.openhealthtools.mdht.uml.cda.hitsp.PayersSection; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.PayersSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Payers Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • + * {@link org.openhealthtools.mdht.uml.cda.hitsp.PayersSection#validateHITSPPayersSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate HITSP Payers Section Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class PayersSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHITSPPayersSectionTemplateId() { + OperationsTestCase validateHITSPPayersSectionTemplateIdTestCase = new OperationsTestCase( + "validateHITSPPayersSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HITSP_PAYERS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PayersSection target) { + + } + + @Override + protected void updateToPass(PayersSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PayersSectionOperations.validateHITSPPayersSectionTemplateId( + (PayersSection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPPayersSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHITSPPayersSectionInsuranceProvider() { + OperationsTestCase validateHITSPPayersSectionInsuranceProviderTestCase = new OperationsTestCase( + "validateHITSPPayersSectionInsuranceProvider", + operationsForOCL.getOCLValue("VALIDATE_HITSP_PAYERS_SECTION_INSURANCE_PROVIDER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PayersSection target) { + + } + + @Override + protected void updateToPass(PayersSection target) { + target.init(); + InsuranceProvider insuranceProvider = HITSPFactory.eINSTANCE.createInsuranceProvider().init(); + + target.addAct(insuranceProvider); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PayersSectionOperations.validateHITSPPayersSectionInsuranceProvider( + (PayersSection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPPayersSectionInsuranceProviderTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetInsuranceProviders() { + + PayersSection target = objectFactory.create(); + target.getInsuranceProviders(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PayersSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public PayersSection create() { + return HITSPFactory.eINSTANCE.createPayersSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends PayersSectionOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PayersSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/PhysicalExamSectionTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/PhysicalExamSectionTest.java new file mode 100644 index 000000000..3c703f596 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/PhysicalExamSectionTest.java @@ -0,0 +1,196 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.hitsp.Condition; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.PhysicalExamSection; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.PhysicalExamSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Physical Exam Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.PhysicalExamSection#validateHITSPPhysicalExamSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Physical Exam Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.PhysicalExamSection#validateHITSPPhysicalExamSectionCondition(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Physical Exam Section Condition}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.PhysicalExamSection#getConditions() Get Conditions}
  • + *
+ *

+ * + * @generated + */ + +public class PhysicalExamSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHITSPPhysicalExamSectionTemplateId() { + OperationsTestCase validateHITSPPhysicalExamSectionTemplateIdTestCase = new OperationsTestCase( + "validateHITSPPhysicalExamSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HITSP_PHYSICAL_EXAM_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicalExamSection target) { + + } + + @Override + protected void updateToPass(PhysicalExamSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicalExamSectionOperations.validateHITSPPhysicalExamSectionTemplateId( + (PhysicalExamSection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPPhysicalExamSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHITSPPhysicalExamSectionCondition() { + OperationsTestCase validateHITSPPhysicalExamSectionConditionTestCase = new OperationsTestCase( + "validateHITSPPhysicalExamSectionCondition", + operationsForOCL.getOCLValue("VALIDATE_HITSP_PHYSICAL_EXAM_SECTION_CONDITION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicalExamSection target) { + + } + + @Override + protected void updateToPass(PhysicalExamSection target) { + target.init(); + + Condition condition = HITSPFactory.eINSTANCE.createCondition().init(); + target.addAct(condition); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicalExamSectionOperations.validateHITSPPhysicalExamSectionCondition( + (PhysicalExamSection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPPhysicalExamSectionConditionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetConditions() { + + PhysicalExamSection target = objectFactory.create(); + target.getConditions(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PhysicalExamSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public PhysicalExamSection create() { + return HITSPFactory.eINSTANCE.createPhysicalExamSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends PhysicalExamSectionOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PhysicalExamSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/PlanOfCareSectionTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/PlanOfCareSectionTest.java new file mode 100644 index 000000000..032ec6ea4 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/PlanOfCareSectionTest.java @@ -0,0 +1,330 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.PlanOfCareSection; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.PlanOfCareSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Plan Of Care Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.PlanOfCareSection#validateHITSPPlanOfCareSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Plan Of Care Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.PlanOfCareSection#validateHITSPPlanOfCareSectionMedication(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Plan Of Care Section Medication}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.PlanOfCareSection#validateHITSPPlanOfCareSectionImmunization(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Plan Of Care Section Immunization}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.PlanOfCareSection#validateHITSPPlanOfCareSectionEncounter(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Plan Of Care Section Encounter}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.PlanOfCareSection#validateHITSPPlanOfCareSectionProcedure(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Plan Of Care Section Procedure}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.PlanOfCareSection#getMedication() Get Medication}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.PlanOfCareSection#getImmunization() Get Immunization}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.PlanOfCareSection#getEncounter() Get Encounter}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.PlanOfCareSection#getProcedure() Get Procedure}
  • + *
+ *

+ * + * @generated + */ + +public class PlanOfCareSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHITSPPlanOfCareSectionTemplateId() { + OperationsTestCase validateHITSPPlanOfCareSectionTemplateIdTestCase = new OperationsTestCase( + "validateHITSPPlanOfCareSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HITSP_PLAN_OF_CARE_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareSection target) { + + } + + @Override + protected void updateToPass(PlanOfCareSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareSectionOperations.validateHITSPPlanOfCareSectionTemplateId( + (PlanOfCareSection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPPlanOfCareSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateHITSPPlanOfCareSectionMedication() { + OperationsTestCase validateHITSPPlanOfCareSectionMedicationTestCase = new OperationsTestCase( + "validateHITSPPlanOfCareSectionMedication", + operationsForOCL.getOCLValue("VALIDATE_HITSP_PLAN_OF_CARE_SECTION_MEDICATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareSection target) { + target.init(); + } + + @Override + protected void updateToPass(PlanOfCareSection target) { + target.addSubstanceAdministration(HITSPFactory.eINSTANCE.createMedicationNormalDose().init()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareSectionOperations.validateHITSPPlanOfCareSectionMedication( + (PlanOfCareSection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPPlanOfCareSectionMedicationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateHITSPPlanOfCareSectionImmunization() { + OperationsTestCase validateHITSPPlanOfCareSectionImmunizationTestCase = new OperationsTestCase( + "validateHITSPPlanOfCareSectionImmunization", + operationsForOCL.getOCLValue("VALIDATE_HITSP_PLAN_OF_CARE_SECTION_IMMUNIZATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareSection target) { + target.init(); + } + + @Override + protected void updateToPass(PlanOfCareSection target) { + + target.addSubstanceAdministration(HITSPFactory.eINSTANCE.createImmunization().init()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareSectionOperations.validateHITSPPlanOfCareSectionImmunization( + (PlanOfCareSection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPPlanOfCareSectionImmunizationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateHITSPPlanOfCareSectionEncounter() { + OperationsTestCase validateHITSPPlanOfCareSectionEncounterTestCase = new OperationsTestCase( + "validateHITSPPlanOfCareSectionEncounter", + operationsForOCL.getOCLValue("VALIDATE_HITSP_PLAN_OF_CARE_SECTION_ENCOUNTER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareSection target) { + target.init(); + } + + @Override + protected void updateToPass(PlanOfCareSection target) { + target.addEncounter(HITSPFactory.eINSTANCE.createEncounter().init()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareSectionOperations.validateHITSPPlanOfCareSectionEncounter( + (PlanOfCareSection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPPlanOfCareSectionEncounterTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateHITSPPlanOfCareSectionProcedure() { + OperationsTestCase validateHITSPPlanOfCareSectionProcedureTestCase = new OperationsTestCase( + "validateHITSPPlanOfCareSectionProcedure", + operationsForOCL.getOCLValue("VALIDATE_HITSP_PLAN_OF_CARE_SECTION_PROCEDURE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareSection target) { + target.init(); + } + + @Override + protected void updateToPass(PlanOfCareSection target) { + target.addProcedure(HITSPFactory.eINSTANCE.createPastProcedure().init()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareSectionOperations.validateHITSPPlanOfCareSectionProcedure( + (PlanOfCareSection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPPlanOfCareSectionProcedureTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetMedication() { + + PlanOfCareSection target = objectFactory.create(); + target.getMedication(); + + } + + /** + * + * @generated + */ + @Test + public void testGetImmunization() { + + PlanOfCareSection target = objectFactory.create(); + target.getImmunization(); + + } + + /** + * + * @generated + */ + @Test + public void testGetEncounter() { + + PlanOfCareSection target = objectFactory.create(); + target.getEncounter(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProcedure() { + + PlanOfCareSection target = objectFactory.create(); + target.getProcedure(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PlanOfCareSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public PlanOfCareSection create() { + return HITSPFactory.eINSTANCE.createPlanOfCareSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PlanOfCareSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PlanOfCareSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/PlannedProcedureTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/PlannedProcedureTest.java new file mode 100644 index 000000000..d8371c306 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/PlannedProcedureTest.java @@ -0,0 +1,45 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Planned Procedure' model objects. + * + * + * + * @generated + */ + +public class PlannedProcedureTest extends CDAValidationTest { + + /** + * No Operations Test + * @generated + */ + @Test + public void testNoOperations() { + } + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PlannedProcedureOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/ProblemListSectionTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/ProblemListSectionTest.java new file mode 100644 index 000000000..d7bb4d875 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/ProblemListSectionTest.java @@ -0,0 +1,195 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.hitsp.Condition; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.ProblemListSection; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.ProblemListSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Problem List Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.ProblemListSection#validateProblemListSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem List Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.ProblemListSection#validateProblemListSectionCondition(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem List Section Condition}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.ProblemListSection#getConditions() Get Conditions}
  • + *
+ *

+ * + * @generated + */ + +public class ProblemListSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateProblemListSectionTemplateId() { + OperationsTestCase validateProblemListSectionTemplateIdTestCase = new OperationsTestCase( + "validateProblemListSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_LIST_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemListSection target) { + + } + + @Override + protected void updateToPass(ProblemListSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemListSectionOperations.validateProblemListSectionTemplateId( + (ProblemListSection) objectToTest, diagnostician, map); + } + + }; + + validateProblemListSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProblemListSectionCondition() { + OperationsTestCase validateProblemListSectionConditionTestCase = new OperationsTestCase( + "validateProblemListSectionCondition", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_LIST_SECTION_CONDITION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemListSection target) { + + } + + @Override + protected void updateToPass(ProblemListSection target) { + target.init(); + Condition act = HITSPFactory.eINSTANCE.createCondition(); + target.addAct(act); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemListSectionOperations.validateProblemListSectionCondition( + (ProblemListSection) objectToTest, diagnostician, map); + } + + }; + + validateProblemListSectionConditionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetConditions() { + + ProblemListSection target = objectFactory.create(); + target.getConditions(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ProblemListSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public ProblemListSection create() { + return HITSPFactory.eINSTANCE.createProblemListSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends ProblemListSectionOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ProblemListSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/ProcedureTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/ProcedureTest.java new file mode 100644 index 000000000..02cfcb40a --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/ProcedureTest.java @@ -0,0 +1,306 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Performer2; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.Procedure; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.ProcedureOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; +import org.openhealthtools.mdht.uml.hl7.datatypes.TEL; + +/** + * + * A static utility class that provides operations related to 'Procedure' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Procedure#validateHITSPProcedureHasCodeOriginalText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Procedure Has Code Original Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Procedure#validateHITSPProcedurePerformerAssignedEntity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Procedure Performer Assigned Entity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Procedure#validateHITSPProcedureTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Procedure Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Procedure#validateHITSPProcedureTargetSiteCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Procedure Target Site Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Procedure#validateHITSPProcedureCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Procedure Code}
  • + *
+ *

+ * + * @generated + */ + +public class ProcedureTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateHITSPProcedureHasCodeOriginalText() { + OperationsTestCase validateHITSPProcedureHasCodeOriginalTextTestCase = new OperationsTestCase( + "validateHITSPProcedureHasCodeOriginalText", + operationsForOCL.getOCLValue("VALIDATE_HITSP_PROCEDURE_HAS_CODE_ORIGINAL_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Procedure target) { + target.init(); + CD cd = DatatypesFactory.eINSTANCE.createCD(); + cd.setCode("code"); + ED ed = DatatypesFactory.eINSTANCE.createED(); + + // TEL tel = DatatypesFactory.eINSTANCE.createTEL("reference"); + // ed.setReference(tel); + cd.setOriginalText(ed); + target.setCode(cd); + } + + @Override + protected void updateToPass(Procedure target) { + + CD cd = DatatypesFactory.eINSTANCE.createCD(); + cd.setCode("code"); + ED ed = DatatypesFactory.eINSTANCE.createED(); + + TEL tel = DatatypesFactory.eINSTANCE.createTEL("reference"); + ed.setReference(tel); + cd.setOriginalText(ed); + target.setCode(cd); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureOperations.validateHITSPProcedureHasCodeOriginalText( + (Procedure) objectToTest, diagnostician, map); + } + + }; + + validateHITSPProcedureHasCodeOriginalTextTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateHITSPProcedurePerformerAssignedEntity() { + OperationsTestCase validateHITSPProcedurePerformerAssignedEntityTestCase = new OperationsTestCase( + "validateHITSPProcedurePerformerAssignedEntity", + operationsForOCL.getOCLValue("VALIDATE_HITSP_PROCEDURE_PERFORMER_ASSIGNED_ENTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Procedure target) { + target.init(); + Performer2 p2 = CDAFactory.eINSTANCE.createPerformer2(); + target.getPerformers().add(p2); + } + + @Override + protected void updateToPass(Procedure target) { + target.getPerformers().clear(); + Performer2 p2 = CDAFactory.eINSTANCE.createPerformer2(); + p2.setAssignedEntity(CDAFactory.eINSTANCE.createAssignedEntity()); + target.getPerformers().add(p2); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureOperations.validateHITSPProcedurePerformerAssignedEntity( + (Procedure) objectToTest, diagnostician, map); + } + + }; + + validateHITSPProcedurePerformerAssignedEntityTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHITSPProcedureTemplateId() { + OperationsTestCase validateHITSPProcedureTemplateIdTestCase = new OperationsTestCase( + "validateHITSPProcedureTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HITSP_PROCEDURE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Procedure target) { + + } + + @Override + protected void updateToPass(Procedure target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureOperations.validateHITSPProcedureTemplateId( + (Procedure) objectToTest, diagnostician, map); + } + + }; + + validateHITSPProcedureTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateHITSPProcedureTargetSiteCode() { + OperationsTestCase validateHITSPProcedureTargetSiteCodeTestCase = new OperationsTestCase( + "validateHITSPProcedureTargetSiteCode", + operationsForOCL.getOCLValue("VALIDATE_HITSP_PROCEDURE_TARGET_SITE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Procedure target) { + target.init(); + } + + @Override + protected void updateToPass(Procedure target) { + target.getTargetSiteCodes().clear(); + target.getTargetSiteCodes().add( + DatatypesFactory.eINSTANCE.createCD("code", "2.16.840.1.113883.6.96", "", "")); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureOperations.validateHITSPProcedureTargetSiteCode( + (Procedure) objectToTest, diagnostician, map); + } + + }; + + validateHITSPProcedureTargetSiteCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateHITSPProcedureCode() { + OperationsTestCase validateHITSPProcedureCodeTestCase = new OperationsTestCase( + "validateHITSPProcedureCode", + operationsForOCL.getOCLValue("VALIDATE_HITSP_PROCEDURE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Procedure target) { + target.init(); + } + + @Override + protected void updateToPass(Procedure target) { + target.setCode(DatatypesFactory.eINSTANCE.createCD()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureOperations.validateHITSPProcedureCode((Procedure) objectToTest, diagnostician, map); + } + + }; + + validateHITSPProcedureCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ProcedureOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public Procedure create() { + return HITSPFactory.eINSTANCE.createPlannedProcedure(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ProcedureOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ProcedureOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/ReasonForReferralSectionTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/ReasonForReferralSectionTest.java new file mode 100644 index 000000000..a37ef6cb9 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/ReasonForReferralSectionTest.java @@ -0,0 +1,248 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.hitsp.Condition; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.ReasonForReferralSection; +import org.openhealthtools.mdht.uml.cda.hitsp.Result; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.ReasonForReferralSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Reason For Referral Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.ReasonForReferralSection#validateHITSPReasonForReferralSectionCondition(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Reason For Referral Section Condition}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.ReasonForReferralSection#validateHITSPReasonForReferralSectionResult(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Reason For Referral Section Result}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.ReasonForReferralSection#getConditions() Get Conditions}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.ReasonForReferralSection#getResults() Get Results}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.ReasonForReferralSection#validateCodedReasonForReferralSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Coded Reason For Referral Section Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class ReasonForReferralSectionTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateHITSPReasonForReferralSectionCondition() { + OperationsTestCase validateHITSPReasonForReferralSectionConditionTestCase = new OperationsTestCase( + "validateHITSPReasonForReferralSectionCondition", + operationsForOCL.getOCLValue("VALIDATE_HITSP_REASON_FOR_REFERRAL_SECTION_CONDITION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReasonForReferralSection target) { + + } + + @Override + protected void updateToPass(ReasonForReferralSection target) { + target.init(); + Condition condition = HITSPFactory.eINSTANCE.createCondition().init(); + target.addAct(condition); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReasonForReferralSectionOperations.validateHITSPReasonForReferralSectionCondition( + (ReasonForReferralSection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPReasonForReferralSectionConditionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHITSPReasonForReferralSectionResult() { + OperationsTestCase validateHITSPReasonForReferralSectionResultTestCase = new OperationsTestCase( + "validateHITSPReasonForReferralSectionResult", + operationsForOCL.getOCLValue("VALIDATE_HITSP_REASON_FOR_REFERRAL_SECTION_RESULT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReasonForReferralSection target) { + + } + + @Override + protected void updateToPass(ReasonForReferralSection target) { + target.init(); + + Result result = HITSPFactory.eINSTANCE.createResult().init(); + + target.addObservation(result); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReasonForReferralSectionOperations.validateHITSPReasonForReferralSectionResult( + (ReasonForReferralSection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPReasonForReferralSectionResultTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetConditions() { + + ReasonForReferralSection target = objectFactory.create(); + target.getConditions(); + + } + + /** + * + * @generated + */ + @Test + public void testGetResults() { + + ReasonForReferralSection target = objectFactory.create(); + target.getResults(); + + } + + /** + * + * @generated + */ + @Test + public void testValidateCodedReasonForReferralSectionTemplateId() { + OperationsTestCase validateCodedReasonForReferralSectionTemplateIdTestCase = new OperationsTestCase( + "validateCodedReasonForReferralSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_CODED_REASON_FOR_REFERRAL_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReasonForReferralSection target) { + + } + + @Override + protected void updateToPass(ReasonForReferralSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReasonForReferralSectionOperations.validateCodedReasonForReferralSectionTemplateId( + (ReasonForReferralSection) objectToTest, diagnostician, map); + } + + }; + + validateCodedReasonForReferralSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ReasonForReferralSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public ReasonForReferralSection create() { + return HITSPFactory.eINSTANCE.createReasonForReferralSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends ReasonForReferralSectionOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ReasonForReferralSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/ReferralSummaryTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/ReferralSummaryTest.java new file mode 100644 index 000000000..f8dd1fc4f --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/ReferralSummaryTest.java @@ -0,0 +1,140 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.ReferralSummary; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.ReferralSummaryOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Referral Summary' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.ReferralSummary#validateMedicalSummaryTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medical Summary Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class ReferralSummaryTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateMedicalSummaryTemplateId() { + OperationsTestCase validateMedicalSummaryTemplateIdTestCase = new OperationsTestCase( + "validateMedicalSummaryTemplateId", + operationsForOCL.getOCLValue("VALIDATE_MEDICAL_SUMMARY_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReferralSummary target) { + + } + + @Override + protected void updateToPass(ReferralSummary target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReferralSummaryOperations.validateMedicalSummaryTemplateId( + (ReferralSummary) objectToTest, diagnostician, map); + } + + }; + + validateMedicalSummaryTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ReferralSummaryOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ReferralSummary create() { + return HITSPFactory.eINSTANCE.createReferralSummary(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ReferralSummaryOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ReferralSummaryOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/ResultOrganizerTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/ResultOrganizerTest.java new file mode 100644 index 000000000..166e6348d --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/ResultOrganizerTest.java @@ -0,0 +1,153 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.ResultOrganizer; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.ResultOrganizerOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Result Organizer' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.ResultOrganizer#validateHITSPResultOrganizerResult(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Result Organizer Result}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.ResultOrganizer#getResults() Get Results}
  • + *
+ *

+ * + * @generated + */ + +public class ResultOrganizerTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateHITSPResultOrganizerResult() { + OperationsTestCase validateHITSPResultOrganizerResultTestCase = new OperationsTestCase( + "validateHITSPResultOrganizerResult", + operationsForOCL.getOCLValue("VALIDATE_HITSP_RESULT_ORGANIZER_RESULT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultOrganizer target) { + + } + + @Override + protected void updateToPass(ResultOrganizer target) { + target.init(); + target.addObservation(HITSPFactory.eINSTANCE.createResult()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultOrganizerOperations.validateHITSPResultOrganizerResult( + (ResultOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateHITSPResultOrganizerResultTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetResults() { + + ResultOrganizer target = objectFactory.create(); + target.getResults(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ResultOrganizerOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ResultOrganizer create() { + return HITSPFactory.eINSTANCE.createResultOrganizer(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ResultOrganizerOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ResultOrganizerOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/ResultTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/ResultTest.java new file mode 100644 index 000000000..ed4ca4de6 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/ResultTest.java @@ -0,0 +1,392 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.Result; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.ResultOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActMoodDocumentObservation; + +/** + * A static utility class that provides operations + * related to 'Result' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Result#validateResultTypeCodeSystem(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Type Code System}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Result#validateResultLaboratoryResultsValueSet(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Laboratory Results Value Set}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Result#validateResultValuePresence(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Value Presence}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Result#validateResultTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Result#validateResultCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Result#validateResultEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.Result#validateResultValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Value}
  • + *
+ *

+ * + * @generated + */ + +public class ResultTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateResultTypeCodeSystem() { + OperationsTestCase validateResultTypeCodeSystemTestCase = new OperationsTestCase( + "validateResultTypeCodeSystem", + operationsForOCL.getOCLValue("VALIDATE_RESULT_TYPE_CODE_SYSTEM__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Result target) { + + } + + @Override + protected void updateToPass(Result target) { + + } + + @Override + public void addPassTests() { + + addPassTest(new PassTest() { + + @Override + public void updateToPass(Result target) { + target.init(); + CD cd = DatatypesFactory.eINSTANCE.createCD(); + cd.setCodeSystem("2.16.840.1.113883.6.1"); + target.setCode(cd); + } + + }); + + addPassTest(new PassTest() { + + @Override + public void updateToPass(Result target) { + target.init(); + CD cd = DatatypesFactory.eINSTANCE.createCD(); + cd.setCodeSystem("2.16.840.1.113883.6.96"); + target.setCode(cd); + } + + }); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultOperations.validateResultTypeCodeSystem((Result) objectToTest, diagnostician, map); + } + + }; + + validateResultTypeCodeSystemTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateResultLaboratoryResultsValueSet() { + OperationsTestCase validateResultLaboratoryResultsValueSetTestCase = new OperationsTestCase( + "validateResultLaboratoryResultsValueSet", + operationsForOCL.getOCLValue("VALIDATE_RESULT_LABORATORY_RESULTS_VALUE_SET__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Result target) { + + } + + @Override + protected void updateToPass(Result target) { + target.init(); + CD cd = DatatypesFactory.eINSTANCE.createCD(); + cd.setCodeSystem("2.16.840.1.113883.6.1"); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultOperations.validateResultLaboratoryResultsValueSet( + (Result) objectToTest, diagnostician, map); + } + + }; + + validateResultLaboratoryResultsValueSetTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateResultValuePresence() { + OperationsTestCase validateResultValuePresenceTestCase = new OperationsTestCase( + "validateResultValuePresence", + operationsForOCL.getOCLValue("VALIDATE_RESULT_VALUE_PRESENCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Result target) { + target.init(); + target.setMoodCode(x_ActMoodDocumentObservation.INT); + CE value = DatatypesFactory.eINSTANCE.createCE(); + target.getValues().add(value); + + } + + @Override + protected void updateToPass(Result target) { + target.setMoodCode(x_ActMoodDocumentObservation.EVN); + CE value = DatatypesFactory.eINSTANCE.createCE(); + target.getValues().add(value); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultOperations.validateResultValuePresence((Result) objectToTest, diagnostician, map); + } + + }; + + validateResultValuePresenceTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateResultTemplateId() { + OperationsTestCase validateResultTemplateIdTestCase = new OperationsTestCase( + "validateResultTemplateId", + operationsForOCL.getOCLValue("VALIDATE_RESULT_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(Result target) { + + } + + @Override + protected void updateToPass(Result target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultOperations.validateResultTemplateId((Result) objectToTest, diagnostician, map); + } + + }; + + validateResultTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateResultCode() { + OperationsTestCase validateResultCodeTestCase = new OperationsTestCase( + "validateResultCode", operationsForOCL.getOCLValue("VALIDATE_RESULT_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Result target) { + + } + + @Override + protected void updateToPass(Result target) { + target.init(); + CD cd = DatatypesFactory.eINSTANCE.createCD(); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultOperations.validateResultCode((Result) objectToTest, diagnostician, map); + } + + }; + + validateResultCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateResultEffectiveTime() { + OperationsTestCase validateResultEffectiveTimeTestCase = new OperationsTestCase( + "validateResultEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_RESULT_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Result target) { + + } + + @Override + protected void updateToPass(Result target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultOperations.validateResultEffectiveTime((Result) objectToTest, diagnostician, map); + } + + }; + + validateResultEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateResultValue() { + OperationsTestCase validateResultValueTestCase = new OperationsTestCase( + "validateResultValue", + operationsForOCL.getOCLValue("VALIDATE_RESULT_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(Result target) { + + } + + @Override + protected void updateToPass(Result target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD(); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultOperations.validateResultValue((Result) objectToTest, diagnostician, map); + } + + }; + + validateResultValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ResultOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public Result create() { + return HITSPFactory.eINSTANCE.createResult(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends ResultOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ResultOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/ReviewOfSystemsSectionTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/ReviewOfSystemsSectionTest.java new file mode 100644 index 000000000..30c0db934 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/ReviewOfSystemsSectionTest.java @@ -0,0 +1,144 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.ReviewOfSystemsSection; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.ReviewOfSystemsSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Review Of Systems Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.ReviewOfSystemsSection#validateHITSPReviewOfSystemsSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Review Of Systems Section Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class ReviewOfSystemsSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHITSPReviewOfSystemsSectionTemplateId() { + OperationsTestCase validateHITSPReviewOfSystemsSectionTemplateIdTestCase = new OperationsTestCase( + "validateHITSPReviewOfSystemsSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HITSP_REVIEW_OF_SYSTEMS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReviewOfSystemsSection target) { + + } + + @Override + protected void updateToPass(ReviewOfSystemsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReviewOfSystemsSectionOperations.validateHITSPReviewOfSystemsSectionTemplateId( + (ReviewOfSystemsSection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPReviewOfSystemsSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ReviewOfSystemsSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public ReviewOfSystemsSection create() { + return HITSPFactory.eINSTANCE.createReviewOfSystemsSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends ReviewOfSystemsSectionOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ReviewOfSystemsSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/SocialHistorySectionTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/SocialHistorySectionTest.java new file mode 100644 index 000000000..1ff485f4a --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/SocialHistorySectionTest.java @@ -0,0 +1,200 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.SocialHistory; +import org.openhealthtools.mdht.uml.cda.hitsp.SocialHistorySection; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.SocialHistorySectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Social History Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.SocialHistorySection#validateHITSPSocialHistorySectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Social History Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.SocialHistorySection#validateHITSPSocialHistorySectionSocialHistory(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Social History Section Social History}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.SocialHistorySection#getSocialHistories() Get Social Histories}
  • + *
+ *

+ * + * @generated + */ + +public class SocialHistorySectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHITSPSocialHistorySectionTemplateId() { + OperationsTestCase validateHITSPSocialHistorySectionTemplateIdTestCase = new OperationsTestCase( + "validateHITSPSocialHistorySectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HITSP_SOCIAL_HISTORY_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistorySection target) { + + } + + @Override + protected void updateToPass(SocialHistorySection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistorySectionOperations.validateHITSPSocialHistorySectionTemplateId( + (SocialHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPSocialHistorySectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHITSPSocialHistorySectionSocialHistory() { + OperationsTestCase validateHITSPSocialHistorySectionSocialHistoryTestCase = new OperationsTestCase( + "validateHITSPSocialHistorySectionSocialHistory", + operationsForOCL.getOCLValue("VALIDATE_HITSP_SOCIAL_HISTORY_SECTION_SOCIAL_HISTORY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistorySection target) { + + } + + @Override + protected void updateToPass(SocialHistorySection target) { + target.init(); + + SocialHistory socialHistory = HITSPFactory.eINSTANCE.createSocialHistory().init(); + + SocialHistory socialHistory2 = HITSPFactory.eINSTANCE.createSocialHistory().init(); + + target.addObservation(socialHistory); + target.addObservation(socialHistory2); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistorySectionOperations.validateHITSPSocialHistorySectionSocialHistory( + (SocialHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPSocialHistorySectionSocialHistoryTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetSocialHistories() { + + SocialHistorySection target = objectFactory.create(); + target.getSocialHistories(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends SocialHistorySectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public SocialHistorySection create() { + return HITSPFactory.eINSTANCE.createSocialHistorySection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends SocialHistorySectionOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // SocialHistorySectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/SocialHistoryTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/SocialHistoryTest.java new file mode 100644 index 000000000..78e87de75 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/SocialHistoryTest.java @@ -0,0 +1,287 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.SocialHistory; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.SocialHistoryOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; + +/** + * + * A static utility class that provides operations related to 'Social History' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.SocialHistory#validateSocialHistoryTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Social History Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.SocialHistory#validateSocialHistoryCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Social History Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.SocialHistory#validateSocialHistoryCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Social History Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.SocialHistory#validateSocialHistoryEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Social History Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.SocialHistory#validateSocialHistoryText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Social History Text}
  • + *
+ *

+ * + * @generated + */ + +public class SocialHistoryTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateSocialHistoryTemplateId() { + OperationsTestCase validateSocialHistoryTemplateIdTestCase = new OperationsTestCase( + "validateSocialHistoryTemplateId", + operationsForOCL.getOCLValue("VALIDATE_SOCIAL_HISTORY_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistory target) { + + } + + @Override + protected void updateToPass(SocialHistory target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistoryOperations.validateSocialHistoryTemplateId( + (SocialHistory) objectToTest, diagnostician, map); + } + + }; + + validateSocialHistoryTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSocialHistoryCodeP() { + OperationsTestCase validateSocialHistoryCodePTestCase = new OperationsTestCase( + "validateSocialHistoryCodeP", + operationsForOCL.getOCLValue("VALIDATE_SOCIAL_HISTORY_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistory target) { + + } + + @Override + protected void updateToPass(SocialHistory target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistoryOperations.validateSocialHistoryCodeP( + (SocialHistory) objectToTest, diagnostician, map); + } + + }; + + validateSocialHistoryCodePTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSocialHistoryCode() { + OperationsTestCase validateSocialHistoryCodeTestCase = new OperationsTestCase( + "validateSocialHistoryCode", + operationsForOCL.getOCLValue("VALIDATE_SOCIAL_HISTORY_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(SocialHistory target) { + + } + + @Override + protected void updateToPass(SocialHistory target) { + target.init(); + CD code = DatatypesFactory.eINSTANCE.createCD(); + code.setCodeSystem("2.16.840.1.113883.6.96"); + code.setCode("160573003"); + target.setCode(code); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistoryOperations.validateSocialHistoryCode( + (SocialHistory) objectToTest, diagnostician, map); + } + + }; + + validateSocialHistoryCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSocialHistoryEffectiveTime() { + OperationsTestCase validateSocialHistoryEffectiveTimeTestCase = new OperationsTestCase( + "validateSocialHistoryEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_SOCIAL_HISTORY_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistory target) { + + } + + @Override + protected void updateToPass(SocialHistory target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistoryOperations.validateSocialHistoryEffectiveTime( + (SocialHistory) objectToTest, diagnostician, map); + } + + }; + + validateSocialHistoryEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSocialHistoryText() { + OperationsTestCase validateSocialHistoryTextTestCase = new OperationsTestCase( + "validateSocialHistoryText", + operationsForOCL.getOCLValue("VALIDATE_SOCIAL_HISTORY_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(SocialHistory target) { + + } + + @Override + protected void updateToPass(SocialHistory target) { + target.init(); + target.setText(DatatypesFactory.eINSTANCE.createED()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistoryOperations.validateSocialHistoryText( + (SocialHistory) objectToTest, diagnostician, map); + } + + }; + + validateSocialHistoryTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends SocialHistoryOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public SocialHistory create() { + return HITSPFactory.eINSTANCE.createSocialHistory(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends SocialHistoryOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // SocialHistoryOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/SupportGuardianTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/SupportGuardianTest.java new file mode 100644 index 000000000..742d31df6 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/SupportGuardianTest.java @@ -0,0 +1,144 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.SupportGuardian; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.SupportGuardianOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Support Guardian' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.SupportGuardian#validateHITSPSupportGuardianTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Support Guardian Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class SupportGuardianTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHITSPSupportGuardianTemplateId() { + OperationsTestCase validateHITSPSupportGuardianTemplateIdTestCase = new OperationsTestCase( + "validateHITSPSupportGuardianTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HITSP_SUPPORT_GUARDIAN_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SupportGuardian target) { + + } + + @Override + protected void updateToPass(SupportGuardian target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SupportGuardianOperations.validateHITSPSupportGuardianTemplateId( + (SupportGuardian) objectToTest, diagnostician, map); + } + + }; + + validateHITSPSupportGuardianTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends SupportGuardianOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public SupportGuardian create() { + return HITSPFactory.eINSTANCE.createSupportGuardian(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends SupportGuardianOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // SupportGuardianOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/SupportParticipantTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/SupportParticipantTest.java new file mode 100644 index 000000000..57d9a0af3 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/SupportParticipantTest.java @@ -0,0 +1,144 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.SupportParticipant; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.SupportParticipantOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Support Participant' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.SupportParticipant#validateHITSPSupportParticipantTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Support Participant Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class SupportParticipantTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHITSPSupportParticipantTemplateId() { + OperationsTestCase validateHITSPSupportParticipantTemplateIdTestCase = new OperationsTestCase( + "validateHITSPSupportParticipantTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HITSP_SUPPORT_PARTICIPANT_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SupportParticipant target) { + + } + + @Override + protected void updateToPass(SupportParticipant target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SupportParticipantOperations.validateHITSPSupportParticipantTemplateId( + (SupportParticipant) objectToTest, diagnostician, map); + } + + }; + + validateHITSPSupportParticipantTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends SupportParticipantOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public SupportParticipant create() { + return HITSPFactory.eINSTANCE.createSupportParticipant(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends SupportParticipantOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // SupportParticipantOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/SupportTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/SupportTest.java new file mode 100644 index 000000000..8b7cad1a5 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/SupportTest.java @@ -0,0 +1,46 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Support' model objects. + * + * + * @generated + */ + +public class SupportTest extends CDAValidationTest { + + /** + * No Operations Test + * + * @generated + */ + @Test + public void testNoOperations() { + } + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // SupportOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/SurgeriesSectionTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/SurgeriesSectionTest.java new file mode 100644 index 000000000..af5a7ddba --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/SurgeriesSectionTest.java @@ -0,0 +1,187 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.SurgeriesSection; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.SurgeriesSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Surgeries Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.SurgeriesSection#validateHITSPSurgeriesSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Surgeries Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.SurgeriesSection#validateHITSPSurgeriesSectionProcedureActivity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Surgeries Section Procedure Activity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.SurgeriesSection#getProcedureActivities() Get Procedure Activities}
  • + *
+ *

+ * + * @generated + */ + +public class SurgeriesSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHITSPSurgeriesSectionTemplateId() { + OperationsTestCase validateHITSPSurgeriesSectionTemplateIdTestCase = new OperationsTestCase( + "validateHITSPSurgeriesSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HITSP_SURGERIES_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SurgeriesSection target) { + + } + + @Override + protected void updateToPass(SurgeriesSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SurgeriesSectionOperations.validateHITSPSurgeriesSectionTemplateId( + (SurgeriesSection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPSurgeriesSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateHITSPSurgeriesSectionProcedureActivity() { + OperationsTestCase validateHITSPSurgeriesSectionProcedureActivityTestCase = new OperationsTestCase( + "validateHITSPSurgeriesSectionProcedureActivity", + operationsForOCL.getOCLValue("VALIDATE_HITSP_SURGERIES_SECTION_PROCEDURE_ACTIVITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SurgeriesSection target) { + target.init(); + } + + @Override + protected void updateToPass(SurgeriesSection target) { + target.addProcedure(HITSPFactory.eINSTANCE.createPastProcedure().init()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SurgeriesSectionOperations.validateHITSPSurgeriesSectionProcedureActivity( + (SurgeriesSection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPSurgeriesSectionProcedureActivityTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProcedureActivities() { + + SurgeriesSection target = objectFactory.create(); + target.getProcedureActivities(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends SurgeriesSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public SurgeriesSection create() { + return HITSPFactory.eINSTANCE.createSurgeriesSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends SurgeriesSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // SurgeriesSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/UnstructuredDocumentTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/UnstructuredDocumentTest.java new file mode 100644 index 000000000..ffdb6f87f --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/UnstructuredDocumentTest.java @@ -0,0 +1,233 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Component2; +import org.openhealthtools.mdht.uml.cda.Patient; +import org.openhealthtools.mdht.uml.cda.PatientRole; +import org.openhealthtools.mdht.uml.cda.RecordTarget; +import org.openhealthtools.mdht.uml.cda.StructuredBody; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.UnstructuredDocument; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.UnstructuredDocumentOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Unstructured Document' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.UnstructuredDocument#validateScannedDocumentTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Scanned Document Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.UnstructuredDocument#validateUnstructuredDocumentNoStructuredData(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Unstructured Document No Structured Data}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.UnstructuredDocument#validateUnstructuredDocumentOnePatientPerDocument(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Unstructured Document One Patient Per Document}
  • + *
+ *

+ * + * @generated + */ + +public class UnstructuredDocumentTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateScannedDocumentTemplateId() { + OperationsTestCase validateScannedDocumentTemplateIdTestCase = new OperationsTestCase( + "validateScannedDocumentTemplateId", + operationsForOCL.getOCLValue("VALIDATE_SCANNED_DOCUMENT_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(UnstructuredDocument target) { + + } + + @Override + protected void updateToPass(UnstructuredDocument target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return UnstructuredDocumentOperations.validateScannedDocumentTemplateId( + (UnstructuredDocument) objectToTest, diagnostician, map); + } + + }; + + validateScannedDocumentTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateUnstructuredDocumentNoStructuredData() { + OperationsTestCase validateUnstructuredDocumentNoStructuredDataTestCase = new OperationsTestCase( + "validateUnstructuredDocumentNoStructuredData", + operationsForOCL.getOCLValue("VALIDATE_UNSTRUCTURED_DOCUMENT_NO_STRUCTURED_DATA__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(UnstructuredDocument target) { + target.init(); + Component2 component = CDAFactory.eINSTANCE.createComponent2(); + target.setComponent(component); + StructuredBody sb = CDAFactory.eINSTANCE.createStructuredBody(); + target.getComponent().setStructuredBody(sb); + + } + + @Override + protected void updateToPass(UnstructuredDocument target) { + Component2 component = CDAFactory.eINSTANCE.createComponent2(); + target.setComponent(component); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return UnstructuredDocumentOperations.validateUnstructuredDocumentNoStructuredData( + (UnstructuredDocument) objectToTest, diagnostician, map); + } + + }; + + validateUnstructuredDocumentNoStructuredDataTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateUnstructuredDocumentOnePatientPerDocument() { + OperationsTestCase validateUnstructuredDocumentOnePatientPerDocumentTestCase = new OperationsTestCase( + "validateUnstructuredDocumentOnePatientPerDocument", + operationsForOCL.getOCLValue("VALIDATE_UNSTRUCTURED_DOCUMENT_ONE_PATIENT_PER_DOCUMENT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(UnstructuredDocument target) { + + } + + @Override + protected void updateToPass(UnstructuredDocument target) { + target.init(); + + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient p = CDAFactory.eINSTANCE.createPatient(); + pr.setPatient(p); + rt.setPatientRole(pr); + + target.getRecordTargets().add(rt); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return UnstructuredDocumentOperations.validateUnstructuredDocumentOnePatientPerDocument( + (UnstructuredDocument) objectToTest, diagnostician, map); + } + + }; + + validateUnstructuredDocumentOnePatientPerDocumentTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends UnstructuredDocumentOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public UnstructuredDocument create() { + return HITSPFactory.eINSTANCE.createUnstructuredDocument(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends UnstructuredDocumentOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // UnstructuredDocumentOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/UnstructuredOrScannedDocumentTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/UnstructuredOrScannedDocumentTest.java new file mode 100644 index 000000000..a38c7ced4 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/UnstructuredOrScannedDocumentTest.java @@ -0,0 +1,45 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Unstructured Or Scanned Document' model objects. + * + * + * + * @generated + */ + +public class UnstructuredOrScannedDocumentTest extends CDAValidationTest { + + /** + * No Operations Test + * @generated + */ + @Test + public void testNoOperations() { + } + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // UnstructuredOrScannedDocumentOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/VitalSignTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/VitalSignTest.java new file mode 100644 index 000000000..98410d913 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/VitalSignTest.java @@ -0,0 +1,220 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ccd.operations.ResultObservationOperations; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.VitalSign; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.VitalSignOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; + +/** + * A static utility class that provides operations + * related to 'Vital Sign' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.VitalSign#validateVitalSignTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Sign Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.VitalSign#validateVitalSignCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Sign Code}
  • + *
+ *

+ * + * @generated + */ + +public class VitalSignTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateVitalSignTemplateId() { + OperationsTestCase validateVitalSignTemplateIdTestCase = new OperationsTestCase( + "validateVitalSignTemplateId", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGN_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSign target) { + + } + + @Override + protected void updateToPass(VitalSign target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignOperations.validateVitalSignTemplateId((VitalSign) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateVitalSignCode() { + OperationsTestCase validateVitalSignCodeTestCase = new OperationsTestCase( + "validateVitalSignCode", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGN_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(VitalSign target) { + target.init(); + } + + @Override + protected void updateToPass(VitalSign target) { + CD cd = DatatypesFactory.eINSTANCE.createCD(); + cd.setCode("8310-5"); + cd.setCodeSystem("2.16.840.1.113883.6.1"); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignOperations.validateVitalSignCode((VitalSign) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateResultObservationCode() { + OperationsTestCase validateResultObservationCodeTestCase = new OperationsTestCase( + "validateResultObservationCode", + operationsForOCL.getOCLValue("VALIDATE_RESULT_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSign target) { + + } + + @Override + protected void updateToPass(VitalSign target) { + target.init(); + + CD cd = DatatypesFactory.eINSTANCE.createCD(); + cd.setCode("8306-3"); + cd.setCodeSystem("2.16.840.1.113883.6.1"); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultObservationOperations.validateResultObservationCode( + (VitalSign) objectToTest, diagnostician, map); + } + + }; + + validateResultObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends VitalSignOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public VitalSign create() { + return HITSPFactory.eINSTANCE.createVitalSign(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends VitalSignOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // VitalSignOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/VitalSignsSectionTest.java b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/VitalSignsSectionTest.java new file mode 100644 index 000000000..a431875d0 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/src/org/openhealthtools/mdht/uml/cda/hitsp/tests/VitalSignsSectionTest.java @@ -0,0 +1,191 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.hitsp.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Component4; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.VitalSign; +import org.openhealthtools.mdht.uml.cda.hitsp.VitalSignsSection; +import org.openhealthtools.mdht.uml.cda.hitsp.operations.VitalSignsSectionOperations; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.VitalSignsOrganizer; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Vital Signs Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.VitalSignsSection#validateHITSPVitalSignsSectionVitalSignEntry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Vital Signs Section Vital Sign Entry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.hitsp.VitalSignsSection#validateHITSPVitalSignsSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate HITSP Vital Signs Section Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class VitalSignsSectionTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateHITSPVitalSignsSectionVitalSignEntry() { + OperationsTestCase validateHITSPVitalSignsSectionVitalSignEntryTestCase = new OperationsTestCase( + "validateHITSPVitalSignsSectionVitalSignEntry", + operationsForOCL.getOCLValue("VALIDATE_HITSP_VITAL_SIGNS_SECTION_VITAL_SIGN_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignsSection target) { + + } + + @Override + protected void updateToPass(VitalSignsSection target) { + target.init(); + VitalSignsOrganizer organizer = IHEFactory.eINSTANCE.createVitalSignsOrganizer().init(); + target.addOrganizer(organizer); + + Component4 component = CDAFactory.eINSTANCE.createComponent4(); + VitalSign observation = HITSPFactory.eINSTANCE.createVitalSign().init(); + component.setObservation(observation); + organizer.getComponents().add(component); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignsSectionOperations.validateHITSPVitalSignsSectionVitalSignEntry( + (VitalSignsSection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPVitalSignsSectionVitalSignEntryTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHITSPVitalSignsSectionTemplateId() { + OperationsTestCase validateHITSPVitalSignsSectionTemplateIdTestCase = new OperationsTestCase( + "validateHITSPVitalSignsSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HITSP_VITAL_SIGNS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignsSection target) { + + } + + @Override + protected void updateToPass(VitalSignsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignsSectionOperations.validateHITSPVitalSignsSectionTemplateId( + (VitalSignsSection) objectToTest, diagnostician, map); + } + + }; + + validateHITSPVitalSignsSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends VitalSignsSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public VitalSignsSection create() { + return HITSPFactory.eINSTANCE.createVitalSignsSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends VitalSignsSectionOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // VitalSignsSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.hitsp.tests/test.xml b/org.openhealthtools.mdht.uml.cda.hitsp.tests/test.xml new file mode 100644 index 000000000..016eebb59 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.hitsp.tests/test.xml @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/.classpath b/org.openhealthtools.mdht.uml.cda.ihe.tests/.classpath new file mode 100644 index 000000000..121e527a9 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/.project b/org.openhealthtools.mdht.uml.cda.ihe.tests/.project new file mode 100644 index 000000000..d5d6fca27 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/.project @@ -0,0 +1,28 @@ + + + org.openhealthtools.mdht.uml.cda.ihe.tests + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.pde.PluginNature + + diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/.settings/org.eclipse.jdt.core.prefs b/org.openhealthtools.mdht.uml.cda.ihe.tests/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..fd79a3e6c --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,355 @@ +#Mon May 16 10:24:25 EDT 2011 +eclipse.preferences.version=1 +org.eclipse.jdt.core.codeComplete.argumentPrefixes= +org.eclipse.jdt.core.codeComplete.argumentSuffixes= +org.eclipse.jdt.core.codeComplete.fieldPrefixes= +org.eclipse.jdt.core.codeComplete.fieldSuffixes= +org.eclipse.jdt.core.codeComplete.localPrefixes= +org.eclipse.jdt.core.codeComplete.localSuffixes= +org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.5 +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.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning +org.eclipse.jdt.core.compiler.problem.deadCode=warning +org.eclipse.jdt.core.compiler.problem.deprecation=warning +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore +org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=error +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore +org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning +org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +org.eclipse.jdt.core.compiler.problem.nullReference=warning +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore +org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=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 +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedImport=warning +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +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.5 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=36 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=36 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=36 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=36 +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_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=49 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=32 +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_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=0 +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 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=1 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=150 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@fmtOff +org.eclipse.jdt.core.formatter.enabling_tag=@fmtOn +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +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=true +org.eclipse.jdt.core.formatter.indentation.size=4 +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_parameter=do not 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=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +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_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_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 +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +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_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 +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +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_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not 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_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 +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +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_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 +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +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_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_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 +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=false +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=120 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +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=false +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/.settings/org.eclipse.jdt.ui.prefs b/org.openhealthtools.mdht.uml.cda.ihe.tests/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 000000000..6245d2099 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,120 @@ +#Tue Mar 29 22:38:51 EDT 2011 +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=false +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=false +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=false +cleanup.format_source_code=true +cleanup.format_source_code_changes_only=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=false +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=true +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=true +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=true +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_blocks=true +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_parentheses_in_expressions=false +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup_profile=_MDHT +cleanup_settings_version=2 +eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true +formatter_profile=_MDHT +formatter_settings_version=11 +org.eclipse.jdt.ui.exception.name=e +org.eclipse.jdt.ui.gettersetter.use.is=true +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com; +org.eclipse.jdt.ui.javadoc=true +org.eclipse.jdt.ui.keywordthis=false +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.overrideannotation=true +org.eclipse.jdt.ui.staticondemandthreshold=99 +org.eclipse.jdt.ui.text.custom_code_templates= +sp_cleanup.add_default_serial_version_id=true +sp_cleanup.add_generated_serial_version_id=false +sp_cleanup.add_missing_annotations=true +sp_cleanup.add_missing_deprecated_annotations=true +sp_cleanup.add_missing_methods=false +sp_cleanup.add_missing_nls_tags=false +sp_cleanup.add_missing_override_annotations=true +sp_cleanup.add_missing_override_annotations_interface_methods=false +sp_cleanup.add_serial_version_id=false +sp_cleanup.always_use_blocks=true +sp_cleanup.always_use_parentheses_in_expressions=false +sp_cleanup.always_use_this_for_non_static_field_access=false +sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.convert_to_enhanced_for_loop=false +sp_cleanup.correct_indentation=false +sp_cleanup.format_source_code=true +sp_cleanup.format_source_code_changes_only=false +sp_cleanup.make_local_variable_final=false +sp_cleanup.make_parameters_final=false +sp_cleanup.make_private_fields_final=true +sp_cleanup.make_type_abstract_if_missing_method=false +sp_cleanup.make_variable_declarations_final=false +sp_cleanup.never_use_blocks=false +sp_cleanup.never_use_parentheses_in_expressions=true +sp_cleanup.on_save_use_additional_actions=true +sp_cleanup.organize_imports=true +sp_cleanup.qualify_static_field_accesses_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_with_declaring_class=false +sp_cleanup.qualify_static_method_accesses_with_declaring_class=false +sp_cleanup.remove_private_constructors=true +sp_cleanup.remove_trailing_whitespaces=true +sp_cleanup.remove_trailing_whitespaces_all=true +sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +sp_cleanup.remove_unnecessary_casts=true +sp_cleanup.remove_unnecessary_nls_tags=false +sp_cleanup.remove_unused_imports=false +sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_private_fields=true +sp_cleanup.remove_unused_private_members=false +sp_cleanup.remove_unused_private_methods=true +sp_cleanup.remove_unused_private_types=true +sp_cleanup.sort_members=false +sp_cleanup.sort_members_all=false +sp_cleanup.use_blocks=false +sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_parentheses_in_expressions=false +sp_cleanup.use_this_for_non_static_field_access=false +sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true +sp_cleanup.use_this_for_non_static_method_access=false +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/META-INF/MANIFEST.MF b/org.openhealthtools.mdht.uml.cda.ihe.tests/META-INF/MANIFEST.MF new file mode 100644 index 000000000..8da0acf6b --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/META-INF/MANIFEST.MF @@ -0,0 +1,23 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: org.openhealthtools.mdht.uml.cda.ihe.tests;singleton:=true +Bundle-Version: 1.1.0.qualifier +Bundle-ClassPath: . +Bundle-Vendor: %providerName +Bundle-Localization: plugin +Bundle-RequiredExecutionEnvironment: J2SE-1.5 +Export-Package: org.openhealthtools.mdht.uml.cda.ihe.tests +Require-Bundle: org.eclipse.core.runtime, + org.openhealthtools.mdht.uml.cda.ihe;visibility:=reexport, + org.openhealthtools.mdht.uml.cda.ccd;visibility:=reexport, + org.openhealthtools.mdht.uml.cda;visibility:=reexport, + org.openhealthtools.mdht.uml.cda.cdt;visibility:=reexport, + org.openhealthtools.mdht.uml.hl7.datatypes;visibility:=reexport, + org.eclipse.emf.ecore;visibility:=reexport, + org.openhealthtools.mdht.uml.hl7.rim;visibility:=reexport, + org.openhealthtools.mdht.uml.hl7.vocab;visibility:=reexport, + org.eclipse.emf.ecore.xmi;visibility:=reexport, + org.junit;visibility:=reexport, + org.openhealthtools.mdht.uml.cda.test;visibility:=reexport +Bundle-ActivationPolicy: lazy diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/build.properties b/org.openhealthtools.mdht.uml.cda.ihe.tests/build.properties new file mode 100644 index 000000000..e8b61f336 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/build.properties @@ -0,0 +1,17 @@ +############################################################################### +# Copyright (c) 2011, 2012 Sean Muir and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Sean Muir (JKM Software) - initial API and implementation +############################################################################### + +bin.includes = .,\ + META-INF/,\ + plugin.properties +jars.compile.order = . +source.. = src/ +output.. = bin/ diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/plugin.properties b/org.openhealthtools.mdht.uml.cda.ihe.tests/plugin.properties new file mode 100644 index 000000000..fcfbc7a0a --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/plugin.properties @@ -0,0 +1,14 @@ +############################################################################### +# Copyright (c) 2011, 2012 Sean Muir and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Sean Muir (JKM Software) - initial API and implementation +############################################################################### + +pluginName = IHE Tests +providerName = www.example.org + diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/AbdomenSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/AbdomenSectionTest.java new file mode 100644 index 000000000..f8864e529 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/AbdomenSectionTest.java @@ -0,0 +1,223 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.AbdomenSection; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.operations.AbdomenSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Abdomen Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.AbdomenSection#validateAbdomenSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Abdomen Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.AbdomenSection#validateAbdomenSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Abdomen Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.AbdomenSection#validateAbdomenSectionProblemEntry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Abdomen Section Problem Entry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.AbdomenSection#getProblemEntry() Get Problem Entry}
  • + *
+ *

+ * + * @generated + */ + +public class AbdomenSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateAbdomenSectionTemplateId() { + OperationsTestCase validateAbdomenSectionTemplateIdTestCase = new OperationsTestCase( + "validateAbdomenSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_ABDOMEN_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AbdomenSection target) { + + } + + @Override + protected void updateToPass(AbdomenSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AbdomenSectionOperations.validateAbdomenSectionTemplateId( + (AbdomenSection) objectToTest, diagnostician, map); + } + + }; + + validateAbdomenSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAbdomenSectionCode() { + OperationsTestCase validateAbdomenSectionCodeTestCase = new OperationsTestCase( + "validateAbdomenSectionCode", + operationsForOCL.getOCLValue("VALIDATE_ABDOMEN_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AbdomenSection target) { + + } + + @Override + protected void updateToPass(AbdomenSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AbdomenSectionOperations.validateAbdomenSectionCode( + (AbdomenSection) objectToTest, diagnostician, map); + } + + }; + + validateAbdomenSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAbdomenSectionProblemEntry() { + OperationsTestCase validateAbdomenSectionProblemEntryTestCase = new OperationsTestCase( + "validateAbdomenSectionProblemEntry", + operationsForOCL.getOCLValue("VALIDATE_ABDOMEN_SECTION_PROBLEM_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AbdomenSection target) { + target.init(); + } + + @Override + protected void updateToPass(AbdomenSection target) { + + target.addObservation(IHEFactory.eINSTANCE.createProblemEntry().init()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AbdomenSectionOperations.validateAbdomenSectionProblemEntry( + (AbdomenSection) objectToTest, diagnostician, map); + } + + }; + + validateAbdomenSectionProblemEntryTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemEntry() { + + AbdomenSection target = objectFactory.create(); + target.getProblemEntry(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends AbdomenSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public AbdomenSection create() { + return IHEFactory.eINSTANCE.createAbdomenSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends AbdomenSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // AbdomenSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ActiveProblemsSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ActiveProblemsSectionTest.java new file mode 100644 index 000000000..94721be77 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ActiveProblemsSectionTest.java @@ -0,0 +1,192 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.ActiveProblemsSection; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.operations.ActiveProblemsSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Active Problems Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ActiveProblemsSection#validateActiveProblemsSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Active Problems Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ActiveProblemsSection#validateActiveProblemsSectionProblemConcernEntry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Active Problems Section Problem Concern Entry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ActiveProblemsSection#getProblemConcernEntries() Get Problem Concern Entries}
  • + *
+ *

+ * + * @generated + */ + +public class ActiveProblemsSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateActiveProblemsSectionTemplateId() { + OperationsTestCase validateActiveProblemsSectionTemplateIdTestCase = new OperationsTestCase( + "validateActiveProblemsSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_ACTIVE_PROBLEMS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ActiveProblemsSection target) { + + } + + @Override + protected void updateToPass(ActiveProblemsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ActiveProblemsSectionOperations.validateActiveProblemsSectionTemplateId( + (ActiveProblemsSection) objectToTest, diagnostician, map); + } + + }; + + validateActiveProblemsSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateActiveProblemsSectionProblemConcernEntry() { + OperationsTestCase validateActiveProblemsSectionProblemConcernEntryTestCase = new OperationsTestCase( + "validateActiveProblemsSectionProblemConcernEntry", + operationsForOCL.getOCLValue("VALIDATE_ACTIVE_PROBLEMS_SECTION_PROBLEM_CONCERN_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ActiveProblemsSection target) { + + } + + @Override + protected void updateToPass(ActiveProblemsSection target) { + target.init(); + target.addAct(IHEFactory.eINSTANCE.createProblemConcernEntry().init()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ActiveProblemsSectionOperations.validateActiveProblemsSectionProblemConcernEntry( + (ActiveProblemsSection) objectToTest, diagnostician, map); + } + + }; + + validateActiveProblemsSectionProblemConcernEntryTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemConcernEntries() { + + ActiveProblemsSection target = objectFactory.create(); + target.getProblemConcernEntries(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ActiveProblemsSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public ActiveProblemsSection create() { + return IHEFactory.eINSTANCE.createActiveProblemsSection(); + } + + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ActiveProblemsSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ActiveProblemsSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/AdmissionMedicationHistorySectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/AdmissionMedicationHistorySectionTest.java new file mode 100644 index 000000000..7858e5684 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/AdmissionMedicationHistorySectionTest.java @@ -0,0 +1,177 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.AdmissionMedicationHistorySection; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.operations.AdmissionMedicationHistorySectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Admission Medication History Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.AdmissionMedicationHistorySection#validateAdmissionMedicationHistorySectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Admission Medication History Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.AdmissionMedicationHistorySection#validateAdmissionMedicationHistorySectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Admission Medication History Section Code}
  • + *
+ *

+ * + * @generated + */ + +public class AdmissionMedicationHistorySectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateAdmissionMedicationHistorySectionTemplateId() { + OperationsTestCase validateAdmissionMedicationHistorySectionTemplateIdTestCase = new OperationsTestCase( + "validateAdmissionMedicationHistorySectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_ADMISSION_MEDICATION_HISTORY_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdmissionMedicationHistorySection target) { + + } + + @Override + protected void updateToPass(AdmissionMedicationHistorySection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdmissionMedicationHistorySectionOperations.validateAdmissionMedicationHistorySectionTemplateId( + (AdmissionMedicationHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateAdmissionMedicationHistorySectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAdmissionMedicationHistorySectionCode() { + OperationsTestCase validateAdmissionMedicationHistorySectionCodeTestCase = new OperationsTestCase( + "validateAdmissionMedicationHistorySectionCode", + operationsForOCL.getOCLValue("VALIDATE_ADMISSION_MEDICATION_HISTORY_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdmissionMedicationHistorySection target) { + + } + + @Override + protected void updateToPass(AdmissionMedicationHistorySection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdmissionMedicationHistorySectionOperations.validateAdmissionMedicationHistorySectionCode( + (AdmissionMedicationHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateAdmissionMedicationHistorySectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends AdmissionMedicationHistorySectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public AdmissionMedicationHistorySection create() { + return IHEFactory.eINSTANCE.createAdmissionMedicationHistorySection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends AdmissionMedicationHistorySectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // AdmissionMedicationHistorySectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/AdvanceDirectiveObservationTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/AdvanceDirectiveObservationTest.java new file mode 100644 index 000000000..b1f5902db --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/AdvanceDirectiveObservationTest.java @@ -0,0 +1,361 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ihe.AdvanceDirectiveObservation; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.operations.AdvanceDirectiveObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; + +/** + * + * A static utility class that provides operations related to 'Advance Directive Observation' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.AdvanceDirectiveObservation#validateIHEAdvanceDirectiveObservationHasExternalReference(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Advance Directive Observation Has External Reference}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.AdvanceDirectiveObservation#validateIHEAdvanceDirectiveObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Advance Directive Observation Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.AdvanceDirectiveObservation#validateIHEAdvanceDirectiveObservationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Advance Directive Observation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.AdvanceDirectiveObservation#validateIHEAdvanceDirectiveObservationRepeatNumber(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Advance Directive Observation Repeat Number}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.AdvanceDirectiveObservation#validateIHEAdvanceDirectiveObservationInterpretationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Advance Directive Observation Interpretation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.AdvanceDirectiveObservation#validateIHEAdvanceDirectiveObservationTargetSiteCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Advance Directive Observation Target Site Code}
  • + *
+ *

+ * + * @generated + */ + +public class AdvanceDirectiveObservationTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateIHEAdvanceDirectiveObservationHasExternalReference() { + OperationsTestCase validateIHEAdvanceDirectiveObservationHasExternalReferenceTestCase = new OperationsTestCase( + "validateIHEAdvanceDirectiveObservationHasExternalReference", + operationsForOCL.getOCLValue("VALIDATE_IHE_ADVANCE_DIRECTIVE_OBSERVATION_HAS_EXTERNAL_REFERENCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveObservation target) { + target.init(); + } + + @Override + protected void updateToPass(AdvanceDirectiveObservation target) { + + target.getReferences().add(CCDFactory.eINSTANCE.createAdvanceDirectiveReference().init()); + ; + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveObservationOperations.validateIHEAdvanceDirectiveObservationHasExternalReference( + (AdvanceDirectiveObservation) objectToTest, diagnostician, map); + } + + }; + + validateIHEAdvanceDirectiveObservationHasExternalReferenceTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateIHEAdvanceDirectiveObservationTemplateId() { + OperationsTestCase validateIHEAdvanceDirectiveObservationTemplateIdTestCase = new OperationsTestCase( + "validateIHEAdvanceDirectiveObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_IHE_ADVANCE_DIRECTIVE_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveObservation target) { + + } + + @Override + protected void updateToPass(AdvanceDirectiveObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveObservationOperations.validateIHEAdvanceDirectiveObservationTemplateId( + (AdvanceDirectiveObservation) objectToTest, diagnostician, map); + } + + }; + + validateIHEAdvanceDirectiveObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateIHEAdvanceDirectiveObservationCode() { + OperationsTestCase validateIHEAdvanceDirectiveObservationCodeTestCase = new OperationsTestCase( + "validateIHEAdvanceDirectiveObservationCode", + operationsForOCL.getOCLValue("VALIDATE_IHE_ADVANCE_DIRECTIVE_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveObservation target) { + + } + + @Override + protected void updateToPass(AdvanceDirectiveObservation target) { + target.init(); + + CD cd = DatatypesFactory.eINSTANCE.createCD(); + cd.setCodeSystem("2.16.840.1.113883.6.96"); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveObservationOperations.validateIHEAdvanceDirectiveObservationCode( + (AdvanceDirectiveObservation) objectToTest, diagnostician, map); + } + + }; + + validateIHEAdvanceDirectiveObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateIHEAdvanceDirectiveObservationRepeatNumber() { + OperationsTestCase validateIHEAdvanceDirectiveObservationRepeatNumberTestCase = new OperationsTestCase( + "validateIHEAdvanceDirectiveObservationRepeatNumber", + operationsForOCL.getOCLValue("VALIDATE_IHE_ADVANCE_DIRECTIVE_OBSERVATION_REPEAT_NUMBER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveObservation target) { + target.init(); + } + + @Override + protected void updateToPass(AdvanceDirectiveObservation target) { + + target.setRepeatNumber(DatatypesFactory.eINSTANCE.createIVL_INT()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveObservationOperations.validateIHEAdvanceDirectiveObservationRepeatNumber( + (AdvanceDirectiveObservation) objectToTest, diagnostician, map); + } + + }; + + validateIHEAdvanceDirectiveObservationRepeatNumberTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateIHEAdvanceDirectiveObservationInterpretationCode() { + OperationsTestCase validateIHEAdvanceDirectiveObservationInterpretationCodeTestCase = new OperationsTestCase( + "validateIHEAdvanceDirectiveObservationInterpretationCode", + operationsForOCL.getOCLValue("VALIDATE_IHE_ADVANCE_DIRECTIVE_OBSERVATION_INTERPRETATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveObservation target) { + target.init(); + } + + @Override + protected void updateToPass(AdvanceDirectiveObservation target) { + + target.getInterpretationCodes().add(DatatypesFactory.eINSTANCE.createCE()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveObservationOperations.validateIHEAdvanceDirectiveObservationInterpretationCode( + (AdvanceDirectiveObservation) objectToTest, diagnostician, map); + } + + }; + + validateIHEAdvanceDirectiveObservationInterpretationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateIHEAdvanceDirectiveObservationTargetSiteCode() { + OperationsTestCase validateIHEAdvanceDirectiveObservationTargetSiteCodeTestCase = new OperationsTestCase( + "validateIHEAdvanceDirectiveObservationTargetSiteCode", + operationsForOCL.getOCLValue("VALIDATE_IHE_ADVANCE_DIRECTIVE_OBSERVATION_TARGET_SITE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveObservation target) { + target.init(); + } + + @Override + protected void updateToPass(AdvanceDirectiveObservation target) { + target.getTargetSiteCodes().add(DatatypesFactory.eINSTANCE.createCD()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectiveObservationOperations.validateIHEAdvanceDirectiveObservationTargetSiteCode( + (AdvanceDirectiveObservation) objectToTest, diagnostician, map); + } + + }; + + validateIHEAdvanceDirectiveObservationTargetSiteCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAdvanceDirectiveObservationCode() { + OperationsTestCase validateAdvanceDirectiveObservationCodeTestCase = new OperationsTestCase( + "validateAdvanceDirectiveObservationCode", + operationsForOCL.getOCLValue("VALIDATE_ADVANCE_DIRECTIVE_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectiveObservation target) { + + } + + @Override + protected void updateToPass(AdvanceDirectiveObservation target) { + target.init(); + + CD cd = DatatypesFactory.eINSTANCE.createCD(); + cd.setCodeSystem("2.16.840.1.113883.6.96"); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return org.openhealthtools.mdht.uml.cda.ccd.operations.AdvanceDirectiveObservationOperations.validateAdvanceDirectiveObservationCode( + (AdvanceDirectiveObservation) objectToTest, diagnostician, map); + } + + }; + + validateAdvanceDirectiveObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends AdvanceDirectiveObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public AdvanceDirectiveObservation create() { + return IHEFactory.eINSTANCE.createAdvanceDirectiveObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends AdvanceDirectiveObservationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // AdvanceDirectiveObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/AdvanceDirectivesSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/AdvanceDirectivesSectionTest.java new file mode 100644 index 000000000..66b9809b0 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/AdvanceDirectivesSectionTest.java @@ -0,0 +1,142 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.AdvanceDirectivesSection; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.operations.AdvanceDirectivesSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Advance Directives Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.AdvanceDirectivesSection#validateIHEAdvanceDirectivesSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Advance Directives Section Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class AdvanceDirectivesSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateIHEAdvanceDirectivesSectionTemplateId() { + OperationsTestCase validateIHEAdvanceDirectivesSectionTemplateIdTestCase = new OperationsTestCase( + "validateIHEAdvanceDirectivesSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_IHE_ADVANCE_DIRECTIVES_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AdvanceDirectivesSection target) { + + } + + @Override + protected void updateToPass(AdvanceDirectivesSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AdvanceDirectivesSectionOperations.validateIHEAdvanceDirectivesSectionTemplateId( + (AdvanceDirectivesSection) objectToTest, diagnostician, map); + } + + }; + + validateIHEAdvanceDirectivesSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends AdvanceDirectivesSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public AdvanceDirectivesSection create() { + return IHEFactory.eINSTANCE.createAdvanceDirectivesSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends AdvanceDirectivesSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // AdvanceDirectivesSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/AllergiesReactionsSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/AllergiesReactionsSectionTest.java new file mode 100644 index 000000000..5f65b8c3f --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/AllergiesReactionsSectionTest.java @@ -0,0 +1,192 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.AllergiesReactionsSection; +import org.openhealthtools.mdht.uml.cda.ihe.AllergyIntoleranceConcern; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.operations.AllergiesReactionsSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Allergies Reactions Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.AllergiesReactionsSection#validateAllergiesReactionsSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergies Reactions Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.AllergiesReactionsSection#validateAllergiesReactionsSectionAllergyIntoleranceConcern(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergies Reactions Section Allergy Intolerance Concern}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.AllergiesReactionsSection#getAllergyIntoleranceConcerns() Get Allergy Intolerance Concerns}
  • + *
+ *

+ * + * @generated + */ + +public class AllergiesReactionsSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateAllergiesReactionsSectionTemplateId() { + OperationsTestCase validateAllergiesReactionsSectionTemplateIdTestCase = new OperationsTestCase( + "validateAllergiesReactionsSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_ALLERGIES_REACTIONS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergiesReactionsSection target) { + + } + + @Override + protected void updateToPass(AllergiesReactionsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergiesReactionsSectionOperations.validateAllergiesReactionsSectionTemplateId( + (AllergiesReactionsSection) objectToTest, diagnostician, map); + } + + }; + + validateAllergiesReactionsSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergiesReactionsSectionAllergyIntoleranceConcern() { + OperationsTestCase validateAllergiesReactionsSectionAllergyIntoleranceConcernTestCase = new OperationsTestCase( + "validateAllergiesReactionsSectionAllergyIntoleranceConcern", + operationsForOCL.getOCLValue("VALIDATE_ALLERGIES_REACTIONS_SECTION_ALLERGY_INTOLERANCE_CONCERN__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergiesReactionsSection target) { + target.init(); + + } + + @Override + protected void updateToPass(AllergiesReactionsSection target) { + AllergyIntoleranceConcern aic = IHEFactory.eINSTANCE.createAllergyIntoleranceConcern().init(); + target.addAct(aic); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergiesReactionsSectionOperations.validateAllergiesReactionsSectionAllergyIntoleranceConcern( + (AllergiesReactionsSection) objectToTest, diagnostician, map); + } + + }; + + validateAllergiesReactionsSectionAllergyIntoleranceConcernTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetAllergyIntoleranceConcerns() { + + AllergiesReactionsSection target = objectFactory.create(); + target.getAllergyIntoleranceConcerns(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends AllergiesReactionsSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public AllergiesReactionsSection create() { + return IHEFactory.eINSTANCE.createAllergiesReactionsSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends AllergiesReactionsSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // AllergiesReactionsSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/AllergyIntoleranceConcernTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/AllergyIntoleranceConcernTest.java new file mode 100644 index 000000000..c0fedad17 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/AllergyIntoleranceConcernTest.java @@ -0,0 +1,199 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.ihe.AllergyIntolerance; +import org.openhealthtools.mdht.uml.cda.ihe.AllergyIntoleranceConcern; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.operations.AllergyIntoleranceConcernOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * + * A static utility class that provides operations related to 'Allergy Intolerance Concern' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.AllergyIntoleranceConcern#validateAllergyIntoleranceConcernTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Intolerance Concern Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.AllergyIntoleranceConcern#validateAllergyIntoleranceConcernAllergyIntolerance(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Intolerance Concern Allergy Intolerance}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.AllergyIntoleranceConcern#getAllergyIntolerances() Get Allergy Intolerances}
  • + *
+ *

+ * + * @generated + */ + +public class AllergyIntoleranceConcernTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateAllergyIntoleranceConcernTemplateId() { + OperationsTestCase validateAllergyIntoleranceConcernTemplateIdTestCase = new OperationsTestCase( + "validateAllergyIntoleranceConcernTemplateId", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_INTOLERANCE_CONCERN_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyIntoleranceConcern target) { + + } + + @Override + protected void updateToPass(AllergyIntoleranceConcern target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyIntoleranceConcernOperations.validateAllergyIntoleranceConcernTemplateId( + (AllergyIntoleranceConcern) objectToTest, diagnostician, map); + } + + }; + + validateAllergyIntoleranceConcernTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyIntoleranceConcernAllergyIntolerance() { + OperationsTestCase validateAllergyIntoleranceConcernAllergyIntoleranceTestCase = new OperationsTestCase( + "validateAllergyIntoleranceConcernAllergyIntolerance", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_INTOLERANCE_CONCERN_ALLERGY_INTOLERANCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyIntoleranceConcern target) { + target.init(); + + } + + @Override + protected void updateToPass(AllergyIntoleranceConcern target) { + AllergyIntolerance ai = IHEFactory.eINSTANCE.createAllergyIntolerance().init(); + target.addObservation(ai); + + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyIntoleranceConcernOperations.validateAllergyIntoleranceConcernAllergyIntolerance( + (AllergyIntoleranceConcern) objectToTest, diagnostician, map); + } + + }; + + validateAllergyIntoleranceConcernAllergyIntoleranceTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetAllergyIntolerances() { + + AllergyIntoleranceConcern target = objectFactory.create(); + target.getAllergyIntolerances(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends AllergyIntoleranceConcernOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public AllergyIntoleranceConcern create() { + return IHEFactory.eINSTANCE.createAllergyIntoleranceConcern(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends AllergyIntoleranceConcernOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // AllergyIntoleranceConcernOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/AllergyIntoleranceTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/AllergyIntoleranceTest.java new file mode 100644 index 000000000..03e2811b3 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/AllergyIntoleranceTest.java @@ -0,0 +1,894 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.Participant2; +import org.openhealthtools.mdht.uml.cda.ParticipantRole; +import org.openhealthtools.mdht.uml.cda.PlayingEntity; +import org.openhealthtools.mdht.uml.cda.ihe.AllergyIntolerance; +import org.openhealthtools.mdht.uml.cda.ihe.Comment; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.ProblemEntryReactionObservationContainer; +import org.openhealthtools.mdht.uml.cda.ihe.ProblemStatusObservation; +import org.openhealthtools.mdht.uml.cda.ihe.Severity; +import org.openhealthtools.mdht.uml.cda.ihe.operations.AllergyIntoleranceOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; +import org.openhealthtools.mdht.uml.hl7.datatypes.TEL; +import org.openhealthtools.mdht.uml.hl7.vocab.EntityClassRoot; +import org.openhealthtools.mdht.uml.hl7.vocab.ParticipationType; +import org.openhealthtools.mdht.uml.hl7.vocab.RoleClassRoot; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * + * A static utility class that provides operations related to 'Allergy Intolerance' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.AllergyIntolerance#validateAllergyIntoleranceCodeCodeSystemRequired(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Intolerance Code Code System Required}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.AllergyIntolerance#validateAllergyIntoleranceDisplayNameCodeName(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Intolerance Display Name Code Name}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.AllergyIntolerance#validateAllergyIntoleranceAllergySubstance(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Intolerance Allergy Substance}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.AllergyIntolerance#validateAllergyIntoleranceAllergySubstanceTypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Intolerance Allergy Substance Type Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.AllergyIntolerance#validateAllergyIntoleranceAllergySubstanceParticipantRole(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Intolerance Allergy Substance Participant Role}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.AllergyIntolerance#validateAllergyIntoleranceAllergySubstanceParticipantRoleClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Intolerance Allergy Substance Participant Role Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.AllergyIntolerance#validateAllergyIntoleranceAllergySubstancePlayingEntity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Intolerance Allergy Substance Playing Entity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.AllergyIntolerance#validateAllergyIntoleranceAllergySubstancePlayingEntityClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Intolerance Allergy Substance Playing Entity Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.AllergyIntolerance#validateAllergyIntoleranceAllergySubstancePlayingEntityCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Intolerance Allergy Substance Playing Entity Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.AllergyIntolerance#validateAllergyIntolerancePlayingEntityCodeReference(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Intolerance Playing Entity Code Reference}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.AllergyIntolerance#validateAllergyIntoleranceTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Intolerance Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.AllergyIntolerance#validateAllergyIntoleranceCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Intolerance Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.AllergyIntolerance#validateAllergyIntoleranceCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Intolerance Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.AllergyIntolerance#validateAllergyIntoleranceValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Intolerance Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.AllergyIntolerance#validateAllergyIntoleranceProblemEntryReactionObservationContainer(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Intolerance Problem Entry Reaction Observation Container}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.AllergyIntolerance#validateAllergyIntoleranceSeverity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Intolerance Severity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.AllergyIntolerance#validateAllergyIntoleranceProblemStatusObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Intolerance Problem Status Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.AllergyIntolerance#validateAllergyIntoleranceComment(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Allergy Intolerance Comment}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.AllergyIntolerance#getProblemEntryReactionObservationContainers() Get Problem Entry Reaction Observation Containers}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.AllergyIntolerance#getIHESeverity() Get IHE Severity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.AllergyIntolerance#getIHEProblemStatusObservation() Get IHE Problem Status Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.AllergyIntolerance#getIHEComments() Get IHE Comments}
  • + *
+ *

+ * + * @generated + */ + +public class AllergyIntoleranceTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyIntoleranceCodeCodeSystemRequired() { + OperationsTestCase validateAllergyIntoleranceCodeCodeSystemRequiredTestCase = new OperationsTestCase( + "validateAllergyIntoleranceCodeCodeSystemRequired", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_INTOLERANCE_CODE_CODE_SYSTEM_REQUIRED__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyIntolerance target) { + + } + + @Override + protected void updateToPass(AllergyIntolerance target) { + target.init(); + CD cd = DatatypesFactory.eINSTANCE.createCD(); + cd.setCode("test"); + cd.setCodeSystem("codeSystem"); + target.setCode(cd); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyIntoleranceOperations.validateAllergyIntoleranceCodeCodeSystemRequired( + (AllergyIntolerance) objectToTest, diagnostician, map); + } + + }; + + validateAllergyIntoleranceCodeCodeSystemRequiredTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyIntoleranceDisplayNameCodeName() { + OperationsTestCase validateAllergyIntoleranceDisplayNameCodeNameTestCase = new OperationsTestCase( + "validateAllergyIntoleranceDisplayNameCodeName", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_INTOLERANCE_DISPLAY_NAME_CODE_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyIntolerance target) { + + } + + @Override + protected void updateToPass(AllergyIntolerance target) { + target.init(); + CD cd = DatatypesFactory.eINSTANCE.createCD(); + cd.setDisplayName("test"); + cd.setCodeSystemName("codeSystemName"); + target.setCode(cd); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyIntoleranceOperations.validateAllergyIntoleranceDisplayNameCodeName( + (AllergyIntolerance) objectToTest, diagnostician, map); + } + + }; + + validateAllergyIntoleranceDisplayNameCodeNameTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyIntoleranceAllergySubstance() { + OperationsTestCase validateAllergyIntoleranceAllergySubstanceTestCase = new OperationsTestCase( + "validateAllergyIntoleranceAllergySubstance", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_INTOLERANCE_ALLERGY_SUBSTANCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyIntolerance target) { + + } + + @Override + protected void updateToPass(AllergyIntolerance target) { + target.init(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + target.getParticipants().add(par); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyIntoleranceOperations.validateAllergyIntoleranceAllergySubstance( + (AllergyIntolerance) objectToTest, diagnostician, map); + } + + }; + + validateAllergyIntoleranceAllergySubstanceTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyIntoleranceAllergySubstanceTypeCode() { + OperationsTestCase validateAllergyIntoleranceAllergySubstanceTypeCodeTestCase = new OperationsTestCase( + "validateAllergyIntoleranceAllergySubstanceTypeCode", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_INTOLERANCE_ALLERGY_SUBSTANCE_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyIntolerance target) { + target.init(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + target.getParticipants().add(par); + } + + @Override + protected void updateToPass(AllergyIntolerance target) { + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setTypeCode(ParticipationType.CSM); + target.getParticipants().clear(); + target.getParticipants().add(par); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyIntoleranceOperations.validateAllergyIntoleranceAllergySubstanceTypeCode( + (AllergyIntolerance) objectToTest, diagnostician, map); + } + + }; + + validateAllergyIntoleranceAllergySubstanceTypeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyIntoleranceAllergySubstanceParticipantRole() { + OperationsTestCase validateAllergyIntoleranceAllergySubstanceParticipantRoleTestCase = new OperationsTestCase( + "validateAllergyIntoleranceAllergySubstanceParticipantRole", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_INTOLERANCE_ALLERGY_SUBSTANCE_PARTICIPANT_ROLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyIntolerance target) { + + } + + @Override + protected void updateToPass(AllergyIntolerance target) { + target.init(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setTypeCode(ParticipationType.CSM); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + par.setParticipantRole(pr); + target.getParticipants().add(par); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyIntoleranceOperations.validateAllergyIntoleranceAllergySubstanceParticipantRole( + (AllergyIntolerance) objectToTest, diagnostician, map); + } + + }; + + validateAllergyIntoleranceAllergySubstanceParticipantRoleTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyIntoleranceAllergySubstanceParticipantRoleClassCode() { + OperationsTestCase validateAllergyIntoleranceAllergySubstanceParticipantRoleClassCodeTestCase = new OperationsTestCase( + "validateAllergyIntoleranceAllergySubstanceParticipantRoleClassCode", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_INTOLERANCE_ALLERGY_SUBSTANCE_PARTICIPANT_ROLE_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyIntolerance target) { + + } + + @Override + protected void updateToPass(AllergyIntolerance target) { + target.init(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setTypeCode(ParticipationType.CSM); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + pr.setClassCode(RoleClassRoot.MANU); + par.setParticipantRole(pr); + target.getParticipants().add(par); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyIntoleranceOperations.validateAllergyIntoleranceAllergySubstanceParticipantRoleClassCode( + (AllergyIntolerance) objectToTest, diagnostician, map); + } + + }; + + validateAllergyIntoleranceAllergySubstanceParticipantRoleClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyIntoleranceAllergySubstancePlayingEntity() { + OperationsTestCase validateAllergyIntoleranceAllergySubstancePlayingEntityTestCase = new OperationsTestCase( + "validateAllergyIntoleranceAllergySubstancePlayingEntity", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_INTOLERANCE_ALLERGY_SUBSTANCE_PLAYING_ENTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyIntolerance target) { + + } + + @Override + protected void updateToPass(AllergyIntolerance target) { + target.init(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setTypeCode(ParticipationType.CSM); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + pr.setClassCode(RoleClassRoot.MANU); + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + pr.setPlayingEntity(pe); + par.setParticipantRole(pr); + target.getParticipants().add(par); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyIntoleranceOperations.validateAllergyIntoleranceAllergySubstancePlayingEntity( + (AllergyIntolerance) objectToTest, diagnostician, map); + } + + }; + + validateAllergyIntoleranceAllergySubstancePlayingEntityTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyIntoleranceAllergySubstancePlayingEntityClassCode() { + OperationsTestCase validateAllergyIntoleranceAllergySubstancePlayingEntityClassCodeTestCase = new OperationsTestCase( + "validateAllergyIntoleranceAllergySubstancePlayingEntityClassCode", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_INTOLERANCE_ALLERGY_SUBSTANCE_PLAYING_ENTITY_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyIntolerance target) { + + } + + @Override + protected void updateToPass(AllergyIntolerance target) { + target.init(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setTypeCode(ParticipationType.CSM); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + pr.setClassCode(RoleClassRoot.MANU); + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + pe.setClassCode(EntityClassRoot.MMAT); + pr.setPlayingEntity(pe); + par.setParticipantRole(pr); + target.getParticipants().add(par); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyIntoleranceOperations.validateAllergyIntoleranceAllergySubstancePlayingEntityClassCode( + (AllergyIntolerance) objectToTest, diagnostician, map); + } + + }; + + validateAllergyIntoleranceAllergySubstancePlayingEntityClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyIntoleranceAllergySubstancePlayingEntityCode() { + OperationsTestCase validateAllergyIntoleranceAllergySubstancePlayingEntityCodeTestCase = new OperationsTestCase( + "validateAllergyIntoleranceAllergySubstancePlayingEntityCode", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_INTOLERANCE_ALLERGY_SUBSTANCE_PLAYING_ENTITY_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyIntolerance target) { + + } + + @Override + protected void updateToPass(AllergyIntolerance target) { + target.init(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setTypeCode(ParticipationType.CSM); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + pr.setClassCode(RoleClassRoot.MANU); + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + pe.setClassCode(EntityClassRoot.MMAT); + pe.setCode(DatatypesFactory.eINSTANCE.createCE()); + pr.setPlayingEntity(pe); + par.setParticipantRole(pr); + target.getParticipants().add(par); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyIntoleranceOperations.validateAllergyIntoleranceAllergySubstancePlayingEntityCode( + (AllergyIntolerance) objectToTest, diagnostician, map); + } + + }; + + validateAllergyIntoleranceAllergySubstancePlayingEntityCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyIntolerancePlayingEntityCodeReference() { + OperationsTestCase validateAllergyIntolerancePlayingEntityCodeReferenceTestCase = new OperationsTestCase( + "validateAllergyIntolerancePlayingEntityCodeReference", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_INTOLERANCE_PLAYING_ENTITY_CODE_REFERENCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyIntolerance target) { + + } + + @Override + protected void updateToPass(AllergyIntolerance target) { + target.init(); + Participant2 par = CDAFactory.eINSTANCE.createParticipant2(); + par.setTypeCode(ParticipationType.CSM); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + pr.setClassCode(RoleClassRoot.MANU); + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + pe.setClassCode(EntityClassRoot.MMAT); + CE code = DatatypesFactory.eINSTANCE.createCE(); + ED ot = DatatypesFactory.eINSTANCE.createED(); + TEL ref = DatatypesFactory.eINSTANCE.createTEL(); + ot.setReference(ref); + code.setOriginalText(ot); + pe.setCode(code); + pr.setPlayingEntity(pe); + par.setParticipantRole(pr); + target.getParticipants().add(par); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyIntoleranceOperations.validateAllergyIntolerancePlayingEntityCodeReference( + (AllergyIntolerance) objectToTest, diagnostician, map); + } + + }; + + validateAllergyIntolerancePlayingEntityCodeReferenceTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAllergyIntoleranceTemplateId() { + OperationsTestCase validateAllergyIntoleranceTemplateIdTestCase = new OperationsTestCase( + "validateAllergyIntoleranceTemplateId", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_INTOLERANCE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyIntolerance target) { + + } + + @Override + protected void updateToPass(AllergyIntolerance target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyIntoleranceOperations.validateAllergyIntoleranceTemplateId( + (AllergyIntolerance) objectToTest, diagnostician, map); + } + + }; + + validateAllergyIntoleranceTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAllergyIntoleranceCodeP() { + OperationsTestCase validateAllergyIntoleranceCodePTestCase = new OperationsTestCase( + "validateAllergyIntoleranceCodeP", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_INTOLERANCE_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyIntolerance target) { + + } + + @Override + protected void updateToPass(AllergyIntolerance target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyIntoleranceOperations.validateAllergyIntoleranceCodeP( + (AllergyIntolerance) objectToTest, diagnostician, map); + } + + }; + + validateAllergyIntoleranceCodePTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateAllergyIntoleranceCode() { + OperationsTestCase validateAllergyIntoleranceCodeTestCase = new OperationsTestCase( + "validateAllergyIntoleranceCode", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_INTOLERANCE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyIntolerance target) { + + } + + @Override + protected void updateToPass(AllergyIntolerance target) { + target.init(); + + CD cd = DatatypesFactory.eINSTANCE.createCD(); + cd.setCodeSystem("2.16.840.1.113883.5.4"); + cd.setCode("aaa"); + target.setCode(cd); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyIntoleranceOperations.validateAllergyIntoleranceCode( + (AllergyIntolerance) objectToTest, diagnostician, map); + } + + }; + + validateAllergyIntoleranceCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAllergyIntoleranceValue() { + OperationsTestCase validateAllergyIntoleranceValueTestCase = new OperationsTestCase( + "validateAllergyIntoleranceValue", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_INTOLERANCE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyIntolerance target) { + + } + + @Override + protected void updateToPass(AllergyIntolerance target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD(); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyIntoleranceOperations.validateAllergyIntoleranceValue( + (AllergyIntolerance) objectToTest, diagnostician, map); + } + + }; + + validateAllergyIntoleranceValueTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyIntoleranceProblemEntryReactionObservationContainer() { + OperationsTestCase validateAllergyIntoleranceProblemEntryReactionObservationContainerTestCase = new OperationsTestCase( + "validateAllergyIntoleranceProblemEntryReactionObservationContainer", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_INTOLERANCE_PROBLEM_ENTRY_REACTION_OBSERVATION_CONTAINER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyIntolerance target) { + target.init(); + + ProblemEntryReactionObservationContainer peroc = IHEFactory.eINSTANCE.createProblemEntryReactionObservationContainer().init(); + target.addObservation(peroc); + + } + + @Override + protected void updateToPass(AllergyIntolerance target) { + + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.MFST); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyIntoleranceOperations.validateAllergyIntoleranceProblemEntryReactionObservationContainer( + (AllergyIntolerance) objectToTest, diagnostician, map); + } + + }; + + validateAllergyIntoleranceProblemEntryReactionObservationContainerTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyIntoleranceSeverity() { + OperationsTestCase validateAllergyIntoleranceSeverityTestCase = new OperationsTestCase( + "validateAllergyIntoleranceSeverity", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_INTOLERANCE_SEVERITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyIntolerance target) { + target.init(); + Severity severity = IHEFactory.eINSTANCE.createSeverity().init(); + target.addObservation(severity); + } + + @Override + protected void updateToPass(AllergyIntolerance target) { + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.REFR); + } + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyIntoleranceOperations.validateAllergyIntoleranceSeverity( + (AllergyIntolerance) objectToTest, diagnostician, map); + } + + }; + + validateAllergyIntoleranceSeverityTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyIntoleranceProblemStatusObservation() { + OperationsTestCase validateAllergyIntoleranceProblemStatusObservationTestCase = new OperationsTestCase( + "validateAllergyIntoleranceProblemStatusObservation", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_INTOLERANCE_PROBLEM_STATUS_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyIntolerance target) { + target.init(); + ProblemStatusObservation pso = IHEFactory.eINSTANCE.createProblemStatusObservation().init(); + target.addObservation(pso); + + } + + @Override + protected void updateToPass(AllergyIntolerance target) { + + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.REFR); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyIntoleranceOperations.validateAllergyIntoleranceProblemStatusObservation( + (AllergyIntolerance) objectToTest, diagnostician, map); + } + + }; + + validateAllergyIntoleranceProblemStatusObservationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateAllergyIntoleranceComment() { + OperationsTestCase validateAllergyIntoleranceCommentTestCase = new OperationsTestCase( + "validateAllergyIntoleranceComment", + operationsForOCL.getOCLValue("VALIDATE_ALLERGY_INTOLERANCE_COMMENT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AllergyIntolerance target) { + target.init(); + Comment comment = IHEFactory.eINSTANCE.createComment().init(); + target.addAct(comment); + } + + @Override + protected void updateToPass(AllergyIntolerance target) { + + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + } + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AllergyIntoleranceOperations.validateAllergyIntoleranceComment( + (AllergyIntolerance) objectToTest, diagnostician, map); + } + + }; + + validateAllergyIntoleranceCommentTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemEntryReactionObservationContainers() { + + AllergyIntolerance target = objectFactory.create(); + target.getProblemEntryReactionObservationContainers(); + + } + + /** + * + * @generated + */ + @Test + public void testGetIHESeverity() { + + AllergyIntolerance target = objectFactory.create(); + target.getIHESeverity(); + + } + + /** + * + * @generated + */ + @Test + public void testGetIHEProblemStatusObservation() { + + AllergyIntolerance target = objectFactory.create(); + target.getIHEProblemStatusObservation(); + + } + + /** + * + * @generated + */ + @Test + public void testGetIHEComments() { + + AllergyIntolerance target = objectFactory.create(); + target.getIHEComments(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends AllergyIntoleranceOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public AllergyIntolerance create() { + return IHEFactory.eINSTANCE.createAllergyIntolerance(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends AllergyIntoleranceOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // AllergyIntoleranceOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/AssessmentAndPlanSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/AssessmentAndPlanSectionTest.java new file mode 100644 index 000000000..e21577a2a --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/AssessmentAndPlanSectionTest.java @@ -0,0 +1,177 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.AssessmentAndPlanSection; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.operations.AssessmentAndPlanSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Assessment And Plan Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.AssessmentAndPlanSection#validateAssessmentAndPlanSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment And Plan Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.AssessmentAndPlanSection#validateAssessmentAndPlanSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment And Plan Section Code}
  • + *
+ *

+ * + * @generated + */ + +public class AssessmentAndPlanSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateAssessmentAndPlanSectionTemplateId() { + OperationsTestCase validateAssessmentAndPlanSectionTemplateIdTestCase = new OperationsTestCase( + "validateAssessmentAndPlanSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_AND_PLAN_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentAndPlanSection target) { + + } + + @Override + protected void updateToPass(AssessmentAndPlanSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentAndPlanSectionOperations.validateAssessmentAndPlanSectionTemplateId( + (AssessmentAndPlanSection) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentAndPlanSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateAssessmentAndPlanSectionCode() { + OperationsTestCase validateAssessmentAndPlanSectionCodeTestCase = new OperationsTestCase( + "validateAssessmentAndPlanSectionCode", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_AND_PLAN_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentAndPlanSection target) { + + } + + @Override + protected void updateToPass(AssessmentAndPlanSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentAndPlanSectionOperations.validateAssessmentAndPlanSectionCode( + (AssessmentAndPlanSection) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentAndPlanSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends AssessmentAndPlanSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public AssessmentAndPlanSection create() { + return IHEFactory.eINSTANCE.createAssessmentAndPlanSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends AssessmentAndPlanSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // AssessmentAndPlanSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/BreastSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/BreastSectionTest.java new file mode 100644 index 000000000..4d349a373 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/BreastSectionTest.java @@ -0,0 +1,174 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.BreastSection; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.operations.BreastSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Breast Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.BreastSection#validateBreastSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Breast Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.BreastSection#validateBreastSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Breast Section Code}
  • + *
+ *

+ * + * @generated + */ + +public class BreastSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateBreastSectionTemplateId() { + OperationsTestCase validateBreastSectionTemplateIdTestCase = new OperationsTestCase( + "validateBreastSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_BREAST_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(BreastSection target) { + + } + + @Override + protected void updateToPass(BreastSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return BreastSectionOperations.validateBreastSectionTemplateId( + (BreastSection) objectToTest, diagnostician, map); + } + + }; + + validateBreastSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateBreastSectionCode() { + OperationsTestCase validateBreastSectionCodeTestCase = new OperationsTestCase( + "validateBreastSectionCode", + operationsForOCL.getOCLValue("VALIDATE_BREAST_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(BreastSection target) { + + } + + @Override + protected void updateToPass(BreastSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return BreastSectionOperations.validateBreastSectionCode( + (BreastSection) objectToTest, diagnostician, map); + } + + }; + + validateBreastSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends BreastSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public BreastSection create() { + return IHEFactory.eINSTANCE.createBreastSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends BreastSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // BreastSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/CarePlanSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/CarePlanSectionTest.java new file mode 100644 index 000000000..cb26b2c03 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/CarePlanSectionTest.java @@ -0,0 +1,142 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.CarePlanSection; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.operations.CarePlanSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Care Plan Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.CarePlanSection#validateCarePlanSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Care Plan Section Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class CarePlanSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateCarePlanSectionTemplateId() { + OperationsTestCase validateCarePlanSectionTemplateIdTestCase = new OperationsTestCase( + "validateCarePlanSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_CARE_PLAN_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CarePlanSection target) { + + } + + @Override + protected void updateToPass(CarePlanSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CarePlanSectionOperations.validateCarePlanSectionTemplateId( + (CarePlanSection) objectToTest, diagnostician, map); + } + + }; + + validateCarePlanSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends CarePlanSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public CarePlanSection create() { + return IHEFactory.eINSTANCE.createCarePlanSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends CarePlanSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // CarePlanSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ChestWallSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ChestWallSectionTest.java new file mode 100644 index 000000000..76134ec3f --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ChestWallSectionTest.java @@ -0,0 +1,223 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.ChestWallSection; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.operations.ChestWallSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Chest Wall Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ChestWallSection#validateChestWallSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Chest Wall Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ChestWallSection#validateChestWallSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Chest Wall Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ChestWallSection#validateChestWallSectionProblemEntry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Chest Wall Section Problem Entry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ChestWallSection#getProblemEntry() Get Problem Entry}
  • + *
+ *

+ * + * @generated + */ + +public class ChestWallSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateChestWallSectionTemplateId() { + OperationsTestCase validateChestWallSectionTemplateIdTestCase = new OperationsTestCase( + "validateChestWallSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_CHEST_WALL_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ChestWallSection target) { + + } + + @Override + protected void updateToPass(ChestWallSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ChestWallSectionOperations.validateChestWallSectionTemplateId( + (ChestWallSection) objectToTest, diagnostician, map); + } + + }; + + validateChestWallSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateChestWallSectionCode() { + OperationsTestCase validateChestWallSectionCodeTestCase = new OperationsTestCase( + "validateChestWallSectionCode", + operationsForOCL.getOCLValue("VALIDATE_CHEST_WALL_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ChestWallSection target) { + + } + + @Override + protected void updateToPass(ChestWallSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ChestWallSectionOperations.validateChestWallSectionCode( + (ChestWallSection) objectToTest, diagnostician, map); + } + + }; + + validateChestWallSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateChestWallSectionProblemEntry() { + OperationsTestCase validateChestWallSectionProblemEntryTestCase = new OperationsTestCase( + "validateChestWallSectionProblemEntry", + operationsForOCL.getOCLValue("VALIDATE_CHEST_WALL_SECTION_PROBLEM_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ChestWallSection target) { + target.init(); + } + + @Override + protected void updateToPass(ChestWallSection target) { + + target.addObservation(IHEFactory.eINSTANCE.createProblemEntry().init()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ChestWallSectionOperations.validateChestWallSectionProblemEntry( + (ChestWallSection) objectToTest, diagnostician, map); + } + + }; + + validateChestWallSectionProblemEntryTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemEntry() { + + ChestWallSection target = objectFactory.create(); + target.getProblemEntry(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ChestWallSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ChestWallSection create() { + return IHEFactory.eINSTANCE.createChestWallSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ChestWallSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ChestWallSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ChiefComplaintSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ChiefComplaintSectionTest.java new file mode 100644 index 000000000..4f4a79909 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ChiefComplaintSectionTest.java @@ -0,0 +1,177 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.ChiefComplaintSection; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.operations.ChiefComplaintSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Chief Complaint Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ChiefComplaintSection#validateChiefComplaintSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Chief Complaint Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ChiefComplaintSection#validateChiefComplaintSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Chief Complaint Section Code}
  • + *
+ *

+ * + * @generated + */ + +public class ChiefComplaintSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateChiefComplaintSectionTemplateId() { + OperationsTestCase validateChiefComplaintSectionTemplateIdTestCase = new OperationsTestCase( + "validateChiefComplaintSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_CHIEF_COMPLAINT_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ChiefComplaintSection target) { + + } + + @Override + protected void updateToPass(ChiefComplaintSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ChiefComplaintSectionOperations.validateChiefComplaintSectionTemplateId( + (ChiefComplaintSection) objectToTest, diagnostician, map); + } + + }; + + validateChiefComplaintSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateChiefComplaintSectionCode() { + OperationsTestCase validateChiefComplaintSectionCodeTestCase = new OperationsTestCase( + "validateChiefComplaintSectionCode", + operationsForOCL.getOCLValue("VALIDATE_CHIEF_COMPLAINT_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ChiefComplaintSection target) { + + } + + @Override + protected void updateToPass(ChiefComplaintSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ChiefComplaintSectionOperations.validateChiefComplaintSectionCode( + (ChiefComplaintSection) objectToTest, diagnostician, map); + } + + }; + + validateChiefComplaintSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ChiefComplaintSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public ChiefComplaintSection create() { + return IHEFactory.eINSTANCE.createChiefComplaintSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ChiefComplaintSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ChiefComplaintSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/CodedAdvanceDirectivesSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/CodedAdvanceDirectivesSectionTest.java new file mode 100644 index 000000000..d03021647 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/CodedAdvanceDirectivesSectionTest.java @@ -0,0 +1,191 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.CodedAdvanceDirectivesSection; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.operations.CodedAdvanceDirectivesSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Coded Advance Directives Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.CodedAdvanceDirectivesSection#validateCodedAdvanceDirectivesSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Coded Advance Directives Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.CodedAdvanceDirectivesSection#validateCodedAdvanceDirectivesSectionAdvanceDirectivesObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Coded Advance Directives Section Advance Directives Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.CodedAdvanceDirectivesSection#getAdvanceDirectivesObservations() Get Advance Directives Observations}
  • + *
+ *

+ * + * @generated + */ + +public class CodedAdvanceDirectivesSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateCodedAdvanceDirectivesSectionTemplateId() { + OperationsTestCase validateCodedAdvanceDirectivesSectionTemplateIdTestCase = new OperationsTestCase( + "validateCodedAdvanceDirectivesSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_CODED_ADVANCE_DIRECTIVES_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CodedAdvanceDirectivesSection target) { + + } + + @Override + protected void updateToPass(CodedAdvanceDirectivesSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CodedAdvanceDirectivesSectionOperations.validateCodedAdvanceDirectivesSectionTemplateId( + (CodedAdvanceDirectivesSection) objectToTest, diagnostician, map); + } + + }; + + validateCodedAdvanceDirectivesSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateCodedAdvanceDirectivesSectionAdvanceDirectivesObservation() { + OperationsTestCase validateCodedAdvanceDirectivesSectionAdvanceDirectivesObservationTestCase = new OperationsTestCase( + "validateCodedAdvanceDirectivesSectionAdvanceDirectivesObservation", + operationsForOCL.getOCLValue("VALIDATE_CODED_ADVANCE_DIRECTIVES_SECTION_ADVANCE_DIRECTIVES_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CodedAdvanceDirectivesSection target) { + + } + + @Override + protected void updateToPass(CodedAdvanceDirectivesSection target) { + target.init(); + target.addObservation(IHEFactory.eINSTANCE.createAdvanceDirectiveObservation()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CodedAdvanceDirectivesSectionOperations.validateCodedAdvanceDirectivesSectionAdvanceDirectivesObservation( + (CodedAdvanceDirectivesSection) objectToTest, diagnostician, map); + } + + }; + + validateCodedAdvanceDirectivesSectionAdvanceDirectivesObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetAdvanceDirectivesObservations() { + + CodedAdvanceDirectivesSection target = objectFactory.create(); + target.getAdvanceDirectivesObservations(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends CodedAdvanceDirectivesSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public CodedAdvanceDirectivesSection create() { + return IHEFactory.eINSTANCE.createCodedAdvanceDirectivesSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends CodedAdvanceDirectivesSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // CodedAdvanceDirectivesSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/CodedFamilyMedicalHistorySectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/CodedFamilyMedicalHistorySectionTest.java new file mode 100644 index 000000000..8eda0f7c9 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/CodedFamilyMedicalHistorySectionTest.java @@ -0,0 +1,188 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.CodedFamilyMedicalHistorySection; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.operations.CodedFamilyMedicalHistorySectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Coded Family Medical History Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.CodedFamilyMedicalHistorySection#validateCodedFamilyMedicalHistorySectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Coded Family Medical History Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.CodedFamilyMedicalHistorySection#validateCodedFamilyMedicalHistorySectionFamilyHistoryOrganizer(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Coded Family Medical History Section Family History Organizer}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.CodedFamilyMedicalHistorySection#getIHEFamilyHistoryOrganizer() Get IHE Family History Organizer}
  • + *
+ *

+ * + * @generated + */ + +public class CodedFamilyMedicalHistorySectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateCodedFamilyMedicalHistorySectionTemplateId() { + OperationsTestCase validateCodedFamilyMedicalHistorySectionTemplateIdTestCase = new OperationsTestCase( + "validateCodedFamilyMedicalHistorySectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_CODED_FAMILY_MEDICAL_HISTORY_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CodedFamilyMedicalHistorySection target) { + + } + + @Override + protected void updateToPass(CodedFamilyMedicalHistorySection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CodedFamilyMedicalHistorySectionOperations.validateCodedFamilyMedicalHistorySectionTemplateId( + (CodedFamilyMedicalHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateCodedFamilyMedicalHistorySectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCodedFamilyMedicalHistorySectionFamilyHistoryOrganizer() { + OperationsTestCase validateCodedFamilyMedicalHistorySectionFamilyHistoryOrganizerTestCase = new OperationsTestCase( + "validateCodedFamilyMedicalHistorySectionFamilyHistoryOrganizer", + operationsForOCL.getOCLValue("VALIDATE_CODED_FAMILY_MEDICAL_HISTORY_SECTION_FAMILY_HISTORY_ORGANIZER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CodedFamilyMedicalHistorySection target) { + target.init(); + } + + @Override + protected void updateToPass(CodedFamilyMedicalHistorySection target) { + target.addOrganizer(IHEFactory.eINSTANCE.createFamilyHistoryOrganizer().init()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CodedFamilyMedicalHistorySectionOperations.validateCodedFamilyMedicalHistorySectionFamilyHistoryOrganizer( + (CodedFamilyMedicalHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateCodedFamilyMedicalHistorySectionFamilyHistoryOrganizerTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetIHEFamilyHistoryOrganizer() { + + CodedFamilyMedicalHistorySection target = objectFactory.create(); + target.getIHEFamilyHistoryOrganizer(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends CodedFamilyMedicalHistorySectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public CodedFamilyMedicalHistorySection create() { + return IHEFactory.eINSTANCE.createCodedFamilyMedicalHistorySection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends CodedFamilyMedicalHistorySectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // CodedFamilyMedicalHistorySectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/CodedReasonForReferralSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/CodedReasonForReferralSectionTest.java new file mode 100644 index 000000000..ba1053dfa --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/CodedReasonForReferralSectionTest.java @@ -0,0 +1,235 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.CodedReasonForReferralSection; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.operations.CodedReasonForReferralSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Coded Reason For Referral Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.CodedReasonForReferralSection#validateCodedReasonForReferralSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Coded Reason For Referral Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.CodedReasonForReferralSection#validateCodedReasonForReferralSectionSimpleObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Coded Reason For Referral Section Simple Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.CodedReasonForReferralSection#validateCodedReasonForReferralSectionProblemEntry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Coded Reason For Referral Section Problem Entry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.CodedReasonForReferralSection#getSimpleObservations() Get Simple Observations}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.CodedReasonForReferralSection#getProblemEntries() Get Problem Entries}
  • + *
+ *

+ * + * @generated + */ + +public class CodedReasonForReferralSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateCodedReasonForReferralSectionTemplateId() { + OperationsTestCase validateCodedReasonForReferralSectionTemplateIdTestCase = new OperationsTestCase( + "validateCodedReasonForReferralSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_CODED_REASON_FOR_REFERRAL_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CodedReasonForReferralSection target) { + + } + + @Override + protected void updateToPass(CodedReasonForReferralSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CodedReasonForReferralSectionOperations.validateCodedReasonForReferralSectionTemplateId( + (CodedReasonForReferralSection) objectToTest, diagnostician, map); + } + + }; + + validateCodedReasonForReferralSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCodedReasonForReferralSectionSimpleObservation() { + OperationsTestCase validateCodedReasonForReferralSectionSimpleObservationTestCase = new OperationsTestCase( + "validateCodedReasonForReferralSectionSimpleObservation", + operationsForOCL.getOCLValue("VALIDATE_CODED_REASON_FOR_REFERRAL_SECTION_SIMPLE_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CodedReasonForReferralSection target) { + target.init(); + } + + @Override + protected void updateToPass(CodedReasonForReferralSection target) { + target.addObservation(IHEFactory.eINSTANCE.createVitalSignObservation().init()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CodedReasonForReferralSectionOperations.validateCodedReasonForReferralSectionSimpleObservation( + (CodedReasonForReferralSection) objectToTest, diagnostician, map); + } + + }; + + validateCodedReasonForReferralSectionSimpleObservationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateCodedReasonForReferralSectionProblemEntry() { + OperationsTestCase validateCodedReasonForReferralSectionProblemEntryTestCase = new OperationsTestCase( + "validateCodedReasonForReferralSectionProblemEntry", + operationsForOCL.getOCLValue("VALIDATE_CODED_REASON_FOR_REFERRAL_SECTION_PROBLEM_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CodedReasonForReferralSection target) { + target.init(); + } + + @Override + protected void updateToPass(CodedReasonForReferralSection target) { + target.addObservation(IHEFactory.eINSTANCE.createProblemEntry().init()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CodedReasonForReferralSectionOperations.validateCodedReasonForReferralSectionProblemEntry( + (CodedReasonForReferralSection) objectToTest, diagnostician, map); + } + + }; + + validateCodedReasonForReferralSectionProblemEntryTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetSimpleObservations() { + + CodedReasonForReferralSection target = objectFactory.create(); + target.getSimpleObservations(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProblemEntries() { + + CodedReasonForReferralSection target = objectFactory.create(); + target.getProblemEntries(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends CodedReasonForReferralSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public CodedReasonForReferralSection create() { + return IHEFactory.eINSTANCE.createCodedReasonForReferralSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends CodedReasonForReferralSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // CodedReasonForReferralSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/CodedResultsSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/CodedResultsSectionTest.java new file mode 100644 index 000000000..b01b4bee6 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/CodedResultsSectionTest.java @@ -0,0 +1,325 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.CodedResultsSection; +import org.openhealthtools.mdht.uml.cda.ihe.ExternalReference; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.VitalSignObservation; +import org.openhealthtools.mdht.uml.cda.ihe.operations.CodedResultsSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Coded Results Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.CodedResultsSection#validateCodedResultsSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Coded Results Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.CodedResultsSection#validateCodedResultsSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Coded Results Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.CodedResultsSection#validateCodedResultsSectionProcedureEntry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Coded Results Section Procedure Entry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.CodedResultsSection#validateCodedResultsSectionExternalReference(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Coded Results Section External Reference}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.CodedResultsSection#validateCodedResultsSectionSimpleObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Coded Results Section Simple Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.CodedResultsSection#getProcedureEntries() Get Procedure Entries}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.CodedResultsSection#getExternalReferences() Get External References}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.CodedResultsSection#getSimpleObservations() Get Simple Observations}
  • + *
+ *

+ * + * @generated + */ + +public class CodedResultsSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateCodedResultsSectionTemplateId() { + OperationsTestCase validateCodedResultsSectionTemplateIdTestCase = new OperationsTestCase( + "validateCodedResultsSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_CODED_RESULTS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CodedResultsSection target) { + + } + + @Override + protected void updateToPass(CodedResultsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CodedResultsSectionOperations.validateCodedResultsSectionTemplateId( + (CodedResultsSection) objectToTest, diagnostician, map); + } + + }; + + validateCodedResultsSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCodedResultsSectionCode() { + OperationsTestCase validateCodedResultsSectionCodeTestCase = new OperationsTestCase( + "validateCodedResultsSectionCode", + operationsForOCL.getOCLValue("VALIDATE_CODED_RESULTS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CodedResultsSection target) { + + } + + @Override + protected void updateToPass(CodedResultsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CodedResultsSectionOperations.validateCodedResultsSectionCode( + (CodedResultsSection) objectToTest, diagnostician, map); + } + + }; + + validateCodedResultsSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateCodedResultsSectionProcedureEntry() { + OperationsTestCase validateCodedResultsSectionProcedureEntryTestCase = new OperationsTestCase( + "validateCodedResultsSectionProcedureEntry", + operationsForOCL.getOCLValue("VALIDATE_CODED_RESULTS_SECTION_PROCEDURE_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CodedResultsSection target) { + + } + + @Override + protected void updateToPass(CodedResultsSection target) { + target.init(); + target.addProcedure(IHEFactory.eINSTANCE.createProcedureEntryProcedureActivityProcedure()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CodedResultsSectionOperations.validateCodedResultsSectionProcedureEntry( + (CodedResultsSection) objectToTest, diagnostician, map); + } + + }; + + validateCodedResultsSectionProcedureEntryTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateCodedResultsSectionExternalReference() { + OperationsTestCase validateCodedResultsSectionExternalReferenceTestCase = new OperationsTestCase( + "validateCodedResultsSectionExternalReference", + operationsForOCL.getOCLValue("VALIDATE_CODED_RESULTS_SECTION_EXTERNAL_REFERENCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + @Override + protected void updateToFail(CodedResultsSection target) { + target.init(); + } + + @Override + protected void updateToPass(CodedResultsSection target) { + + ExternalReference er = IHEFactory.eINSTANCE.createExternalReference().init(); + + target.addAct(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CodedResultsSectionOperations.validateCodedResultsSectionExternalReference( + (CodedResultsSection) objectToTest, diagnostician, map); + } + + }; + + validateCodedResultsSectionExternalReferenceTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateCodedResultsSectionSimpleObservation() { + OperationsTestCase validateCodedResultsSectionSimpleObservationTestCase = new OperationsTestCase( + "validateCodedResultsSectionSimpleObservation", + operationsForOCL.getOCLValue("VALIDATE_CODED_RESULTS_SECTION_SIMPLE_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CodedResultsSection target) { + target.init(); + } + + @Override + protected void updateToPass(CodedResultsSection target) { + VitalSignObservation vso = IHEFactory.eINSTANCE.createVitalSignObservation().init(); + target.addObservation(vso); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CodedResultsSectionOperations.validateCodedResultsSectionSimpleObservation( + (CodedResultsSection) objectToTest, diagnostician, map); + } + + }; + + validateCodedResultsSectionSimpleObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProcedureEntries() { + + CodedResultsSection target = objectFactory.create(); + target.getProcedureEntries(); + + } + + /** + * + * @generated + */ + @Test + public void testGetExternalReferences() { + + CodedResultsSection target = objectFactory.create(); + target.getExternalReferences(); + + } + + /** + * + * @generated + */ + @Test + public void testGetSimpleObservations() { + + CodedResultsSection target = objectFactory.create(); + target.getSimpleObservations(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends CodedResultsSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public CodedResultsSection create() { + return IHEFactory.eINSTANCE.createCodedResultsSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends CodedResultsSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // CodedResultsSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/CodedSocialHistorySectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/CodedSocialHistorySectionTest.java new file mode 100644 index 000000000..5f4547745 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/CodedSocialHistorySectionTest.java @@ -0,0 +1,185 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.CodedSocialHistorySection; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.operations.CodedSocialHistorySectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Coded Social History Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.CodedSocialHistorySection#validateCodedSocialHistorySectionSocialHistoryObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Coded Social History Section Social History Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.CodedSocialHistorySection#getIHESocialHistoryObservations() Get IHE Social History Observations}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.CodedSocialHistorySection#validateSocialHistorySectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Social History Section Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class CodedSocialHistorySectionTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateCodedSocialHistorySectionSocialHistoryObservation() { + OperationsTestCase validateCodedSocialHistorySectionSocialHistoryObservationTestCase = new OperationsTestCase( + "validateCodedSocialHistorySectionSocialHistoryObservation", + operationsForOCL.getOCLValue("VALIDATE_CODED_SOCIAL_HISTORY_SECTION_SOCIAL_HISTORY_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CodedSocialHistorySection target) { + target.init(); + + } + + @Override + protected void updateToPass(CodedSocialHistorySection target) { + + target.addObservation(IHEFactory.eINSTANCE.createSocialHistoryObservation().init()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CodedSocialHistorySectionOperations.validateCodedSocialHistorySectionSocialHistoryObservation( + (CodedSocialHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateCodedSocialHistorySectionSocialHistoryObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetIHESocialHistoryObservations() { + + CodedSocialHistorySection target = objectFactory.create(); + target.getIHESocialHistoryObservations(); + + } + + /** + * + * @generated + */ + @Test + public void testValidateSocialHistorySectionTemplateId() { + OperationsTestCase validateSocialHistorySectionTemplateIdTestCase = new OperationsTestCase( + "validateSocialHistorySectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_SOCIAL_HISTORY_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CodedSocialHistorySection target) { + + } + + @Override + protected void updateToPass(CodedSocialHistorySection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CodedSocialHistorySectionOperations.validateSocialHistorySectionTemplateId( + (CodedSocialHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateSocialHistorySectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends CodedSocialHistorySectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public CodedSocialHistorySection create() { + return IHEFactory.eINSTANCE.createCodedSocialHistorySection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends CodedSocialHistorySectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // CodedSocialHistorySectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/CodedSurgeriesSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/CodedSurgeriesSectionTest.java new file mode 100644 index 000000000..9eeb0180a --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/CodedSurgeriesSectionTest.java @@ -0,0 +1,244 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.CodedSurgeriesSection; +import org.openhealthtools.mdht.uml.cda.ihe.ExternalReference; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.ProcedureEntryProcedureActivityProcedure; +import org.openhealthtools.mdht.uml.cda.ihe.operations.CodedSurgeriesSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Coded Surgeries Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.CodedSurgeriesSection#validateCodedSurgeriesSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Coded Surgeries Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.CodedSurgeriesSection#validateCodedSurgeriesSectionExternalReference(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Coded Surgeries Section External Reference}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.CodedSurgeriesSection#validateCodedSurgeriesSectionProcedureEntryProcedureActivityProcedure(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Coded Surgeries Section Procedure Entry Procedure Activity Procedure}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.CodedSurgeriesSection#getExternalReference() Get External Reference}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.CodedSurgeriesSection#getProcedureEntryProcedureActivityProcedures() Get Procedure Entry Procedure Activity Procedures}
  • + *
+ *

+ * + * @generated + */ + +public class CodedSurgeriesSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateCodedSurgeriesSectionTemplateId() { + OperationsTestCase validateCodedSurgeriesSectionTemplateIdTestCase = new OperationsTestCase( + "validateCodedSurgeriesSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_CODED_SURGERIES_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CodedSurgeriesSection target) { + + } + + @Override + protected void updateToPass(CodedSurgeriesSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CodedSurgeriesSectionOperations.validateCodedSurgeriesSectionTemplateId( + (CodedSurgeriesSection) objectToTest, diagnostician, map); + } + + }; + + validateCodedSurgeriesSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateCodedSurgeriesSectionExternalReference() { + OperationsTestCase validateCodedSurgeriesSectionExternalReferenceTestCase = new OperationsTestCase( + "validateCodedSurgeriesSectionExternalReference", + operationsForOCL.getOCLValue("VALIDATE_CODED_SURGERIES_SECTION_EXTERNAL_REFERENCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CodedSurgeriesSection target) { + target.init(); + } + + @Override + protected void updateToPass(CodedSurgeriesSection target) { + + ExternalReference er = IHEFactory.eINSTANCE.createExternalReference().init(); + + target.addAct(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CodedSurgeriesSectionOperations.validateCodedSurgeriesSectionExternalReference( + (CodedSurgeriesSection) objectToTest, diagnostician, map); + } + + }; + + validateCodedSurgeriesSectionExternalReferenceTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateCodedSurgeriesSectionProcedureEntryProcedureActivityProcedure() { + OperationsTestCase validateCodedSurgeriesSectionProcedureEntryProcedureActivityProcedureTestCase = new OperationsTestCase( + "validateCodedSurgeriesSectionProcedureEntryProcedureActivityProcedure", + operationsForOCL.getOCLValue("VALIDATE_CODED_SURGERIES_SECTION_PROCEDURE_ENTRY_PROCEDURE_ACTIVITY_PROCEDURE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CodedSurgeriesSection target) { + target.init(); + } + + @Override + protected void updateToPass(CodedSurgeriesSection target) { + + ProcedureEntryProcedureActivityProcedure pepap = IHEFactory.eINSTANCE.createProcedureEntryProcedureActivityProcedure().init(); + + target.addProcedure(pepap); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CodedSurgeriesSectionOperations.validateCodedSurgeriesSectionProcedureEntryProcedureActivityProcedure( + (CodedSurgeriesSection) objectToTest, diagnostician, map); + } + + }; + + validateCodedSurgeriesSectionProcedureEntryProcedureActivityProcedureTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetExternalReference() { + + CodedSurgeriesSection target = objectFactory.create(); + target.getExternalReference(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProcedureEntryProcedureActivityProcedures() { + + CodedSurgeriesSection target = objectFactory.create(); + target.getProcedureEntryProcedureActivityProcedures(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends CodedSurgeriesSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public CodedSurgeriesSection create() { + return IHEFactory.eINSTANCE.createCodedSurgeriesSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends CodedSurgeriesSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // CodedSurgeriesSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/CodedVitalSignsSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/CodedVitalSignsSectionTest.java new file mode 100644 index 000000000..a856bacb3 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/CodedVitalSignsSectionTest.java @@ -0,0 +1,193 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.CodedVitalSignsSection; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.VitalSignsOrganizer; +import org.openhealthtools.mdht.uml.cda.ihe.operations.CodedVitalSignsSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Coded Vital Signs Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.CodedVitalSignsSection#validateCodedVitalSignsSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Coded Vital Signs Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.CodedVitalSignsSection#validateCodedVitalSignsSectionVitalSignsOrganizer(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Coded Vital Signs Section Vital Signs Organizer}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.CodedVitalSignsSection#getIHEVitalSignsOrganizers() Get IHE Vital Signs Organizers}
  • + *
+ *

+ * + * @generated + */ + +public class CodedVitalSignsSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateCodedVitalSignsSectionTemplateId() { + OperationsTestCase validateCodedVitalSignsSectionTemplateIdTestCase = new OperationsTestCase( + "validateCodedVitalSignsSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_CODED_VITAL_SIGNS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CodedVitalSignsSection target) { + + } + + @Override + protected void updateToPass(CodedVitalSignsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CodedVitalSignsSectionOperations.validateCodedVitalSignsSectionTemplateId( + (CodedVitalSignsSection) objectToTest, diagnostician, map); + } + + }; + + validateCodedVitalSignsSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateCodedVitalSignsSectionVitalSignsOrganizer() { + OperationsTestCase validateCodedVitalSignsSectionVitalSignsOrganizerTestCase = new OperationsTestCase( + "validateCodedVitalSignsSectionVitalSignsOrganizer", + operationsForOCL.getOCLValue("VALIDATE_CODED_VITAL_SIGNS_SECTION_VITAL_SIGNS_ORGANIZER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CodedVitalSignsSection target) { + + } + + @Override + protected void updateToPass(CodedVitalSignsSection target) { + target.init(); + VitalSignsOrganizer vso = IHEFactory.eINSTANCE.createVitalSignsOrganizer().init(); + target.addOrganizer(vso); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CodedVitalSignsSectionOperations.validateCodedVitalSignsSectionVitalSignsOrganizer( + (CodedVitalSignsSection) objectToTest, diagnostician, map); + } + + }; + + validateCodedVitalSignsSectionVitalSignsOrganizerTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetIHEVitalSignsOrganizers() { + + CodedVitalSignsSection target = objectFactory.create(); + target.getIHEVitalSignsOrganizers(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends CodedVitalSignsSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public CodedVitalSignsSection create() { + return IHEFactory.eINSTANCE.createCodedVitalSignsSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends CodedVitalSignsSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // CodedVitalSignsSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/CombinationMedicationTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/CombinationMedicationTest.java new file mode 100644 index 000000000..1bb622bbd --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/CombinationMedicationTest.java @@ -0,0 +1,180 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.SubstanceAdministration; +import org.openhealthtools.mdht.uml.cda.ihe.CombinationMedication; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.operations.CombinationMedicationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Combination Medication' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.CombinationMedication#validateCombinationMedicationSubstanceAdministration(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Combination Medication Substance Administration}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.CombinationMedication#validateCombinationMedicationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Combination Medication Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class CombinationMedicationTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateCombinationMedicationSubstanceAdministration() { + OperationsTestCase validateCombinationMedicationSubstanceAdministrationTestCase = new OperationsTestCase( + "validateCombinationMedicationSubstanceAdministration", + operationsForOCL.getOCLValue("VALIDATE_COMBINATION_MEDICATION_SUBSTANCE_ADMINISTRATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CombinationMedication target) { + target.init(); + + } + + @Override + protected void updateToPass(CombinationMedication target) { + SubstanceAdministration substanceAdministration = IHEFactory.eINSTANCE.createNormalDose().init(); // CDAFactory.eINSTANCE.createSubstanceAdministration(); + target.addSubstanceAdministration(substanceAdministration); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CombinationMedicationOperations.validateCombinationMedicationSubstanceAdministration( + (CombinationMedication) objectToTest, diagnostician, map); + } + + }; + + validateCombinationMedicationSubstanceAdministrationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCombinationMedicationTemplateId() { + OperationsTestCase validateCombinationMedicationTemplateIdTestCase = new OperationsTestCase( + "validateCombinationMedicationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_COMBINATION_MEDICATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CombinationMedication target) { + + } + + @Override + protected void updateToPass(CombinationMedication target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CombinationMedicationOperations.validateCombinationMedicationTemplateId( + (CombinationMedication) objectToTest, diagnostician, map); + } + + }; + + validateCombinationMedicationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends CombinationMedicationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public CombinationMedication create() { + return IHEFactory.eINSTANCE.createCombinationMedication(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends CombinationMedicationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // CombinationMedicationOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/CommentTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/CommentTest.java new file mode 100644 index 000000000..42d28c8b2 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/CommentTest.java @@ -0,0 +1,422 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.AssignedAuthor; +import org.openhealthtools.mdht.uml.cda.Author; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Organization; +import org.openhealthtools.mdht.uml.cda.ihe.Comment; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.operations.CommentOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.AD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.datatypes.ON; +import org.openhealthtools.mdht.uml.hl7.datatypes.TEL; + +/** + * + * A static utility class that provides operations related to 'Comment' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.Comment#validateIHECommentHasTextReference(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Comment Has Text Reference}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.Comment#validateIHECommentEffectiveTimeWhenAuthorPresent(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Comment Effective Time When Author Present}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.Comment#validateIHECommentHasAuthorId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Comment Has Author Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.Comment#validateIHECommentHasAuthorOrganization(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Comment Has Author Organization}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.Comment#validateIHECommentStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Comment Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.Comment#validateIHECommentText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Comment Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.Comment#validateIHECommentAuthor(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Comment Author}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.Comment#validateCommentTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Comment Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class CommentTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateIHECommentHasTextReference() { + OperationsTestCase validateIHECommentHasTextReferenceTestCase = new OperationsTestCase( + "validateIHECommentHasTextReference", + operationsForOCL.getOCLValue("VALIDATE_IHE_COMMENT_HAS_TEXT_REFERENCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Comment target) { + + } + + @Override + protected void updateToPass(Comment target) { + target.init(); + ED text = DatatypesFactory.eINSTANCE.createED(); + TEL ref = DatatypesFactory.eINSTANCE.createTEL(); + text.setReference(ref); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CommentOperations.validateIHECommentHasTextReference((Comment) objectToTest, diagnostician, map); + } + + }; + + validateIHECommentHasTextReferenceTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateIHECommentEffectiveTimeWhenAuthorPresent() { + OperationsTestCase validateIHECommentEffectiveTimeWhenAuthorPresentTestCase = new OperationsTestCase( + "validateIHECommentEffectiveTimeWhenAuthorPresent", + operationsForOCL.getOCLValue("VALIDATE_IHE_COMMENT_EFFECTIVE_TIME_WHEN_AUTHOR_PRESENT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Comment target) { + target.init(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + target.getAuthors().add(author); + } + + @Override + protected void updateToPass(Comment target) { + IVL_TS value = DatatypesFactory.eINSTANCE.createIVL_TS("time"); + target.setEffectiveTime(value); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CommentOperations.validateIHECommentEffectiveTimeWhenAuthorPresent( + (Comment) objectToTest, diagnostician, map); + } + + }; + + validateIHECommentEffectiveTimeWhenAuthorPresentTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateIHECommentHasAuthorId() { + OperationsTestCase validateIHECommentHasAuthorIdTestCase = new OperationsTestCase( + "validateIHECommentHasAuthorId", + operationsForOCL.getOCLValue("VALIDATE_IHE_COMMENT_HAS_AUTHOR_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Comment target) { + target.init(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + AssignedAuthor assignedAuthor = CDAFactory.eINSTANCE.createAssignedAuthor(); + author.setAssignedAuthor(assignedAuthor); + target.getAuthors().add(author); + + } + + @Override + protected void updateToPass(Comment target) { + for (Author author : target.getAuthors()) { + II ii = DatatypesFactory.eINSTANCE.createII("IDHERE"); + author.getAssignedAuthor().getIds().add(ii); + AD ad = DatatypesFactory.eINSTANCE.createAD(); + author.getAssignedAuthor().getAddrs().add(ad); + TEL tel = DatatypesFactory.eINSTANCE.createTEL("telephonehere"); + author.getAssignedAuthor().getTelecoms().add(tel); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CommentOperations.validateIHECommentHasAuthorId((Comment) objectToTest, diagnostician, map); + } + + }; + + validateIHECommentHasAuthorIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateIHECommentHasAuthorOrganization() { + OperationsTestCase validateIHECommentHasAuthorOrganizationTestCase = new OperationsTestCase( + "validateIHECommentHasAuthorOrganization", + operationsForOCL.getOCLValue("VALIDATE_IHE_COMMENT_HAS_AUTHOR_ORGANIZATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Comment target) { + target.init(); + Author author = CDAFactory.eINSTANCE.createAuthor(); + AssignedAuthor assignedAuthor = CDAFactory.eINSTANCE.createAssignedAuthor(); + author.setAssignedAuthor(assignedAuthor); + Organization organization = CDAFactory.eINSTANCE.createOrganization(); + author.getAssignedAuthor().setRepresentedOrganization(organization); + target.getAuthors().add(author); + } + + @Override + protected void updateToPass(Comment target) { + for (Author author : target.getAuthors()) { + ON name = DatatypesFactory.eINSTANCE.createON(); + name.addText("NAMEOFORANIZATION"); + author.getAssignedAuthor().getRepresentedOrganization().getNames().add(name); + + } + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CommentOperations.validateIHECommentHasAuthorOrganization( + (Comment) objectToTest, diagnostician, map); + } + + }; + + validateIHECommentHasAuthorOrganizationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateIHECommentStatusCode() { + OperationsTestCase validateIHECommentStatusCodeTestCase = new OperationsTestCase( + "validateIHECommentStatusCode", + operationsForOCL.getOCLValue("VALIDATE_IHE_COMMENT_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Comment target) { + + } + + @Override + protected void updateToPass(Comment target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CommentOperations.validateIHECommentStatusCode((Comment) objectToTest, diagnostician, map); + } + + }; + + validateIHECommentStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateIHECommentText() { + OperationsTestCase validateIHECommentTextTestCase = new OperationsTestCase( + "validateIHECommentText", + operationsForOCL.getOCLValue("VALIDATE_IHE_COMMENT_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(Comment target) { + target.init(); + } + + @Override + protected void updateToPass(Comment target) { + ED text = DatatypesFactory.eINSTANCE.createED("Comment Text"); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CommentOperations.validateIHECommentText((Comment) objectToTest, diagnostician, map); + } + + }; + + validateIHECommentTextTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateIHECommentAuthor() { + OperationsTestCase validateIHECommentAuthorTestCase = new OperationsTestCase( + "validateIHECommentAuthor", + operationsForOCL.getOCLValue("VALIDATE_IHE_COMMENT_AUTHOR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(Comment target) { + target.init(); + } + + @Override + protected void updateToPass(Comment target) { + target.getAuthors().add(CDAFactory.eINSTANCE.createAuthor()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CommentOperations.validateIHECommentAuthor((Comment) objectToTest, diagnostician, map); + } + + }; + + validateIHECommentAuthorTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateCommentTemplateId() { + OperationsTestCase validateCommentTemplateIdTestCase = new OperationsTestCase( + "validateCommentTemplateId", + operationsForOCL.getOCLValue("VALIDATE_COMMENT_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(Comment target) { + + } + + @Override + protected void updateToPass(Comment target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CommentOperations.validateCommentTemplateId((Comment) objectToTest, diagnostician, map); + } + + }; + + validateCommentTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends CommentOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public Comment create() { + return IHEFactory.eINSTANCE.createComment(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends CommentOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // CommentOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ConcernEntryTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ConcernEntryTest.java new file mode 100644 index 000000000..9cda80d2d --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ConcernEntryTest.java @@ -0,0 +1,347 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.Reference; +import org.openhealthtools.mdht.uml.cda.ihe.AllergyIntolerance; +import org.openhealthtools.mdht.uml.cda.ihe.ConcernEntry; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.operations.ConcernEntryOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipExternalReference; + +/** + * + * A static utility class that provides operations related to 'Concern Entry' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ConcernEntry#validateConcernEntryEffectiveTimeLowHigh(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Concern Entry Effective Time Low High}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ConcernEntry#validateConcernEntryHasRelatedObservations(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Concern Entry Has Related Observations}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ConcernEntry#validateConcernEntryRelatedObservationsTypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Concern Entry Related Observations Type Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ConcernEntry#validateConcernEntryHasRelatedReferencesTypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Concern Entry Has Related References Type Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ConcernEntry#validateConcernEntryTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Concern Entry Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ConcernEntry#validateConcernEntryEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Concern Entry Effective Time}
  • + *
+ *

+ * + * @generated + */ + +public class ConcernEntryTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateConcernEntryEffectiveTimeLowHigh() { + OperationsTestCase validateConcernEntryEffectiveTimeLowHighTestCase = new OperationsTestCase( + "validateConcernEntryEffectiveTimeLowHigh", + operationsForOCL.getOCLValue("VALIDATE_CONCERN_ENTRY_EFFECTIVE_TIME_LOW_HIGH__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConcernEntry target) { + target.init(); + IVL_TS value = DatatypesFactory.eINSTANCE.createIVL_TS("lowvalue", "highvalue"); + target.setEffectiveTime(value); + } + + @Override + protected void updateToPass(ConcernEntry target) { + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConcernEntryOperations.validateConcernEntryEffectiveTimeLowHigh( + (ConcernEntry) objectToTest, diagnostician, map); + } + + }; + + validateConcernEntryEffectiveTimeLowHighTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConcernEntryHasRelatedObservations() { + OperationsTestCase validateConcernEntryHasRelatedObservationsTestCase = new OperationsTestCase( + "validateConcernEntryHasRelatedObservations", + operationsForOCL.getOCLValue("VALIDATE_CONCERN_ENTRY_HAS_RELATED_OBSERVATIONS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConcernEntry target) { + + } + + @Override + protected void updateToPass(ConcernEntry target) { + target.init(); + + AllergyIntolerance ai = IHEFactory.eINSTANCE.createAllergyIntolerance().init(); + + target.addObservation(ai); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConcernEntryOperations.validateConcernEntryHasRelatedObservations( + (ConcernEntry) objectToTest, diagnostician, map); + } + + }; + + validateConcernEntryHasRelatedObservationsTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConcernEntryRelatedObservationsTypeCode() { + OperationsTestCase validateConcernEntryRelatedObservationsTypeCodeTestCase = new OperationsTestCase( + "validateConcernEntryRelatedObservationsTypeCode", + operationsForOCL.getOCLValue("VALIDATE_CONCERN_ENTRY_RELATED_OBSERVATIONS_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConcernEntry target) { + target.init(); + + AllergyIntolerance ai = IHEFactory.eINSTANCE.createAllergyIntolerance().init(); + + target.addObservation(ai); + } + + @Override + protected void updateToPass(ConcernEntry target) { + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConcernEntryOperations.validateConcernEntryRelatedObservationsTypeCode( + (ConcernEntry) objectToTest, diagnostician, map); + } + + }; + + validateConcernEntryRelatedObservationsTypeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateConcernEntryHasRelatedReferencesTypeCode() { + OperationsTestCase validateConcernEntryHasRelatedReferencesTypeCodeTestCase = new OperationsTestCase( + "validateConcernEntryHasRelatedReferencesTypeCode", + operationsForOCL.getOCLValue("VALIDATE_CONCERN_ENTRY_HAS_RELATED_REFERENCES_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConcernEntry target) { + target.init(); + target.getReferences().add(CDAFactory.eINSTANCE.createReference()); + } + + @Override + protected void updateToPass(ConcernEntry target) { + for (Reference ref : target.getReferences()) { + + ref.setTypeCode(x_ActRelationshipExternalReference.REFR); + + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConcernEntryOperations.validateConcernEntryHasRelatedReferencesTypeCode( + (ConcernEntry) objectToTest, diagnostician, map); + } + + }; + + validateConcernEntryHasRelatedReferencesTypeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateConcernEntryTemplateId() { + OperationsTestCase validateConcernEntryTemplateIdTestCase = new OperationsTestCase( + "validateConcernEntryTemplateId", + operationsForOCL.getOCLValue("VALIDATE_CONCERN_ENTRY_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConcernEntry target) { + + } + + @Override + protected void updateToPass(ConcernEntry target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConcernEntryOperations.validateConcernEntryTemplateId( + (ConcernEntry) objectToTest, diagnostician, map); + } + + }; + + validateConcernEntryTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConcernEntryEffectiveTime() { + OperationsTestCase validateConcernEntryEffectiveTimeTestCase = new OperationsTestCase( + "validateConcernEntryEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_CONCERN_ENTRY_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConcernEntry target) { + + } + + @Override + protected void updateToPass(ConcernEntry target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConcernEntryOperations.validateConcernEntryEffectiveTime( + (ConcernEntry) objectToTest, diagnostician, map); + } + + }; + + validateConcernEntryEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ConcernEntryOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ConcernEntry create() { + return IHEFactory.eINSTANCE.createConcernEntry(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ConcernEntryOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ConcernEntryOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ConditionalDoseTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ConditionalDoseTest.java new file mode 100644 index 000000000..6aa2c641c --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ConditionalDoseTest.java @@ -0,0 +1,180 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.SubstanceAdministration; +import org.openhealthtools.mdht.uml.cda.ihe.ConditionalDose; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.operations.ConditionalDoseOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Conditional Dose' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ConditionalDose#validateConditionalDoseConditionalDosingSubstanceAdministration(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Conditional Dose Conditional Dosing Substance Administration}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ConditionalDose#validateConditionalDoseTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Conditional Dose Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class ConditionalDoseTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateConditionalDoseConditionalDosingSubstanceAdministration() { + OperationsTestCase validateConditionalDoseConditionalDosingSubstanceAdministrationTestCase = new OperationsTestCase( + "validateConditionalDoseConditionalDosingSubstanceAdministration", + operationsForOCL.getOCLValue("VALIDATE_CONDITIONAL_DOSE_CONDITIONAL_DOSING_SUBSTANCE_ADMINISTRATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConditionalDose target) { + target.init(); + } + + @Override + protected void updateToPass(ConditionalDose target) { + SubstanceAdministration sa = CDAFactory.eINSTANCE.createSubstanceAdministration(); + target.addSubstanceAdministration(sa); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConditionalDoseOperations.validateConditionalDoseConditionalDosingSubstanceAdministration( + (ConditionalDose) objectToTest, diagnostician, map); + } + + }; + + validateConditionalDoseConditionalDosingSubstanceAdministrationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateConditionalDoseTemplateId() { + OperationsTestCase validateConditionalDoseTemplateIdTestCase = new OperationsTestCase( + "validateConditionalDoseTemplateId", + operationsForOCL.getOCLValue("VALIDATE_CONDITIONAL_DOSE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConditionalDose target) { + + } + + @Override + protected void updateToPass(ConditionalDose target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConditionalDoseOperations.validateConditionalDoseTemplateId( + (ConditionalDose) objectToTest, diagnostician, map); + } + + }; + + validateConditionalDoseTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ConditionalDoseOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public ConditionalDose create() { + return IHEFactory.eINSTANCE.createConditionalDose(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ConditionalDoseOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ConditionalDoseOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/CoverageEntryTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/CoverageEntryTest.java new file mode 100644 index 000000000..12513c692 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/CoverageEntryTest.java @@ -0,0 +1,232 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.ccd.CoverageActivity; +import org.openhealthtools.mdht.uml.cda.ccd.operations.CoverageActivityOperations; +import org.openhealthtools.mdht.uml.cda.ihe.CoverageEntry; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.operations.CoverageEntryOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * + * A static utility class that provides operations related to 'Coverage Entry' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.CoverageEntry#validateCoverageEntryTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Coverage Entry Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.CoverageEntry#validateCoverageEntryPayerEntry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Coverage Entry Payer Entry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.CoverageEntry#getPayerEntries() Get Payer Entries}
  • + *
+ *

+ * + * @generated + */ + +public class CoverageEntryTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateCoverageEntryTemplateId() { + OperationsTestCase validateCoverageEntryTemplateIdTestCase = new OperationsTestCase( + "validateCoverageEntryTemplateId", + operationsForOCL.getOCLValue("VALIDATE_COVERAGE_ENTRY_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CoverageEntry target) { + + } + + @Override + protected void updateToPass(CoverageEntry target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CoverageEntryOperations.validateCoverageEntryTemplateId( + (CoverageEntry) objectToTest, diagnostician, map); + } + + }; + + validateCoverageEntryTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateCoverageEntryPayerEntry() { + OperationsTestCase validateCoverageEntryPayerEntryTestCase = new OperationsTestCase( + "validateCoverageEntryPayerEntry", + operationsForOCL.getOCLValue("VALIDATE_COVERAGE_ENTRY_PAYER_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CoverageEntry target) { + + } + + @Override + protected void updateToPass(CoverageEntry target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + er.setAct(IHEFactory.eINSTANCE.createPayerEntry()); + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CoverageEntryOperations.validateCoverageEntryPayerEntry( + (CoverageEntry) objectToTest, diagnostician, map); + } + + }; + + validateCoverageEntryPayerEntryTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateCoverageActivityMoodCode() { + OperationsTestCase validateCoverageActivityMoodCodeTestCase = new OperationsTestCase( + "validateCoverageActivityMoodCode", + operationsForOCL.getOCLValue("VALIDATE_COVERAGE_ACTIVITY_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(CoverageActivity target) { + + } + + @Override + protected void updateToPass(CoverageActivity target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return CoverageActivityOperations.validateCoverageActivityMoodCode( + (CoverageActivity) objectToTest, diagnostician, map); + } + + }; + + validateCoverageActivityMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetPayerEntries() { + + CoverageEntry target = objectFactory.create(); + target.getPayerEntries(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends CoverageEntryOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public CoverageEntry create() { + return IHEFactory.eINSTANCE.createCoverageEntry(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends CoverageEntryOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // CoverageEntryOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/DischargeDiagnosisSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/DischargeDiagnosisSectionTest.java new file mode 100644 index 000000000..360c955f4 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/DischargeDiagnosisSectionTest.java @@ -0,0 +1,225 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.DischargeDiagnosisSection; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.operations.DischargeDiagnosisSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Discharge Diagnosis Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.DischargeDiagnosisSection#validateDischargeDiagnosisSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Diagnosis Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.DischargeDiagnosisSection#validateDischargeDiagnosisSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Diagnosis Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.DischargeDiagnosisSection#validateDischargeDiagnosisSectionProblemConcernEntry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Diagnosis Section Problem Concern Entry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.DischargeDiagnosisSection#getProblemConcernEntry() Get Problem Concern Entry}
  • + *
+ *

+ * + * @generated + */ + +public class DischargeDiagnosisSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateDischargeDiagnosisSectionTemplateId() { + OperationsTestCase validateDischargeDiagnosisSectionTemplateIdTestCase = new OperationsTestCase( + "validateDischargeDiagnosisSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_DIAGNOSIS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeDiagnosisSection target) { + + } + + @Override + protected void updateToPass(DischargeDiagnosisSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeDiagnosisSectionOperations.validateDischargeDiagnosisSectionTemplateId( + (DischargeDiagnosisSection) objectToTest, diagnostician, map); + } + + }; + + validateDischargeDiagnosisSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeDiagnosisSectionCode() { + OperationsTestCase validateDischargeDiagnosisSectionCodeTestCase = new OperationsTestCase( + "validateDischargeDiagnosisSectionCode", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_DIAGNOSIS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeDiagnosisSection target) { + + } + + @Override + protected void updateToPass(DischargeDiagnosisSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeDiagnosisSectionOperations.validateDischargeDiagnosisSectionCode( + (DischargeDiagnosisSection) objectToTest, diagnostician, map); + } + + }; + + validateDischargeDiagnosisSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateDischargeDiagnosisSectionProblemConcernEntry() { + OperationsTestCase validateDischargeDiagnosisSectionProblemConcernEntryTestCase = new OperationsTestCase( + "validateDischargeDiagnosisSectionProblemConcernEntry", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_DIAGNOSIS_SECTION_PROBLEM_CONCERN_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeDiagnosisSection target) { + + } + + @Override + protected void updateToPass(DischargeDiagnosisSection target) { + target.init(); + target.addAct(IHEFactory.eINSTANCE.createProblemConcernEntry()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeDiagnosisSectionOperations.validateDischargeDiagnosisSectionProblemConcernEntry( + (DischargeDiagnosisSection) objectToTest, diagnostician, map); + } + + }; + + validateDischargeDiagnosisSectionProblemConcernEntryTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemConcernEntry() { + + DischargeDiagnosisSection target = objectFactory.create(); + target.getProblemConcernEntry(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends DischargeDiagnosisSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public DischargeDiagnosisSection create() { + return IHEFactory.eINSTANCE.createDischargeDiagnosisSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends DischargeDiagnosisSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // DischargeDiagnosisSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/DischargeDietTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/DischargeDietTest.java new file mode 100644 index 000000000..2109af296 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/DischargeDietTest.java @@ -0,0 +1,174 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.DischargeDiet; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.operations.DischargeDietOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Discharge Diet' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.DischargeDiet#validateDischargeDietTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Diet Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.DischargeDiet#validateDischargeDietCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Diet Code}
  • + *
+ *

+ * + * @generated + */ + +public class DischargeDietTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateDischargeDietTemplateId() { + OperationsTestCase validateDischargeDietTemplateIdTestCase = new OperationsTestCase( + "validateDischargeDietTemplateId", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_DIET_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeDiet target) { + + } + + @Override + protected void updateToPass(DischargeDiet target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeDietOperations.validateDischargeDietTemplateId( + (DischargeDiet) objectToTest, diagnostician, map); + } + + }; + + validateDischargeDietTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeDietCode() { + OperationsTestCase validateDischargeDietCodeTestCase = new OperationsTestCase( + "validateDischargeDietCode", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_DIET_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(DischargeDiet target) { + + } + + @Override + protected void updateToPass(DischargeDiet target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeDietOperations.validateDischargeDietCode( + (DischargeDiet) objectToTest, diagnostician, map); + } + + }; + + validateDischargeDietCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends DischargeDietOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public DischargeDiet create() { + return IHEFactory.eINSTANCE.createDischargeDiet(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends DischargeDietOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // DischargeDietOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/DischargeSummaryTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/DischargeSummaryTest.java new file mode 100644 index 000000000..6b08644ba --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/DischargeSummaryTest.java @@ -0,0 +1,233 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.ActiveProblemsSection; +import org.openhealthtools.mdht.uml.cda.ihe.DischargeSummary; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.operations.DischargeSummaryOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Discharge Summary' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.DischargeSummary#validateDischargeSummaryTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.DischargeSummary#validateDischargeSummaryCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.DischargeSummary#validateDischargeSummaryActiveProblemsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Active Problems Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.DischargeSummary#getActiveProblemsSection() Get Active Problems Section}
  • + *
+ *

+ * + * @generated + */ + +public class DischargeSummaryTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryTemplateId() { + OperationsTestCase validateDischargeSummaryTemplateIdTestCase = new OperationsTestCase( + "validateDischargeSummaryTemplateId", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryTemplateId( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryCode() { + OperationsTestCase validateDischargeSummaryCodeTestCase = new OperationsTestCase( + "validateDischargeSummaryCode", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryCode( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateDischargeSummaryActiveProblemsSection() { + OperationsTestCase validateDischargeSummaryActiveProblemsSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryActiveProblemsSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_ACTIVE_PROBLEMS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* ActiveProblemsSection */ + ActiveProblemsSection section = + + IHEFactory.eINSTANCE.createActiveProblemsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryActiveProblemsSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryActiveProblemsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetActiveProblemsSection() { + + DischargeSummary target = objectFactory.create(); + target.getActiveProblemsSection(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends DischargeSummaryOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public DischargeSummary create() { + return IHEFactory.eINSTANCE.createDischargeSummary(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends DischargeSummaryOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // DischargeSummaryOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/EarsNoseMouthThroatSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/EarsNoseMouthThroatSectionTest.java new file mode 100644 index 000000000..5b9eb0e84 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/EarsNoseMouthThroatSectionTest.java @@ -0,0 +1,223 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.EarsNoseMouthThroatSection; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.operations.EarsNoseMouthThroatSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Ears Nose Mouth Throat Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.EarsNoseMouthThroatSection#validateEarsNoseMouthThroatSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Ears Nose Mouth Throat Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.EarsNoseMouthThroatSection#validateEarsNoseMouthThroatSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Ears Nose Mouth Throat Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.EarsNoseMouthThroatSection#validateEarsNoseMouthThroatSectionProblemEntry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Ears Nose Mouth Throat Section Problem Entry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.EarsNoseMouthThroatSection#getProblemEntry() Get Problem Entry}
  • + *
+ *

+ * + * @generated + */ + +public class EarsNoseMouthThroatSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateEarsNoseMouthThroatSectionTemplateId() { + OperationsTestCase validateEarsNoseMouthThroatSectionTemplateIdTestCase = new OperationsTestCase( + "validateEarsNoseMouthThroatSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_EARS_NOSE_MOUTH_THROAT_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EarsNoseMouthThroatSection target) { + + } + + @Override + protected void updateToPass(EarsNoseMouthThroatSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EarsNoseMouthThroatSectionOperations.validateEarsNoseMouthThroatSectionTemplateId( + (EarsNoseMouthThroatSection) objectToTest, diagnostician, map); + } + + }; + + validateEarsNoseMouthThroatSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateEarsNoseMouthThroatSectionCode() { + OperationsTestCase validateEarsNoseMouthThroatSectionCodeTestCase = new OperationsTestCase( + "validateEarsNoseMouthThroatSectionCode", + operationsForOCL.getOCLValue("VALIDATE_EARS_NOSE_MOUTH_THROAT_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EarsNoseMouthThroatSection target) { + + } + + @Override + protected void updateToPass(EarsNoseMouthThroatSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EarsNoseMouthThroatSectionOperations.validateEarsNoseMouthThroatSectionCode( + (EarsNoseMouthThroatSection) objectToTest, diagnostician, map); + } + + }; + + validateEarsNoseMouthThroatSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateEarsNoseMouthThroatSectionProblemEntry() { + OperationsTestCase validateEarsNoseMouthThroatSectionProblemEntryTestCase = new OperationsTestCase( + "validateEarsNoseMouthThroatSectionProblemEntry", + operationsForOCL.getOCLValue("VALIDATE_EARS_NOSE_MOUTH_THROAT_SECTION_PROBLEM_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EarsNoseMouthThroatSection target) { + target.init(); + } + + @Override + protected void updateToPass(EarsNoseMouthThroatSection target) { + + target.addObservation(IHEFactory.eINSTANCE.createProblemEntry().init()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EarsNoseMouthThroatSectionOperations.validateEarsNoseMouthThroatSectionProblemEntry( + (EarsNoseMouthThroatSection) objectToTest, diagnostician, map); + } + + }; + + validateEarsNoseMouthThroatSectionProblemEntryTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemEntry() { + + EarsNoseMouthThroatSection target = objectFactory.create(); + target.getProblemEntry(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends EarsNoseMouthThroatSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public EarsNoseMouthThroatSection create() { + return IHEFactory.eINSTANCE.createEarsNoseMouthThroatSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends EarsNoseMouthThroatSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // EarsNoseMouthThroatSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/EarsSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/EarsSectionTest.java new file mode 100644 index 000000000..07a211ec5 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/EarsSectionTest.java @@ -0,0 +1,221 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.EarsSection; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.operations.EarsSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Ears Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.EarsSection#validateEarsSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Ears Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.EarsSection#validateEarsSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Ears Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.EarsSection#validateEarsSectionProblemEntry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Ears Section Problem Entry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.EarsSection#getProblemEntry() Get Problem Entry}
  • + *
+ *

+ * + * @generated + */ + +public class EarsSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateEarsSectionTemplateId() { + OperationsTestCase validateEarsSectionTemplateIdTestCase = new OperationsTestCase( + "validateEarsSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_EARS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EarsSection target) { + + } + + @Override + protected void updateToPass(EarsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EarsSectionOperations.validateEarsSectionTemplateId( + (EarsSection) objectToTest, diagnostician, map); + } + + }; + + validateEarsSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateEarsSectionCode() { + OperationsTestCase validateEarsSectionCodeTestCase = new OperationsTestCase( + "validateEarsSectionCode", + operationsForOCL.getOCLValue("VALIDATE_EARS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(EarsSection target) { + + } + + @Override + protected void updateToPass(EarsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EarsSectionOperations.validateEarsSectionCode((EarsSection) objectToTest, diagnostician, map); + } + + }; + + validateEarsSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateEarsSectionProblemEntry() { + OperationsTestCase validateEarsSectionProblemEntryTestCase = new OperationsTestCase( + "validateEarsSectionProblemEntry", + operationsForOCL.getOCLValue("VALIDATE_EARS_SECTION_PROBLEM_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EarsSection target) { + target.init(); + } + + @Override + protected void updateToPass(EarsSection target) { + + target.addObservation(IHEFactory.eINSTANCE.createProblemEntry().init()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EarsSectionOperations.validateEarsSectionProblemEntry( + (EarsSection) objectToTest, diagnostician, map); + } + + }; + + validateEarsSectionProblemEntryTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemEntry() { + + EarsSection target = objectFactory.create(); + target.getProblemEntry(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends EarsSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public EarsSection create() { + return IHEFactory.eINSTANCE.createEarsSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends EarsSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // EarsSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/EncounterActivityTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/EncounterActivityTest.java new file mode 100644 index 000000000..a50410166 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/EncounterActivityTest.java @@ -0,0 +1,142 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.EncounterActivity; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.operations.EncounterActivityOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Encounter Activity' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.EncounterActivity#validateEncountersActivityTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounters Activity Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class EncounterActivityTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateEncountersActivityTemplateId() { + OperationsTestCase validateEncountersActivityTemplateIdTestCase = new OperationsTestCase( + "validateEncountersActivityTemplateId", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTERS_ACTIVITY_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncounterActivity target) { + + } + + @Override + protected void updateToPass(EncounterActivity target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncounterActivityOperations.validateEncountersActivityTemplateId( + (EncounterActivity) objectToTest, diagnostician, map); + } + + }; + + validateEncountersActivityTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends EncounterActivityOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public EncounterActivity create() { + return IHEFactory.eINSTANCE.createEncounterActivity(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends EncounterActivityOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // EncounterActivityOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/EncounterEntryTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/EncounterEntryTest.java new file mode 100644 index 000000000..49007bb76 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/EncounterEntryTest.java @@ -0,0 +1,321 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.EncounterEntry; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.operations.EncounterEntryOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; + +/** + * + * A static utility class that provides operations related to 'Encounter Entry' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.EncounterEntry#validateEncounterEntryTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounter Entry Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.EncounterEntry#validateEncounterEntryClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounter Entry Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.EncounterEntry#validateEncounterEntryCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounter Entry Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.EncounterEntry#validateEncounterEntryCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounter Entry Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.EncounterEntry#validateEncounterEntryId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounter Entry Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.EncounterEntry#validateEncounterEntryText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounter Entry Text}
  • + *
+ *

+ * + * @generated + */ + +public class EncounterEntryTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateEncounterEntryTemplateId() { + OperationsTestCase validateEncounterEntryTemplateIdTestCase = new OperationsTestCase( + "validateEncounterEntryTemplateId", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTER_ENTRY_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncounterEntry target) { + + } + + @Override + protected void updateToPass(EncounterEntry target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncounterEntryOperations.validateEncounterEntryTemplateId( + (EncounterEntry) objectToTest, diagnostician, map); + } + + }; + + validateEncounterEntryTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateEncounterEntryClassCode() { + OperationsTestCase validateEncounterEntryClassCodeTestCase = new OperationsTestCase( + "validateEncounterEntryClassCode", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTER_ENTRY_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncounterEntry target) { + + } + + @Override + protected void updateToPass(EncounterEntry target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncounterEntryOperations.validateEncounterEntryClassCode( + (EncounterEntry) objectToTest, diagnostician, map); + } + + }; + + validateEncounterEntryClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateEncounterEntryCode() { + OperationsTestCase validateEncounterEntryCodeTestCase = new OperationsTestCase( + "validateEncounterEntryCode", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTER_ENTRY_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncounterEntry target) { + + } + + @Override + protected void updateToPass(EncounterEntry target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncounterEntryOperations.validateEncounterEntryCode( + (EncounterEntry) objectToTest, diagnostician, map); + } + + }; + + validateEncounterEntryCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateEncounterEntryCodeP() { + OperationsTestCase validateEncounterEntryCodePTestCase = new OperationsTestCase( + "validateEncounterEntryCodeP", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTER_ENTRY_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncounterEntry target) { + + } + + @Override + protected void updateToPass(EncounterEntry target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncounterEntryOperations.validateEncounterEntryCodeP( + (EncounterEntry) objectToTest, diagnostician, map); + } + + }; + + validateEncounterEntryCodePTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateEncounterEntryId() { + OperationsTestCase validateEncounterEntryIdTestCase = new OperationsTestCase( + "validateEncounterEntryId", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTER_ENTRY_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(EncounterEntry target) { + target.init(); + } + + @Override + protected void updateToPass(EncounterEntry target) { + II ii = DatatypesFactory.eINSTANCE.createII("root"); + target.getIds().add(ii); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncounterEntryOperations.validateEncounterEntryId( + (EncounterEntry) objectToTest, diagnostician, map); + } + + }; + + validateEncounterEntryIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateEncounterEntryText() { + OperationsTestCase validateEncounterEntryTextTestCase = new OperationsTestCase( + "validateEncounterEntryText", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTER_ENTRY_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncounterEntry target) { + target.init(); + } + + @Override + protected void updateToPass(EncounterEntry target) { + + ED ed = DatatypesFactory.eINSTANCE.createED("text"); + target.setText(ed); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncounterEntryOperations.validateEncounterEntryText( + (EncounterEntry) objectToTest, diagnostician, map); + } + + }; + + validateEncounterEntryTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends EncounterEntryOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated NOT + */ + private static class ObjectFactory implements TestObjectFactory { + + public EncounterEntry create() { + return IHEFactory.eINSTANCE.createEncounterPlanOfCare(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends EncounterEntryOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // EncounterEntryOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/EncounterHistorySectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/EncounterHistorySectionTest.java new file mode 100644 index 000000000..430afe120 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/EncounterHistorySectionTest.java @@ -0,0 +1,193 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.EncounterEntry; +import org.openhealthtools.mdht.uml.cda.ihe.EncounterHistorySection; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.operations.EncounterHistorySectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Encounter History Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.EncounterHistorySection#validateEncounterHistorySectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounter History Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.EncounterHistorySection#validateEncounterHistorySectionEncounterEntry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounter History Section Encounter Entry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.EncounterHistorySection#getEncounterEntries() Get Encounter Entries}
  • + *
+ *

+ * + * @generated + */ + +public class EncounterHistorySectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateEncounterHistorySectionTemplateId() { + OperationsTestCase validateEncounterHistorySectionTemplateIdTestCase = new OperationsTestCase( + "validateEncounterHistorySectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTER_HISTORY_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncounterHistorySection target) { + + } + + @Override + protected void updateToPass(EncounterHistorySection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncounterHistorySectionOperations.validateEncounterHistorySectionTemplateId( + (EncounterHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateEncounterHistorySectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateEncounterHistorySectionEncounterEntry() { + OperationsTestCase validateEncounterHistorySectionEncounterEntryTestCase = new OperationsTestCase( + "validateEncounterHistorySectionEncounterEntry", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTER_HISTORY_SECTION_ENCOUNTER_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncounterHistorySection target) { + target.init(); + + } + + @Override + protected void updateToPass(EncounterHistorySection target) { + EncounterEntry ee = IHEFactory.eINSTANCE.createEncounterActivity().init(); + + target.addEncounter(ee); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncounterHistorySectionOperations.validateEncounterHistorySectionEncounterEntry( + (EncounterHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateEncounterHistorySectionEncounterEntryTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetEncounterEntries() { + + EncounterHistorySection target = objectFactory.create(); + target.getEncounterEntries(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends EncounterHistorySectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public EncounterHistorySection create() { + return IHEFactory.eINSTANCE.createEncounterHistorySection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends EncounterHistorySectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // EncounterHistorySectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/EncounterPlanOfCareTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/EncounterPlanOfCareTest.java new file mode 100644 index 000000000..dfc567554 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/EncounterPlanOfCareTest.java @@ -0,0 +1,207 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.EncounterPlanOfCare; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.operations.EncounterPlanOfCareOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.vocab.x_DocumentEncounterMood; + +/** + * + * A static utility class that provides operations related to 'Encounter Plan Of Care' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.EncounterPlanOfCare#validatePlanOfCareActivityEncounterTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Plan Of Care Activity Encounter Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.EncounterPlanOfCare#validateEncounterPlanOfCareMoodCodeValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounter Plan Of Care Mood Code Value}
  • + *
+ *

+ * + * @generated + */ + +public class EncounterPlanOfCareTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidatePlanOfCareActivityEncounterTemplateId() { + OperationsTestCase validatePlanOfCareActivityEncounterTemplateIdTestCase = new OperationsTestCase( + "validatePlanOfCareActivityEncounterTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_ACTIVITY_ENCOUNTER_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncounterPlanOfCare target) { + + } + + @Override + protected void updateToPass(EncounterPlanOfCare target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncounterPlanOfCareOperations.validatePlanOfCareActivityEncounterTemplateId( + (EncounterPlanOfCare) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareActivityEncounterTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateEncounterPlanOfCareMoodCodeValue() { + OperationsTestCase validateEncounterPlanOfCareMoodCodeValueTestCase = new OperationsTestCase( + "validateEncounterPlanOfCareMoodCodeValue", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTER_PLAN_OF_CARE_MOOD_CODE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncounterPlanOfCare target) { + + } + + @Override + protected void updateToPass(EncounterPlanOfCare target) { + + } + + /* + * (non-Javadoc) + * + * @see org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest.OperationsTestCase#addPassTests() + */ + @Override + public void addPassTests() { + + addPassTest(new PassTest() { + + @Override + public void updateToPass(EncounterPlanOfCare target) { + target.init(); + target.setMoodCode(x_DocumentEncounterMood.ARQ); + } + + }); + + addPassTest(new PassTest() { + + @Override + public void updateToPass(EncounterPlanOfCare target) { + target.init(); + target.setMoodCode(x_DocumentEncounterMood.PRMS); + } + + }); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncounterPlanOfCareOperations.validateEncounterPlanOfCareMoodCodeValue( + (EncounterPlanOfCare) objectToTest, diagnostician, map); + } + + }; + + validateEncounterPlanOfCareMoodCodeValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends EncounterPlanOfCareOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public EncounterPlanOfCare create() { + return IHEFactory.eINSTANCE.createEncounterPlanOfCare(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends EncounterPlanOfCareOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // EncounterPlanOfCareOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/EndocrineSystemSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/EndocrineSystemSectionTest.java new file mode 100644 index 000000000..e05f0ac0b --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/EndocrineSystemSectionTest.java @@ -0,0 +1,223 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.EndocrineSystemSection; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.operations.EndocrineSystemSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Endocrine System Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.EndocrineSystemSection#validateEndocrineSystemSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Endocrine System Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.EndocrineSystemSection#validateEndocrineSystemSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Endocrine System Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.EndocrineSystemSection#validateEndocrineSystemSectionProblemEntry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Endocrine System Section Problem Entry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.EndocrineSystemSection#getProblemEntry() Get Problem Entry}
  • + *
+ *

+ * + * @generated + */ + +public class EndocrineSystemSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateEndocrineSystemSectionTemplateId() { + OperationsTestCase validateEndocrineSystemSectionTemplateIdTestCase = new OperationsTestCase( + "validateEndocrineSystemSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_ENDOCRINE_SYSTEM_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EndocrineSystemSection target) { + + } + + @Override + protected void updateToPass(EndocrineSystemSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EndocrineSystemSectionOperations.validateEndocrineSystemSectionTemplateId( + (EndocrineSystemSection) objectToTest, diagnostician, map); + } + + }; + + validateEndocrineSystemSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateEndocrineSystemSectionCode() { + OperationsTestCase validateEndocrineSystemSectionCodeTestCase = new OperationsTestCase( + "validateEndocrineSystemSectionCode", + operationsForOCL.getOCLValue("VALIDATE_ENDOCRINE_SYSTEM_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EndocrineSystemSection target) { + + } + + @Override + protected void updateToPass(EndocrineSystemSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EndocrineSystemSectionOperations.validateEndocrineSystemSectionCode( + (EndocrineSystemSection) objectToTest, diagnostician, map); + } + + }; + + validateEndocrineSystemSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateEndocrineSystemSectionProblemEntry() { + OperationsTestCase validateEndocrineSystemSectionProblemEntryTestCase = new OperationsTestCase( + "validateEndocrineSystemSectionProblemEntry", + operationsForOCL.getOCLValue("VALIDATE_ENDOCRINE_SYSTEM_SECTION_PROBLEM_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EndocrineSystemSection target) { + target.init(); + } + + @Override + protected void updateToPass(EndocrineSystemSection target) { + + target.addObservation(IHEFactory.eINSTANCE.createProblemEntry().init()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EndocrineSystemSectionOperations.validateEndocrineSystemSectionProblemEntry( + (EndocrineSystemSection) objectToTest, diagnostician, map); + } + + }; + + validateEndocrineSystemSectionProblemEntryTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemEntry() { + + EndocrineSystemSection target = objectFactory.create(); + target.getProblemEntry(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends EndocrineSystemSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public EndocrineSystemSection create() { + return IHEFactory.eINSTANCE.createEndocrineSystemSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends EndocrineSystemSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // EndocrineSystemSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ExternalReferenceTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ExternalReferenceTest.java new file mode 100644 index 000000000..feae9c918 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ExternalReferenceTest.java @@ -0,0 +1,524 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.ExternalDocument; +import org.openhealthtools.mdht.uml.cda.Reference; +import org.openhealthtools.mdht.uml.cda.ihe.ExternalReference; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.operations.ExternalReferenceOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.vocab.ActClassDocument; +import org.openhealthtools.mdht.uml.hl7.vocab.ActMood; +import org.openhealthtools.mdht.uml.hl7.vocab.NullFlavor; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipExternalReference; + +/** + * + * A static utility class that provides operations related to 'External Reference' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ExternalReference#validateExternalReferenceHasNoCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate External Reference Has No Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ExternalReference#validateExternalReferenceHasReference(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate External Reference Has Reference}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ExternalReference#validateExternalReferenceHasReferenceExternalDocument(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate External Reference Has Reference External Document}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ExternalReference#validateExternalReferenceHasReferenceExternalDocumentID(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate External Reference Has Reference External Document ID}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ExternalReference#validateExternalReferenceHasReferenceExternalDocumentText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate External Reference Has Reference External Document Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ExternalReference#validateExternalReferenceTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate External Reference Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ExternalReference#validateExternalReferenceClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate External Reference Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ExternalReference#validateExternalReferenceMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate External Reference Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ExternalReference#validateExternalReferenceId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate External Reference Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ExternalReference#validateExternalReferenceText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate External Reference Text}
  • + *
+ *

+ * + * @generated + */ + +public class ExternalReferenceTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateExternalReferenceHasNoCode() { + OperationsTestCase validateExternalReferenceHasNoCodeTestCase = new OperationsTestCase( + "validateExternalReferenceHasNoCode", + operationsForOCL.getOCLValue("VALIDATE_EXTERNAL_REFERENCE_HAS_NO_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ExternalReference target) { + target.init(); + CD value = DatatypesFactory.eINSTANCE.createCD(); + target.setCode(value); + } + + @Override + protected void updateToPass(ExternalReference target) { + CD value = DatatypesFactory.eINSTANCE.createCD(); + value.setNullFlavor(NullFlavor.NA); + target.setCode(value); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ExternalReferenceOperations.validateExternalReferenceHasNoCode( + (ExternalReference) objectToTest, diagnostician, map); + } + + }; + + validateExternalReferenceHasNoCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateExternalReferenceHasReference() { + OperationsTestCase validateExternalReferenceHasReferenceTestCase = new OperationsTestCase( + "validateExternalReferenceHasReference", + operationsForOCL.getOCLValue("VALIDATE_EXTERNAL_REFERENCE_HAS_REFERENCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ExternalReference target) { + target.init(); + + Reference ref = CDAFactory.eINSTANCE.createReference(); + target.getReferences().add(ref); + + ref = CDAFactory.eINSTANCE.createReference(); + target.getReferences().add(ref); + + } + + @Override + protected void updateToPass(ExternalReference target) { + + int a = 0; + for (Reference ref : target.getReferences()) { + if (a++ % 2 == 0) { + ref.setTypeCode(x_ActRelationshipExternalReference.SPRT); + } else { + ref.setTypeCode(x_ActRelationshipExternalReference.REFR); + } + + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ExternalReferenceOperations.validateExternalReferenceHasReference( + (ExternalReference) objectToTest, diagnostician, map); + } + + }; + + validateExternalReferenceHasReferenceTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateExternalReferenceHasReferenceExternalDocument() { + OperationsTestCase validateExternalReferenceHasReferenceExternalDocumentTestCase = new OperationsTestCase( + "validateExternalReferenceHasReferenceExternalDocument", + operationsForOCL.getOCLValue("VALIDATE_EXTERNAL_REFERENCE_HAS_REFERENCE_EXTERNAL_DOCUMENT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ExternalReference target) { + target.init(); + + Reference ref = CDAFactory.eINSTANCE.createReference(); + ExternalDocument extdoc = CDAFactory.eINSTANCE.createExternalDocument(); + extdoc.setClassCode(ActClassDocument.CDALVLONE); + ref.setExternalDocument(extdoc); + target.getReferences().add(ref); + + } + + @Override + protected void updateToPass(ExternalReference target) { + + for (Reference ref : target.getReferences()) { + ref.setTypeCode(x_ActRelationshipExternalReference.SPRT); + ref.getExternalDocument().setClassCode(ActClassDocument.DOC); + ref.getExternalDocument().setMoodCode(ActMood.EVN); + + } + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ExternalReferenceOperations.validateExternalReferenceHasReferenceExternalDocument( + (ExternalReference) objectToTest, diagnostician, map); + } + + }; + + validateExternalReferenceHasReferenceExternalDocumentTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateExternalReferenceHasReferenceExternalDocumentID() { + OperationsTestCase validateExternalReferenceHasReferenceExternalDocumentIDTestCase = new OperationsTestCase( + "validateExternalReferenceHasReferenceExternalDocumentID", + operationsForOCL.getOCLValue("VALIDATE_EXTERNAL_REFERENCE_HAS_REFERENCE_EXTERNAL_DOCUMENT_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ExternalReference target) { + target.init(); + Reference ref = CDAFactory.eINSTANCE.createReference(); + ref.setTypeCode(x_ActRelationshipExternalReference.SPRT); + ExternalDocument extdoc = CDAFactory.eINSTANCE.createExternalDocument(); + extdoc.setClassCode(ActClassDocument.DOC); + ED text = DatatypesFactory.eINSTANCE.createED("string"); + extdoc.setText(text); + ref.setExternalDocument(extdoc); + target.getReferences().add(ref); + + } + + @Override + protected void updateToPass(ExternalReference target) { + for (Reference ref : target.getReferences()) { + + II ii = DatatypesFactory.eINSTANCE.createII(); + ref.getExternalDocument().getIds().add(ii); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ExternalReferenceOperations.validateExternalReferenceHasReferenceExternalDocumentID( + (ExternalReference) objectToTest, diagnostician, map); + } + + }; + + validateExternalReferenceHasReferenceExternalDocumentIDTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateExternalReferenceHasReferenceExternalDocumentText() { + OperationsTestCase validateExternalReferenceHasReferenceExternalDocumentTextTestCase = new OperationsTestCase( + "validateExternalReferenceHasReferenceExternalDocumentText", + operationsForOCL.getOCLValue("VALIDATE_EXTERNAL_REFERENCE_HAS_REFERENCE_EXTERNAL_DOCUMENT_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ExternalReference target) { + target.init(); + Reference ref = CDAFactory.eINSTANCE.createReference(); + ref.setTypeCode(x_ActRelationshipExternalReference.SPRT); + ExternalDocument extdoc = CDAFactory.eINSTANCE.createExternalDocument(); + extdoc.setClassCode(ActClassDocument.DOC); + DatatypesFactory.eINSTANCE.createED("string"); + // extdoc.setText(text); + ref.setExternalDocument(extdoc); + target.getReferences().add(ref); + } + + @Override + protected void updateToPass(ExternalReference target) { + for (Reference ref : target.getReferences()) { + + ED text = DatatypesFactory.eINSTANCE.createED("string"); + ref.getExternalDocument().setText(text); + } + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ExternalReferenceOperations.validateExternalReferenceHasReferenceExternalDocumentText( + (ExternalReference) objectToTest, diagnostician, map); + } + + }; + + validateExternalReferenceHasReferenceExternalDocumentTextTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateExternalReferenceTemplateId() { + OperationsTestCase validateExternalReferenceTemplateIdTestCase = new OperationsTestCase( + "validateExternalReferenceTemplateId", + operationsForOCL.getOCLValue("VALIDATE_EXTERNAL_REFERENCE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ExternalReference target) { + + } + + @Override + protected void updateToPass(ExternalReference target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ExternalReferenceOperations.validateExternalReferenceTemplateId( + (ExternalReference) objectToTest, diagnostician, map); + } + + }; + + validateExternalReferenceTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateExternalReferenceClassCode() { + OperationsTestCase validateExternalReferenceClassCodeTestCase = new OperationsTestCase( + "validateExternalReferenceClassCode", + operationsForOCL.getOCLValue("VALIDATE_EXTERNAL_REFERENCE_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ExternalReference target) { + + } + + @Override + protected void updateToPass(ExternalReference target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ExternalReferenceOperations.validateExternalReferenceClassCode( + (ExternalReference) objectToTest, diagnostician, map); + } + + }; + + validateExternalReferenceClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateExternalReferenceMoodCode() { + OperationsTestCase validateExternalReferenceMoodCodeTestCase = new OperationsTestCase( + "validateExternalReferenceMoodCode", + operationsForOCL.getOCLValue("VALIDATE_EXTERNAL_REFERENCE_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ExternalReference target) { + + } + + @Override + protected void updateToPass(ExternalReference target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ExternalReferenceOperations.validateExternalReferenceMoodCode( + (ExternalReference) objectToTest, diagnostician, map); + } + + }; + + validateExternalReferenceMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateExternalReferenceId() { + OperationsTestCase validateExternalReferenceIdTestCase = new OperationsTestCase( + "validateExternalReferenceId", + operationsForOCL.getOCLValue("VALIDATE_EXTERNAL_REFERENCE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ExternalReference target) { + target.init(); + } + + @Override + protected void updateToPass(ExternalReference target) { + II ii = DatatypesFactory.eINSTANCE.createII("root"); + target.getIds().add(ii); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ExternalReferenceOperations.validateExternalReferenceId( + (ExternalReference) objectToTest, diagnostician, map); + } + + }; + + validateExternalReferenceIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateExternalReferenceText() { + OperationsTestCase validateExternalReferenceTextTestCase = new OperationsTestCase( + "validateExternalReferenceText", + operationsForOCL.getOCLValue("VALIDATE_EXTERNAL_REFERENCE_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ExternalReference target) { + target.init(); + } + + @Override + protected void updateToPass(ExternalReference target) { + ED value = DatatypesFactory.eINSTANCE.createED("TextValueHere"); + target.setText(value); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ExternalReferenceOperations.validateExternalReferenceText( + (ExternalReference) objectToTest, diagnostician, map); + } + + }; + + validateExternalReferenceTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ExternalReferenceOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public ExternalReference create() { + return IHEFactory.eINSTANCE.createExternalReference(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ExternalReferenceOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ExternalReferenceOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ExtremitiesSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ExtremitiesSectionTest.java new file mode 100644 index 000000000..ab0163d9d --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ExtremitiesSectionTest.java @@ -0,0 +1,223 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.ExtremitiesSection; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.operations.ExtremitiesSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Extremities Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ExtremitiesSection#validateExtremitiesSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Extremities Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ExtremitiesSection#validateExtremitiesSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Extremities Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ExtremitiesSection#validateExtremitiesSectionProblemEntry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Extremities Section Problem Entry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ExtremitiesSection#getProblemEntry() Get Problem Entry}
  • + *
+ *

+ * + * @generated + */ + +public class ExtremitiesSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateExtremitiesSectionTemplateId() { + OperationsTestCase validateExtremitiesSectionTemplateIdTestCase = new OperationsTestCase( + "validateExtremitiesSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_EXTREMITIES_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ExtremitiesSection target) { + + } + + @Override + protected void updateToPass(ExtremitiesSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ExtremitiesSectionOperations.validateExtremitiesSectionTemplateId( + (ExtremitiesSection) objectToTest, diagnostician, map); + } + + }; + + validateExtremitiesSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateExtremitiesSectionCode() { + OperationsTestCase validateExtremitiesSectionCodeTestCase = new OperationsTestCase( + "validateExtremitiesSectionCode", + operationsForOCL.getOCLValue("VALIDATE_EXTREMITIES_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ExtremitiesSection target) { + + } + + @Override + protected void updateToPass(ExtremitiesSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ExtremitiesSectionOperations.validateExtremitiesSectionCode( + (ExtremitiesSection) objectToTest, diagnostician, map); + } + + }; + + validateExtremitiesSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateExtremitiesSectionProblemEntry() { + OperationsTestCase validateExtremitiesSectionProblemEntryTestCase = new OperationsTestCase( + "validateExtremitiesSectionProblemEntry", + operationsForOCL.getOCLValue("VALIDATE_EXTREMITIES_SECTION_PROBLEM_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ExtremitiesSection target) { + target.init(); + } + + @Override + protected void updateToPass(ExtremitiesSection target) { + + target.addObservation(IHEFactory.eINSTANCE.createProblemEntry().init()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ExtremitiesSectionOperations.validateExtremitiesSectionProblemEntry( + (ExtremitiesSection) objectToTest, diagnostician, map); + } + + }; + + validateExtremitiesSectionProblemEntryTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemEntry() { + + ExtremitiesSection target = objectFactory.create(); + target.getProblemEntry(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ExtremitiesSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ExtremitiesSection create() { + return IHEFactory.eINSTANCE.createExtremitiesSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ExtremitiesSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ExtremitiesSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/EyesSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/EyesSectionTest.java new file mode 100644 index 000000000..13a39e0d5 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/EyesSectionTest.java @@ -0,0 +1,221 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.EyesSection; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.operations.EyesSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Eyes Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.EyesSection#validateEyesSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Eyes Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.EyesSection#validateEyesSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Eyes Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.EyesSection#validateEyesSectionProblemEntry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Eyes Section Problem Entry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.EyesSection#getProblemEntry() Get Problem Entry}
  • + *
+ *

+ * + * @generated + */ + +public class EyesSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateEyesSectionTemplateId() { + OperationsTestCase validateEyesSectionTemplateIdTestCase = new OperationsTestCase( + "validateEyesSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_EYES_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EyesSection target) { + + } + + @Override + protected void updateToPass(EyesSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EyesSectionOperations.validateEyesSectionTemplateId( + (EyesSection) objectToTest, diagnostician, map); + } + + }; + + validateEyesSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateEyesSectionCode() { + OperationsTestCase validateEyesSectionCodeTestCase = new OperationsTestCase( + "validateEyesSectionCode", + operationsForOCL.getOCLValue("VALIDATE_EYES_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(EyesSection target) { + + } + + @Override + protected void updateToPass(EyesSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EyesSectionOperations.validateEyesSectionCode((EyesSection) objectToTest, diagnostician, map); + } + + }; + + validateEyesSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateEyesSectionProblemEntry() { + OperationsTestCase validateEyesSectionProblemEntryTestCase = new OperationsTestCase( + "validateEyesSectionProblemEntry", + operationsForOCL.getOCLValue("VALIDATE_EYES_SECTION_PROBLEM_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EyesSection target) { + target.init(); + } + + @Override + protected void updateToPass(EyesSection target) { + + target.addObservation(IHEFactory.eINSTANCE.createProblemEntry().init()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EyesSectionOperations.validateEyesSectionProblemEntry( + (EyesSection) objectToTest, diagnostician, map); + } + + }; + + validateEyesSectionProblemEntryTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemEntry() { + + EyesSection target = objectFactory.create(); + target.getProblemEntry(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends EyesSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public EyesSection create() { + return IHEFactory.eINSTANCE.createEyesSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends EyesSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // EyesSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/FamilyHistoryObservationTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/FamilyHistoryObservationTest.java new file mode 100644 index 000000000..53ca29233 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/FamilyHistoryObservationTest.java @@ -0,0 +1,220 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.FamilyHistoryObservation; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.operations.FamilyHistoryObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; + +/** + * + * A static utility class that provides operations related to 'Family History Observation' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.FamilyHistoryObservation#validateSimpleObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Simple Observation Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.FamilyHistoryObservation#validateIHEFamilyHistoryObservationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Family History Observation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.FamilyHistoryObservation#validateIHEFamilyHistoryObservationValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Family History Observation Value}
  • + *
+ *

+ * + * @generated + */ + +public class FamilyHistoryObservationTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateSimpleObservationTemplateId() { + OperationsTestCase validateSimpleObservationTemplateIdTestCase = new OperationsTestCase( + "validateSimpleObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_SIMPLE_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryObservation target) { + + } + + @Override + protected void updateToPass(FamilyHistoryObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryObservationOperations.validateSimpleObservationTemplateId( + (FamilyHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateSimpleObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateIHEFamilyHistoryObservationCode() { + OperationsTestCase validateIHEFamilyHistoryObservationCodeTestCase = new OperationsTestCase( + "validateIHEFamilyHistoryObservationCode", + operationsForOCL.getOCLValue("VALIDATE_IHE_FAMILY_HISTORY_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryObservation target) { + + } + + @Override + protected void updateToPass(FamilyHistoryObservation target) { + target.init(); + + CD cd = DatatypesFactory.eINSTANCE.createCD(); + cd.setCodeSystem("2.16.840.1.113883.6.96"); + cd.setCode("404684003"); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryObservationOperations.validateIHEFamilyHistoryObservationCode( + (FamilyHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateIHEFamilyHistoryObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateIHEFamilyHistoryObservationValue() { + OperationsTestCase validateIHEFamilyHistoryObservationValueTestCase = new OperationsTestCase( + "validateIHEFamilyHistoryObservationValue", + operationsForOCL.getOCLValue("VALIDATE_IHE_FAMILY_HISTORY_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryObservation target) { + + } + + @Override + protected void updateToPass(FamilyHistoryObservation target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD(); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryObservationOperations.validateIHEFamilyHistoryObservationValue( + (FamilyHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateIHEFamilyHistoryObservationValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends FamilyHistoryObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public FamilyHistoryObservation create() { + return IHEFactory.eINSTANCE.createFamilyHistoryObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends FamilyHistoryObservationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // FamilyHistoryObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/FamilyHistoryOrganizerTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/FamilyHistoryOrganizerTest.java new file mode 100644 index 000000000..cfab688e0 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/FamilyHistoryOrganizerTest.java @@ -0,0 +1,386 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Participant2; +import org.openhealthtools.mdht.uml.cda.ParticipantRole; +import org.openhealthtools.mdht.uml.cda.PlayingEntity; +import org.openhealthtools.mdht.uml.cda.ihe.FamilyHistoryOrganizer; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.operations.FamilyHistoryOrganizerOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.vocab.EntityClassRoot; +import org.openhealthtools.mdht.uml.hl7.vocab.RoleClassRoot; + +/** + * + * A static utility class that provides operations related to 'Family History Organizer' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.FamilyHistoryOrganizer#validateIHEFamilyHistoryOrganizerHasParticipant(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Family History Organizer Has Participant}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.FamilyHistoryOrganizer#validateIHEFamilyHistoryOrganizerHasParticipantParticipantRole(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Family History Organizer Has Participant Participant Role}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.FamilyHistoryOrganizer#validateIHEFamilyHistoryOrganizerHasParticipantRoleCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Family History Organizer Has Participant Role Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.FamilyHistoryOrganizer#validateIHEFamilyHistoryOrganizerHasParticipantRolePlayingEntity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Family History Organizer Has Participant Role Playing Entity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.FamilyHistoryOrganizer#validateIHEFamilyHistoryOrganizerTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Family History Organizer Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.FamilyHistoryOrganizer#validateIHEFamilyHistoryOrganizerCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Family History Organizer Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.FamilyHistoryOrganizer#validateIHEFamilyHistoryOrganizerFamilyHistoryObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Family History Organizer Family History Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.FamilyHistoryOrganizer#getIHEFamilyHistoryObservations() Get IHE Family History Observations}
  • + *
+ *

+ * + * @generated + */ + +public class FamilyHistoryOrganizerTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateIHEFamilyHistoryOrganizerHasParticipant() { + OperationsTestCase validateIHEFamilyHistoryOrganizerHasParticipantTestCase = new OperationsTestCase( + "validateIHEFamilyHistoryOrganizerHasParticipant", + operationsForOCL.getOCLValue("VALIDATE_IHE_FAMILY_HISTORY_ORGANIZER_HAS_PARTICIPANT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryOrganizer target) { + target.init(); + } + + @Override + protected void updateToPass(FamilyHistoryOrganizer target) { + target.getParticipants().add(CDAFactory.eINSTANCE.createParticipant2()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryOrganizerOperations.validateIHEFamilyHistoryOrganizerHasParticipant( + (FamilyHistoryOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateIHEFamilyHistoryOrganizerHasParticipantTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateIHEFamilyHistoryOrganizerHasParticipantParticipantRole() { + OperationsTestCase validateIHEFamilyHistoryOrganizerHasParticipantParticipantRoleTestCase = new OperationsTestCase( + "validateIHEFamilyHistoryOrganizerHasParticipantParticipantRole", + operationsForOCL.getOCLValue("VALIDATE_IHE_FAMILY_HISTORY_ORGANIZER_HAS_PARTICIPANT_PARTICIPANT_ROLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryOrganizer target) { + target.init(); + + } + + @Override + protected void updateToPass(FamilyHistoryOrganizer target) { + + Participant2 p2 = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + pr.setClassCode(RoleClassRoot.PRS); + pr.setCode(DatatypesFactory.eINSTANCE.createCE()); + p2.setParticipantRole(pr); + target.getParticipants().add(p2); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryOrganizerOperations.validateIHEFamilyHistoryOrganizerHasParticipantParticipantRole( + (FamilyHistoryOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateIHEFamilyHistoryOrganizerHasParticipantParticipantRoleTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateIHEFamilyHistoryOrganizerHasParticipantRoleCode() { + OperationsTestCase validateIHEFamilyHistoryOrganizerHasParticipantRoleCodeTestCase = new OperationsTestCase( + "validateIHEFamilyHistoryOrganizerHasParticipantRoleCode", + operationsForOCL.getOCLValue("VALIDATE_IHE_FAMILY_HISTORY_ORGANIZER_HAS_PARTICIPANT_ROLE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryOrganizer target) { + target.init(); + } + + @Override + protected void updateToPass(FamilyHistoryOrganizer target) { + + Participant2 p2 = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + pr.setCode(DatatypesFactory.eINSTANCE.createCE()); + p2.setParticipantRole(pr); + target.getParticipants().add(p2); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryOrganizerOperations.validateIHEFamilyHistoryOrganizerHasParticipantRoleCode( + (FamilyHistoryOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateIHEFamilyHistoryOrganizerHasParticipantRoleCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateIHEFamilyHistoryOrganizerHasParticipantRolePlayingEntity() { + OperationsTestCase validateIHEFamilyHistoryOrganizerHasParticipantRolePlayingEntityTestCase = new OperationsTestCase( + "validateIHEFamilyHistoryOrganizerHasParticipantRolePlayingEntity", + operationsForOCL.getOCLValue("VALIDATE_IHE_FAMILY_HISTORY_ORGANIZER_HAS_PARTICIPANT_ROLE_PLAYING_ENTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryOrganizer target) { + target.init(); + } + + @Override + protected void updateToPass(FamilyHistoryOrganizer target) { + + Participant2 p2 = CDAFactory.eINSTANCE.createParticipant2(); + ParticipantRole pr = CDAFactory.eINSTANCE.createParticipantRole(); + pr.setCode(DatatypesFactory.eINSTANCE.createCE()); + PlayingEntity pe = CDAFactory.eINSTANCE.createPlayingEntity(); + pe.setClassCode(EntityClassRoot.PSN); + pr.setPlayingEntity(pe); + p2.setParticipantRole(pr); + target.getParticipants().add(p2); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryOrganizerOperations.validateIHEFamilyHistoryOrganizerHasParticipantRolePlayingEntity( + (FamilyHistoryOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateIHEFamilyHistoryOrganizerHasParticipantRolePlayingEntityTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateIHEFamilyHistoryOrganizerTemplateId() { + OperationsTestCase validateIHEFamilyHistoryOrganizerTemplateIdTestCase = new OperationsTestCase( + "validateIHEFamilyHistoryOrganizerTemplateId", + operationsForOCL.getOCLValue("VALIDATE_IHE_FAMILY_HISTORY_ORGANIZER_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryOrganizer target) { + + } + + @Override + protected void updateToPass(FamilyHistoryOrganizer target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryOrganizerOperations.validateIHEFamilyHistoryOrganizerTemplateId( + (FamilyHistoryOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateIHEFamilyHistoryOrganizerTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateIHEFamilyHistoryOrganizerCode() { + OperationsTestCase validateIHEFamilyHistoryOrganizerCodeTestCase = new OperationsTestCase( + "validateIHEFamilyHistoryOrganizerCode", + operationsForOCL.getOCLValue("VALIDATE_IHE_FAMILY_HISTORY_ORGANIZER_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryOrganizer target) { + + } + + @Override + protected void updateToPass(FamilyHistoryOrganizer target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryOrganizerOperations.validateIHEFamilyHistoryOrganizerCode( + (FamilyHistoryOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateIHEFamilyHistoryOrganizerCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateIHEFamilyHistoryOrganizerFamilyHistoryObservation() { + OperationsTestCase validateIHEFamilyHistoryOrganizerFamilyHistoryObservationTestCase = new OperationsTestCase( + "validateIHEFamilyHistoryOrganizerFamilyHistoryObservation", + operationsForOCL.getOCLValue("VALIDATE_IHE_FAMILY_HISTORY_ORGANIZER_FAMILY_HISTORY_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyHistoryOrganizer target) { + target.init(); + } + + @Override + protected void updateToPass(FamilyHistoryOrganizer target) { + + target.addObservation(IHEFactory.eINSTANCE.createFamilyHistoryObservation().init()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyHistoryOrganizerOperations.validateIHEFamilyHistoryOrganizerFamilyHistoryObservation( + (FamilyHistoryOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateIHEFamilyHistoryOrganizerFamilyHistoryObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetIHEFamilyHistoryObservations() { + + FamilyHistoryOrganizer target = objectFactory.create(); + target.getIHEFamilyHistoryObservations(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends FamilyHistoryOrganizerOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public FamilyHistoryOrganizer create() { + return IHEFactory.eINSTANCE.createFamilyHistoryOrganizer(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends FamilyHistoryOrganizerOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // FamilyHistoryOrganizerOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/FamilyMedicalHistorySectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/FamilyMedicalHistorySectionTest.java new file mode 100644 index 000000000..5758541c6 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/FamilyMedicalHistorySectionTest.java @@ -0,0 +1,142 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.FamilyMedicalHistorySection; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.operations.FamilyMedicalHistorySectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Family Medical History Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.FamilyMedicalHistorySection#validateFamilyMedicalHistorySectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Family Medical History Section Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class FamilyMedicalHistorySectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateFamilyMedicalHistorySectionTemplateId() { + OperationsTestCase validateFamilyMedicalHistorySectionTemplateIdTestCase = new OperationsTestCase( + "validateFamilyMedicalHistorySectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_FAMILY_MEDICAL_HISTORY_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FamilyMedicalHistorySection target) { + + } + + @Override + protected void updateToPass(FamilyMedicalHistorySection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FamilyMedicalHistorySectionOperations.validateFamilyMedicalHistorySectionTemplateId( + (FamilyMedicalHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateFamilyMedicalHistorySectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends FamilyMedicalHistorySectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public FamilyMedicalHistorySection create() { + return IHEFactory.eINSTANCE.createFamilyMedicalHistorySection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends FamilyMedicalHistorySectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // FamilyMedicalHistorySectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/FunctionalStatusSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/FunctionalStatusSectionTest.java new file mode 100644 index 000000000..5976802cd --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/FunctionalStatusSectionTest.java @@ -0,0 +1,136 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.FunctionalStatusSection; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.operations.FunctionalStatusSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Functional Status Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.FunctionalStatusSection#validateFunctionalStatusSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Functional Status Section Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class FunctionalStatusSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateFunctionalStatusSectionTemplateId() { + OperationsTestCase validateFunctionalStatusSectionTemplateIdTestCase = new OperationsTestCase( + "validateFunctionalStatusSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_FUNCTIONAL_STATUS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(FunctionalStatusSection target) { + + } + + @Override + protected void updateToPass(FunctionalStatusSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return FunctionalStatusSectionOperations.validateFunctionalStatusSectionTemplateId( + (FunctionalStatusSection) objectToTest, diagnostician, map); + } + + }; + + validateFunctionalStatusSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends FunctionalStatusSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public FunctionalStatusSection create() { + return IHEFactory.eINSTANCE.createFunctionalStatusSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends FunctionalStatusSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // FunctionalStatusSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/GeneralAppearanceSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/GeneralAppearanceSectionTest.java new file mode 100644 index 000000000..f537ba0de --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/GeneralAppearanceSectionTest.java @@ -0,0 +1,226 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.GeneralAppearanceSection; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.ProblemEntry; +import org.openhealthtools.mdht.uml.cda.ihe.operations.GeneralAppearanceSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'General Appearance Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.GeneralAppearanceSection#validateGeneralAppearanceSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Appearance Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.GeneralAppearanceSection#validateGeneralAppearanceSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Appearance Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.GeneralAppearanceSection#validateGeneralAppearanceSectionProblemEntry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Appearance Section Problem Entry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.GeneralAppearanceSection#getProblemEntry() Get Problem Entry}
  • + *
+ *

+ * + * @generated + */ + +public class GeneralAppearanceSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateGeneralAppearanceSectionTemplateId() { + OperationsTestCase validateGeneralAppearanceSectionTemplateIdTestCase = new OperationsTestCase( + "validateGeneralAppearanceSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_APPEARANCE_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralAppearanceSection target) { + + } + + @Override + protected void updateToPass(GeneralAppearanceSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralAppearanceSectionOperations.validateGeneralAppearanceSectionTemplateId( + (GeneralAppearanceSection) objectToTest, diagnostician, map); + } + + }; + + validateGeneralAppearanceSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateGeneralAppearanceSectionCode() { + OperationsTestCase validateGeneralAppearanceSectionCodeTestCase = new OperationsTestCase( + "validateGeneralAppearanceSectionCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_APPEARANCE_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralAppearanceSection target) { + + } + + @Override + protected void updateToPass(GeneralAppearanceSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralAppearanceSectionOperations.validateGeneralAppearanceSectionCode( + (GeneralAppearanceSection) objectToTest, diagnostician, map); + } + + }; + + validateGeneralAppearanceSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateGeneralAppearanceSectionProblemEntry() { + OperationsTestCase validateGeneralAppearanceSectionProblemEntryTestCase = new OperationsTestCase( + "validateGeneralAppearanceSectionProblemEntry", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_APPEARANCE_SECTION_PROBLEM_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralAppearanceSection target) { + + } + + @Override + protected void updateToPass(GeneralAppearanceSection target) { + target.init(); + ProblemEntry entry = IHEFactory.eINSTANCE.createProblemEntry().init(); + target.addObservation(entry); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralAppearanceSectionOperations.validateGeneralAppearanceSectionProblemEntry( + (GeneralAppearanceSection) objectToTest, diagnostician, map); + } + + }; + + validateGeneralAppearanceSectionProblemEntryTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemEntry() { + + GeneralAppearanceSection target = objectFactory.create(); + target.getProblemEntry(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends GeneralAppearanceSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public GeneralAppearanceSection create() { + return IHEFactory.eINSTANCE.createGeneralAppearanceSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends GeneralAppearanceSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // GeneralAppearanceSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/GenitaliaSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/GenitaliaSectionTest.java new file mode 100644 index 000000000..be89c79d0 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/GenitaliaSectionTest.java @@ -0,0 +1,223 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.GenitaliaSection; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.operations.GenitaliaSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Genitalia Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.GenitaliaSection#validateGenitaliaSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Genitalia Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.GenitaliaSection#validateGenitaliaSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Genitalia Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.GenitaliaSection#validateGenitaliaSectionProblemEntry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Genitalia Section Problem Entry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.GenitaliaSection#getProblemEntry() Get Problem Entry}
  • + *
+ *

+ * + * @generated + */ + +public class GenitaliaSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateGenitaliaSectionTemplateId() { + OperationsTestCase validateGenitaliaSectionTemplateIdTestCase = new OperationsTestCase( + "validateGenitaliaSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_GENITALIA_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GenitaliaSection target) { + + } + + @Override + protected void updateToPass(GenitaliaSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GenitaliaSectionOperations.validateGenitaliaSectionTemplateId( + (GenitaliaSection) objectToTest, diagnostician, map); + } + + }; + + validateGenitaliaSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateGenitaliaSectionCode() { + OperationsTestCase validateGenitaliaSectionCodeTestCase = new OperationsTestCase( + "validateGenitaliaSectionCode", + operationsForOCL.getOCLValue("VALIDATE_GENITALIA_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GenitaliaSection target) { + + } + + @Override + protected void updateToPass(GenitaliaSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GenitaliaSectionOperations.validateGenitaliaSectionCode( + (GenitaliaSection) objectToTest, diagnostician, map); + } + + }; + + validateGenitaliaSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateGenitaliaSectionProblemEntry() { + OperationsTestCase validateGenitaliaSectionProblemEntryTestCase = new OperationsTestCase( + "validateGenitaliaSectionProblemEntry", + operationsForOCL.getOCLValue("VALIDATE_GENITALIA_SECTION_PROBLEM_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GenitaliaSection target) { + target.init(); + } + + @Override + protected void updateToPass(GenitaliaSection target) { + + target.addObservation(IHEFactory.eINSTANCE.createProblemEntry().init()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GenitaliaSectionOperations.validateGenitaliaSectionProblemEntry( + (GenitaliaSection) objectToTest, diagnostician, map); + } + + }; + + validateGenitaliaSectionProblemEntryTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemEntry() { + + GenitaliaSection target = objectFactory.create(); + target.getProblemEntry(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends GenitaliaSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public GenitaliaSection create() { + return IHEFactory.eINSTANCE.createGenitaliaSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends GenitaliaSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // GenitaliaSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/HeadSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/HeadSectionTest.java new file mode 100644 index 000000000..9c2a8e266 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/HeadSectionTest.java @@ -0,0 +1,221 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.HeadSection; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.operations.HeadSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Head Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.HeadSection#validateHeadSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Head Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.HeadSection#validateHeadSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Head Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.HeadSection#validateHeadSectionProblemEntry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Head Section Problem Entry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.HeadSection#getProblemEntry() Get Problem Entry}
  • + *
+ *

+ * + * @generated + */ + +public class HeadSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHeadSectionTemplateId() { + OperationsTestCase validateHeadSectionTemplateIdTestCase = new OperationsTestCase( + "validateHeadSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HEAD_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HeadSection target) { + + } + + @Override + protected void updateToPass(HeadSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HeadSectionOperations.validateHeadSectionTemplateId( + (HeadSection) objectToTest, diagnostician, map); + } + + }; + + validateHeadSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHeadSectionCode() { + OperationsTestCase validateHeadSectionCodeTestCase = new OperationsTestCase( + "validateHeadSectionCode", + operationsForOCL.getOCLValue("VALIDATE_HEAD_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(HeadSection target) { + + } + + @Override + protected void updateToPass(HeadSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HeadSectionOperations.validateHeadSectionCode((HeadSection) objectToTest, diagnostician, map); + } + + }; + + validateHeadSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateHeadSectionProblemEntry() { + OperationsTestCase validateHeadSectionProblemEntryTestCase = new OperationsTestCase( + "validateHeadSectionProblemEntry", + operationsForOCL.getOCLValue("VALIDATE_HEAD_SECTION_PROBLEM_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HeadSection target) { + target.init(); + } + + @Override + protected void updateToPass(HeadSection target) { + target.addObservation(IHEFactory.eINSTANCE.createProblemEntry().init()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HeadSectionOperations.validateHeadSectionProblemEntry( + (HeadSection) objectToTest, diagnostician, map); + } + + }; + + validateHeadSectionProblemEntryTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemEntry() { + + HeadSection target = objectFactory.create(); + target.getProblemEntry(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends HeadSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public HeadSection create() { + return IHEFactory.eINSTANCE.createHeadSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends HeadSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // HeadSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/HealthStatusObservationTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/HealthStatusObservationTest.java new file mode 100644 index 000000000..dab7fe0bf --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/HealthStatusObservationTest.java @@ -0,0 +1,298 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ccd.operations.StatusObservationOperations; +import org.openhealthtools.mdht.uml.cda.ihe.HealthStatusObservation; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.operations.HealthStatusObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.ANY; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; +import org.openhealthtools.mdht.uml.hl7.datatypes.TEL; + +/** + * + * A static utility class that provides operations related to 'Health Status Observation' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.HealthStatusObservation#validateHealthStatusObservationHasTextReference(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Health Status Observation Has Text Reference}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.HealthStatusObservation#validateHealthStatusObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Health Status Observation Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.HealthStatusObservation#validateHealthStatusObservationText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Health Status Observation Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.HealthStatusObservation#validateHealthStatusObservationValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Health Status Observation Value}
  • + *
+ *

+ * + * @generated + */ + +public class HealthStatusObservationTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateHealthStatusObservationHasTextReference() { + OperationsTestCase validateHealthStatusObservationHasTextReferenceTestCase = new OperationsTestCase( + "validateHealthStatusObservationHasTextReference", + operationsForOCL.getOCLValue("VALIDATE_HEALTH_STATUS_OBSERVATION_HAS_TEXT_REFERENCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HealthStatusObservation target) { + target.init(); + ED value = DatatypesFactory.eINSTANCE.createED("Test"); + target.setText(value); + } + + @Override + protected void updateToPass(HealthStatusObservation target) { + TEL value = DatatypesFactory.eINSTANCE.createTEL(); + target.getText().setReference(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HealthStatusObservationOperations.validateHealthStatusObservationHasTextReference( + (HealthStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateHealthStatusObservationHasTextReferenceTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHealthStatusObservationTemplateId() { + OperationsTestCase validateHealthStatusObservationTemplateIdTestCase = new OperationsTestCase( + "validateHealthStatusObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HEALTH_STATUS_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HealthStatusObservation target) { + + } + + @Override + protected void updateToPass(HealthStatusObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HealthStatusObservationOperations.validateHealthStatusObservationTemplateId( + (HealthStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateHealthStatusObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHealthStatusObservationText() { + OperationsTestCase validateHealthStatusObservationTextTestCase = new OperationsTestCase( + "validateHealthStatusObservationText", + operationsForOCL.getOCLValue("VALIDATE_HEALTH_STATUS_OBSERVATION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HealthStatusObservation target) { + target.init(); + } + + @Override + protected void updateToPass(HealthStatusObservation target) { + ED value = DatatypesFactory.eINSTANCE.createED("Test"); + target.setText(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HealthStatusObservationOperations.validateHealthStatusObservationText( + (HealthStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateHealthStatusObservationTextTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateHealthStatusObservationValue() { + OperationsTestCase validateHealthStatusObservationValueTestCase = new OperationsTestCase( + "validateHealthStatusObservationValue", + operationsForOCL.getOCLValue("VALIDATE_HEALTH_STATUS_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HealthStatusObservation target) { + + } + + @Override + protected void updateToPass(HealthStatusObservation target) { + target.init(); + + CE value = DatatypesFactory.eINSTANCE.createCE(); + value.setCodeSystem("2.16.840.1.113883.6.96"); + value.setCode("81323004"); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HealthStatusObservationOperations.validateHealthStatusObservationValue( + (HealthStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateHealthStatusObservationValueTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateStatusObservationValue() { + OperationsTestCase validateStatusObservationValueTestCase = new OperationsTestCase( + "validateStatusObservationValue", + operationsForOCL.getOCLValue("VALIDATE_STATUS_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HealthStatusObservation target) { + target.init(); + } + + @Override + protected void updateToPass(HealthStatusObservation target) { + + ANY arg0 = DatatypesFactory.eINSTANCE.createCE("81323004", "2.16.840.1.113883.6.96"); + target.getValues().add(arg0); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return StatusObservationOperations.validateStatusObservationValue( + (HealthStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateStatusObservationValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends HealthStatusObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public HealthStatusObservation create() { + return IHEFactory.eINSTANCE.createHealthStatusObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends HealthStatusObservationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // HealthStatusObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/HealthcareProvidersPharmaciesTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/HealthcareProvidersPharmaciesTest.java new file mode 100644 index 000000000..1d8a3da32 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/HealthcareProvidersPharmaciesTest.java @@ -0,0 +1,142 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.HealthcareProvidersPharmacies; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.operations.HealthcareProvidersPharmaciesOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Healthcare Providers Pharmacies' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.HealthcareProvidersPharmacies#validateHealthcareProvidersPharmaciesTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Healthcare Providers Pharmacies Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class HealthcareProvidersPharmaciesTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHealthcareProvidersPharmaciesTemplateId() { + OperationsTestCase validateHealthcareProvidersPharmaciesTemplateIdTestCase = new OperationsTestCase( + "validateHealthcareProvidersPharmaciesTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HEALTHCARE_PROVIDERS_PHARMACIES_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HealthcareProvidersPharmacies target) { + + } + + @Override + protected void updateToPass(HealthcareProvidersPharmacies target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HealthcareProvidersPharmaciesOperations.validateHealthcareProvidersPharmaciesTemplateId( + (HealthcareProvidersPharmacies) objectToTest, diagnostician, map); + } + + }; + + validateHealthcareProvidersPharmaciesTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends HealthcareProvidersPharmaciesOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public HealthcareProvidersPharmacies create() { + return IHEFactory.eINSTANCE.createHealthcareProvidersPharmacies(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends HealthcareProvidersPharmaciesOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // HealthcareProvidersPharmaciesOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/HeartSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/HeartSectionTest.java new file mode 100644 index 000000000..0b347cf09 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/HeartSectionTest.java @@ -0,0 +1,220 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.HeartSection; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.operations.HeartSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Heart Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.HeartSection#validateHeartSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Heart Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.HeartSection#validateHeartSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Heart Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.HeartSection#validateHeartSectionProblemEntry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Heart Section Problem Entry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.HeartSection#getProblemEntry() Get Problem Entry}
  • + *
+ *

+ * + * @generated + */ + +public class HeartSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHeartSectionTemplateId() { + OperationsTestCase validateHeartSectionTemplateIdTestCase = new OperationsTestCase( + "validateHeartSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HEART_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HeartSection target) { + + } + + @Override + protected void updateToPass(HeartSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HeartSectionOperations.validateHeartSectionTemplateId( + (HeartSection) objectToTest, diagnostician, map); + } + + }; + + validateHeartSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHeartSectionCode() { + OperationsTestCase validateHeartSectionCodeTestCase = new OperationsTestCase( + "validateHeartSectionCode", + operationsForOCL.getOCLValue("VALIDATE_HEART_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(HeartSection target) { + + } + + @Override + protected void updateToPass(HeartSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HeartSectionOperations.validateHeartSectionCode((HeartSection) objectToTest, diagnostician, map); + } + + }; + + validateHeartSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateHeartSectionProblemEntry() { + OperationsTestCase validateHeartSectionProblemEntryTestCase = new OperationsTestCase( + "validateHeartSectionProblemEntry", + operationsForOCL.getOCLValue("VALIDATE_HEART_SECTION_PROBLEM_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HeartSection target) { + target.init(); + } + + @Override + protected void updateToPass(HeartSection target) { + target.addObservation(IHEFactory.eINSTANCE.createProblemEntry().init()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HeartSectionOperations.validateHeartSectionProblemEntry( + (HeartSection) objectToTest, diagnostician, map); + } + + }; + + validateHeartSectionProblemEntryTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemEntry() { + + HeartSection target = objectFactory.create(); + target.getProblemEntry(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends HeartSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public HeartSection create() { + return IHEFactory.eINSTANCE.createHeartSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends HeartSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // HeartSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/HistoryOfPastIllnessSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/HistoryOfPastIllnessSectionTest.java new file mode 100644 index 000000000..82e460631 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/HistoryOfPastIllnessSectionTest.java @@ -0,0 +1,177 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.HistoryOfPastIllnessSection; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.operations.HistoryOfPastIllnessSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'History Of Past Illness Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.HistoryOfPastIllnessSection#validateHistoryOfPastIllnessSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History Of Past Illness Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.HistoryOfPastIllnessSection#validateHistoryOfPastIllnessSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History Of Past Illness Section Code}
  • + *
+ *

+ * + * @generated + */ + +public class HistoryOfPastIllnessSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHistoryOfPastIllnessSectionTemplateId() { + OperationsTestCase validateHistoryOfPastIllnessSectionTemplateIdTestCase = new OperationsTestCase( + "validateHistoryOfPastIllnessSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_OF_PAST_ILLNESS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryOfPastIllnessSection target) { + + } + + @Override + protected void updateToPass(HistoryOfPastIllnessSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryOfPastIllnessSectionOperations.validateHistoryOfPastIllnessSectionTemplateId( + (HistoryOfPastIllnessSection) objectToTest, diagnostician, map); + } + + }; + + validateHistoryOfPastIllnessSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHistoryOfPastIllnessSectionCode() { + OperationsTestCase validateHistoryOfPastIllnessSectionCodeTestCase = new OperationsTestCase( + "validateHistoryOfPastIllnessSectionCode", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_OF_PAST_ILLNESS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryOfPastIllnessSection target) { + + } + + @Override + protected void updateToPass(HistoryOfPastIllnessSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryOfPastIllnessSectionOperations.validateHistoryOfPastIllnessSectionCode( + (HistoryOfPastIllnessSection) objectToTest, diagnostician, map); + } + + }; + + validateHistoryOfPastIllnessSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends HistoryOfPastIllnessSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public HistoryOfPastIllnessSection create() { + return IHEFactory.eINSTANCE.createHistoryOfPastIllnessSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends HistoryOfPastIllnessSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // HistoryOfPastIllnessSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/HistoryOfPresentIllnessTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/HistoryOfPresentIllnessTest.java new file mode 100644 index 000000000..30f8edc2d --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/HistoryOfPresentIllnessTest.java @@ -0,0 +1,177 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.HistoryOfPresentIllness; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.operations.HistoryOfPresentIllnessOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'History Of Present Illness' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.HistoryOfPresentIllness#validateHistoryOfPresentIllnessTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History Of Present Illness Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.HistoryOfPresentIllness#validateHistoryOfPresentIllnessCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate History Of Present Illness Code}
  • + *
+ *

+ * + * @generated + */ + +public class HistoryOfPresentIllnessTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHistoryOfPresentIllnessTemplateId() { + OperationsTestCase validateHistoryOfPresentIllnessTemplateIdTestCase = new OperationsTestCase( + "validateHistoryOfPresentIllnessTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_OF_PRESENT_ILLNESS_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryOfPresentIllness target) { + + } + + @Override + protected void updateToPass(HistoryOfPresentIllness target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryOfPresentIllnessOperations.validateHistoryOfPresentIllnessTemplateId( + (HistoryOfPresentIllness) objectToTest, diagnostician, map); + } + + }; + + validateHistoryOfPresentIllnessTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHistoryOfPresentIllnessCode() { + OperationsTestCase validateHistoryOfPresentIllnessCodeTestCase = new OperationsTestCase( + "validateHistoryOfPresentIllnessCode", + operationsForOCL.getOCLValue("VALIDATE_HISTORY_OF_PRESENT_ILLNESS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HistoryOfPresentIllness target) { + + } + + @Override + protected void updateToPass(HistoryOfPresentIllness target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HistoryOfPresentIllnessOperations.validateHistoryOfPresentIllnessCode( + (HistoryOfPresentIllness) objectToTest, diagnostician, map); + } + + }; + + validateHistoryOfPresentIllnessCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends HistoryOfPresentIllnessOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public HistoryOfPresentIllness create() { + return IHEFactory.eINSTANCE.createHistoryOfPresentIllness(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends HistoryOfPresentIllnessOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // HistoryOfPresentIllnessOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/HospitalAdmissionDiagnosisSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/HospitalAdmissionDiagnosisSectionTest.java new file mode 100644 index 000000000..792bd65fe --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/HospitalAdmissionDiagnosisSectionTest.java @@ -0,0 +1,225 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.HospitalAdmissionDiagnosisSection; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.operations.HospitalAdmissionDiagnosisSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Hospital Admission Diagnosis Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.HospitalAdmissionDiagnosisSection#validateHospitalAdmissionDiagnosisSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Admission Diagnosis Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.HospitalAdmissionDiagnosisSection#validateHospitalAdmissionDiagnosisSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Admission Diagnosis Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.HospitalAdmissionDiagnosisSection#validateHospitalAdmissionDiagnosisSectionProblemConcernEntry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Admission Diagnosis Section Problem Concern Entry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.HospitalAdmissionDiagnosisSection#getProblemConcernEntry() Get Problem Concern Entry}
  • + *
+ *

+ * + * @generated + */ + +public class HospitalAdmissionDiagnosisSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHospitalAdmissionDiagnosisSectionTemplateId() { + OperationsTestCase validateHospitalAdmissionDiagnosisSectionTemplateIdTestCase = new OperationsTestCase( + "validateHospitalAdmissionDiagnosisSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_ADMISSION_DIAGNOSIS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalAdmissionDiagnosisSection target) { + + } + + @Override + protected void updateToPass(HospitalAdmissionDiagnosisSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalAdmissionDiagnosisSectionOperations.validateHospitalAdmissionDiagnosisSectionTemplateId( + (HospitalAdmissionDiagnosisSection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalAdmissionDiagnosisSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalAdmissionDiagnosisSectionCode() { + OperationsTestCase validateHospitalAdmissionDiagnosisSectionCodeTestCase = new OperationsTestCase( + "validateHospitalAdmissionDiagnosisSectionCode", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_ADMISSION_DIAGNOSIS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalAdmissionDiagnosisSection target) { + + } + + @Override + protected void updateToPass(HospitalAdmissionDiagnosisSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalAdmissionDiagnosisSectionOperations.validateHospitalAdmissionDiagnosisSectionCode( + (HospitalAdmissionDiagnosisSection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalAdmissionDiagnosisSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHospitalAdmissionDiagnosisSectionProblemConcernEntry() { + OperationsTestCase validateHospitalAdmissionDiagnosisSectionProblemConcernEntryTestCase = new OperationsTestCase( + "validateHospitalAdmissionDiagnosisSectionProblemConcernEntry", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_ADMISSION_DIAGNOSIS_SECTION_PROBLEM_CONCERN_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalAdmissionDiagnosisSection target) { + + } + + @Override + protected void updateToPass(HospitalAdmissionDiagnosisSection target) { + target.init(); + target.addAct(IHEFactory.eINSTANCE.createProblemConcernEntry()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalAdmissionDiagnosisSectionOperations.validateHospitalAdmissionDiagnosisSectionProblemConcernEntry( + (HospitalAdmissionDiagnosisSection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalAdmissionDiagnosisSectionProblemConcernEntryTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemConcernEntry() { + + HospitalAdmissionDiagnosisSection target = objectFactory.create(); + target.getProblemConcernEntry(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends HospitalAdmissionDiagnosisSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public HospitalAdmissionDiagnosisSection create() { + return IHEFactory.eINSTANCE.createHospitalAdmissionDiagnosisSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends HospitalAdmissionDiagnosisSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // HospitalAdmissionDiagnosisSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/HospitalCourseSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/HospitalCourseSectionTest.java new file mode 100644 index 000000000..3e9e1670f --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/HospitalCourseSectionTest.java @@ -0,0 +1,177 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.HospitalCourseSection; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.operations.HospitalCourseSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Hospital Course Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.HospitalCourseSection#validateHospitalCourseSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Course Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.HospitalCourseSection#validateHospitalCourseSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Course Section Code}
  • + *
+ *

+ * + * @generated + */ + +public class HospitalCourseSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHospitalCourseSectionTemplateId() { + OperationsTestCase validateHospitalCourseSectionTemplateIdTestCase = new OperationsTestCase( + "validateHospitalCourseSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_COURSE_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalCourseSection target) { + + } + + @Override + protected void updateToPass(HospitalCourseSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalCourseSectionOperations.validateHospitalCourseSectionTemplateId( + (HospitalCourseSection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalCourseSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalCourseSectionCode() { + OperationsTestCase validateHospitalCourseSectionCodeTestCase = new OperationsTestCase( + "validateHospitalCourseSectionCode", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_COURSE_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalCourseSection target) { + + } + + @Override + protected void updateToPass(HospitalCourseSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalCourseSectionOperations.validateHospitalCourseSectionCode( + (HospitalCourseSection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalCourseSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends HospitalCourseSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public HospitalCourseSection create() { + return IHEFactory.eINSTANCE.createHospitalCourseSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends HospitalCourseSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // HospitalCourseSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/HospitalDischargeMedicationsSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/HospitalDischargeMedicationsSectionTest.java new file mode 100644 index 000000000..2aa2ecc24 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/HospitalDischargeMedicationsSectionTest.java @@ -0,0 +1,226 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.HospitalDischargeMedicationsSection; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.operations.HospitalDischargeMedicationsSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Hospital Discharge Medications Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.HospitalDischargeMedicationsSection#validateHospitalDischargeMedicationsSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Discharge Medications Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.HospitalDischargeMedicationsSection#validateHospitalDischargeMedicationsSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Discharge Medications Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.HospitalDischargeMedicationsSection#validateHospitalDischargeMedicationsSectionMedication(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Discharge Medications Section Medication}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.HospitalDischargeMedicationsSection#getMedication() Get Medication}
  • + *
+ *

+ * + * @generated + */ + +public class HospitalDischargeMedicationsSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHospitalDischargeMedicationsSectionTemplateId() { + OperationsTestCase validateHospitalDischargeMedicationsSectionTemplateIdTestCase = new OperationsTestCase( + "validateHospitalDischargeMedicationsSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_DISCHARGE_MEDICATIONS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalDischargeMedicationsSection target) { + + } + + @Override + protected void updateToPass(HospitalDischargeMedicationsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalDischargeMedicationsSectionOperations.validateHospitalDischargeMedicationsSectionTemplateId( + (HospitalDischargeMedicationsSection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalDischargeMedicationsSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalDischargeMedicationsSectionCode() { + OperationsTestCase validateHospitalDischargeMedicationsSectionCodeTestCase = new OperationsTestCase( + "validateHospitalDischargeMedicationsSectionCode", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_DISCHARGE_MEDICATIONS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalDischargeMedicationsSection target) { + + } + + @Override + protected void updateToPass(HospitalDischargeMedicationsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalDischargeMedicationsSectionOperations.validateHospitalDischargeMedicationsSectionCode( + (HospitalDischargeMedicationsSection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalDischargeMedicationsSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateHospitalDischargeMedicationsSectionMedication() { + OperationsTestCase validateHospitalDischargeMedicationsSectionMedicationTestCase = new OperationsTestCase( + "validateHospitalDischargeMedicationsSectionMedication", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_DISCHARGE_MEDICATIONS_SECTION_MEDICATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalDischargeMedicationsSection target) { + + } + + @Override + protected void updateToPass(HospitalDischargeMedicationsSection target) { + target.init(); + target.addSubstanceAdministration(IHEFactory.eINSTANCE.createNormalDose()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalDischargeMedicationsSectionOperations.validateHospitalDischargeMedicationsSectionMedication( + (HospitalDischargeMedicationsSection) objectToTest, diagnostician, map); + } + + }; + + validateHospitalDischargeMedicationsSectionMedicationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetMedication() { + + HospitalDischargeMedicationsSection target = objectFactory.create(); + target.getMedication(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends HospitalDischargeMedicationsSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public HospitalDischargeMedicationsSection create() { + return IHEFactory.eINSTANCE.createHospitalDischargeMedicationsSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends HospitalDischargeMedicationsSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // HospitalDischargeMedicationsSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/HospitalDischargePhysicalTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/HospitalDischargePhysicalTest.java new file mode 100644 index 000000000..c5d7043e0 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/HospitalDischargePhysicalTest.java @@ -0,0 +1,175 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.HospitalDischargePhysical; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.operations.HospitalDischargePhysicalOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Hospital Discharge Physical' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.HospitalDischargePhysical#validateHospitalDischargePhysicalTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Discharge Physical Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.HospitalDischargePhysical#validateHospitalDischargePhysicalCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Hospital Discharge Physical Code}
  • + *
+ *

+ * + * @generated + */ + +public class HospitalDischargePhysicalTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateHospitalDischargePhysicalTemplateId() { + OperationsTestCase validateHospitalDischargePhysicalTemplateIdTestCase = new OperationsTestCase( + "validateHospitalDischargePhysicalTemplateId", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_DISCHARGE_PHYSICAL_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalDischargePhysical target) { + + } + + @Override + protected void updateToPass(HospitalDischargePhysical target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalDischargePhysicalOperations.validateHospitalDischargePhysicalTemplateId( + (HospitalDischargePhysical) objectToTest, diagnostician, map); + } + + }; + + validateHospitalDischargePhysicalTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateHospitalDischargePhysicalCode() { + OperationsTestCase validateHospitalDischargePhysicalCodeTestCase = new OperationsTestCase( + "validateHospitalDischargePhysicalCode", + operationsForOCL.getOCLValue("VALIDATE_HOSPITAL_DISCHARGE_PHYSICAL_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(HospitalDischargePhysical target) { + + } + + @Override + protected void updateToPass(HospitalDischargePhysical target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return HospitalDischargePhysicalOperations.validateHospitalDischargePhysicalCode( + (HospitalDischargePhysical) objectToTest, diagnostician, map); + } + + }; + + validateHospitalDischargePhysicalCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends HospitalDischargePhysicalOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public HospitalDischargePhysical create() { + return IHEFactory.eINSTANCE.createHospitalDischargePhysical(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends HospitalDischargePhysicalOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // HospitalDischargePhysicalOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/IHEAllTests.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/IHEAllTests.java new file mode 100644 index 000000000..b2247dbcb --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/IHEAllTests.java @@ -0,0 +1,54 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import junit.framework.Test; +import junit.framework.TestSuite; +import junit.textui.TestRunner; + +/** + * + * A test suite for the 'IHE' model. + * + * @generated + */ +public class IHEAllTests extends TestSuite { + + /** + * + * + * @generated + */ + public static void main(String[] args) { + TestRunner.run(suite()); + } + + /** + * + * + * @generated + */ + public static Test suite() { + TestSuite suite = new IHEAllTests("IHE Tests"); + suite.addTest(IHETests.suite()); + return suite; + } + + /** + * + * + * @generated + */ + public IHEAllTests(String name) { + super(name); + } + +} // IHEAllTests diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/IHEExample.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/IHEExample.java new file mode 100644 index 000000000..f28ac728b --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/IHEExample.java @@ -0,0 +1,119 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.io.File; +import java.io.IOException; + +import org.eclipse.emf.common.util.Diagnostic; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; +import org.eclipse.emf.ecore.util.Diagnostician; +import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.IHEPackage; +import org.openhealthtools.mdht.uml.cda.ihe.ImmunizationsSection; + +/** + * + * A sample utility for the 'ihe' package. + * + * @generated + */ +public class IHEExample { + /** + * + * Load all the argument file paths or URIs as instances of the model. + * + * @param args the file paths or URIs. + * @generated + */ + public static void main(String[] args) { + // Create a resource set to hold the resources. + // + ResourceSet resourceSet = new ResourceSetImpl(); + + // Register the appropriate resource factory to handle all file extensions. + // + resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put( + Resource.Factory.Registry.DEFAULT_EXTENSION, new XMIResourceFactoryImpl()); + + // Register the package to ensure it is available during loading. + // + resourceSet.getPackageRegistry().put(IHEPackage.eNS_URI, IHEPackage.eINSTANCE); + + // If there are no arguments, emit an appropriate usage message. + // + if (args.length == 0) { + System.out.println("Enter a list of file paths or URIs that have content like this:"); + try { + Resource resource = resourceSet.createResource(URI.createURI("http:///My.ihe")); + ImmunizationsSection root = IHEFactory.eINSTANCE.createImmunizationsSection(); + resource.getContents().add(root); + resource.save(System.out, null); + } catch (IOException exception) { + exception.printStackTrace(); + } + } else { + // Iterate over all the arguments. + // + for (int i = 0; i < args.length; ++i) { + // Construct the URI for the instance file. + // The argument is treated as a file path only if it denotes an existing file. + // Otherwise, it's directly treated as a URL. + // + File file = new File(args[i]); + URI uri = file.isFile() + ? URI.createFileURI(file.getAbsolutePath()) + : URI.createURI(args[i]); + + try { + // Demand load resource for this file. + // + Resource resource = resourceSet.getResource(uri, true); + System.out.println("Loaded " + uri); + + // Validate the contents of the loaded resource. + // + for (EObject eObject : resource.getContents()) { + Diagnostic diagnostic = Diagnostician.INSTANCE.validate(eObject); + if (diagnostic.getSeverity() != Diagnostic.OK) { + printDiagnostic(diagnostic, ""); + } + } + } catch (RuntimeException exception) { + System.out.println("Problem loading " + uri); + exception.printStackTrace(); + } + } + } + } + + /** + * + * Prints diagnostics with indentation. + * + * @param diagnostic the diagnostic to print. + * @param indent the indentation for printing. + * @generated + */ + protected static void printDiagnostic(Diagnostic diagnostic, String indent) { + System.out.print(indent); + System.out.println(diagnostic.getMessage()); + for (Diagnostic child : diagnostic.getChildren()) { + printDiagnostic(child, indent + " "); + } + } + +} // IHEExample diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/IHERegistryDelegateTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/IHERegistryDelegateTest.java new file mode 100644 index 000000000..771ec929f --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/IHERegistryDelegateTest.java @@ -0,0 +1,114 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.IHERegistryDelegate; +import org.openhealthtools.mdht.uml.cda.ihe.operations.IHERegistryDelegateOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Registry Delegate' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.RegistryDelegate#getEClass(java.lang.String, java.lang.Object) Get EClass}
  • + *
+ *

+ * + * @generated + */ + +public class IHERegistryDelegateTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testGetEClass() { + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends IHERegistryDelegateOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public IHERegistryDelegate create() { + return IHEFactory.eINSTANCE.createIHERegistryDelegate(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends IHERegistryDelegateOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // IHERegistryDelegateOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/IHETests.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/IHETests.java new file mode 100644 index 000000000..d146dc85e --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/IHETests.java @@ -0,0 +1,77 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import junit.framework.JUnit4TestAdapter; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +/** + * + * A test suite for the 'ihe' package. + * + * + + * @generated + */ +@RunWith(Suite.class) +@Suite.SuiteClasses({ + ImmunizationsSectionTest.class, ImmunizationTest.class, MedicationsAdministeredSectionTest.class, + ConcernEntryTest.class, MedicalDocumentTest.class, ActiveProblemsSectionTest.class, + ProblemConcernEntryTest.class, ProblemEntryTest.class, SeverityTest.class, ProblemStatusObservationTest.class, + HealthStatusObservationTest.class, CommentTest.class, InternalReferenceTest.class, + PatientMedicalInstructionsTest.class, SupplyEntryTest.class, MedicationFullfillmentInstructionsTest.class, + MedicationsSectionTest.class, AllergyIntoleranceConcernTest.class, AllergyIntoleranceTest.class, + ProblemEntryReactionObservationContainerTest.class, AllergiesReactionsSectionTest.class, NormalDoseTest.class, + TaperedDoseTest.class, SplitDoseTest.class, ConditionalDoseTest.class, CombinationMedicationTest.class, + VitalSignsSectionTest.class, CodedVitalSignsSectionTest.class, VitalSignsOrganizerTest.class, + VitalSignObservationTest.class, PayersSectionTest.class, CoverageEntryTest.class, PayerEntryTest.class, + HistoryOfPastIllnessSectionTest.class, ChiefComplaintSectionTest.class, ReasonForReferralSectionTest.class, + HistoryOfPresentIllnessTest.class, SurgeriesSectionTest.class, CodedSurgeriesSectionTest.class, + ExternalReferenceTest.class, ProcedureEntryProcedureActivityProcedureTest.class, + HospitalAdmissionDiagnosisSectionTest.class, DischargeDiagnosisSectionTest.class, + AdmissionMedicationHistorySectionTest.class, HospitalDischargeMedicationsSectionTest.class, + CodedAdvanceDirectivesSectionTest.class, AdvanceDirectivesSectionTest.class, + AdvanceDirectiveObservationTest.class, PhysicalExamNarrativeSectionTest.class, PhysicalExamSectionTest.class, + GeneralAppearanceSectionTest.class, VisibleImplantedMedicalDevicesSectionTest.class, + IntegumentarySystemSectionTest.class, HeadSectionTest.class, EyesSectionTest.class, + EarsNoseMouthThroatSectionTest.class, EarsSectionTest.class, NoseSectionTest.class, + MouthThroatTeethSectionTest.class, NeckSectionTest.class, EndocrineSystemSectionTest.class, + ThoraxLungsSectionTest.class, ChestWallSectionTest.class, BreastSectionTest.class, HeartSectionTest.class, + RespiratorySystemSectionTest.class, AbdomenSectionTest.class, LymphaticSectionTest.class, + VesselsSectionTest.class, MusculoskeletalSystemSectionTest.class, NeurologicSystemSectionTest.class, + GenitaliaSectionTest.class, RectumSectionTest.class, ExtremitiesSectionTest.class, + ReviewOfSystemsSectionTest.class, HospitalCourseSectionTest.class, CodedResultsSectionTest.class, + AssessmentAndPlanSectionTest.class, CarePlanSectionTest.class, FamilyMedicalHistorySectionTest.class, + SocialHistorySectionTest.class, EncounterHistorySectionTest.class, MedicalDevicesSectionTest.class, + LanguageCommunicationTest.class, MedicalSummaryTest.class, DischargeSummaryTest.class, + HealthcareProvidersPharmaciesTest.class, ObservationRequestEntryTest.class, ProductEntryTest.class, + ProcedureEntryPlanOfCareActivityProcedureTest.class, PHRExtractTest.class, PHRUpdateTest.class, + EncounterActivityTest.class, EncounterPlanOfCareTest.class, IntakeOutputSectionTest.class, + PregnancyHistorySectionTest.class, PregnancyObservationTest.class, PatientContactGuardianTest.class, + PatientContactParticipantTest.class, ScannedDocumentTest.class, ScanOriginalAuthorTest.class, + ScanningDeviceTest.class, ScanDataEntererTest.class, DischargeDietTest.class, + HospitalDischargePhysicalTest.class, CodedFamilyMedicalHistorySectionTest.class, + FamilyHistoryOrganizerTest.class, FamilyHistoryObservationTest.class, SocialHistoryObservationTest.class, + CodedReasonForReferralSectionTest.class, IHERegistryDelegateTest.class }) +public class IHETests { + + /** + * + * + * @generated + */ + public static junit.framework.Test suite() { + return new JUnit4TestAdapter(IHETests.class); + } + +} // IHETests diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ImmunizationTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ImmunizationTest.java new file mode 100644 index 000000000..3a15a3748 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ImmunizationTest.java @@ -0,0 +1,330 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ccd.Comment; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.Immunization; +import org.openhealthtools.mdht.uml.cda.ihe.operations.ImmunizationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; + +/** + * + * A static utility class that provides operations related to 'Immunization' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.Immunization#validateImmunizationComments(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Comments}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.Immunization#validateImmunizationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.Immunization#validateImmunizationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.Immunization#validateImmunizationStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.Immunization#validateImmunizationMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.Immunization#validateImmunizationEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Immunization Effective Time}
  • + *
+ *

+ * + * @generated + */ + +public class ImmunizationTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateImmunizationComments() { + OperationsTestCase validateImmunizationCommentsTestCase = new OperationsTestCase( + "validateImmunizationComments", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_COMMENTS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Immunization target) { + target.init(); + target.setNegationInd(true); + } + + @Override + protected void updateToPass(Immunization target) { + target.init(); + + Comment comment = CCDFactory.eINSTANCE.createComment().init(); + target.addAct(comment); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationOperations.validateImmunizationComments( + (Immunization) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationCommentsTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateImmunizationTemplateId() { + OperationsTestCase validateImmunizationTemplateIdTestCase = new OperationsTestCase( + "validateImmunizationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Immunization target) { + + } + + @Override + protected void updateToPass(Immunization target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationOperations.validateImmunizationTemplateId( + (Immunization) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateImmunizationCode() { + OperationsTestCase validateImmunizationCodeTestCase = new OperationsTestCase( + "validateImmunizationCode", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(Immunization target) { + + } + + @Override + protected void updateToPass(Immunization target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationOperations.validateImmunizationCode((Immunization) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateImmunizationStatusCode() { + OperationsTestCase validateImmunizationStatusCodeTestCase = new OperationsTestCase( + "validateImmunizationStatusCode", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Immunization target) { + + } + + @Override + protected void updateToPass(Immunization target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationOperations.validateImmunizationStatusCode( + (Immunization) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateImmunizationMoodCode() { + OperationsTestCase validateImmunizationMoodCodeTestCase = new OperationsTestCase( + "validateImmunizationMoodCode", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Immunization target) { + + } + + @Override + protected void updateToPass(Immunization target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationOperations.validateImmunizationMoodCode( + (Immunization) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateImmunizationEffectiveTime() { + OperationsTestCase validateImmunizationEffectiveTimeTestCase = new OperationsTestCase( + "validateImmunizationEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_IMMUNIZATION_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Immunization target) { + + } + + @Override + protected void updateToPass(Immunization target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.getEffectiveTimes().add(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationOperations.validateImmunizationEffectiveTime( + (Immunization) objectToTest, diagnostician, map); + } + + }; + + validateImmunizationEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ImmunizationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public Immunization create() { + return IHEFactory.eINSTANCE.createImmunization(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ImmunizationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ImmunizationOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ImmunizationsSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ImmunizationsSectionTest.java new file mode 100644 index 000000000..1684328ad --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ImmunizationsSectionTest.java @@ -0,0 +1,193 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.SubstanceAdministration; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.ImmunizationsSection; +import org.openhealthtools.mdht.uml.cda.ihe.operations.ImmunizationsSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Immunizations Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ImmunizationsSection#validateIHEImmunizationsSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Immunizations Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ImmunizationsSection#validateIHEImmunizationsSectionImmunization(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Immunizations Section Immunization}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ImmunizationsSection#getImmunizations() Get Immunizations}
  • + *
+ *

+ * + * @generated + */ + +public class ImmunizationsSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateIHEImmunizationsSectionTemplateId() { + OperationsTestCase validateIHEImmunizationsSectionTemplateIdTestCase = new OperationsTestCase( + "validateIHEImmunizationsSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_IHE_IMMUNIZATIONS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationsSection target) { + + } + + @Override + protected void updateToPass(ImmunizationsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationsSectionOperations.validateIHEImmunizationsSectionTemplateId( + (ImmunizationsSection) objectToTest, diagnostician, map); + } + + }; + + validateIHEImmunizationsSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateIHEImmunizationsSectionImmunization() { + OperationsTestCase validateIHEImmunizationsSectionImmunizationTestCase = new OperationsTestCase( + "validateIHEImmunizationsSectionImmunization", + operationsForOCL.getOCLValue("VALIDATE_IHE_IMMUNIZATIONS_SECTION_IMMUNIZATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ImmunizationsSection target) { + target.init(); + + } + + @Override + protected void updateToPass(ImmunizationsSection target) { + SubstanceAdministration substanceAdministration = IHEFactory.eINSTANCE.createImmunization().init(); + target.addSubstanceAdministration(substanceAdministration); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ImmunizationsSectionOperations.validateIHEImmunizationsSectionImmunization( + (ImmunizationsSection) objectToTest, diagnostician, map); + } + + }; + + validateIHEImmunizationsSectionImmunizationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetImmunizations() { + + ImmunizationsSection target = objectFactory.create(); + target.getImmunizations(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ImmunizationsSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public ImmunizationsSection create() { + return IHEFactory.eINSTANCE.createImmunizationsSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ImmunizationsSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ImmunizationsSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/IntakeOutputSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/IntakeOutputSectionTest.java new file mode 100644 index 000000000..00eb807f0 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/IntakeOutputSectionTest.java @@ -0,0 +1,142 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.IntakeOutputSection; +import org.openhealthtools.mdht.uml.cda.ihe.operations.IntakeOutputSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Intake Output Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.IntakeOutputSection#validateIntakeOutputSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Intake Output Section Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class IntakeOutputSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateIntakeOutputSectionTemplateId() { + OperationsTestCase validateIntakeOutputSectionTemplateIdTestCase = new OperationsTestCase( + "validateIntakeOutputSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_INTAKE_OUTPUT_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(IntakeOutputSection target) { + + } + + @Override + protected void updateToPass(IntakeOutputSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return IntakeOutputSectionOperations.validateIntakeOutputSectionTemplateId( + (IntakeOutputSection) objectToTest, diagnostician, map); + } + + }; + + validateIntakeOutputSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends IntakeOutputSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public IntakeOutputSection create() { + return IHEFactory.eINSTANCE.createIntakeOutputSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends IntakeOutputSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // IntakeOutputSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/IntegumentarySystemSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/IntegumentarySystemSectionTest.java new file mode 100644 index 000000000..a75b8fd71 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/IntegumentarySystemSectionTest.java @@ -0,0 +1,222 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.IntegumentarySystemSection; +import org.openhealthtools.mdht.uml.cda.ihe.operations.IntegumentarySystemSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Integumentary System Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.IntegumentarySystemSection#validateIntegumentarySystemSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Integumentary System Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.IntegumentarySystemSection#validateIntegumentarySystemSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Integumentary System Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.IntegumentarySystemSection#validateIntegumentarySystemSectionProblemEntry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Integumentary System Section Problem Entry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.IntegumentarySystemSection#getProblemEntry() Get Problem Entry}
  • + *
+ *

+ * + * @generated + */ + +public class IntegumentarySystemSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateIntegumentarySystemSectionTemplateId() { + OperationsTestCase validateIntegumentarySystemSectionTemplateIdTestCase = new OperationsTestCase( + "validateIntegumentarySystemSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_INTEGUMENTARY_SYSTEM_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(IntegumentarySystemSection target) { + + } + + @Override + protected void updateToPass(IntegumentarySystemSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return IntegumentarySystemSectionOperations.validateIntegumentarySystemSectionTemplateId( + (IntegumentarySystemSection) objectToTest, diagnostician, map); + } + + }; + + validateIntegumentarySystemSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateIntegumentarySystemSectionCode() { + OperationsTestCase validateIntegumentarySystemSectionCodeTestCase = new OperationsTestCase( + "validateIntegumentarySystemSectionCode", + operationsForOCL.getOCLValue("VALIDATE_INTEGUMENTARY_SYSTEM_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(IntegumentarySystemSection target) { + + } + + @Override + protected void updateToPass(IntegumentarySystemSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return IntegumentarySystemSectionOperations.validateIntegumentarySystemSectionCode( + (IntegumentarySystemSection) objectToTest, diagnostician, map); + } + + }; + + validateIntegumentarySystemSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateIntegumentarySystemSectionProblemEntry() { + OperationsTestCase validateIntegumentarySystemSectionProblemEntryTestCase = new OperationsTestCase( + "validateIntegumentarySystemSectionProblemEntry", + operationsForOCL.getOCLValue("VALIDATE_INTEGUMENTARY_SYSTEM_SECTION_PROBLEM_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(IntegumentarySystemSection target) { + target.init(); + } + + @Override + protected void updateToPass(IntegumentarySystemSection target) { + target.addObservation(IHEFactory.eINSTANCE.createProblemEntry().init()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return IntegumentarySystemSectionOperations.validateIntegumentarySystemSectionProblemEntry( + (IntegumentarySystemSection) objectToTest, diagnostician, map); + } + + }; + + validateIntegumentarySystemSectionProblemEntryTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemEntry() { + + IntegumentarySystemSection target = objectFactory.create(); + target.getProblemEntry(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends IntegumentarySystemSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public IntegumentarySystemSection create() { + return IHEFactory.eINSTANCE.createIntegumentarySystemSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends IntegumentarySystemSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // IntegumentarySystemSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/InternalReferenceTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/InternalReferenceTest.java new file mode 100644 index 000000000..c622bc01f --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/InternalReferenceTest.java @@ -0,0 +1,217 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.InternalReference; +import org.openhealthtools.mdht.uml.cda.ihe.operations.InternalReferenceOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; + +/** + * + * A static utility class that provides operations related to 'Internal Reference' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.InternalReference#validateInternalReferenceTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Internal Reference Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.InternalReference#validateInternalReferenceCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Internal Reference Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.InternalReference#validateInternalReferenceId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Internal Reference Id}
  • + *
+ *

+ * + * @generated + */ + +public class InternalReferenceTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateInternalReferenceTemplateId() { + OperationsTestCase validateInternalReferenceTemplateIdTestCase = new OperationsTestCase( + "validateInternalReferenceTemplateId", + operationsForOCL.getOCLValue("VALIDATE_INTERNAL_REFERENCE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(InternalReference target) { + + } + + @Override + protected void updateToPass(InternalReference target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return InternalReferenceOperations.validateInternalReferenceTemplateId( + (InternalReference) objectToTest, diagnostician, map); + } + + }; + + validateInternalReferenceTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateInternalReferenceCode() { + OperationsTestCase validateInternalReferenceCodeTestCase = new OperationsTestCase( + "validateInternalReferenceCode", + operationsForOCL.getOCLValue("VALIDATE_INTERNAL_REFERENCE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(InternalReference target) { + target.init(); + } + + @Override + protected void updateToPass(InternalReference target) { + CD cd = DatatypesFactory.eINSTANCE.createCD(); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return InternalReferenceOperations.validateInternalReferenceCode( + (InternalReference) objectToTest, diagnostician, map); + } + + }; + + validateInternalReferenceCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateInternalReferenceId() { + OperationsTestCase validateInternalReferenceIdTestCase = new OperationsTestCase( + "validateInternalReferenceId", + operationsForOCL.getOCLValue("VALIDATE_INTERNAL_REFERENCE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(InternalReference target) { + target.init(); + } + + @Override + protected void updateToPass(InternalReference target) { + II ii = DatatypesFactory.eINSTANCE.createII(); + target.getIds().add(ii); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return InternalReferenceOperations.validateInternalReferenceId( + (InternalReference) objectToTest, diagnostician, map); + } + + }; + + validateInternalReferenceIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends InternalReferenceOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public InternalReference create() { + return IHEFactory.eINSTANCE.createInternalReference(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends InternalReferenceOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // InternalReferenceOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/LanguageCommunicationTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/LanguageCommunicationTest.java new file mode 100644 index 000000000..9d7b3b472 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/LanguageCommunicationTest.java @@ -0,0 +1,142 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.LanguageCommunication; +import org.openhealthtools.mdht.uml.cda.ihe.operations.LanguageCommunicationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Language Communication' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.LanguageCommunication#validateIHELanguageCommunicationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Language Communication Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class LanguageCommunicationTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateIHELanguageCommunicationTemplateId() { + OperationsTestCase validateIHELanguageCommunicationTemplateIdTestCase = new OperationsTestCase( + "validateIHELanguageCommunicationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_IHE_LANGUAGE_COMMUNICATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(LanguageCommunication target) { + + } + + @Override + protected void updateToPass(LanguageCommunication target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return LanguageCommunicationOperations.validateIHELanguageCommunicationTemplateId( + (LanguageCommunication) objectToTest, diagnostician, map); + } + + }; + + validateIHELanguageCommunicationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends LanguageCommunicationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public LanguageCommunication create() { + return IHEFactory.eINSTANCE.createLanguageCommunication(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends LanguageCommunicationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // LanguageCommunicationOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/LymphaticSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/LymphaticSectionTest.java new file mode 100644 index 000000000..3da6da8c1 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/LymphaticSectionTest.java @@ -0,0 +1,223 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.LymphaticSection; +import org.openhealthtools.mdht.uml.cda.ihe.operations.LymphaticSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Lymphatic Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.LymphaticSection#validateLymphaticSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Lymphatic Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.LymphaticSection#validateLymphaticSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Lymphatic Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.LymphaticSection#validateLymphaticSectionProblemEntry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Lymphatic Section Problem Entry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.LymphaticSection#getProblemEntry() Get Problem Entry}
  • + *
+ *

+ * + * @generated + */ + +public class LymphaticSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateLymphaticSectionTemplateId() { + OperationsTestCase validateLymphaticSectionTemplateIdTestCase = new OperationsTestCase( + "validateLymphaticSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_LYMPHATIC_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(LymphaticSection target) { + + } + + @Override + protected void updateToPass(LymphaticSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return LymphaticSectionOperations.validateLymphaticSectionTemplateId( + (LymphaticSection) objectToTest, diagnostician, map); + } + + }; + + validateLymphaticSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateLymphaticSectionCode() { + OperationsTestCase validateLymphaticSectionCodeTestCase = new OperationsTestCase( + "validateLymphaticSectionCode", + operationsForOCL.getOCLValue("VALIDATE_LYMPHATIC_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(LymphaticSection target) { + + } + + @Override + protected void updateToPass(LymphaticSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return LymphaticSectionOperations.validateLymphaticSectionCode( + (LymphaticSection) objectToTest, diagnostician, map); + } + + }; + + validateLymphaticSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateLymphaticSectionProblemEntry() { + OperationsTestCase validateLymphaticSectionProblemEntryTestCase = new OperationsTestCase( + "validateLymphaticSectionProblemEntry", + operationsForOCL.getOCLValue("VALIDATE_LYMPHATIC_SECTION_PROBLEM_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(LymphaticSection target) { + target.init(); + } + + @Override + protected void updateToPass(LymphaticSection target) { + + target.addObservation(IHEFactory.eINSTANCE.createProblemEntry().init()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return LymphaticSectionOperations.validateLymphaticSectionProblemEntry( + (LymphaticSection) objectToTest, diagnostician, map); + } + + }; + + validateLymphaticSectionProblemEntryTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemEntry() { + + LymphaticSection target = objectFactory.create(); + target.getProblemEntry(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends LymphaticSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public LymphaticSection create() { + return IHEFactory.eINSTANCE.createLymphaticSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends LymphaticSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // LymphaticSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/MedicalDevicesSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/MedicalDevicesSectionTest.java new file mode 100644 index 000000000..ab1fcd675 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/MedicalDevicesSectionTest.java @@ -0,0 +1,142 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.MedicalDevicesSection; +import org.openhealthtools.mdht.uml.cda.ihe.operations.MedicalDevicesSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Medical Devices Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.MedicalDevicesSection#validateMedicalDevicesSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medical Devices Section Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class MedicalDevicesSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateMedicalDevicesSectionTemplateId() { + OperationsTestCase validateMedicalDevicesSectionTemplateIdTestCase = new OperationsTestCase( + "validateMedicalDevicesSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_MEDICAL_DEVICES_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicalDevicesSection target) { + + } + + @Override + protected void updateToPass(MedicalDevicesSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicalDevicesSectionOperations.validateMedicalDevicesSectionTemplateId( + (MedicalDevicesSection) objectToTest, diagnostician, map); + } + + }; + + validateMedicalDevicesSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends MedicalDevicesSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public MedicalDevicesSection create() { + return IHEFactory.eINSTANCE.createMedicalDevicesSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends MedicalDevicesSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // MedicalDevicesSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/MedicalDocumentTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/MedicalDocumentTest.java new file mode 100644 index 000000000..2965f317c --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/MedicalDocumentTest.java @@ -0,0 +1,142 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.MedicalDocument; +import org.openhealthtools.mdht.uml.cda.ihe.operations.MedicalDocumentOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Medical Document' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.MedicalDocument#validateMedicalDocumentTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medical Document Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class MedicalDocumentTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateMedicalDocumentTemplateId() { + OperationsTestCase validateMedicalDocumentTemplateIdTestCase = new OperationsTestCase( + "validateMedicalDocumentTemplateId", + operationsForOCL.getOCLValue("VALIDATE_MEDICAL_DOCUMENT_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicalDocument target) { + + } + + @Override + protected void updateToPass(MedicalDocument target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicalDocumentOperations.validateMedicalDocumentTemplateId( + (MedicalDocument) objectToTest, diagnostician, map); + } + + }; + + validateMedicalDocumentTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends MedicalDocumentOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public MedicalDocument create() { + return IHEFactory.eINSTANCE.createMedicalDocument(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends MedicalDocumentOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // MedicalDocumentOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/MedicalSummaryTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/MedicalSummaryTest.java new file mode 100644 index 000000000..2104c2e3f --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/MedicalSummaryTest.java @@ -0,0 +1,297 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.Act; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Section; +import org.openhealthtools.mdht.uml.cda.SubstanceAdministration; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.MedicalSummary; +import org.openhealthtools.mdht.uml.cda.ihe.ProblemConcernEntry; +import org.openhealthtools.mdht.uml.cda.ihe.operations.MedicalSummaryOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Medical Summary' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.MedicalSummary#validateMedicalSummaryProblemConcernEntry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medical Summary Problem Concern Entry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.MedicalSummary#validateMedicalSummaryAllergyConcernEntry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medical Summary Allergy Concern Entry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.MedicalSummary#validateMedicalSummaryMedications(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medical Summary Medications}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.MedicalSummary#validateMedicalSummaryTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medical Summary Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.MedicalSummary#validateMedicalSummaryCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medical Summary Code}
  • + *
+ *

+ * + * @generated + */ + +public class MedicalSummaryTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicalSummaryProblemConcernEntry() { + OperationsTestCase validateMedicalSummaryProblemConcernEntryTestCase = new OperationsTestCase( + "validateMedicalSummaryProblemConcernEntry", + operationsForOCL.getOCLValue("VALIDATE_MEDICAL_SUMMARY_PROBLEM_CONCERN_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicalSummary target) { + target.init(); + + } + + @Override + protected void updateToPass(MedicalSummary target) { + ProblemConcernEntry pce = IHEFactory.eINSTANCE.createProblemConcernEntry().init(); + Section section = CDAFactory.eINSTANCE.createSection(); + section.addAct(pce); + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicalSummaryOperations.validateMedicalSummaryProblemConcernEntry( + (MedicalSummary) objectToTest, diagnostician, map); + } + + }; + + validateMedicalSummaryProblemConcernEntryTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicalSummaryAllergyConcernEntry() { + OperationsTestCase validateMedicalSummaryAllergyConcernEntryTestCase = new OperationsTestCase( + "validateMedicalSummaryAllergyConcernEntry", + operationsForOCL.getOCLValue("VALIDATE_MEDICAL_SUMMARY_ALLERGY_CONCERN_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicalSummary target) { + target.init(); + } + + @Override + protected void updateToPass(MedicalSummary target) { + + Section section = CDAFactory.eINSTANCE.createSection(); + Act ac = IHEFactory.eINSTANCE.createAllergyIntoleranceConcern(); + section.addAct(ac); + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicalSummaryOperations.validateMedicalSummaryAllergyConcernEntry( + (MedicalSummary) objectToTest, diagnostician, map); + } + + }; + + validateMedicalSummaryAllergyConcernEntryTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicalSummaryMedications() { + OperationsTestCase validateMedicalSummaryMedicationsTestCase = new OperationsTestCase( + "validateMedicalSummaryMedications", + operationsForOCL.getOCLValue("VALIDATE_MEDICAL_SUMMARY_MEDICATIONS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicalSummary target) { + target.init(); + } + + @Override + protected void updateToPass(MedicalSummary target) { + Section section = CDAFactory.eINSTANCE.createSection(); + SubstanceAdministration substanceAdministration = IHEFactory.eINSTANCE.createNormalDose().init(); + section.addSubstanceAdministration(substanceAdministration); + target.addSection(section); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicalSummaryOperations.validateMedicalSummaryMedications( + (MedicalSummary) objectToTest, diagnostician, map); + } + + }; + + validateMedicalSummaryMedicationsTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicalSummaryTemplateId() { + OperationsTestCase validateMedicalSummaryTemplateIdTestCase = new OperationsTestCase( + "validateMedicalSummaryTemplateId", + operationsForOCL.getOCLValue("VALIDATE_MEDICAL_SUMMARY_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicalSummary target) { + + } + + @Override + protected void updateToPass(MedicalSummary target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicalSummaryOperations.validateMedicalSummaryTemplateId( + (MedicalSummary) objectToTest, diagnostician, map); + } + + }; + + validateMedicalSummaryTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicalSummaryCode() { + OperationsTestCase validateMedicalSummaryCodeTestCase = new OperationsTestCase( + "validateMedicalSummaryCode", + operationsForOCL.getOCLValue("VALIDATE_MEDICAL_SUMMARY_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicalSummary target) { + + } + + @Override + protected void updateToPass(MedicalSummary target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicalSummaryOperations.validateMedicalSummaryCode( + (MedicalSummary) objectToTest, diagnostician, map); + } + + }; + + validateMedicalSummaryCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends MedicalSummaryOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public MedicalSummary create() { + return IHEFactory.eINSTANCE.createMedicalSummary(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends MedicalSummaryOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // MedicalSummaryOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/MedicationFullfillmentInstructionsTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/MedicationFullfillmentInstructionsTest.java new file mode 100644 index 000000000..c1a849cc8 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/MedicationFullfillmentInstructionsTest.java @@ -0,0 +1,289 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.MedicationFullfillmentInstructions; +import org.openhealthtools.mdht.uml.cda.ihe.operations.MedicationFullfillmentInstructionsOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; + +/** + * + * A static utility class that provides operations related to 'Medication Fullfillment Instructions' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.MedicationFullfillmentInstructions#validateMedicationFullfillmentInstructionsTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Fullfillment Instructions Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.MedicationFullfillmentInstructions#validateMedicationFullfillmentInstructionsCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Fullfillment Instructions Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.MedicationFullfillmentInstructions#validateMedicationFullfillmentInstructionsCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Fullfillment Instructions Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.MedicationFullfillmentInstructions#validateMedicationFullfillmentInstructionsStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Fullfillment Instructions Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.MedicationFullfillmentInstructions#validateMedicationFullfillmentInstructionsText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Fullfillment Instructions Text}
  • + *
+ *

+ * + * @generated + */ + +public class MedicationFullfillmentInstructionsTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateMedicationFullfillmentInstructionsTemplateId() { + OperationsTestCase validateMedicationFullfillmentInstructionsTemplateIdTestCase = new OperationsTestCase( + "validateMedicationFullfillmentInstructionsTemplateId", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_FULLFILLMENT_INSTRUCTIONS_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationFullfillmentInstructions target) { + + } + + @Override + protected void updateToPass(MedicationFullfillmentInstructions target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationFullfillmentInstructionsOperations.validateMedicationFullfillmentInstructionsTemplateId( + (MedicationFullfillmentInstructions) objectToTest, diagnostician, map); + } + + }; + + validateMedicationFullfillmentInstructionsTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicationFullfillmentInstructionsCodeP() { + OperationsTestCase validateMedicationFullfillmentInstructionsCodePTestCase = new OperationsTestCase( + "validateMedicationFullfillmentInstructionsCodeP", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_FULLFILLMENT_INSTRUCTIONS_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationFullfillmentInstructions target) { + + } + + @Override + protected void updateToPass(MedicationFullfillmentInstructions target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationFullfillmentInstructionsOperations.validateMedicationFullfillmentInstructionsCodeP( + (MedicationFullfillmentInstructions) objectToTest, diagnostician, map); + } + + }; + + validateMedicationFullfillmentInstructionsCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicationFullfillmentInstructionsCode() { + OperationsTestCase validateMedicationFullfillmentInstructionsCodeTestCase = new OperationsTestCase( + "validateMedicationFullfillmentInstructionsCode", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_FULLFILLMENT_INSTRUCTIONS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationFullfillmentInstructions target) { + + } + + @Override + protected void updateToPass(MedicationFullfillmentInstructions target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationFullfillmentInstructionsOperations.validateMedicationFullfillmentInstructionsCode( + (MedicationFullfillmentInstructions) objectToTest, diagnostician, map); + } + + }; + + validateMedicationFullfillmentInstructionsCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicationFullfillmentInstructionsStatusCode() { + OperationsTestCase validateMedicationFullfillmentInstructionsStatusCodeTestCase = new OperationsTestCase( + "validateMedicationFullfillmentInstructionsStatusCode", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_FULLFILLMENT_INSTRUCTIONS_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationFullfillmentInstructions target) { + + } + + @Override + protected void updateToPass(MedicationFullfillmentInstructions target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationFullfillmentInstructionsOperations.validateMedicationFullfillmentInstructionsStatusCode( + (MedicationFullfillmentInstructions) objectToTest, diagnostician, map); + } + + }; + + validateMedicationFullfillmentInstructionsStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationFullfillmentInstructionsText() { + OperationsTestCase validateMedicationFullfillmentInstructionsTextTestCase = new OperationsTestCase( + "validateMedicationFullfillmentInstructionsText", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_FULLFILLMENT_INSTRUCTIONS_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationFullfillmentInstructions target) { + target.init(); + } + + @Override + protected void updateToPass(MedicationFullfillmentInstructions target) { + + ED instruction = DatatypesFactory.eINSTANCE.createED("instruction"); + target.setText(instruction); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationFullfillmentInstructionsOperations.validateMedicationFullfillmentInstructionsText( + (MedicationFullfillmentInstructions) objectToTest, diagnostician, map); + } + + }; + + validateMedicationFullfillmentInstructionsTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends MedicationFullfillmentInstructionsOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public MedicationFullfillmentInstructions create() { + return IHEFactory.eINSTANCE.createMedicationFullfillmentInstructions(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends MedicationFullfillmentInstructionsOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // MedicationFullfillmentInstructionsOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/MedicationTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/MedicationTest.java new file mode 100644 index 000000000..2859658dc --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/MedicationTest.java @@ -0,0 +1,800 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.math.BigDecimal; +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Consumable; +import org.openhealthtools.mdht.uml.cda.Criterion; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.ManufacturedProduct; +import org.openhealthtools.mdht.uml.cda.Material; +import org.openhealthtools.mdht.uml.cda.Precondition; +import org.openhealthtools.mdht.uml.cda.Supply; +import org.openhealthtools.mdht.uml.cda.ccd.CCDFactory; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.Medication; +import org.openhealthtools.mdht.uml.cda.ihe.ProductEntry; +import org.openhealthtools.mdht.uml.cda.ihe.operations.MedicationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; +import org.openhealthtools.mdht.uml.hl7.datatypes.INT; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_PQ; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.datatypes.TEL; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * + * A static utility class that provides operations related to 'Medication' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.Medication#validateMedicationHasDosing(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Has Dosing}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.Medication#validateMedicationDosingRelationship(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Dosing Relationship}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.Medication#validateMedicationHasProductEntry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Has Product Entry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.Medication#validateMedicationHasIntructionsInversion(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Has Intructions Inversion}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.Medication#validateMedicationProductStrength(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Product Strength}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.Medication#validateMedicationProductName(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Product Name}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.Medication#validateMedicationPreconditionReference(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Precondition Reference}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.Medication#validateMedicationHasSupplyEntryInversion(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Has Supply Entry Inversion}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.Medication#validateMedicationHasFillNumber(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Has Fill Number}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.Medication#validateMedicationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.Medication#validateMedicationApproachSiteCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Approach Site Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.Medication#validateMedicationDoseQuantity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Dose Quantity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.Medication#validateMedicationRateQuantity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Rate Quantity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.Medication#validateMedicationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.Medication#validateMedicationStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.Medication#validateMedicationEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medication Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.Medication#getInternalReferences() Get Internal References}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.Medication#getPatientMedicalInstructionss() Get Patient Medical Instructionss}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.Medication#getSupplyEntry() Get Supply Entry}
  • + *
+ *

+ * + * @generated + */ + +public class MedicationTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationHasDosing() { + OperationsTestCase validateMedicationHasDosingTestCase = new OperationsTestCase( + "validateMedicationHasDosing", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_HAS_DOSING__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Medication target) { + + } + + @Override + protected void updateToPass(Medication target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOperations.validateMedicationHasDosing((Medication) objectToTest, diagnostician, map); + } + + }; + + validateMedicationHasDosingTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationDosingRelationship() { + + class CombinationMedicationObjectFactory implements TestObjectFactory { + public Medication create() { + return IHEFactory.eINSTANCE.createCombinationMedication(); + } + } + OperationsTestCase validateMedicationDosingRelationshipTestCase = new OperationsTestCase( + "validateMedicationDosingRelationship", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_DOSING_RELATIONSHIP__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + new CombinationMedicationObjectFactory()) { + + @Override + protected void updateToFail(Medication target) { + target.init(); + } + + @Override + protected void updateToPass(Medication medication) { + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + medication.getEntryRelationships().add(er); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOperations.validateMedicationDosingRelationship( + (Medication) objectToTest, diagnostician, map); + } + + }; + + validateMedicationDosingRelationshipTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationHasProductEntry() { + OperationsTestCase validateMedicationHasProductEntryTestCase = new OperationsTestCase( + "validateMedicationHasProductEntry", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_HAS_PRODUCT_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToPass(Medication medication) { + ProductEntry pe = IHEFactory.eINSTANCE.createProductEntry().init(); + medication.getConsumable().setManufacturedProduct(pe); + } + + @Override + protected void updateToFail(Medication medication) { + medication.init(); + Consumable c = CDAFactory.eINSTANCE.createConsumable(); + ProductEntry pe = IHEFactory.eINSTANCE.createProductEntry(); + c.setManufacturedProduct(pe); + medication.setConsumable(c); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOperations.validateMedicationHasProductEntry( + (Medication) objectToTest, diagnostician, map); + } + + }; + + validateMedicationHasProductEntryTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationHasIntructionsInversion() { + OperationsTestCase validateMedicationHasIntructionsInversionTestCase = new OperationsTestCase( + "validateMedicationHasIntructionsInversion", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_HAS_INTRUCTIONS_INVERSION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToPass(Medication medication) { + + for (EntryRelationship er : medication.getEntryRelationships()) { + er.setInversionInd(true); + } + + } + + @Override + protected void updateToFail(Medication medication) { + medication.init(); + org.openhealthtools.mdht.uml.cda.ihe.PatientMedicalInstructions pi = IHEFactory.eINSTANCE.createPatientMedicalInstructions().init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setAct(pi); + medication.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOperations.validateMedicationHasIntructionsInversion( + (Medication) objectToTest, diagnostician, map); + } + + }; + + validateMedicationHasIntructionsInversionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationProductStrength() { + OperationsTestCase validateMedicationProductStrengthTestCase = new OperationsTestCase( + "validateMedicationProductStrength", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_PRODUCT_STRENGTH__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToPass(Medication medication) { + + medication.getConsumable().getManufacturedProduct().getManufacturedMaterial().getCode().setOriginalText( + DatatypesFactory.eINSTANCE.createED("Name of Material Here")); + } + + @Override + protected void updateToFail(Medication medication) { + + Consumable c = CDAFactory.eINSTANCE.createConsumable(); + + ManufacturedProduct mp = CDAFactory.eINSTANCE.createManufacturedProduct(); + + Material mm = CDAFactory.eINSTANCE.createMaterial(); + + CE ce = DatatypesFactory.eINSTANCE.createCE("123456", "7890"); + mm.setCode(ce); + + mp.setManufacturedMaterial(mm); + + c.setManufacturedProduct(mp); + + medication.setConsumable(c); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOperations.validateMedicationProductStrength( + (Medication) objectToTest, diagnostician, map); + } + + }; + + validateMedicationProductStrengthTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationProductName() { + OperationsTestCase validateMedicationProductNameTestCase = new OperationsTestCase( + "validateMedicationProductName", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_PRODUCT_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToPass(Medication medication) { + medication.getConsumable().getManufacturedProduct().getManufacturedMaterial().setName( + DatatypesFactory.eINSTANCE.createEN()); + } + + @Override + protected void updateToFail(Medication medication) { + + Consumable c = CDAFactory.eINSTANCE.createConsumable(); + + ManufacturedProduct mp = CDAFactory.eINSTANCE.createManufacturedProduct(); + + Material mm = CDAFactory.eINSTANCE.createMaterial(); + + mp.setManufacturedMaterial(mm); + + c.setManufacturedProduct(mp); + + medication.setConsumable(c); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOperations.validateMedicationProductName((Medication) objectToTest, diagnostician, map); + } + + }; + + validateMedicationProductNameTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationPreconditionReference() { + OperationsTestCase validateMedicationPreconditionReferenceTestCase = new OperationsTestCase( + "validateMedicationPreconditionReference", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_PRECONDITION_REFERENCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + @Override + protected void updateToPass(Medication medication) { + for (Precondition pr : medication.getPreconditions()) { + + TEL value = DatatypesFactory.eINSTANCE.createTEL(); + pr.getCriterion().getText().setReference(value); + } + + } + + @Override + protected void updateToFail(Medication medication) { + Precondition p = CDAFactory.eINSTANCE.createPrecondition(); + Criterion c = CDAFactory.eINSTANCE.createCriterion(); + ED ed = DatatypesFactory.eINSTANCE.createED("Reference String"); + c.setText(ed); + + p.setCriterion(c); + medication.getPreconditions().add(p); + + // self.precondition.criterion.text + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOperations.validateMedicationPreconditionReference( + (Medication) objectToTest, diagnostician, map); + } + + }; + + validateMedicationPreconditionReferenceTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationHasSupplyEntryInversion() { + OperationsTestCase validateMedicationHasSupplyEntryInversionTestCase = new OperationsTestCase( + "validateMedicationHasSupplyEntryInversion", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_HAS_SUPPLY_ENTRY_INVERSION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToPass(Medication medication) { + for (EntryRelationship er : medication.getEntryRelationships()) { + er.setInversionInd(false); + } + } + + @Override + protected void updateToFail(Medication medication) { + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + Supply supply = CDAFactory.eINSTANCE.createSupply(); + er.setSupply(supply); + er.setInversionInd(true); + medication.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOperations.validateMedicationHasSupplyEntryInversion( + (Medication) objectToTest, diagnostician, map); + } + + }; + + validateMedicationHasSupplyEntryInversionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationHasFillNumber() { + OperationsTestCase validateMedicationHasFillNumberTestCase = new OperationsTestCase( + "validateMedicationHasFillNumber", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_HAS_FILL_NUMBER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + @Override + protected void updateToPass(Medication medication) { + for (EntryRelationship er : medication.getEntryRelationships()) { + INT i = DatatypesFactory.eINSTANCE.createINT(); + i.setValue(12345); + er.setSequenceNumber(i); + } + } + + @Override + protected void updateToFail(Medication medication) { + Supply supply = CCDFactory.eINSTANCE.createSupplyActivity().init(); + medication.addSupply(supply); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOperations.validateMedicationHasFillNumber( + (Medication) objectToTest, diagnostician, map); + } + + }; + + validateMedicationHasFillNumberTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicationTemplateId() { + OperationsTestCase validateMedicationTemplateIdTestCase = new OperationsTestCase( + "validateMedicationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Medication target) { + + } + + @Override + protected void updateToPass(Medication target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOperations.validateMedicationTemplateId((Medication) objectToTest, diagnostician, map); + } + + }; + + validateMedicationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationApproachSiteCode() { + OperationsTestCase validateMedicationApproachSiteCodeTestCase = new OperationsTestCase( + "validateMedicationApproachSiteCode", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_APPROACH_SITE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Medication target) { + + } + + @Override + protected void updateToPass(Medication medication) { + medication.init(); + CD e = DatatypesFactory.eINSTANCE.createCE(); + medication.getApproachSiteCodes().add(e); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOperations.validateMedicationApproachSiteCode( + (Medication) objectToTest, diagnostician, map); + } + + }; + + validateMedicationApproachSiteCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationDoseQuantity() { + OperationsTestCase validateMedicationDoseQuantityTestCase = new OperationsTestCase( + "validateMedicationDoseQuantity", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_DOSE_QUANTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Medication target) { + + } + + @Override + protected void updateToPass(Medication medication) { + IVL_PQ value = DatatypesFactory.eINSTANCE.createIVL_PQ(); + value.setValue(new BigDecimal(1)); + medication.setDoseQuantity(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOperations.validateMedicationDoseQuantity( + (Medication) objectToTest, diagnostician, map); + } + + }; + + validateMedicationDoseQuantityTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationRateQuantity() { + OperationsTestCase validateMedicationRateQuantityTestCase = new OperationsTestCase( + "validateMedicationRateQuantity", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_RATE_QUANTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Medication target) { + target.init(); + } + + @Override + protected void updateToPass(Medication medication) { + + IVL_PQ value = DatatypesFactory.eINSTANCE.createIVL_PQ(); + medication.setRateQuantity(value); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOperations.validateMedicationRateQuantity( + (Medication) objectToTest, diagnostician, map); + } + + }; + + validateMedicationRateQuantityTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicationCode() { + OperationsTestCase validateMedicationCodeTestCase = new OperationsTestCase( + "validateMedicationCode", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(Medication target) { + + } + + @Override + protected void updateToPass(Medication target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOperations.validateMedicationCode((Medication) objectToTest, diagnostician, map); + } + + }; + + validateMedicationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationStatusCode() { + OperationsTestCase validateMedicationStatusCodeTestCase = new OperationsTestCase( + "validateMedicationStatusCode", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Medication target) { + + } + + @Override + protected void updateToPass(Medication target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOperations.validateMedicationStatusCode((Medication) objectToTest, diagnostician, map); + } + + }; + + validateMedicationStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMedicationEffectiveTime() { + OperationsTestCase validateMedicationEffectiveTimeTestCase = new OperationsTestCase( + "validateMedicationEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_MEDICATION_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Medication target) { + + } + + @Override + protected void updateToPass(Medication target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.getEffectiveTimes().add(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationOperations.validateMedicationEffectiveTime( + (Medication) objectToTest, diagnostician, map); + } + + }; + + validateMedicationEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetInternalReferences() { + + Medication target = objectFactory.create(); + target.getInternalReferences(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPatientMedicalInstructionss() { + + Medication target = objectFactory.create(); + target.getPatientMedicalInstructionss(); + + } + + /** + * + * @generated + */ + @Test + public void testGetSupplyEntry() { + + Medication target = objectFactory.create(); + target.getSupplyEntry(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends MedicationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated NOT + */ + private static class ObjectFactory implements TestObjectFactory { + + public Medication create() { + return IHEFactory.eINSTANCE.createNormalDose(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends MedicationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // MedicationOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/MedicationsAdministeredSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/MedicationsAdministeredSectionTest.java new file mode 100644 index 000000000..6fe363bbe --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/MedicationsAdministeredSectionTest.java @@ -0,0 +1,177 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.MedicationsAdministeredSection; +import org.openhealthtools.mdht.uml.cda.ihe.operations.MedicationsAdministeredSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Medications Administered Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.MedicationsAdministeredSection#validateMedicationsAdministeredSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medications Administered Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.MedicationsAdministeredSection#validateMedicationsAdministeredSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Medications Administered Section Code}
  • + *
+ *

+ * + * @generated + */ + +public class MedicationsAdministeredSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateMedicationsAdministeredSectionTemplateId() { + OperationsTestCase validateMedicationsAdministeredSectionTemplateIdTestCase = new OperationsTestCase( + "validateMedicationsAdministeredSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_MEDICATIONS_ADMINISTERED_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationsAdministeredSection target) { + + } + + @Override + protected void updateToPass(MedicationsAdministeredSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationsAdministeredSectionOperations.validateMedicationsAdministeredSectionTemplateId( + (MedicationsAdministeredSection) objectToTest, diagnostician, map); + } + + }; + + validateMedicationsAdministeredSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMedicationsAdministeredSectionCode() { + OperationsTestCase validateMedicationsAdministeredSectionCodeTestCase = new OperationsTestCase( + "validateMedicationsAdministeredSectionCode", + operationsForOCL.getOCLValue("VALIDATE_MEDICATIONS_ADMINISTERED_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationsAdministeredSection target) { + + } + + @Override + protected void updateToPass(MedicationsAdministeredSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationsAdministeredSectionOperations.validateMedicationsAdministeredSectionCode( + (MedicationsAdministeredSection) objectToTest, diagnostician, map); + } + + }; + + validateMedicationsAdministeredSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends MedicationsAdministeredSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public MedicationsAdministeredSection create() { + return IHEFactory.eINSTANCE.createMedicationsAdministeredSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends MedicationsAdministeredSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // MedicationsAdministeredSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/MedicationsSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/MedicationsSectionTest.java new file mode 100644 index 000000000..54159951d --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/MedicationsSectionTest.java @@ -0,0 +1,191 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.Medication; +import org.openhealthtools.mdht.uml.cda.ihe.MedicationsSection; +import org.openhealthtools.mdht.uml.cda.ihe.operations.MedicationsSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Medications Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.MedicationsSection#validateIHEMedicationsSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Medications Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.MedicationsSection#validateIHEMedicationsSectionMedication(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Medications Section Medication}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.MedicationsSection#getMedications() Get Medications}
  • + *
+ *

+ * + * @generated + */ + +public class MedicationsSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateIHEMedicationsSectionTemplateId() { + OperationsTestCase validateIHEMedicationsSectionTemplateIdTestCase = new OperationsTestCase( + "validateIHEMedicationsSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_IHE_MEDICATIONS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationsSection target) { + + } + + @Override + protected void updateToPass(MedicationsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationsSectionOperations.validateIHEMedicationsSectionTemplateId( + (MedicationsSection) objectToTest, diagnostician, map); + } + + }; + + validateIHEMedicationsSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateIHEMedicationsSectionMedication() { + OperationsTestCase validateIHEMedicationsSectionMedicationTestCase = new OperationsTestCase( + "validateIHEMedicationsSectionMedication", + operationsForOCL.getOCLValue("VALIDATE_IHE_MEDICATIONS_SECTION_MEDICATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MedicationsSection target) { + target.init(); + } + + @Override + protected void updateToPass(MedicationsSection target) { + Medication sa = IHEFactory.eINSTANCE.createNormalDose().init(); + target.addSubstanceAdministration(sa); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MedicationsSectionOperations.validateIHEMedicationsSectionMedication( + (MedicationsSection) objectToTest, diagnostician, map); + } + + }; + + validateIHEMedicationsSectionMedicationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetMedications() { + + MedicationsSection target = objectFactory.create(); + target.getMedications(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends MedicationsSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public MedicationsSection create() { + return IHEFactory.eINSTANCE.createMedicationsSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends MedicationsSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // MedicationsSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/MouthThroatTeethSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/MouthThroatTeethSectionTest.java new file mode 100644 index 000000000..792b8c78c --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/MouthThroatTeethSectionTest.java @@ -0,0 +1,223 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.MouthThroatTeethSection; +import org.openhealthtools.mdht.uml.cda.ihe.operations.MouthThroatTeethSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Mouth Throat Teeth Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.MouthThroatTeethSection#validateMouthThroatTeethSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Mouth Throat Teeth Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.MouthThroatTeethSection#validateMouthThroatTeethSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Mouth Throat Teeth Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.MouthThroatTeethSection#validateMouthThroatTeethSectionProblemEntry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Mouth Throat Teeth Section Problem Entry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.MouthThroatTeethSection#getProblemEntry() Get Problem Entry}
  • + *
+ *

+ * + * @generated + */ + +public class MouthThroatTeethSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateMouthThroatTeethSectionTemplateId() { + OperationsTestCase validateMouthThroatTeethSectionTemplateIdTestCase = new OperationsTestCase( + "validateMouthThroatTeethSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_MOUTH_THROAT_TEETH_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MouthThroatTeethSection target) { + + } + + @Override + protected void updateToPass(MouthThroatTeethSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MouthThroatTeethSectionOperations.validateMouthThroatTeethSectionTemplateId( + (MouthThroatTeethSection) objectToTest, diagnostician, map); + } + + }; + + validateMouthThroatTeethSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMouthThroatTeethSectionCode() { + OperationsTestCase validateMouthThroatTeethSectionCodeTestCase = new OperationsTestCase( + "validateMouthThroatTeethSectionCode", + operationsForOCL.getOCLValue("VALIDATE_MOUTH_THROAT_TEETH_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MouthThroatTeethSection target) { + + } + + @Override + protected void updateToPass(MouthThroatTeethSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MouthThroatTeethSectionOperations.validateMouthThroatTeethSectionCode( + (MouthThroatTeethSection) objectToTest, diagnostician, map); + } + + }; + + validateMouthThroatTeethSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMouthThroatTeethSectionProblemEntry() { + OperationsTestCase validateMouthThroatTeethSectionProblemEntryTestCase = new OperationsTestCase( + "validateMouthThroatTeethSectionProblemEntry", + operationsForOCL.getOCLValue("VALIDATE_MOUTH_THROAT_TEETH_SECTION_PROBLEM_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MouthThroatTeethSection target) { + target.init(); + } + + @Override + protected void updateToPass(MouthThroatTeethSection target) { + + target.addObservation(IHEFactory.eINSTANCE.createProblemEntry().init()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MouthThroatTeethSectionOperations.validateMouthThroatTeethSectionProblemEntry( + (MouthThroatTeethSection) objectToTest, diagnostician, map); + } + + }; + + validateMouthThroatTeethSectionProblemEntryTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemEntry() { + + MouthThroatTeethSection target = objectFactory.create(); + target.getProblemEntry(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends MouthThroatTeethSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public MouthThroatTeethSection create() { + return IHEFactory.eINSTANCE.createMouthThroatTeethSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends MouthThroatTeethSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // MouthThroatTeethSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/MusculoskeletalSystemSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/MusculoskeletalSystemSectionTest.java new file mode 100644 index 000000000..aa71101e9 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/MusculoskeletalSystemSectionTest.java @@ -0,0 +1,223 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.MusculoskeletalSystemSection; +import org.openhealthtools.mdht.uml.cda.ihe.operations.MusculoskeletalSystemSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Musculoskeletal System Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.MusculoskeletalSystemSection#validateMusculoskeletalSystemSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Musculoskeletal System Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.MusculoskeletalSystemSection#validateMusculoskeletalSystemSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Musculoskeletal System Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.MusculoskeletalSystemSection#validateMusculoskeletalSystemSectionProblemEntry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Musculoskeletal System Section Problem Entry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.MusculoskeletalSystemSection#getProblemEntry() Get Problem Entry}
  • + *
+ *

+ * + * @generated + */ + +public class MusculoskeletalSystemSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateMusculoskeletalSystemSectionTemplateId() { + OperationsTestCase validateMusculoskeletalSystemSectionTemplateIdTestCase = new OperationsTestCase( + "validateMusculoskeletalSystemSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_MUSCULOSKELETAL_SYSTEM_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MusculoskeletalSystemSection target) { + + } + + @Override + protected void updateToPass(MusculoskeletalSystemSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MusculoskeletalSystemSectionOperations.validateMusculoskeletalSystemSectionTemplateId( + (MusculoskeletalSystemSection) objectToTest, diagnostician, map); + } + + }; + + validateMusculoskeletalSystemSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateMusculoskeletalSystemSectionCode() { + OperationsTestCase validateMusculoskeletalSystemSectionCodeTestCase = new OperationsTestCase( + "validateMusculoskeletalSystemSectionCode", + operationsForOCL.getOCLValue("VALIDATE_MUSCULOSKELETAL_SYSTEM_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MusculoskeletalSystemSection target) { + + } + + @Override + protected void updateToPass(MusculoskeletalSystemSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MusculoskeletalSystemSectionOperations.validateMusculoskeletalSystemSectionCode( + (MusculoskeletalSystemSection) objectToTest, diagnostician, map); + } + + }; + + validateMusculoskeletalSystemSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMusculoskeletalSystemSectionProblemEntry() { + OperationsTestCase validateMusculoskeletalSystemSectionProblemEntryTestCase = new OperationsTestCase( + "validateMusculoskeletalSystemSectionProblemEntry", + operationsForOCL.getOCLValue("VALIDATE_MUSCULOSKELETAL_SYSTEM_SECTION_PROBLEM_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(MusculoskeletalSystemSection target) { + target.init(); + } + + @Override + protected void updateToPass(MusculoskeletalSystemSection target) { + + target.addObservation(IHEFactory.eINSTANCE.createProblemEntry().init()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return MusculoskeletalSystemSectionOperations.validateMusculoskeletalSystemSectionProblemEntry( + (MusculoskeletalSystemSection) objectToTest, diagnostician, map); + } + + }; + + validateMusculoskeletalSystemSectionProblemEntryTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemEntry() { + + MusculoskeletalSystemSection target = objectFactory.create(); + target.getProblemEntry(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends MusculoskeletalSystemSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public MusculoskeletalSystemSection create() { + return IHEFactory.eINSTANCE.createMusculoskeletalSystemSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends MusculoskeletalSystemSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // MusculoskeletalSystemSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/NeckSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/NeckSectionTest.java new file mode 100644 index 000000000..d1187f813 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/NeckSectionTest.java @@ -0,0 +1,221 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.NeckSection; +import org.openhealthtools.mdht.uml.cda.ihe.operations.NeckSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Neck Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.NeckSection#validateNeckSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Neck Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.NeckSection#validateNeckSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Neck Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.NeckSection#validateNeckSectionProblemEntry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Neck Section Problem Entry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.NeckSection#getProblemEntry() Get Problem Entry}
  • + *
+ *

+ * + * @generated + */ + +public class NeckSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateNeckSectionTemplateId() { + OperationsTestCase validateNeckSectionTemplateIdTestCase = new OperationsTestCase( + "validateNeckSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_NECK_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(NeckSection target) { + + } + + @Override + protected void updateToPass(NeckSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return NeckSectionOperations.validateNeckSectionTemplateId( + (NeckSection) objectToTest, diagnostician, map); + } + + }; + + validateNeckSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateNeckSectionCode() { + OperationsTestCase validateNeckSectionCodeTestCase = new OperationsTestCase( + "validateNeckSectionCode", + operationsForOCL.getOCLValue("VALIDATE_NECK_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(NeckSection target) { + + } + + @Override + protected void updateToPass(NeckSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return NeckSectionOperations.validateNeckSectionCode((NeckSection) objectToTest, diagnostician, map); + } + + }; + + validateNeckSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateNeckSectionProblemEntry() { + OperationsTestCase validateNeckSectionProblemEntryTestCase = new OperationsTestCase( + "validateNeckSectionProblemEntry", + operationsForOCL.getOCLValue("VALIDATE_NECK_SECTION_PROBLEM_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(NeckSection target) { + target.init(); + } + + @Override + protected void updateToPass(NeckSection target) { + + target.addObservation(IHEFactory.eINSTANCE.createProblemEntry().init()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return NeckSectionOperations.validateNeckSectionProblemEntry( + (NeckSection) objectToTest, diagnostician, map); + } + + }; + + validateNeckSectionProblemEntryTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemEntry() { + + NeckSection target = objectFactory.create(); + target.getProblemEntry(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends NeckSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public NeckSection create() { + return IHEFactory.eINSTANCE.createNeckSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends NeckSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // NeckSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/NeurologicSystemSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/NeurologicSystemSectionTest.java new file mode 100644 index 000000000..38aab04ac --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/NeurologicSystemSectionTest.java @@ -0,0 +1,223 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.NeurologicSystemSection; +import org.openhealthtools.mdht.uml.cda.ihe.operations.NeurologicSystemSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Neurologic System Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.NeurologicSystemSection#validateNeurologicSystemSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Neurologic System Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.NeurologicSystemSection#validateNeurologicSystemSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Neurologic System Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.NeurologicSystemSection#validateNeurologicSystemSectionProblemEntry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Neurologic System Section Problem Entry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.NeurologicSystemSection#getProblemEntry() Get Problem Entry}
  • + *
+ *

+ * + * @generated + */ + +public class NeurologicSystemSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateNeurologicSystemSectionTemplateId() { + OperationsTestCase validateNeurologicSystemSectionTemplateIdTestCase = new OperationsTestCase( + "validateNeurologicSystemSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_NEUROLOGIC_SYSTEM_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(NeurologicSystemSection target) { + + } + + @Override + protected void updateToPass(NeurologicSystemSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return NeurologicSystemSectionOperations.validateNeurologicSystemSectionTemplateId( + (NeurologicSystemSection) objectToTest, diagnostician, map); + } + + }; + + validateNeurologicSystemSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateNeurologicSystemSectionCode() { + OperationsTestCase validateNeurologicSystemSectionCodeTestCase = new OperationsTestCase( + "validateNeurologicSystemSectionCode", + operationsForOCL.getOCLValue("VALIDATE_NEUROLOGIC_SYSTEM_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(NeurologicSystemSection target) { + + } + + @Override + protected void updateToPass(NeurologicSystemSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return NeurologicSystemSectionOperations.validateNeurologicSystemSectionCode( + (NeurologicSystemSection) objectToTest, diagnostician, map); + } + + }; + + validateNeurologicSystemSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateNeurologicSystemSectionProblemEntry() { + OperationsTestCase validateNeurologicSystemSectionProblemEntryTestCase = new OperationsTestCase( + "validateNeurologicSystemSectionProblemEntry", + operationsForOCL.getOCLValue("VALIDATE_NEUROLOGIC_SYSTEM_SECTION_PROBLEM_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(NeurologicSystemSection target) { + target.init(); + } + + @Override + protected void updateToPass(NeurologicSystemSection target) { + + target.addObservation(IHEFactory.eINSTANCE.createProblemEntry().init()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return NeurologicSystemSectionOperations.validateNeurologicSystemSectionProblemEntry( + (NeurologicSystemSection) objectToTest, diagnostician, map); + } + + }; + + validateNeurologicSystemSectionProblemEntryTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemEntry() { + + NeurologicSystemSection target = objectFactory.create(); + target.getProblemEntry(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends NeurologicSystemSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public NeurologicSystemSection create() { + return IHEFactory.eINSTANCE.createNeurologicSystemSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends NeurologicSystemSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // NeurologicSystemSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/NormalDoseTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/NormalDoseTest.java new file mode 100644 index 000000000..d0cf883a5 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/NormalDoseTest.java @@ -0,0 +1,182 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.NormalDose; +import org.openhealthtools.mdht.uml.cda.ihe.operations.NormalDoseOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Normal Dose' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.NormalDose#validateNormalDoseNoSubordinateSubstanceAdministration(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Normal Dose No Subordinate Substance Administration}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.NormalDose#validateNormalDoseTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Normal Dose Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class NormalDoseTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateNormalDoseNoSubordinateSubstanceAdministration() { + OperationsTestCase validateNormalDoseNoSubordinateSubstanceAdministrationTestCase = new OperationsTestCase( + "validateNormalDoseNoSubordinateSubstanceAdministration", + operationsForOCL.getOCLValue("VALIDATE_NORMAL_DOSE_NO_SUBORDINATE_SUBSTANCE_ADMINISTRATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToPass(NormalDose target) { + // target.getSubstanceAdministrations().clear(); + target.getEntryRelationships().clear(); + + // target.addObservation(CCDFactory.eINSTANCE.createMedicationStatusObservation().init()); + + } + + @Override + protected void updateToFail(NormalDose target) { + target.init(); + target.addSubstanceAdministration(CDAFactory.eINSTANCE.createSubstanceAdministration()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return NormalDoseOperations.validateNormalDoseNoSubordinateSubstanceAdministration( + (NormalDose) objectToTest, diagnostician, map); + } + + }; + + validateNormalDoseNoSubordinateSubstanceAdministrationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateNormalDoseTemplateId() { + OperationsTestCase validateNormalDoseTemplateIdTestCase = new OperationsTestCase( + "validateNormalDoseTemplateId", + operationsForOCL.getOCLValue("VALIDATE_NORMAL_DOSE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(NormalDose target) { + + } + + @Override + protected void updateToPass(NormalDose target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return NormalDoseOperations.validateNormalDoseTemplateId((NormalDose) objectToTest, diagnostician, map); + } + + }; + + validateNormalDoseTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends NormalDoseOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public NormalDose create() { + return IHEFactory.eINSTANCE.createNormalDose(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends NormalDoseOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // NormalDoseOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/NoseSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/NoseSectionTest.java new file mode 100644 index 000000000..f6f32984f --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/NoseSectionTest.java @@ -0,0 +1,221 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.NoseSection; +import org.openhealthtools.mdht.uml.cda.ihe.operations.NoseSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Nose Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.NoseSection#validateNoseSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Nose Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.NoseSection#validateNoseSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Nose Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.NoseSection#validateNoseSectionProblemEntry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Nose Section Problem Entry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.NoseSection#getProblemEntry() Get Problem Entry}
  • + *
+ *

+ * + * @generated + */ + +public class NoseSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateNoseSectionTemplateId() { + OperationsTestCase validateNoseSectionTemplateIdTestCase = new OperationsTestCase( + "validateNoseSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_NOSE_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(NoseSection target) { + + } + + @Override + protected void updateToPass(NoseSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return NoseSectionOperations.validateNoseSectionTemplateId( + (NoseSection) objectToTest, diagnostician, map); + } + + }; + + validateNoseSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateNoseSectionCode() { + OperationsTestCase validateNoseSectionCodeTestCase = new OperationsTestCase( + "validateNoseSectionCode", + operationsForOCL.getOCLValue("VALIDATE_NOSE_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(NoseSection target) { + + } + + @Override + protected void updateToPass(NoseSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return NoseSectionOperations.validateNoseSectionCode((NoseSection) objectToTest, diagnostician, map); + } + + }; + + validateNoseSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateNoseSectionProblemEntry() { + OperationsTestCase validateNoseSectionProblemEntryTestCase = new OperationsTestCase( + "validateNoseSectionProblemEntry", + operationsForOCL.getOCLValue("VALIDATE_NOSE_SECTION_PROBLEM_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(NoseSection target) { + target.init(); + } + + @Override + protected void updateToPass(NoseSection target) { + + target.addObservation(IHEFactory.eINSTANCE.createProblemEntry().init()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return NoseSectionOperations.validateNoseSectionProblemEntry( + (NoseSection) objectToTest, diagnostician, map); + } + + }; + + validateNoseSectionProblemEntryTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemEntry() { + + NoseSection target = objectFactory.create(); + target.getProblemEntry(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends NoseSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public NoseSection create() { + return IHEFactory.eINSTANCE.createNoseSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends NoseSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // NoseSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ObservationRequestEntryTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ObservationRequestEntryTest.java new file mode 100644 index 000000000..1d9769195 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ObservationRequestEntryTest.java @@ -0,0 +1,142 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.ObservationRequestEntry; +import org.openhealthtools.mdht.uml.cda.ihe.operations.ObservationRequestEntryOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Observation Request Entry' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ObservationRequestEntry#validateObservationRequestEntryTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Observation Request Entry Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class ObservationRequestEntryTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateObservationRequestEntryTemplateId() { + OperationsTestCase validateObservationRequestEntryTemplateIdTestCase = new OperationsTestCase( + "validateObservationRequestEntryTemplateId", + operationsForOCL.getOCLValue("VALIDATE_OBSERVATION_REQUEST_ENTRY_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ObservationRequestEntry target) { + + } + + @Override + protected void updateToPass(ObservationRequestEntry target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ObservationRequestEntryOperations.validateObservationRequestEntryTemplateId( + (ObservationRequestEntry) objectToTest, diagnostician, map); + } + + }; + + validateObservationRequestEntryTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ObservationRequestEntryOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public ObservationRequestEntry create() { + return IHEFactory.eINSTANCE.createObservationRequestEntry(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ObservationRequestEntryOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ObservationRequestEntryOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/PHRExtractTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/PHRExtractTest.java new file mode 100644 index 000000000..20b25ec4a --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/PHRExtractTest.java @@ -0,0 +1,141 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.PHRExtract; +import org.openhealthtools.mdht.uml.cda.ihe.operations.PHRExtractOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'PHR Extract' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PHRExtract#validatePHRExtractTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate PHR Extract Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class PHRExtractTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidatePHRExtractTemplateId() { + OperationsTestCase validatePHRExtractTemplateIdTestCase = new OperationsTestCase( + "validatePHRExtractTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PHR_EXTRACT_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PHRExtract target) { + + } + + @Override + protected void updateToPass(PHRExtract target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PHRExtractOperations.validatePHRExtractTemplateId((PHRExtract) objectToTest, diagnostician, map); + } + + }; + + validatePHRExtractTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PHRExtractOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public PHRExtract create() { + return IHEFactory.eINSTANCE.createPHRExtract(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PHRExtractOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PHRExtractOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/PHRUpdateTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/PHRUpdateTest.java new file mode 100644 index 000000000..3ba31c023 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/PHRUpdateTest.java @@ -0,0 +1,141 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.PHRUpdate; +import org.openhealthtools.mdht.uml.cda.ihe.operations.PHRUpdateOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'PHR Update' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PHRUpdate#validatePHRUpdateTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate PHR Update Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class PHRUpdateTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidatePHRUpdateTemplateId() { + OperationsTestCase validatePHRUpdateTemplateIdTestCase = new OperationsTestCase( + "validatePHRUpdateTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PHR_UPDATE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PHRUpdate target) { + + } + + @Override + protected void updateToPass(PHRUpdate target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PHRUpdateOperations.validatePHRUpdateTemplateId((PHRUpdate) objectToTest, diagnostician, map); + } + + }; + + validatePHRUpdateTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PHRUpdateOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public PHRUpdate create() { + return IHEFactory.eINSTANCE.createPHRUpdate(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PHRUpdateOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PHRUpdateOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/PatientContactGuardianTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/PatientContactGuardianTest.java new file mode 100644 index 000000000..ecf850b28 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/PatientContactGuardianTest.java @@ -0,0 +1,285 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.PatientContactGuardian; +import org.openhealthtools.mdht.uml.cda.ihe.operations.PatientContactGuardianOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.AD; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.TEL; + +/** + * + * A static utility class that provides operations related to 'Patient Contact Guardian' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PatientContactGuardian#validatePatientContactGuardianTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Contact Guardian Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PatientContactGuardian#validatePatientContactGuardianAddr(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Contact Guardian Addr}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PatientContactGuardian#validatePatientContactGuardianClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Contact Guardian Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PatientContactGuardian#validatePatientContactGuardianCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Contact Guardian Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PatientContactGuardian#validatePatientContactGuardianTelecom(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Contact Guardian Telecom}
  • + *
+ *

+ * + * @generated + */ + +public class PatientContactGuardianTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidatePatientContactGuardianTemplateId() { + OperationsTestCase validatePatientContactGuardianTemplateIdTestCase = new OperationsTestCase( + "validatePatientContactGuardianTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_CONTACT_GUARDIAN_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PatientContactGuardian target) { + + } + + @Override + protected void updateToPass(PatientContactGuardian target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PatientContactGuardianOperations.validatePatientContactGuardianTemplateId( + (PatientContactGuardian) objectToTest, diagnostician, map); + } + + }; + + validatePatientContactGuardianTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePatientContactGuardianAddr() { + OperationsTestCase validatePatientContactGuardianAddrTestCase = new OperationsTestCase( + "validatePatientContactGuardianAddr", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_CONTACT_GUARDIAN_ADDR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PatientContactGuardian target) { + target.init(); + } + + @Override + protected void updateToPass(PatientContactGuardian target) { + AD ad = DatatypesFactory.eINSTANCE.createAD(); + target.getAddrs().add(ad); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PatientContactGuardianOperations.validatePatientContactGuardianAddr( + (PatientContactGuardian) objectToTest, diagnostician, map); + } + + }; + + validatePatientContactGuardianAddrTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePatientContactGuardianClassCode() { + OperationsTestCase validatePatientContactGuardianClassCodeTestCase = new OperationsTestCase( + "validatePatientContactGuardianClassCode", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_CONTACT_GUARDIAN_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PatientContactGuardian target) { + + } + + @Override + protected void updateToPass(PatientContactGuardian target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PatientContactGuardianOperations.validatePatientContactGuardianClassCode( + (PatientContactGuardian) objectToTest, diagnostician, map); + } + + }; + + validatePatientContactGuardianClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePatientContactGuardianCode() { + OperationsTestCase validatePatientContactGuardianCodeTestCase = new OperationsTestCase( + "validatePatientContactGuardianCode", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_CONTACT_GUARDIAN_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PatientContactGuardian target) { + + } + + @Override + protected void updateToPass(PatientContactGuardian target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PatientContactGuardianOperations.validatePatientContactGuardianCode( + (PatientContactGuardian) objectToTest, diagnostician, map); + } + + }; + + validatePatientContactGuardianCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePatientContactGuardianTelecom() { + OperationsTestCase validatePatientContactGuardianTelecomTestCase = new OperationsTestCase( + "validatePatientContactGuardianTelecom", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_CONTACT_GUARDIAN_TELECOM__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PatientContactGuardian target) { + target.init(); + } + + @Override + protected void updateToPass(PatientContactGuardian target) { + TEL tel = DatatypesFactory.eINSTANCE.createTEL(); + target.getTelecoms().add(tel); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PatientContactGuardianOperations.validatePatientContactGuardianTelecom( + (PatientContactGuardian) objectToTest, diagnostician, map); + } + + }; + + validatePatientContactGuardianTelecomTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PatientContactGuardianOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public PatientContactGuardian create() { + return IHEFactory.eINSTANCE.createPatientContactGuardian(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PatientContactGuardianOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PatientContactGuardianOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/PatientContactParticipantTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/PatientContactParticipantTest.java new file mode 100644 index 000000000..32f025cb3 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/PatientContactParticipantTest.java @@ -0,0 +1,214 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.PatientContactParticipant; +import org.openhealthtools.mdht.uml.cda.ihe.operations.PatientContactParticipantOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; + +/** + * + * A static utility class that provides operations related to 'Patient Contact Participant' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PatientContactParticipant#validatePatientContactParticipantTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Contact Participant Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PatientContactParticipant#validatePatientContactParticipantTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Contact Participant Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PatientContactParticipant#validatePatientContactParticipantTypeCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Contact Participant Type Code}
  • + *
+ *

+ * + * @generated + */ + +public class PatientContactParticipantTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidatePatientContactParticipantTemplateId() { + OperationsTestCase validatePatientContactParticipantTemplateIdTestCase = new OperationsTestCase( + "validatePatientContactParticipantTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_CONTACT_PARTICIPANT_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PatientContactParticipant target) { + + } + + @Override + protected void updateToPass(PatientContactParticipant target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PatientContactParticipantOperations.validatePatientContactParticipantTemplateId( + (PatientContactParticipant) objectToTest, diagnostician, map); + } + + }; + + validatePatientContactParticipantTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePatientContactParticipantTime() { + OperationsTestCase validatePatientContactParticipantTimeTestCase = new OperationsTestCase( + "validatePatientContactParticipantTime", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_CONTACT_PARTICIPANT_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PatientContactParticipant target) { + target.init(); + } + + @Override + protected void updateToPass(PatientContactParticipant target) { + IVL_TS time = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setTime(time); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PatientContactParticipantOperations.validatePatientContactParticipantTime( + (PatientContactParticipant) objectToTest, diagnostician, map); + } + + }; + + validatePatientContactParticipantTimeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePatientContactParticipantTypeCode() { + OperationsTestCase validatePatientContactParticipantTypeCodeTestCase = new OperationsTestCase( + "validatePatientContactParticipantTypeCode", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_CONTACT_PARTICIPANT_TYPE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PatientContactParticipant target) { + + } + + @Override + protected void updateToPass(PatientContactParticipant target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PatientContactParticipantOperations.validatePatientContactParticipantTypeCode( + (PatientContactParticipant) objectToTest, diagnostician, map); + } + + }; + + validatePatientContactParticipantTypeCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PatientContactParticipantOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public PatientContactParticipant create() { + return IHEFactory.eINSTANCE.createPatientContactParticipant(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PatientContactParticipantOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PatientContactParticipantOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/PatientContactTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/PatientContactTest.java new file mode 100644 index 000000000..f90f903e0 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/PatientContactTest.java @@ -0,0 +1,46 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Patient Contact' model objects. + * + * + * + * @generated + */ + +public class PatientContactTest extends CDAValidationTest { + + /** + * No Operations Test + * @generated + */ + @Test + public void testNoOperations() { + } + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PatientContactOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/PatientMedicalInstructionsTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/PatientMedicalInstructionsTest.java new file mode 100644 index 000000000..1ce0cd2d0 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/PatientMedicalInstructionsTest.java @@ -0,0 +1,323 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.PatientMedicalInstructions; +import org.openhealthtools.mdht.uml.cda.ihe.operations.PatientMedicalInstructionsOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; + +/** + * + * A static utility class that provides operations related to 'Patient Medical Instructions' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PatientMedicalInstructions#validatePatientMedicalInstructionsTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Medical Instructions Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PatientMedicalInstructions#validatePatientMedicalInstructionsClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Medical Instructions Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PatientMedicalInstructions#validatePatientMedicalInstructionsCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Medical Instructions Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PatientMedicalInstructions#validatePatientMedicalInstructionsCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Medical Instructions Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PatientMedicalInstructions#validatePatientMedicalInstructionsStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Medical Instructions Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PatientMedicalInstructions#validatePatientMedicalInstructionsText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Patient Medical Instructions Text}
  • + *
+ *

+ * + * @generated + */ + +public class PatientMedicalInstructionsTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidatePatientMedicalInstructionsTemplateId() { + OperationsTestCase validatePatientMedicalInstructionsTemplateIdTestCase = new OperationsTestCase( + "validatePatientMedicalInstructionsTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_MEDICAL_INSTRUCTIONS_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PatientMedicalInstructions target) { + + } + + @Override + protected void updateToPass(PatientMedicalInstructions target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PatientMedicalInstructionsOperations.validatePatientMedicalInstructionsTemplateId( + (PatientMedicalInstructions) objectToTest, diagnostician, map); + } + + }; + + validatePatientMedicalInstructionsTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePatientMedicalInstructionsClassCode() { + OperationsTestCase validatePatientMedicalInstructionsClassCodeTestCase = new OperationsTestCase( + "validatePatientMedicalInstructionsClassCode", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_MEDICAL_INSTRUCTIONS_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PatientMedicalInstructions target) { + + } + + @Override + protected void updateToPass(PatientMedicalInstructions target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PatientMedicalInstructionsOperations.validatePatientMedicalInstructionsClassCode( + (PatientMedicalInstructions) objectToTest, diagnostician, map); + } + + }; + + validatePatientMedicalInstructionsClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePatientMedicalInstructionsCodeP() { + OperationsTestCase validatePatientMedicalInstructionsCodePTestCase = new OperationsTestCase( + "validatePatientMedicalInstructionsCodeP", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_MEDICAL_INSTRUCTIONS_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PatientMedicalInstructions target) { + + } + + @Override + protected void updateToPass(PatientMedicalInstructions target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PatientMedicalInstructionsOperations.validatePatientMedicalInstructionsCodeP( + (PatientMedicalInstructions) objectToTest, diagnostician, map); + } + + }; + + validatePatientMedicalInstructionsCodePTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePatientMedicalInstructionsCode() { + OperationsTestCase validatePatientMedicalInstructionsCodeTestCase = new OperationsTestCase( + "validatePatientMedicalInstructionsCode", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_MEDICAL_INSTRUCTIONS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PatientMedicalInstructions target) { + + } + + @Override + protected void updateToPass(PatientMedicalInstructions target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PatientMedicalInstructionsOperations.validatePatientMedicalInstructionsCode( + (PatientMedicalInstructions) objectToTest, diagnostician, map); + } + + }; + + validatePatientMedicalInstructionsCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePatientMedicalInstructionsStatusCode() { + OperationsTestCase validatePatientMedicalInstructionsStatusCodeTestCase = new OperationsTestCase( + "validatePatientMedicalInstructionsStatusCode", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_MEDICAL_INSTRUCTIONS_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PatientMedicalInstructions target) { + + } + + @Override + protected void updateToPass(PatientMedicalInstructions target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PatientMedicalInstructionsOperations.validatePatientMedicalInstructionsStatusCode( + (PatientMedicalInstructions) objectToTest, diagnostician, map); + } + + }; + + validatePatientMedicalInstructionsStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePatientMedicalInstructionsText() { + OperationsTestCase validatePatientMedicalInstructionsTextTestCase = new OperationsTestCase( + "validatePatientMedicalInstructionsText", + operationsForOCL.getOCLValue("VALIDATE_PATIENT_MEDICAL_INSTRUCTIONS_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PatientMedicalInstructions target) { + target.init(); + } + + @Override + protected void updateToPass(PatientMedicalInstructions target) { + ED text = DatatypesFactory.eINSTANCE.createED("text"); + target.setText(text); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PatientMedicalInstructionsOperations.validatePatientMedicalInstructionsText( + (PatientMedicalInstructions) objectToTest, diagnostician, map); + } + + }; + + validatePatientMedicalInstructionsTextTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PatientMedicalInstructionsOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public PatientMedicalInstructions create() { + return IHEFactory.eINSTANCE.createPatientMedicalInstructions(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PatientMedicalInstructionsOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PatientMedicalInstructionsOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/PayerEntryTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/PayerEntryTest.java new file mode 100644 index 000000000..e3c187b65 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/PayerEntryTest.java @@ -0,0 +1,142 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.PayerEntry; +import org.openhealthtools.mdht.uml.cda.ihe.operations.PayerEntryOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Payer Entry' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PayerEntry#validatePolicyActivityTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Policy Activity Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class PayerEntryTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidatePolicyActivityTemplateId() { + OperationsTestCase validatePolicyActivityTemplateIdTestCase = new OperationsTestCase( + "validatePolicyActivityTemplateId", + operationsForOCL.getOCLValue("VALIDATE_POLICY_ACTIVITY_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PayerEntry target) { + + } + + @Override + protected void updateToPass(PayerEntry target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PayerEntryOperations.validatePolicyActivityTemplateId( + (PayerEntry) objectToTest, diagnostician, map); + } + + }; + + validatePolicyActivityTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PayerEntryOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public PayerEntry create() { + return IHEFactory.eINSTANCE.createPayerEntry(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PayerEntryOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PayerEntryOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/PayersSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/PayersSectionTest.java new file mode 100644 index 000000000..30dedb35d --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/PayersSectionTest.java @@ -0,0 +1,193 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.CoverageEntry; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.PayersSection; +import org.openhealthtools.mdht.uml.cda.ihe.operations.PayersSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Payers Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PayersSection#validateIHEPayersSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Payers Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PayersSection#validateIHEPayersSectionCoverageEntry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Payers Section Coverage Entry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PayersSection#getCoverageEntries() Get Coverage Entries}
  • + *
+ *

+ * + * @generated + */ + +public class PayersSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateIHEPayersSectionTemplateId() { + OperationsTestCase validateIHEPayersSectionTemplateIdTestCase = new OperationsTestCase( + "validateIHEPayersSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_IHE_PAYERS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PayersSection target) { + + } + + @Override + protected void updateToPass(PayersSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PayersSectionOperations.validateIHEPayersSectionTemplateId( + (PayersSection) objectToTest, diagnostician, map); + } + + }; + + validateIHEPayersSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateIHEPayersSectionCoverageEntry() { + OperationsTestCase validateIHEPayersSectionCoverageEntryTestCase = new OperationsTestCase( + "validateIHEPayersSectionCoverageEntry", + operationsForOCL.getOCLValue("VALIDATE_IHE_PAYERS_SECTION_COVERAGE_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PayersSection target) { + target.init(); + + } + + @Override + protected void updateToPass(PayersSection target) { + CoverageEntry entry = IHEFactory.eINSTANCE.createCoverageEntry().init(); + target.addAct(entry); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PayersSectionOperations.validateIHEPayersSectionCoverageEntry( + (PayersSection) objectToTest, diagnostician, map); + } + + }; + + validateIHEPayersSectionCoverageEntryTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetCoverageEntries() { + + PayersSection target = objectFactory.create(); + target.getCoverageEntries(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PayersSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public PayersSection create() { + return IHEFactory.eINSTANCE.createPayersSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PayersSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PayersSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/PhysicalExamNarrativeSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/PhysicalExamNarrativeSectionTest.java new file mode 100644 index 000000000..a1bb279d3 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/PhysicalExamNarrativeSectionTest.java @@ -0,0 +1,177 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamNarrativeSection; +import org.openhealthtools.mdht.uml.cda.ihe.operations.PhysicalExamNarrativeSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Physical Exam Narrative Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamNarrativeSection#validatePhysicalExamNarrativeSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physical Exam Narrative Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamNarrativeSection#validatePhysicalExamNarrativeSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physical Exam Narrative Section Code}
  • + *
+ *

+ * + * @generated + */ + +public class PhysicalExamNarrativeSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidatePhysicalExamNarrativeSectionTemplateId() { + OperationsTestCase validatePhysicalExamNarrativeSectionTemplateIdTestCase = new OperationsTestCase( + "validatePhysicalExamNarrativeSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PHYSICAL_EXAM_NARRATIVE_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicalExamNarrativeSection target) { + + } + + @Override + protected void updateToPass(PhysicalExamNarrativeSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicalExamNarrativeSectionOperations.validatePhysicalExamNarrativeSectionTemplateId( + (PhysicalExamNarrativeSection) objectToTest, diagnostician, map); + } + + }; + + validatePhysicalExamNarrativeSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePhysicalExamNarrativeSectionCode() { + OperationsTestCase validatePhysicalExamNarrativeSectionCodeTestCase = new OperationsTestCase( + "validatePhysicalExamNarrativeSectionCode", + operationsForOCL.getOCLValue("VALIDATE_PHYSICAL_EXAM_NARRATIVE_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicalExamNarrativeSection target) { + + } + + @Override + protected void updateToPass(PhysicalExamNarrativeSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicalExamNarrativeSectionOperations.validatePhysicalExamNarrativeSectionCode( + (PhysicalExamNarrativeSection) objectToTest, diagnostician, map); + } + + }; + + validatePhysicalExamNarrativeSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PhysicalExamNarrativeSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public PhysicalExamNarrativeSection create() { + return IHEFactory.eINSTANCE.createPhysicalExamNarrativeSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PhysicalExamNarrativeSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PhysicalExamNarrativeSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/PhysicalExamSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/PhysicalExamSectionTest.java new file mode 100644 index 000000000..a9ade955d --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/PhysicalExamSectionTest.java @@ -0,0 +1,1542 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.AbdomenSection; +import org.openhealthtools.mdht.uml.cda.ihe.BreastSection; +import org.openhealthtools.mdht.uml.cda.ihe.ChestWallSection; +import org.openhealthtools.mdht.uml.cda.ihe.EarsNoseMouthThroatSection; +import org.openhealthtools.mdht.uml.cda.ihe.EarsSection; +import org.openhealthtools.mdht.uml.cda.ihe.EndocrineSystemSection; +import org.openhealthtools.mdht.uml.cda.ihe.ExtremitiesSection; +import org.openhealthtools.mdht.uml.cda.ihe.EyesSection; +import org.openhealthtools.mdht.uml.cda.ihe.GeneralAppearanceSection; +import org.openhealthtools.mdht.uml.cda.ihe.GenitaliaSection; +import org.openhealthtools.mdht.uml.cda.ihe.HeadSection; +import org.openhealthtools.mdht.uml.cda.ihe.HeartSection; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.IntegumentarySystemSection; +import org.openhealthtools.mdht.uml.cda.ihe.LymphaticSection; +import org.openhealthtools.mdht.uml.cda.ihe.MouthThroatTeethSection; +import org.openhealthtools.mdht.uml.cda.ihe.MusculoskeletalSystemSection; +import org.openhealthtools.mdht.uml.cda.ihe.NeckSection; +import org.openhealthtools.mdht.uml.cda.ihe.NeurologicSystemSection; +import org.openhealthtools.mdht.uml.cda.ihe.NoseSection; +import org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection; +import org.openhealthtools.mdht.uml.cda.ihe.RectumSection; +import org.openhealthtools.mdht.uml.cda.ihe.RespiratorySystemSection; +import org.openhealthtools.mdht.uml.cda.ihe.ThoraxLungsSection; +import org.openhealthtools.mdht.uml.cda.ihe.VesselsSection; +import org.openhealthtools.mdht.uml.cda.ihe.VisibleImplantedMedicalDevicesSection; +import org.openhealthtools.mdht.uml.cda.ihe.VitalSignsSection; +import org.openhealthtools.mdht.uml.cda.ihe.operations.PhysicalExamSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Physical Exam Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#validatePhysicalExamSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physical Exam Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#validatePhysicalExamSectionVitalSignsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physical Exam Section Vital Signs Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#validatePhysicalExamSectionGeneralAppearanceSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physical Exam Section General Appearance Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#validatePhysicalExamSectionVisibleImplantedMedicalDevicesSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physical Exam Section Visible Implanted Medical Devices Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#validatePhysicalExamSectionIntegumentarySystemSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physical Exam Section Integumentary System Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#validatePhysicalExamSectionHeadSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physical Exam Section Head Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#validatePhysicalExamSectionEyesSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physical Exam Section Eyes Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#validatePhysicalExamSectionEarsNoseMouthThroatSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physical Exam Section Ears Nose Mouth Throat Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#validatePhysicalExamSectionEarsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physical Exam Section Ears Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#validatePhysicalExamSectionNoseSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physical Exam Section Nose Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#validatePhysicalExamSectionMouthThroatTeethSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physical Exam Section Mouth Throat Teeth Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#validatePhysicalExamSectionNeckSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physical Exam Section Neck Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#validatePhysicalExamSectionEndocrineSystemSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physical Exam Section Endocrine System Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#validatePhysicalExamSectionThoraxLungsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physical Exam Section Thorax Lungs Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#validatePhysicalExamSectionChestWallSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physical Exam Section Chest Wall Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#validatePhysicalExamSectionBreastSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physical Exam Section Breast Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#validatePhysicalExamSectionHeartSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physical Exam Section Heart Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#validatePhysicalExamSectionRespiratorySystemSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physical Exam Section Respiratory System Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#validatePhysicalExamSectionAbdomenSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physical Exam Section Abdomen Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#validatePhysicalExamSectionLymphaticSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physical Exam Section Lymphatic Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#validatePhysicalExamSectionVesselsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physical Exam Section Vessels Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#validatePhysicalExamSectionMusculoskeletalSystemSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physical Exam Section Musculoskeletal System Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#validatePhysicalExamSectionNeurologicSystemSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physical Exam Section Neurologic System Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#validatePhysicalExamSectionGenitaliaSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physical Exam Section Genitalia Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#validatePhysicalExamSectionRectumSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physical Exam Section Rectum Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#validatePhysicalExamSectionExtremitiesSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Physical Exam Section Extremities Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#getVitalSignsSection() Get Vital Signs Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#getGeneralAppearanceSection() Get General Appearance Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#getVisibleImplantedMedicalDevicesSection() Get Visible Implanted Medical Devices Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#getIntegumentarySystemSection() Get Integumentary System Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#getHeadSection() Get Head Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#getEyesSection() Get Eyes Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#getEarsNoseMouthThroatSection() Get Ears Nose Mouth Throat Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#getEarsSection() Get Ears Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#getNoseSection() Get Nose Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#getMouthThroatTeethSection() Get Mouth Throat Teeth Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#getNeckSection() Get Neck Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#getEndocrineSystemSection() Get Endocrine System Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#getThoraxLungsSection() Get Thorax Lungs Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#getChestWallSection() Get Chest Wall Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#getBreastSection() Get Breast Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#getHeartSection() Get Heart Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#getRespiratorySystemSection() Get Respiratory System Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#getAbdomenSection() Get Abdomen Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#getLymphaticSection() Get Lymphatic Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#getVesselsSection() Get Vessels Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#getMusculoskeletalSystemSection() Get Musculoskeletal System Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#getNeurologicSystemSection() Get Neurologic System Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#getGenitaliaSection() Get Genitalia Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#getRectumSection() Get Rectum Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PhysicalExamSection#getExtremitiesSection() Get Extremities Section}
  • + *
+ *

+ * + * @generated + */ + +public class PhysicalExamSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidatePhysicalExamSectionTemplateId() { + OperationsTestCase validatePhysicalExamSectionTemplateIdTestCase = new OperationsTestCase( + "validatePhysicalExamSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PHYSICAL_EXAM_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicalExamSection target) { + + } + + @Override + protected void updateToPass(PhysicalExamSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicalExamSectionOperations.validatePhysicalExamSectionTemplateId( + (PhysicalExamSection) objectToTest, diagnostician, map); + } + + }; + + validatePhysicalExamSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePhysicalExamSectionVitalSignsSection() { + OperationsTestCase validatePhysicalExamSectionVitalSignsSectionTestCase = new OperationsTestCase( + "validatePhysicalExamSectionVitalSignsSection", + operationsForOCL.getOCLValue("VALIDATE_PHYSICAL_EXAM_SECTION_VITAL_SIGNS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicalExamSection target) { + + } + + @Override + protected void updateToPass(PhysicalExamSection target) { + target.init(); + + /* VitalSignsSection */ + VitalSignsSection section = + + IHEFactory.eINSTANCE.createVitalSignsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicalExamSectionOperations.validatePhysicalExamSectionVitalSignsSection( + (PhysicalExamSection) objectToTest, diagnostician, map); + } + + }; + + validatePhysicalExamSectionVitalSignsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePhysicalExamSectionGeneralAppearanceSection() { + OperationsTestCase validatePhysicalExamSectionGeneralAppearanceSectionTestCase = new OperationsTestCase( + "validatePhysicalExamSectionGeneralAppearanceSection", + operationsForOCL.getOCLValue("VALIDATE_PHYSICAL_EXAM_SECTION_GENERAL_APPEARANCE_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicalExamSection target) { + + } + + @Override + protected void updateToPass(PhysicalExamSection target) { + target.init(); + + /* GeneralAppearanceSection */ + GeneralAppearanceSection section = + + IHEFactory.eINSTANCE.createGeneralAppearanceSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicalExamSectionOperations.validatePhysicalExamSectionGeneralAppearanceSection( + (PhysicalExamSection) objectToTest, diagnostician, map); + } + + }; + + validatePhysicalExamSectionGeneralAppearanceSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePhysicalExamSectionVisibleImplantedMedicalDevicesSection() { + OperationsTestCase validatePhysicalExamSectionVisibleImplantedMedicalDevicesSectionTestCase = new OperationsTestCase( + "validatePhysicalExamSectionVisibleImplantedMedicalDevicesSection", + operationsForOCL.getOCLValue("VALIDATE_PHYSICAL_EXAM_SECTION_VISIBLE_IMPLANTED_MEDICAL_DEVICES_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicalExamSection target) { + + } + + @Override + protected void updateToPass(PhysicalExamSection target) { + target.init(); + + /* VisibleImplantedMedicalDevicesSection */ + VisibleImplantedMedicalDevicesSection section = + + IHEFactory.eINSTANCE.createVisibleImplantedMedicalDevicesSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicalExamSectionOperations.validatePhysicalExamSectionVisibleImplantedMedicalDevicesSection( + (PhysicalExamSection) objectToTest, diagnostician, map); + } + + }; + + validatePhysicalExamSectionVisibleImplantedMedicalDevicesSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePhysicalExamSectionIntegumentarySystemSection() { + OperationsTestCase validatePhysicalExamSectionIntegumentarySystemSectionTestCase = new OperationsTestCase( + "validatePhysicalExamSectionIntegumentarySystemSection", + operationsForOCL.getOCLValue("VALIDATE_PHYSICAL_EXAM_SECTION_INTEGUMENTARY_SYSTEM_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicalExamSection target) { + + } + + @Override + protected void updateToPass(PhysicalExamSection target) { + target.init(); + + /* IntegumentarySystemSection */ + IntegumentarySystemSection section = + + IHEFactory.eINSTANCE.createIntegumentarySystemSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicalExamSectionOperations.validatePhysicalExamSectionIntegumentarySystemSection( + (PhysicalExamSection) objectToTest, diagnostician, map); + } + + }; + + validatePhysicalExamSectionIntegumentarySystemSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePhysicalExamSectionHeadSection() { + OperationsTestCase validatePhysicalExamSectionHeadSectionTestCase = new OperationsTestCase( + "validatePhysicalExamSectionHeadSection", + operationsForOCL.getOCLValue("VALIDATE_PHYSICAL_EXAM_SECTION_HEAD_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicalExamSection target) { + + } + + @Override + protected void updateToPass(PhysicalExamSection target) { + target.init(); + + /* HeadSection */ + HeadSection section = + + IHEFactory.eINSTANCE.createHeadSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicalExamSectionOperations.validatePhysicalExamSectionHeadSection( + (PhysicalExamSection) objectToTest, diagnostician, map); + } + + }; + + validatePhysicalExamSectionHeadSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePhysicalExamSectionEyesSection() { + OperationsTestCase validatePhysicalExamSectionEyesSectionTestCase = new OperationsTestCase( + "validatePhysicalExamSectionEyesSection", + operationsForOCL.getOCLValue("VALIDATE_PHYSICAL_EXAM_SECTION_EYES_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicalExamSection target) { + + } + + @Override + protected void updateToPass(PhysicalExamSection target) { + target.init(); + + /* EyesSection */ + EyesSection section = + + IHEFactory.eINSTANCE.createEyesSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicalExamSectionOperations.validatePhysicalExamSectionEyesSection( + (PhysicalExamSection) objectToTest, diagnostician, map); + } + + }; + + validatePhysicalExamSectionEyesSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePhysicalExamSectionEarsNoseMouthThroatSection() { + OperationsTestCase validatePhysicalExamSectionEarsNoseMouthThroatSectionTestCase = new OperationsTestCase( + "validatePhysicalExamSectionEarsNoseMouthThroatSection", + operationsForOCL.getOCLValue("VALIDATE_PHYSICAL_EXAM_SECTION_EARS_NOSE_MOUTH_THROAT_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicalExamSection target) { + + } + + @Override + protected void updateToPass(PhysicalExamSection target) { + target.init(); + + /* EarsNoseMouthThroatSection */ + EarsNoseMouthThroatSection section = + + IHEFactory.eINSTANCE.createEarsNoseMouthThroatSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicalExamSectionOperations.validatePhysicalExamSectionEarsNoseMouthThroatSection( + (PhysicalExamSection) objectToTest, diagnostician, map); + } + + }; + + validatePhysicalExamSectionEarsNoseMouthThroatSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePhysicalExamSectionEarsSection() { + OperationsTestCase validatePhysicalExamSectionEarsSectionTestCase = new OperationsTestCase( + "validatePhysicalExamSectionEarsSection", + operationsForOCL.getOCLValue("VALIDATE_PHYSICAL_EXAM_SECTION_EARS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicalExamSection target) { + + } + + @Override + protected void updateToPass(PhysicalExamSection target) { + target.init(); + + /* EarsSection */ + EarsSection section = + + IHEFactory.eINSTANCE.createEarsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicalExamSectionOperations.validatePhysicalExamSectionEarsSection( + (PhysicalExamSection) objectToTest, diagnostician, map); + } + + }; + + validatePhysicalExamSectionEarsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePhysicalExamSectionNoseSection() { + OperationsTestCase validatePhysicalExamSectionNoseSectionTestCase = new OperationsTestCase( + "validatePhysicalExamSectionNoseSection", + operationsForOCL.getOCLValue("VALIDATE_PHYSICAL_EXAM_SECTION_NOSE_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicalExamSection target) { + + } + + @Override + protected void updateToPass(PhysicalExamSection target) { + target.init(); + + /* NoseSection */ + NoseSection section = + + IHEFactory.eINSTANCE.createNoseSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicalExamSectionOperations.validatePhysicalExamSectionNoseSection( + (PhysicalExamSection) objectToTest, diagnostician, map); + } + + }; + + validatePhysicalExamSectionNoseSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePhysicalExamSectionMouthThroatTeethSection() { + OperationsTestCase validatePhysicalExamSectionMouthThroatTeethSectionTestCase = new OperationsTestCase( + "validatePhysicalExamSectionMouthThroatTeethSection", + operationsForOCL.getOCLValue("VALIDATE_PHYSICAL_EXAM_SECTION_MOUTH_THROAT_TEETH_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicalExamSection target) { + + } + + @Override + protected void updateToPass(PhysicalExamSection target) { + target.init(); + + /* MouthThroatTeethSection */ + MouthThroatTeethSection section = + + IHEFactory.eINSTANCE.createMouthThroatTeethSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicalExamSectionOperations.validatePhysicalExamSectionMouthThroatTeethSection( + (PhysicalExamSection) objectToTest, diagnostician, map); + } + + }; + + validatePhysicalExamSectionMouthThroatTeethSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePhysicalExamSectionNeckSection() { + OperationsTestCase validatePhysicalExamSectionNeckSectionTestCase = new OperationsTestCase( + "validatePhysicalExamSectionNeckSection", + operationsForOCL.getOCLValue("VALIDATE_PHYSICAL_EXAM_SECTION_NECK_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicalExamSection target) { + + } + + @Override + protected void updateToPass(PhysicalExamSection target) { + target.init(); + + /* NeckSection */ + NeckSection section = + + IHEFactory.eINSTANCE.createNeckSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicalExamSectionOperations.validatePhysicalExamSectionNeckSection( + (PhysicalExamSection) objectToTest, diagnostician, map); + } + + }; + + validatePhysicalExamSectionNeckSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePhysicalExamSectionEndocrineSystemSection() { + OperationsTestCase validatePhysicalExamSectionEndocrineSystemSectionTestCase = new OperationsTestCase( + "validatePhysicalExamSectionEndocrineSystemSection", + operationsForOCL.getOCLValue("VALIDATE_PHYSICAL_EXAM_SECTION_ENDOCRINE_SYSTEM_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicalExamSection target) { + + } + + @Override + protected void updateToPass(PhysicalExamSection target) { + target.init(); + + /* EndocrineSystemSection */ + EndocrineSystemSection section = + + IHEFactory.eINSTANCE.createEndocrineSystemSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicalExamSectionOperations.validatePhysicalExamSectionEndocrineSystemSection( + (PhysicalExamSection) objectToTest, diagnostician, map); + } + + }; + + validatePhysicalExamSectionEndocrineSystemSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePhysicalExamSectionThoraxLungsSection() { + OperationsTestCase validatePhysicalExamSectionThoraxLungsSectionTestCase = new OperationsTestCase( + "validatePhysicalExamSectionThoraxLungsSection", + operationsForOCL.getOCLValue("VALIDATE_PHYSICAL_EXAM_SECTION_THORAX_LUNGS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicalExamSection target) { + + } + + @Override + protected void updateToPass(PhysicalExamSection target) { + target.init(); + + /* ThoraxLungsSection */ + ThoraxLungsSection section = + + IHEFactory.eINSTANCE.createThoraxLungsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicalExamSectionOperations.validatePhysicalExamSectionThoraxLungsSection( + (PhysicalExamSection) objectToTest, diagnostician, map); + } + + }; + + validatePhysicalExamSectionThoraxLungsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePhysicalExamSectionChestWallSection() { + OperationsTestCase validatePhysicalExamSectionChestWallSectionTestCase = new OperationsTestCase( + "validatePhysicalExamSectionChestWallSection", + operationsForOCL.getOCLValue("VALIDATE_PHYSICAL_EXAM_SECTION_CHEST_WALL_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicalExamSection target) { + + } + + @Override + protected void updateToPass(PhysicalExamSection target) { + target.init(); + + /* ChestWallSection */ + ChestWallSection section = + + IHEFactory.eINSTANCE.createChestWallSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicalExamSectionOperations.validatePhysicalExamSectionChestWallSection( + (PhysicalExamSection) objectToTest, diagnostician, map); + } + + }; + + validatePhysicalExamSectionChestWallSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePhysicalExamSectionBreastSection() { + OperationsTestCase validatePhysicalExamSectionBreastSectionTestCase = new OperationsTestCase( + "validatePhysicalExamSectionBreastSection", + operationsForOCL.getOCLValue("VALIDATE_PHYSICAL_EXAM_SECTION_BREAST_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicalExamSection target) { + + } + + @Override + protected void updateToPass(PhysicalExamSection target) { + target.init(); + + /* BreastSection */ + BreastSection section = + + IHEFactory.eINSTANCE.createBreastSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicalExamSectionOperations.validatePhysicalExamSectionBreastSection( + (PhysicalExamSection) objectToTest, diagnostician, map); + } + + }; + + validatePhysicalExamSectionBreastSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePhysicalExamSectionHeartSection() { + OperationsTestCase validatePhysicalExamSectionHeartSectionTestCase = new OperationsTestCase( + "validatePhysicalExamSectionHeartSection", + operationsForOCL.getOCLValue("VALIDATE_PHYSICAL_EXAM_SECTION_HEART_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicalExamSection target) { + + } + + @Override + protected void updateToPass(PhysicalExamSection target) { + target.init(); + + /* HeartSection */ + HeartSection section = + + IHEFactory.eINSTANCE.createHeartSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicalExamSectionOperations.validatePhysicalExamSectionHeartSection( + (PhysicalExamSection) objectToTest, diagnostician, map); + } + + }; + + validatePhysicalExamSectionHeartSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePhysicalExamSectionRespiratorySystemSection() { + OperationsTestCase validatePhysicalExamSectionRespiratorySystemSectionTestCase = new OperationsTestCase( + "validatePhysicalExamSectionRespiratorySystemSection", + operationsForOCL.getOCLValue("VALIDATE_PHYSICAL_EXAM_SECTION_RESPIRATORY_SYSTEM_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicalExamSection target) { + + } + + @Override + protected void updateToPass(PhysicalExamSection target) { + target.init(); + + /* RespiratorySystemSection */ + RespiratorySystemSection section = + + IHEFactory.eINSTANCE.createRespiratorySystemSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicalExamSectionOperations.validatePhysicalExamSectionRespiratorySystemSection( + (PhysicalExamSection) objectToTest, diagnostician, map); + } + + }; + + validatePhysicalExamSectionRespiratorySystemSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePhysicalExamSectionAbdomenSection() { + OperationsTestCase validatePhysicalExamSectionAbdomenSectionTestCase = new OperationsTestCase( + "validatePhysicalExamSectionAbdomenSection", + operationsForOCL.getOCLValue("VALIDATE_PHYSICAL_EXAM_SECTION_ABDOMEN_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicalExamSection target) { + + } + + @Override + protected void updateToPass(PhysicalExamSection target) { + target.init(); + + /* AbdomenSection */ + AbdomenSection section = + + IHEFactory.eINSTANCE.createAbdomenSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicalExamSectionOperations.validatePhysicalExamSectionAbdomenSection( + (PhysicalExamSection) objectToTest, diagnostician, map); + } + + }; + + validatePhysicalExamSectionAbdomenSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePhysicalExamSectionLymphaticSection() { + OperationsTestCase validatePhysicalExamSectionLymphaticSectionTestCase = new OperationsTestCase( + "validatePhysicalExamSectionLymphaticSection", + operationsForOCL.getOCLValue("VALIDATE_PHYSICAL_EXAM_SECTION_LYMPHATIC_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicalExamSection target) { + + } + + @Override + protected void updateToPass(PhysicalExamSection target) { + target.init(); + + /* LymphaticSection */ + LymphaticSection section = + + IHEFactory.eINSTANCE.createLymphaticSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicalExamSectionOperations.validatePhysicalExamSectionLymphaticSection( + (PhysicalExamSection) objectToTest, diagnostician, map); + } + + }; + + validatePhysicalExamSectionLymphaticSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePhysicalExamSectionVesselsSection() { + OperationsTestCase validatePhysicalExamSectionVesselsSectionTestCase = new OperationsTestCase( + "validatePhysicalExamSectionVesselsSection", + operationsForOCL.getOCLValue("VALIDATE_PHYSICAL_EXAM_SECTION_VESSELS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicalExamSection target) { + + } + + @Override + protected void updateToPass(PhysicalExamSection target) { + target.init(); + + /* VesselsSection */ + VesselsSection section = + + IHEFactory.eINSTANCE.createVesselsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicalExamSectionOperations.validatePhysicalExamSectionVesselsSection( + (PhysicalExamSection) objectToTest, diagnostician, map); + } + + }; + + validatePhysicalExamSectionVesselsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePhysicalExamSectionMusculoskeletalSystemSection() { + OperationsTestCase validatePhysicalExamSectionMusculoskeletalSystemSectionTestCase = new OperationsTestCase( + "validatePhysicalExamSectionMusculoskeletalSystemSection", + operationsForOCL.getOCLValue("VALIDATE_PHYSICAL_EXAM_SECTION_MUSCULOSKELETAL_SYSTEM_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicalExamSection target) { + + } + + @Override + protected void updateToPass(PhysicalExamSection target) { + target.init(); + + /* MusculoskeletalSystemSection */ + MusculoskeletalSystemSection section = + + IHEFactory.eINSTANCE.createMusculoskeletalSystemSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicalExamSectionOperations.validatePhysicalExamSectionMusculoskeletalSystemSection( + (PhysicalExamSection) objectToTest, diagnostician, map); + } + + }; + + validatePhysicalExamSectionMusculoskeletalSystemSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePhysicalExamSectionNeurologicSystemSection() { + OperationsTestCase validatePhysicalExamSectionNeurologicSystemSectionTestCase = new OperationsTestCase( + "validatePhysicalExamSectionNeurologicSystemSection", + operationsForOCL.getOCLValue("VALIDATE_PHYSICAL_EXAM_SECTION_NEUROLOGIC_SYSTEM_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicalExamSection target) { + + } + + @Override + protected void updateToPass(PhysicalExamSection target) { + target.init(); + + /* NeurologicSystemSection */ + NeurologicSystemSection section = + + IHEFactory.eINSTANCE.createNeurologicSystemSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicalExamSectionOperations.validatePhysicalExamSectionNeurologicSystemSection( + (PhysicalExamSection) objectToTest, diagnostician, map); + } + + }; + + validatePhysicalExamSectionNeurologicSystemSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePhysicalExamSectionGenitaliaSection() { + OperationsTestCase validatePhysicalExamSectionGenitaliaSectionTestCase = new OperationsTestCase( + "validatePhysicalExamSectionGenitaliaSection", + operationsForOCL.getOCLValue("VALIDATE_PHYSICAL_EXAM_SECTION_GENITALIA_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicalExamSection target) { + + } + + @Override + protected void updateToPass(PhysicalExamSection target) { + target.init(); + + /* GenitaliaSection */ + GenitaliaSection section = + + IHEFactory.eINSTANCE.createGenitaliaSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicalExamSectionOperations.validatePhysicalExamSectionGenitaliaSection( + (PhysicalExamSection) objectToTest, diagnostician, map); + } + + }; + + validatePhysicalExamSectionGenitaliaSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePhysicalExamSectionRectumSection() { + OperationsTestCase validatePhysicalExamSectionRectumSectionTestCase = new OperationsTestCase( + "validatePhysicalExamSectionRectumSection", + operationsForOCL.getOCLValue("VALIDATE_PHYSICAL_EXAM_SECTION_RECTUM_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicalExamSection target) { + + } + + @Override + protected void updateToPass(PhysicalExamSection target) { + target.init(); + + /* RectumSection */ + RectumSection section = + + IHEFactory.eINSTANCE.createRectumSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicalExamSectionOperations.validatePhysicalExamSectionRectumSection( + (PhysicalExamSection) objectToTest, diagnostician, map); + } + + }; + + validatePhysicalExamSectionRectumSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePhysicalExamSectionExtremitiesSection() { + OperationsTestCase validatePhysicalExamSectionExtremitiesSectionTestCase = new OperationsTestCase( + "validatePhysicalExamSectionExtremitiesSection", + operationsForOCL.getOCLValue("VALIDATE_PHYSICAL_EXAM_SECTION_EXTREMITIES_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PhysicalExamSection target) { + + } + + @Override + protected void updateToPass(PhysicalExamSection target) { + target.init(); + + /* ExtremitiesSection */ + ExtremitiesSection section = + + IHEFactory.eINSTANCE.createExtremitiesSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PhysicalExamSectionOperations.validatePhysicalExamSectionExtremitiesSection( + (PhysicalExamSection) objectToTest, diagnostician, map); + } + + }; + + validatePhysicalExamSectionExtremitiesSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetVitalSignsSection() { + + PhysicalExamSection target = objectFactory.create(); + target.getVitalSignsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetGeneralAppearanceSection() { + + PhysicalExamSection target = objectFactory.create(); + target.getGeneralAppearanceSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetVisibleImplantedMedicalDevicesSection() { + + PhysicalExamSection target = objectFactory.create(); + target.getVisibleImplantedMedicalDevicesSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetIntegumentarySystemSection() { + + PhysicalExamSection target = objectFactory.create(); + target.getIntegumentarySystemSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetHeadSection() { + + PhysicalExamSection target = objectFactory.create(); + target.getHeadSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetEyesSection() { + + PhysicalExamSection target = objectFactory.create(); + target.getEyesSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetEarsNoseMouthThroatSection() { + + PhysicalExamSection target = objectFactory.create(); + target.getEarsNoseMouthThroatSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetEarsSection() { + + PhysicalExamSection target = objectFactory.create(); + target.getEarsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetNoseSection() { + + PhysicalExamSection target = objectFactory.create(); + target.getNoseSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetMouthThroatTeethSection() { + + PhysicalExamSection target = objectFactory.create(); + target.getMouthThroatTeethSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetNeckSection() { + + PhysicalExamSection target = objectFactory.create(); + target.getNeckSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetEndocrineSystemSection() { + + PhysicalExamSection target = objectFactory.create(); + target.getEndocrineSystemSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetThoraxLungsSection() { + + PhysicalExamSection target = objectFactory.create(); + target.getThoraxLungsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetChestWallSection() { + + PhysicalExamSection target = objectFactory.create(); + target.getChestWallSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetBreastSection() { + + PhysicalExamSection target = objectFactory.create(); + target.getBreastSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetHeartSection() { + + PhysicalExamSection target = objectFactory.create(); + target.getHeartSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetRespiratorySystemSection() { + + PhysicalExamSection target = objectFactory.create(); + target.getRespiratorySystemSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetAbdomenSection() { + + PhysicalExamSection target = objectFactory.create(); + target.getAbdomenSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetLymphaticSection() { + + PhysicalExamSection target = objectFactory.create(); + target.getLymphaticSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetVesselsSection() { + + PhysicalExamSection target = objectFactory.create(); + target.getVesselsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetMusculoskeletalSystemSection() { + + PhysicalExamSection target = objectFactory.create(); + target.getMusculoskeletalSystemSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetNeurologicSystemSection() { + + PhysicalExamSection target = objectFactory.create(); + target.getNeurologicSystemSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetGenitaliaSection() { + + PhysicalExamSection target = objectFactory.create(); + target.getGenitaliaSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetRectumSection() { + + PhysicalExamSection target = objectFactory.create(); + target.getRectumSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetExtremitiesSection() { + + PhysicalExamSection target = objectFactory.create(); + target.getExtremitiesSection(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PhysicalExamSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public PhysicalExamSection create() { + return IHEFactory.eINSTANCE.createPhysicalExamSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PhysicalExamSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PhysicalExamSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/PregnancyHistorySectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/PregnancyHistorySectionTest.java new file mode 100644 index 000000000..b7ca1cccb --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/PregnancyHistorySectionTest.java @@ -0,0 +1,227 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.PregnancyHistorySection; +import org.openhealthtools.mdht.uml.cda.ihe.PregnancyObservation; +import org.openhealthtools.mdht.uml.cda.ihe.operations.PregnancyHistorySectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Pregnancy History Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PregnancyHistorySection#validatePregnancyHistorySectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pregnancy History Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PregnancyHistorySection#validatePregnancyHistorySectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pregnancy History Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PregnancyHistorySection#validatePregnancyHistorySectionPregnancyObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pregnancy History Section Pregnancy Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PregnancyHistorySection#getPregnancyObservations() Get Pregnancy Observations}
  • + *
+ *

+ * + * @generated + */ + +public class PregnancyHistorySectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidatePregnancyHistorySectionTemplateId() { + OperationsTestCase validatePregnancyHistorySectionTemplateIdTestCase = new OperationsTestCase( + "validatePregnancyHistorySectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PREGNANCY_HISTORY_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PregnancyHistorySection target) { + + } + + @Override + protected void updateToPass(PregnancyHistorySection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PregnancyHistorySectionOperations.validatePregnancyHistorySectionTemplateId( + (PregnancyHistorySection) objectToTest, diagnostician, map); + } + + }; + + validatePregnancyHistorySectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePregnancyHistorySectionCode() { + OperationsTestCase validatePregnancyHistorySectionCodeTestCase = new OperationsTestCase( + "validatePregnancyHistorySectionCode", + operationsForOCL.getOCLValue("VALIDATE_PREGNANCY_HISTORY_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PregnancyHistorySection target) { + + } + + @Override + protected void updateToPass(PregnancyHistorySection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PregnancyHistorySectionOperations.validatePregnancyHistorySectionCode( + (PregnancyHistorySection) objectToTest, diagnostician, map); + } + + }; + + validatePregnancyHistorySectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePregnancyHistorySectionPregnancyObservation() { + OperationsTestCase validatePregnancyHistorySectionPregnancyObservationTestCase = new OperationsTestCase( + "validatePregnancyHistorySectionPregnancyObservation", + operationsForOCL.getOCLValue("VALIDATE_PREGNANCY_HISTORY_SECTION_PREGNANCY_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PregnancyHistorySection target) { + + } + + @Override + protected void updateToPass(PregnancyHistorySection target) { + target.init(); + PregnancyObservation observation = IHEFactory.eINSTANCE.createPregnancyObservation().init(); + target.addObservation(observation); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PregnancyHistorySectionOperations.validatePregnancyHistorySectionPregnancyObservation( + (PregnancyHistorySection) objectToTest, diagnostician, map); + } + + }; + + validatePregnancyHistorySectionPregnancyObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetPregnancyObservations() { + + PregnancyHistorySection target = objectFactory.create(); + target.getPregnancyObservations(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PregnancyHistorySectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public PregnancyHistorySection create() { + return IHEFactory.eINSTANCE.createPregnancyHistorySection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PregnancyHistorySectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PregnancyHistorySectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/PregnancyObservationTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/PregnancyObservationTest.java new file mode 100644 index 000000000..812f7c3a1 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/PregnancyObservationTest.java @@ -0,0 +1,364 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.PregnancyObservation; +import org.openhealthtools.mdht.uml.cda.ihe.operations.PregnancyObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_INT; + +/** + * + * A static utility class that provides operations related to 'Pregnancy Observation' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PregnancyObservation#validatePregnancyObservationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pregnancy Observation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PregnancyObservation#validatePregnancyObservationInterpretationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pregnancy Observation Interpretation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PregnancyObservation#validatePregnancyObservationMethodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pregnancy Observation Method Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PregnancyObservation#validatePregnancyObservationRepeatNumber(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pregnancy Observation Repeat Number}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PregnancyObservation#validatePregnancyObservationTargetSiteCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pregnancy Observation Target Site Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PregnancyObservation#validatePregnancyObservationValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Pregnancy Observation Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.PregnancyObservation#validateSimpleObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Simple Observation Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class PregnancyObservationTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidatePregnancyObservationCode() { + OperationsTestCase validatePregnancyObservationCodeTestCase = new OperationsTestCase( + "validatePregnancyObservationCode", + operationsForOCL.getOCLValue("VALIDATE_PREGNANCY_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PregnancyObservation target) { + + } + + @Override + protected void updateToPass(PregnancyObservation target) { + target.init(); + + CD cd = DatatypesFactory.eINSTANCE.createCD(); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PregnancyObservationOperations.validatePregnancyObservationCode( + (PregnancyObservation) objectToTest, diagnostician, map); + } + + }; + + validatePregnancyObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePregnancyObservationInterpretationCode() { + OperationsTestCase validatePregnancyObservationInterpretationCodeTestCase = new OperationsTestCase( + "validatePregnancyObservationInterpretationCode", + operationsForOCL.getOCLValue("VALIDATE_PREGNANCY_OBSERVATION_INTERPRETATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PregnancyObservation target) { + target.init(); + } + + @Override + protected void updateToPass(PregnancyObservation target) { + CE ce = DatatypesFactory.eINSTANCE.createCE(); + target.getInterpretationCodes().add(ce); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PregnancyObservationOperations.validatePregnancyObservationInterpretationCode( + (PregnancyObservation) objectToTest, diagnostician, map); + } + + }; + + validatePregnancyObservationInterpretationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePregnancyObservationMethodCode() { + OperationsTestCase validatePregnancyObservationMethodCodeTestCase = new OperationsTestCase( + "validatePregnancyObservationMethodCode", + operationsForOCL.getOCLValue("VALIDATE_PREGNANCY_OBSERVATION_METHOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PregnancyObservation target) { + target.init(); + } + + @Override + protected void updateToPass(PregnancyObservation target) { + CE ce = DatatypesFactory.eINSTANCE.createCE(); + target.getMethodCodes().add(ce); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PregnancyObservationOperations.validatePregnancyObservationMethodCode( + (PregnancyObservation) objectToTest, diagnostician, map); + } + + }; + + validatePregnancyObservationMethodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePregnancyObservationRepeatNumber() { + OperationsTestCase validatePregnancyObservationRepeatNumberTestCase = new OperationsTestCase( + "validatePregnancyObservationRepeatNumber", + operationsForOCL.getOCLValue("VALIDATE_PREGNANCY_OBSERVATION_REPEAT_NUMBER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PregnancyObservation target) { + target.init(); + } + + @Override + protected void updateToPass(PregnancyObservation target) { + IVL_INT rn = DatatypesFactory.eINSTANCE.createIVL_INT(); + ; + target.setRepeatNumber(rn); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PregnancyObservationOperations.validatePregnancyObservationRepeatNumber( + (PregnancyObservation) objectToTest, diagnostician, map); + } + + }; + + validatePregnancyObservationRepeatNumberTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidatePregnancyObservationTargetSiteCode() { + OperationsTestCase validatePregnancyObservationTargetSiteCodeTestCase = new OperationsTestCase( + "validatePregnancyObservationTargetSiteCode", + operationsForOCL.getOCLValue("VALIDATE_PREGNANCY_OBSERVATION_TARGET_SITE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PregnancyObservation target) { + target.init(); + } + + @Override + protected void updateToPass(PregnancyObservation target) { + CD cd = DatatypesFactory.eINSTANCE.createCD(); + target.getTargetSiteCodes().add(cd); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PregnancyObservationOperations.validatePregnancyObservationTargetSiteCode( + (PregnancyObservation) objectToTest, diagnostician, map); + } + + }; + + validatePregnancyObservationTargetSiteCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidatePregnancyObservationValue() { + OperationsTestCase validatePregnancyObservationValueTestCase = new OperationsTestCase( + "validatePregnancyObservationValue", + operationsForOCL.getOCLValue("VALIDATE_PREGNANCY_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PregnancyObservation target) { + + } + + @Override + protected void updateToPass(PregnancyObservation target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD(); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PregnancyObservationOperations.validatePregnancyObservationValue( + (PregnancyObservation) objectToTest, diagnostician, map); + } + + }; + + validatePregnancyObservationValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSimpleObservationTemplateId() { + OperationsTestCase validateSimpleObservationTemplateIdTestCase = new OperationsTestCase( + "validateSimpleObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_SIMPLE_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PregnancyObservation target) { + + } + + @Override + protected void updateToPass(PregnancyObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PregnancyObservationOperations.validateSimpleObservationTemplateId( + (PregnancyObservation) objectToTest, diagnostician, map); + } + + }; + + validateSimpleObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PregnancyObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public PregnancyObservation create() { + return IHEFactory.eINSTANCE.createPregnancyObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends PregnancyObservationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PregnancyObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ProblemConcernEntryTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ProblemConcernEntryTest.java new file mode 100644 index 000000000..32cc1df0d --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ProblemConcernEntryTest.java @@ -0,0 +1,199 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.ProblemConcernEntry; +import org.openhealthtools.mdht.uml.cda.ihe.ProblemEntry; +import org.openhealthtools.mdht.uml.cda.ihe.operations.ProblemConcernEntryOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * + * A static utility class that provides operations related to 'Problem Concern Entry' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ProblemConcernEntry#validateProblemConcernEntryTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Concern Entry Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ProblemConcernEntry#validateProblemConcernEntryProblemEntry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Concern Entry Problem Entry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ProblemConcernEntry#getProblemEntries() Get Problem Entries}
  • + *
+ *

+ * + * @generated + */ + +public class ProblemConcernEntryTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateProblemConcernEntryTemplateId() { + OperationsTestCase validateProblemConcernEntryTemplateIdTestCase = new OperationsTestCase( + "validateProblemConcernEntryTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_CONCERN_ENTRY_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemConcernEntry target) { + + } + + @Override + protected void updateToPass(ProblemConcernEntry target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemConcernEntryOperations.validateProblemConcernEntryTemplateId( + (ProblemConcernEntry) objectToTest, diagnostician, map); + } + + }; + + validateProblemConcernEntryTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProblemConcernEntryProblemEntry() { + OperationsTestCase validateProblemConcernEntryProblemEntryTestCase = new OperationsTestCase( + "validateProblemConcernEntryProblemEntry", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_CONCERN_ENTRY_PROBLEM_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemConcernEntry target) { + + } + + @Override + protected void updateToPass(ProblemConcernEntry target) { + target.init(); + ProblemEntry problemEntry = IHEFactory.eINSTANCE.createProblemEntry().init(); + target.addObservation(problemEntry); + + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemConcernEntryOperations.validateProblemConcernEntryProblemEntry( + (ProblemConcernEntry) objectToTest, diagnostician, map); + } + + }; + + validateProblemConcernEntryProblemEntryTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemEntries() { + + ProblemConcernEntry target = objectFactory.create(); + target.getProblemEntries(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ProblemConcernEntryOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public ProblemConcernEntry create() { + return IHEFactory.eINSTANCE.createProblemConcernEntry(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ProblemConcernEntryOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ProblemConcernEntryOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ProblemEntryReactionObservationContainerTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ProblemEntryReactionObservationContainerTest.java new file mode 100644 index 000000000..460573749 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ProblemEntryReactionObservationContainerTest.java @@ -0,0 +1,46 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Problem Entry Reaction Observation Container' model objects. + * + * + * + * @generated + */ + +public class ProblemEntryReactionObservationContainerTest extends CDAValidationTest { + + /** + * No Operations Test + * @generated + */ + @Test + public void testNoOperations() { + } + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ProblemEntryReactionObservationContainerOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ProblemEntryTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ProblemEntryTest.java new file mode 100644 index 000000000..161202856 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ProblemEntryTest.java @@ -0,0 +1,660 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.Act; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.ihe.HealthStatusObservation; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.ProblemEntry; +import org.openhealthtools.mdht.uml.cda.ihe.ProblemStatusObservation; +import org.openhealthtools.mdht.uml.cda.ihe.Severity; +import org.openhealthtools.mdht.uml.cda.ihe.operations.ProblemEntryOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.datatypes.TEL; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * + * A static utility class that provides operations related to 'Problem Entry' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ProblemEntry#validateProblemEntryHasTextReference(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Entry Has Text Reference}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ProblemEntry#validateProblemEntryCommentInversionInd(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Entry Comment Inversion Ind}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ProblemEntry#validateProblemEntryTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Entry Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ProblemEntry#validateProblemEntryCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Entry Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ProblemEntry#validateProblemEntryCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Entry Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ProblemEntry#validateProblemEntryEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Entry Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ProblemEntry#validateProblemEntryId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Entry Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ProblemEntry#validateProblemEntryText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Entry Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ProblemEntry#validateProblemEntryValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Entry Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ProblemEntry#validateProblemEntrySeverity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Entry Severity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ProblemEntry#validateProblemEntryProblemStatusObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Entry Problem Status Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ProblemEntry#validateProblemEntryHealthStatusObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Entry Health Status Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ProblemEntry#validateProblemEntryComment(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Problem Entry Comment}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ProblemEntry#getSeverity() Get Severity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ProblemEntry#getProblemStatusObservation() Get Problem Status Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ProblemEntry#getHealthStatusObservation() Get Health Status Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ProblemEntry#getComments() Get Comments}
  • + *
+ *

+ * + * @generated + */ + +public class ProblemEntryTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateProblemEntryHasTextReference() { + OperationsTestCase validateProblemEntryHasTextReferenceTestCase = new OperationsTestCase( + "validateProblemEntryHasTextReference", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_ENTRY_HAS_TEXT_REFERENCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemEntry target) { + target.init(); + + ED value = DatatypesFactory.eINSTANCE.createED("sample text"); + target.setText(value); + } + + @Override + protected void updateToPass(ProblemEntry target) { + + TEL value = DatatypesFactory.eINSTANCE.createTEL("reference"); + target.getText().setReference(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemEntryOperations.validateProblemEntryHasTextReference( + (ProblemEntry) objectToTest, diagnostician, map); + } + + }; + + validateProblemEntryHasTextReferenceTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProblemEntryCommentInversionInd() { + OperationsTestCase validateProblemEntryCommentInversionIndTestCase = new OperationsTestCase( + "validateProblemEntryCommentInversionInd", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_ENTRY_COMMENT_INVERSION_IND__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemEntry target) { + target.init(); + Act comment = IHEFactory.eINSTANCE.createComment().init(); + target.addAct(comment); + } + + @Override + protected void updateToPass(ProblemEntry target) { + for (EntryRelationship er : target.getEntryRelationships()) { + er.setInversionInd(true); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemEntryOperations.validateProblemEntryCommentInversionInd( + (ProblemEntry) objectToTest, diagnostician, map); + } + + }; + + validateProblemEntryCommentInversionIndTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProblemEntryTemplateId() { + OperationsTestCase validateProblemEntryTemplateIdTestCase = new OperationsTestCase( + "validateProblemEntryTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_ENTRY_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemEntry target) { + + } + + @Override + protected void updateToPass(ProblemEntry target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemEntryOperations.validateProblemEntryTemplateId( + (ProblemEntry) objectToTest, diagnostician, map); + } + + }; + + validateProblemEntryTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProblemEntryCodeP() { + OperationsTestCase validateProblemEntryCodePTestCase = new OperationsTestCase( + "validateProblemEntryCodeP", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_ENTRY_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemEntry target) { + + } + + @Override + protected void updateToPass(ProblemEntry target) { + target.init(); + + CD code = DatatypesFactory.eINSTANCE.createCD(); + // it merely needs to exist to satisfy this constraint + + target.setCode(code); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemEntryOperations.validateProblemEntryCodeP((ProblemEntry) objectToTest, diagnostician, map); + } + + }; + + validateProblemEntryCodePTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProblemEntryCode() { + OperationsTestCase validateProblemEntryCodeTestCase = new OperationsTestCase( + "validateProblemEntryCode", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_ENTRY_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(ProblemEntry target) { + + } + + @Override + protected void updateToPass(ProblemEntry target) { + target.init(); + target.getCode().setCode("282291009"); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemEntryOperations.validateProblemEntryCode((ProblemEntry) objectToTest, diagnostician, map); + } + + }; + + validateProblemEntryCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProblemEntryEffectiveTime() { + OperationsTestCase validateProblemEntryEffectiveTimeTestCase = new OperationsTestCase( + "validateProblemEntryEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_ENTRY_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemEntry target) { + + } + + @Override + protected void updateToPass(ProblemEntry target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemEntryOperations.validateProblemEntryEffectiveTime( + (ProblemEntry) objectToTest, diagnostician, map); + } + + }; + + validateProblemEntryEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProblemEntryId() { + OperationsTestCase validateProblemEntryIdTestCase = new OperationsTestCase( + "validateProblemEntryId", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_ENTRY_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(ProblemEntry target) { + target.init(); + } + + @Override + protected void updateToPass(ProblemEntry target) { + II ii = DatatypesFactory.eINSTANCE.createII("ii"); + target.getIds().add(ii); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemEntryOperations.validateProblemEntryId((ProblemEntry) objectToTest, diagnostician, map); + } + + }; + + validateProblemEntryIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProblemEntryText() { + OperationsTestCase validateProblemEntryTextTestCase = new OperationsTestCase( + "validateProblemEntryText", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_ENTRY_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(ProblemEntry target) { + target.init(); + } + + @Override + protected void updateToPass(ProblemEntry target) { + + ED text = DatatypesFactory.eINSTANCE.createED("text"); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemEntryOperations.validateProblemEntryText((ProblemEntry) objectToTest, diagnostician, map); + } + + }; + + validateProblemEntryTextTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProblemEntryValue() { + OperationsTestCase validateProblemEntryValueTestCase = new OperationsTestCase( + "validateProblemEntryValue", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_ENTRY_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(ProblemEntry target) { + + } + + @Override + protected void updateToPass(ProblemEntry target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD(); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemEntryOperations.validateProblemEntryValue((ProblemEntry) objectToTest, diagnostician, map); + } + + }; + + validateProblemEntryValueTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProblemEntrySeverity() { + OperationsTestCase validateProblemEntrySeverityTestCase = new OperationsTestCase( + "validateProblemEntrySeverity", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_ENTRY_SEVERITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemEntry target) { + target.init(); + } + + @Override + protected void updateToPass(ProblemEntry target) { + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + Severity severity = IHEFactory.eINSTANCE.createSeverity(); + er.setObservation(severity); + target.getEntryRelationships().add(er); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemEntryOperations.validateProblemEntrySeverity( + (ProblemEntry) objectToTest, diagnostician, map); + } + + }; + + validateProblemEntrySeverityTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProblemEntryProblemStatusObservation() { + OperationsTestCase validateProblemEntryProblemStatusObservationTestCase = new OperationsTestCase( + "validateProblemEntryProblemStatusObservation", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_ENTRY_PROBLEM_STATUS_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemEntry target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + ProblemStatusObservation pso = IHEFactory.eINSTANCE.createProblemStatusObservation().init(); + er.setObservation(pso); + target.getEntryRelationships().add(er); + } + + @Override + protected void updateToPass(ProblemEntry target) { + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.REFR); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemEntryOperations.validateProblemEntryProblemStatusObservation( + (ProblemEntry) objectToTest, diagnostician, map); + } + + }; + + validateProblemEntryProblemStatusObservationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProblemEntryHealthStatusObservation() { + OperationsTestCase validateProblemEntryHealthStatusObservationTestCase = new OperationsTestCase( + "validateProblemEntryHealthStatusObservation", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_ENTRY_HEALTH_STATUS_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemEntry target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + HealthStatusObservation hso = IHEFactory.eINSTANCE.createHealthStatusObservation().init(); + er.setObservation(hso); + target.getEntryRelationships().add(er); + } + + @Override + protected void updateToPass(ProblemEntry target) { + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.REFR); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemEntryOperations.validateProblemEntryHealthStatusObservation( + (ProblemEntry) objectToTest, diagnostician, map); + } + + }; + + validateProblemEntryHealthStatusObservationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateProblemEntryComment() { + OperationsTestCase validateProblemEntryCommentTestCase = new OperationsTestCase( + "validateProblemEntryComment", + operationsForOCL.getOCLValue("VALIDATE_PROBLEM_ENTRY_COMMENT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemEntry target) { + target.init(); + Act comment = IHEFactory.eINSTANCE.createComment().init(); + target.addAct(comment); + } + + @Override + protected void updateToPass(ProblemEntry target) { + for (EntryRelationship er : target.getEntryRelationships()) { + er.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemEntryOperations.validateProblemEntryComment( + (ProblemEntry) objectToTest, diagnostician, map); + } + + }; + + validateProblemEntryCommentTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetSeverity() { + + ProblemEntry target = objectFactory.create(); + target.getSeverity(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProblemStatusObservation() { + + ProblemEntry target = objectFactory.create(); + target.getProblemStatusObservation(); + + } + + /** + * + * @generated + */ + @Test + public void testGetHealthStatusObservation() { + + ProblemEntry target = objectFactory.create(); + target.getHealthStatusObservation(); + + } + + /** + * + * @generated + */ + @Test + public void testGetComments() { + + ProblemEntry target = objectFactory.create(); + target.getComments(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ProblemEntryOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public ProblemEntry create() { + return IHEFactory.eINSTANCE.createProblemEntry(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ProblemEntryOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ProblemEntryOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ProblemStatusObservationTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ProblemStatusObservationTest.java new file mode 100644 index 000000000..b1d3a3431 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ProblemStatusObservationTest.java @@ -0,0 +1,298 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ccd.operations.StatusObservationOperations; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.ProblemStatusObservation; +import org.openhealthtools.mdht.uml.cda.ihe.operations.ProblemStatusObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.ANY; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; +import org.openhealthtools.mdht.uml.hl7.datatypes.TEL; + +/** + * + * A static utility class that provides operations related to 'Problem Status Observation' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ProblemStatusObservation#validateIHEProblemStatusObservationHasTextReference(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Problem Status Observation Has Text Reference}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ProblemStatusObservation#validateIHEProblemStatusObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Problem Status Observation Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ProblemStatusObservation#validateIHEProblemStatusObservationText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Problem Status Observation Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ProblemStatusObservation#validateIHEProblemStatusObservationValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Problem Status Observation Value}
  • + *
+ *

+ * + * @generated + */ + +public class ProblemStatusObservationTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateIHEProblemStatusObservationHasTextReference() { + OperationsTestCase validateIHEProblemStatusObservationHasTextReferenceTestCase = new OperationsTestCase( + "validateIHEProblemStatusObservationHasTextReference", + operationsForOCL.getOCLValue("VALIDATE_IHE_PROBLEM_STATUS_OBSERVATION_HAS_TEXT_REFERENCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemStatusObservation target) { + target.init(); + ED value = DatatypesFactory.eINSTANCE.createED("text"); + target.setText(value); + } + + @Override + protected void updateToPass(ProblemStatusObservation target) { + TEL value = DatatypesFactory.eINSTANCE.createTEL("reference"); + target.getText().setReference(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemStatusObservationOperations.validateIHEProblemStatusObservationHasTextReference( + (ProblemStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateIHEProblemStatusObservationHasTextReferenceTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateIHEProblemStatusObservationTemplateId() { + OperationsTestCase validateIHEProblemStatusObservationTemplateIdTestCase = new OperationsTestCase( + "validateIHEProblemStatusObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_IHE_PROBLEM_STATUS_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemStatusObservation target) { + + } + + @Override + protected void updateToPass(ProblemStatusObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemStatusObservationOperations.validateIHEProblemStatusObservationTemplateId( + (ProblemStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateIHEProblemStatusObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateIHEProblemStatusObservationText() { + OperationsTestCase validateIHEProblemStatusObservationTextTestCase = new OperationsTestCase( + "validateIHEProblemStatusObservationText", + operationsForOCL.getOCLValue("VALIDATE_IHE_PROBLEM_STATUS_OBSERVATION_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemStatusObservation target) { + target.init(); + } + + @Override + protected void updateToPass(ProblemStatusObservation target) { + ED value = DatatypesFactory.eINSTANCE.createED("text"); + target.setText(value); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemStatusObservationOperations.validateIHEProblemStatusObservationText( + (ProblemStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateIHEProblemStatusObservationTextTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateIHEProblemStatusObservationValue() { + OperationsTestCase validateIHEProblemStatusObservationValueTestCase = new OperationsTestCase( + "validateIHEProblemStatusObservationValue", + operationsForOCL.getOCLValue("VALIDATE_IHE_PROBLEM_STATUS_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemStatusObservation target) { + + } + + @Override + protected void updateToPass(ProblemStatusObservation target) { + target.init(); + + CE cd = DatatypesFactory.eINSTANCE.createCE(); + cd.setCodeSystem("2.16.840.1.113883.6.96"); + cd.setCode("55561003"); + target.setCode(cd); + + target.getValues().add(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProblemStatusObservationOperations.validateIHEProblemStatusObservationValue( + (ProblemStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateIHEProblemStatusObservationValueTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateStatusObservationValue() { + OperationsTestCase validateStatusObservationValueTestCase = new OperationsTestCase( + "validateStatusObservationValue", + operationsForOCL.getOCLValue("VALIDATE_STATUS_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProblemStatusObservation target) { + + } + + @Override + protected void updateToPass(ProblemStatusObservation target) { + target.init(); + ANY cd = DatatypesFactory.eINSTANCE.createCE("55561003", "2.16.840.1.113883.6.96"); + target.getValues().add(cd); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return StatusObservationOperations.validateStatusObservationValue( + (ProblemStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateStatusObservationValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ProblemStatusObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public ProblemStatusObservation create() { + return IHEFactory.eINSTANCE.createProblemStatusObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ProblemStatusObservationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ProblemStatusObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ProcedureEntryPlanOfCareActivityProcedureTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ProcedureEntryPlanOfCareActivityProcedureTest.java new file mode 100644 index 000000000..3fcb74823 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ProcedureEntryPlanOfCareActivityProcedureTest.java @@ -0,0 +1,142 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.ProcedureEntryPlanOfCareActivityProcedure; +import org.openhealthtools.mdht.uml.cda.ihe.operations.ProcedureEntryPlanOfCareActivityProcedureOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Procedure Entry Plan Of Care Activity Procedure' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ProcedureEntryPlanOfCareActivityProcedure#validateProcedureEntryPlanOfCareActivityProcedureMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Entry Plan Of Care Activity Procedure Mood Code}
  • + *
+ *

+ * + * @generated + */ + +public class ProcedureEntryPlanOfCareActivityProcedureTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateProcedureEntryPlanOfCareActivityProcedureMoodCode() { + OperationsTestCase validateProcedureEntryPlanOfCareActivityProcedureMoodCodeTestCase = new OperationsTestCase( + "validateProcedureEntryPlanOfCareActivityProcedureMoodCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ENTRY_PLAN_OF_CARE_ACTIVITY_PROCEDURE_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureEntryPlanOfCareActivityProcedure target) { + + } + + @Override + protected void updateToPass(ProcedureEntryPlanOfCareActivityProcedure target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureEntryPlanOfCareActivityProcedureOperations.validateProcedureEntryPlanOfCareActivityProcedureMoodCode( + (ProcedureEntryPlanOfCareActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureEntryPlanOfCareActivityProcedureMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ProcedureEntryPlanOfCareActivityProcedureOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public ProcedureEntryPlanOfCareActivityProcedure create() { + return IHEFactory.eINSTANCE.createProcedureEntryPlanOfCareActivityProcedure(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ProcedureEntryPlanOfCareActivityProcedureOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ProcedureEntryPlanOfCareActivityProcedureOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ProcedureEntryProcedureActivityProcedureTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ProcedureEntryProcedureActivityProcedureTest.java new file mode 100644 index 000000000..ece77409e --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ProcedureEntryProcedureActivityProcedureTest.java @@ -0,0 +1,45 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Procedure Entry Procedure Activity Procedure' model objects. + * + * + * + * @generated + */ + +public class ProcedureEntryProcedureActivityProcedureTest extends CDAValidationTest { + + /** + * No Operations Test + * @generated + */ + @Test + public void testNoOperations() { + } + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ProcedureEntryProcedureActivityProcedureOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ProcedureEntryTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ProcedureEntryTest.java new file mode 100644 index 000000000..9503c06e3 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ProcedureEntryTest.java @@ -0,0 +1,517 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.InternalReference; +import org.openhealthtools.mdht.uml.cda.ihe.ProcedureEntry; +import org.openhealthtools.mdht.uml.cda.ihe.operations.ProcedureEntryOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; +import org.openhealthtools.mdht.uml.hl7.vocab.x_DocumentProcedureMood; + +/** + * + * A static utility class that provides operations related to 'Procedure Entry' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ProcedureEntry#validateProcedureEntryMoodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Entry Mood Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ProcedureEntry#validateProcedureEntryHasTextReference(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Entry Has Text Reference}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ProcedureEntry#validateProcedureEntryPriorityCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Entry Priority Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ProcedureEntry#validateProcedureEntryHasInversionIndForEncounter(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Entry Has Inversion Ind For Encounter}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ProcedureEntry#validateProcedureEntryTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Entry Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ProcedureEntry#validateProcedureEntryClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Entry Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ProcedureEntry#validateProcedureEntryText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Entry Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ProcedureEntry#validateProcedureEntryApproachSiteCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Entry Approach Site Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ProcedureEntry#validateProcedureEntryInternalReference(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Entry Internal Reference}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ProcedureEntry#validateProcedureEntryInternalReferenceReason(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Entry Internal Reference Reason}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ProcedureEntry#getInternalReference() Get Internal Reference}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ProcedureEntry#getInternalReferenceReasons() Get Internal Reference Reasons}
  • + *
+ *

+ * + * @generated + */ + +public class ProcedureEntryTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateProcedureEntryMoodCode() { + OperationsTestCase validateProcedureEntryMoodCodeTestCase = new OperationsTestCase( + "validateProcedureEntryMoodCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ENTRY_MOOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureEntry target) { + + } + + @Override + protected void updateToPass(ProcedureEntry target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureEntryOperations.validateProcedureEntryMoodCode( + (ProcedureEntry) objectToTest, diagnostician, map); + } + + }; + + validateProcedureEntryMoodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureEntryHasTextReference() { + OperationsTestCase validateProcedureEntryHasTextReferenceTestCase = new OperationsTestCase( + "validateProcedureEntryHasTextReference", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ENTRY_HAS_TEXT_REFERENCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureEntry target) { + target.init(); + } + + @Override + protected void updateToPass(ProcedureEntry target) { + ED ed = DatatypesFactory.eINSTANCE.createED(); + ed.setReference(DatatypesFactory.eINSTANCE.createTEL()); + target.setText(ed); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureEntryOperations.validateProcedureEntryHasTextReference( + (ProcedureEntry) objectToTest, diagnostician, map); + } + + }; + + validateProcedureEntryHasTextReferenceTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureEntryPriorityCode() { + OperationsTestCase validateProcedureEntryPriorityCodeTestCase = new OperationsTestCase( + "validateProcedureEntryPriorityCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ENTRY_PRIORITY_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureEntry target) { + target.init(); + target.setMoodCode(x_DocumentProcedureMood.INT); + + } + + @Override + protected void updateToPass(ProcedureEntry target) { + target.setPriorityCode(DatatypesFactory.eINSTANCE.createCE("CODE", "SYSTEM")); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureEntryOperations.validateProcedureEntryPriorityCode( + (ProcedureEntry) objectToTest, diagnostician, map); + } + + }; + + validateProcedureEntryPriorityCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureEntryHasInversionIndForEncounter() { + OperationsTestCase validateProcedureEntryHasInversionIndForEncounterTestCase = new OperationsTestCase( + "validateProcedureEntryHasInversionIndForEncounter", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ENTRY_HAS_INVERSION_IND_FOR_ENCOUNTER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureEntry target) { + target.init(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + er.setInversionInd(false); + + target.getEntryRelationships().add(er); + } + + @Override + protected void updateToPass(ProcedureEntry target) { + + target.getEntryRelationships().clear(); + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + er.setInversionInd(true); + + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureEntryOperations.validateProcedureEntryHasInversionIndForEncounter( + (ProcedureEntry) objectToTest, diagnostician, map); + } + + }; + + validateProcedureEntryHasInversionIndForEncounterTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureEntryTemplateId() { + OperationsTestCase validateProcedureEntryTemplateIdTestCase = new OperationsTestCase( + "validateProcedureEntryTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ENTRY_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureEntry target) { + + } + + @Override + protected void updateToPass(ProcedureEntry target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureEntryOperations.validateProcedureEntryTemplateId( + (ProcedureEntry) objectToTest, diagnostician, map); + } + + }; + + validateProcedureEntryTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureEntryClassCode() { + OperationsTestCase validateProcedureEntryClassCodeTestCase = new OperationsTestCase( + "validateProcedureEntryClassCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ENTRY_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureEntry target) { + + } + + @Override + protected void updateToPass(ProcedureEntry target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureEntryOperations.validateProcedureEntryClassCode( + (ProcedureEntry) objectToTest, diagnostician, map); + } + + }; + + validateProcedureEntryClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureEntryText() { + OperationsTestCase validateProcedureEntryTextTestCase = new OperationsTestCase( + "validateProcedureEntryText", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ENTRY_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureEntry target) { + + } + + @Override + protected void updateToPass(ProcedureEntry target) { + target.init(); + + ED text = DatatypesFactory.eINSTANCE.createED(); + target.setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureEntryOperations.validateProcedureEntryText( + (ProcedureEntry) objectToTest, diagnostician, map); + } + + }; + + validateProcedureEntryTextTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureEntryApproachSiteCode() { + OperationsTestCase validateProcedureEntryApproachSiteCodeTestCase = new OperationsTestCase( + "validateProcedureEntryApproachSiteCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ENTRY_APPROACH_SITE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureEntry target) { + + } + + @Override + protected void updateToPass(ProcedureEntry target) { + target.init(); + + target.getApproachSiteCodes().add(DatatypesFactory.eINSTANCE.createCD()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureEntryOperations.validateProcedureEntryApproachSiteCode( + (ProcedureEntry) objectToTest, diagnostician, map); + } + + }; + + validateProcedureEntryApproachSiteCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureEntryInternalReference() { + OperationsTestCase validateProcedureEntryInternalReferenceTestCase = new OperationsTestCase( + "validateProcedureEntryInternalReference", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ENTRY_INTERNAL_REFERENCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureEntry target) { + target.init(); + } + + @Override + protected void updateToPass(ProcedureEntry target) { + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + InternalReference ir = IHEFactory.eINSTANCE.createInternalReference().init(); + er.setAct(ir); + er.setTypeCode(x_ActRelationshipEntryRelationship.COMP); + + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureEntryOperations.validateProcedureEntryInternalReference( + (ProcedureEntry) objectToTest, diagnostician, map); + } + + }; + + validateProcedureEntryInternalReferenceTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateProcedureEntryInternalReferenceReason() { + OperationsTestCase validateProcedureEntryInternalReferenceReasonTestCase = new OperationsTestCase( + "validateProcedureEntryInternalReferenceReason", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ENTRY_INTERNAL_REFERENCE_REASON__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureEntry target) { + target.init(); + + } + + @Override + protected void updateToPass(ProcedureEntry target) { + + EntryRelationship er = CDAFactory.eINSTANCE.createEntryRelationship(); + er.setTypeCode(x_ActRelationshipEntryRelationship.RSON); + InternalReference ir = IHEFactory.eINSTANCE.createInternalReference().init(); + er.setAct(ir); + + target.getEntryRelationships().add(er); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureEntryOperations.validateProcedureEntryInternalReferenceReason( + (ProcedureEntry) objectToTest, diagnostician, map); + } + + }; + + validateProcedureEntryInternalReferenceReasonTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetInternalReference() { + + ProcedureEntry target = objectFactory.create(); + target.getInternalReference(); + + } + + /** + * + * @generated + */ + @Test + public void testGetInternalReferenceReasons() { + + ProcedureEntry target = objectFactory.create(); + target.getInternalReferenceReasons(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ProcedureEntryOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated NOT + */ + private static class ObjectFactory implements TestObjectFactory { + public ProcedureEntry create() { + return IHEFactory.eINSTANCE.createProcedureEntryProcedureActivityProcedure(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ProcedureEntryOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ProcedureEntryOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ProceduresAndInterventionsSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ProceduresAndInterventionsSectionTest.java new file mode 100644 index 000000000..acdde0a2e --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ProceduresAndInterventionsSectionTest.java @@ -0,0 +1,184 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.ProceduresAndInterventionsSection; +import org.openhealthtools.mdht.uml.cda.ihe.operations.ProceduresAndInterventionsSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Procedures And Interventions Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ProceduresAndInterventionsSection#validateProceduresAndInterventionsSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedures And Interventions Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ProceduresAndInterventionsSection#validateProceduresAndInterventionsSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedures And Interventions Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ProceduresAndInterventionsSection#getProcedureEntry() Get Procedure Entry}
  • + *
+ *

+ * + * @generated + */ + +public class ProceduresAndInterventionsSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateProceduresAndInterventionsSectionTemplateId() { + OperationsTestCase validateProceduresAndInterventionsSectionTemplateIdTestCase = new OperationsTestCase( + "validateProceduresAndInterventionsSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURES_AND_INTERVENTIONS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProceduresAndInterventionsSection target) { + + } + + @Override + protected void updateToPass(ProceduresAndInterventionsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProceduresAndInterventionsSectionOperations.validateProceduresAndInterventionsSectionTemplateId( + (ProceduresAndInterventionsSection) objectToTest, diagnostician, map); + } + + }; + + validateProceduresAndInterventionsSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProceduresAndInterventionsSectionCode() { + OperationsTestCase validateProceduresAndInterventionsSectionCodeTestCase = new OperationsTestCase( + "validateProceduresAndInterventionsSectionCode", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURES_AND_INTERVENTIONS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProceduresAndInterventionsSection target) { + + } + + @Override + protected void updateToPass(ProceduresAndInterventionsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProceduresAndInterventionsSectionOperations.validateProceduresAndInterventionsSectionCode( + (ProceduresAndInterventionsSection) objectToTest, diagnostician, map); + } + + }; + + validateProceduresAndInterventionsSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProcedureEntry() { + + ProceduresAndInterventionsSection target = objectFactory.create(); + target.getProcedureEntry(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ProceduresAndInterventionsSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ProceduresAndInterventionsSection create() { + return IHEFactory.eINSTANCE.createProceduresAndInterventionsSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ProceduresAndInterventionsSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ProceduresAndInterventionsSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ProductEntryTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ProductEntryTest.java new file mode 100644 index 000000000..7c075675f --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ProductEntryTest.java @@ -0,0 +1,142 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.ProductEntry; +import org.openhealthtools.mdht.uml.cda.ihe.operations.ProductEntryOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Product Entry' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ProductEntry#validateProductEntryTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Product Entry Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class ProductEntryTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateProductEntryTemplateId() { + OperationsTestCase validateProductEntryTemplateIdTestCase = new OperationsTestCase( + "validateProductEntryTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PRODUCT_ENTRY_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProductEntry target) { + + } + + @Override + protected void updateToPass(ProductEntry target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProductEntryOperations.validateProductEntryTemplateId( + (ProductEntry) objectToTest, diagnostician, map); + } + + }; + + validateProductEntryTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ProductEntryOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public ProductEntry create() { + return IHEFactory.eINSTANCE.createProductEntry(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ProductEntryOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ProductEntryOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ReasonForReferralSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ReasonForReferralSectionTest.java new file mode 100644 index 000000000..b661f4eaf --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ReasonForReferralSectionTest.java @@ -0,0 +1,177 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.ReasonForReferralSection; +import org.openhealthtools.mdht.uml.cda.ihe.operations.ReasonForReferralSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Reason For Referral Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ReasonForReferralSection#validateReasonForReferralSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Reason For Referral Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ReasonForReferralSection#validateReasonForReferralSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Reason For Referral Section Code}
  • + *
+ *

+ * + * @generated + */ + +public class ReasonForReferralSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateReasonForReferralSectionTemplateId() { + OperationsTestCase validateReasonForReferralSectionTemplateIdTestCase = new OperationsTestCase( + "validateReasonForReferralSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_REASON_FOR_REFERRAL_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReasonForReferralSection target) { + + } + + @Override + protected void updateToPass(ReasonForReferralSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReasonForReferralSectionOperations.validateReasonForReferralSectionTemplateId( + (ReasonForReferralSection) objectToTest, diagnostician, map); + } + + }; + + validateReasonForReferralSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateReasonForReferralSectionCode() { + OperationsTestCase validateReasonForReferralSectionCodeTestCase = new OperationsTestCase( + "validateReasonForReferralSectionCode", + operationsForOCL.getOCLValue("VALIDATE_REASON_FOR_REFERRAL_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReasonForReferralSection target) { + + } + + @Override + protected void updateToPass(ReasonForReferralSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReasonForReferralSectionOperations.validateReasonForReferralSectionCode( + (ReasonForReferralSection) objectToTest, diagnostician, map); + } + + }; + + validateReasonForReferralSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ReasonForReferralSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public ReasonForReferralSection create() { + return IHEFactory.eINSTANCE.createReasonForReferralSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ReasonForReferralSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ReasonForReferralSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/RectumSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/RectumSectionTest.java new file mode 100644 index 000000000..dfa7862b6 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/RectumSectionTest.java @@ -0,0 +1,222 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.RectumSection; +import org.openhealthtools.mdht.uml.cda.ihe.operations.RectumSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Rectum Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.RectumSection#validateRectumSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Rectum Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.RectumSection#validateRectumSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Rectum Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.RectumSection#validateRectumSectionProblemEntry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Rectum Section Problem Entry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.RectumSection#getProblemEntry() Get Problem Entry}
  • + *
+ *

+ * + * @generated + */ + +public class RectumSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateRectumSectionTemplateId() { + OperationsTestCase validateRectumSectionTemplateIdTestCase = new OperationsTestCase( + "validateRectumSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_RECTUM_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(RectumSection target) { + + } + + @Override + protected void updateToPass(RectumSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return RectumSectionOperations.validateRectumSectionTemplateId( + (RectumSection) objectToTest, diagnostician, map); + } + + }; + + validateRectumSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateRectumSectionCode() { + OperationsTestCase validateRectumSectionCodeTestCase = new OperationsTestCase( + "validateRectumSectionCode", + operationsForOCL.getOCLValue("VALIDATE_RECTUM_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(RectumSection target) { + + } + + @Override + protected void updateToPass(RectumSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return RectumSectionOperations.validateRectumSectionCode( + (RectumSection) objectToTest, diagnostician, map); + } + + }; + + validateRectumSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateRectumSectionProblemEntry() { + OperationsTestCase validateRectumSectionProblemEntryTestCase = new OperationsTestCase( + "validateRectumSectionProblemEntry", + operationsForOCL.getOCLValue("VALIDATE_RECTUM_SECTION_PROBLEM_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(RectumSection target) { + target.init(); + } + + @Override + protected void updateToPass(RectumSection target) { + + target.addObservation(IHEFactory.eINSTANCE.createProblemEntry().init()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return RectumSectionOperations.validateRectumSectionProblemEntry( + (RectumSection) objectToTest, diagnostician, map); + } + + }; + + validateRectumSectionProblemEntryTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemEntry() { + + RectumSection target = objectFactory.create(); + target.getProblemEntry(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends RectumSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public RectumSection create() { + return IHEFactory.eINSTANCE.createRectumSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends RectumSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // RectumSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/RespiratorySystemSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/RespiratorySystemSectionTest.java new file mode 100644 index 000000000..2515f6185 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/RespiratorySystemSectionTest.java @@ -0,0 +1,223 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.RespiratorySystemSection; +import org.openhealthtools.mdht.uml.cda.ihe.operations.RespiratorySystemSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Respiratory System Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.RespiratorySystemSection#validateRespiratorySystemSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Respiratory System Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.RespiratorySystemSection#validateRespiratorySystemSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Respiratory System Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.RespiratorySystemSection#validateRespiratorySystemSectionProblemEntry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Respiratory System Section Problem Entry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.RespiratorySystemSection#getProblemEntry() Get Problem Entry}
  • + *
+ *

+ * + * @generated + */ + +public class RespiratorySystemSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateRespiratorySystemSectionTemplateId() { + OperationsTestCase validateRespiratorySystemSectionTemplateIdTestCase = new OperationsTestCase( + "validateRespiratorySystemSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_RESPIRATORY_SYSTEM_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(RespiratorySystemSection target) { + + } + + @Override + protected void updateToPass(RespiratorySystemSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return RespiratorySystemSectionOperations.validateRespiratorySystemSectionTemplateId( + (RespiratorySystemSection) objectToTest, diagnostician, map); + } + + }; + + validateRespiratorySystemSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateRespiratorySystemSectionCode() { + OperationsTestCase validateRespiratorySystemSectionCodeTestCase = new OperationsTestCase( + "validateRespiratorySystemSectionCode", + operationsForOCL.getOCLValue("VALIDATE_RESPIRATORY_SYSTEM_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(RespiratorySystemSection target) { + + } + + @Override + protected void updateToPass(RespiratorySystemSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return RespiratorySystemSectionOperations.validateRespiratorySystemSectionCode( + (RespiratorySystemSection) objectToTest, diagnostician, map); + } + + }; + + validateRespiratorySystemSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateRespiratorySystemSectionProblemEntry() { + OperationsTestCase validateRespiratorySystemSectionProblemEntryTestCase = new OperationsTestCase( + "validateRespiratorySystemSectionProblemEntry", + operationsForOCL.getOCLValue("VALIDATE_RESPIRATORY_SYSTEM_SECTION_PROBLEM_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(RespiratorySystemSection target) { + target.init(); + } + + @Override + protected void updateToPass(RespiratorySystemSection target) { + + target.addObservation(IHEFactory.eINSTANCE.createProblemEntry().init()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return RespiratorySystemSectionOperations.validateRespiratorySystemSectionProblemEntry( + (RespiratorySystemSection) objectToTest, diagnostician, map); + } + + }; + + validateRespiratorySystemSectionProblemEntryTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemEntry() { + + RespiratorySystemSection target = objectFactory.create(); + target.getProblemEntry(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends RespiratorySystemSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public RespiratorySystemSection create() { + return IHEFactory.eINSTANCE.createRespiratorySystemSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends RespiratorySystemSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // RespiratorySystemSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ReviewOfSystemsSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ReviewOfSystemsSectionTest.java new file mode 100644 index 000000000..eff05e650 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ReviewOfSystemsSectionTest.java @@ -0,0 +1,177 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.ReviewOfSystemsSection; +import org.openhealthtools.mdht.uml.cda.ihe.operations.ReviewOfSystemsSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Review Of Systems Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ReviewOfSystemsSection#validateReviewOfSystemsSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Review Of Systems Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ReviewOfSystemsSection#validateReviewOfSystemsSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Review Of Systems Section Code}
  • + *
+ *

+ * + * @generated + */ + +public class ReviewOfSystemsSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateReviewOfSystemsSectionTemplateId() { + OperationsTestCase validateReviewOfSystemsSectionTemplateIdTestCase = new OperationsTestCase( + "validateReviewOfSystemsSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_REVIEW_OF_SYSTEMS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReviewOfSystemsSection target) { + + } + + @Override + protected void updateToPass(ReviewOfSystemsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReviewOfSystemsSectionOperations.validateReviewOfSystemsSectionTemplateId( + (ReviewOfSystemsSection) objectToTest, diagnostician, map); + } + + }; + + validateReviewOfSystemsSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateReviewOfSystemsSectionCode() { + OperationsTestCase validateReviewOfSystemsSectionCodeTestCase = new OperationsTestCase( + "validateReviewOfSystemsSectionCode", + operationsForOCL.getOCLValue("VALIDATE_REVIEW_OF_SYSTEMS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ReviewOfSystemsSection target) { + + } + + @Override + protected void updateToPass(ReviewOfSystemsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ReviewOfSystemsSectionOperations.validateReviewOfSystemsSectionCode( + (ReviewOfSystemsSection) objectToTest, diagnostician, map); + } + + }; + + validateReviewOfSystemsSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ReviewOfSystemsSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public ReviewOfSystemsSection create() { + return IHEFactory.eINSTANCE.createReviewOfSystemsSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ReviewOfSystemsSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ReviewOfSystemsSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ScanDataEntererTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ScanDataEntererTest.java new file mode 100644 index 000000000..46938a295 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ScanDataEntererTest.java @@ -0,0 +1,276 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.AssignedEntity; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.ClinicalDocument; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.ScanDataEnterer; +import org.openhealthtools.mdht.uml.cda.ihe.operations.ScanDataEntererOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.datatypes.TS; + +/** + * + * A static utility class that provides operations related to 'Scan Data Enterer' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ScanDataEnterer#validateScanDataEntererTimeEqualsDocumentEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Scan Data Enterer Time Equals Document Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ScanDataEnterer#validateScanDataEntererHasAssignedEntityId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Scan Data Enterer Has Assigned Entity Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ScanDataEnterer#validateScanDataEntererTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Scan Data Enterer Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ScanDataEnterer#validateScanDataEntererTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Scan Data Enterer Time}
  • + *
+ *

+ * + * @generated + */ + +public class ScanDataEntererTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateScanDataEntererTimeEqualsDocumentEffectiveTime() { + OperationsTestCase validateScanDataEntererTimeEqualsDocumentEffectiveTimeTestCase = new OperationsTestCase( + "validateScanDataEntererTimeEqualsDocumentEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_SCAN_DATA_ENTERER_TIME_EQUALS_DOCUMENT_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ScanDataEnterer target) { + + target.init(); + TS ts = DatatypesFactory.eINSTANCE.createTS("20071204103022-0500"); + target.setTime(ts); + ClinicalDocument cd = CDAFactory.eINSTANCE.createClinicalDocument(); + TS docts = DatatypesFactory.eINSTANCE.createTS("20081204103022-0500"); + ; + cd.setEffectiveTime(docts); + cd.setDataEnterer(target); + + } + + @Override + protected void updateToPass(ScanDataEnterer target) { + TS ts = DatatypesFactory.eINSTANCE.createTS("20071204103022-0500"); + target.setTime(ts); + + ClinicalDocument cd = CDAFactory.eINSTANCE.createClinicalDocument(); + cd.setEffectiveTime(EcoreUtil.copy(ts)); // one TS cannot have two containers + cd.setDataEnterer(target); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ScanDataEntererOperations.validateScanDataEntererTimeEqualsDocumentEffectiveTime( + (ScanDataEnterer) objectToTest, diagnostician, map); + } + + }; + + validateScanDataEntererTimeEqualsDocumentEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateScanDataEntererHasAssignedEntityId() { + OperationsTestCase validateScanDataEntererHasAssignedEntityIdTestCase = new OperationsTestCase( + "validateScanDataEntererHasAssignedEntityId", + operationsForOCL.getOCLValue("VALIDATE_SCAN_DATA_ENTERER_HAS_ASSIGNED_ENTITY_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + @Override + protected void updateToFail(ScanDataEnterer target) { + target.init(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + + II ii = DatatypesFactory.eINSTANCE.createII(); + ae.getIds().add(ii); + + target.setAssignedEntity(ae); + } + + @Override + protected void updateToPass(ScanDataEnterer target) { + for (II ii : target.getAssignedEntity().getIds()) { + ii.setExtension("extension"); + ii.setRoot("root"); + } + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ScanDataEntererOperations.validateScanDataEntererHasAssignedEntityId( + (ScanDataEnterer) objectToTest, diagnostician, map); + } + + }; + + validateScanDataEntererHasAssignedEntityIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateScanDataEntererTemplateId() { + OperationsTestCase validateScanDataEntererTemplateIdTestCase = new OperationsTestCase( + "validateScanDataEntererTemplateId", + operationsForOCL.getOCLValue("VALIDATE_SCAN_DATA_ENTERER_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ScanDataEnterer target) { + + } + + @Override + protected void updateToPass(ScanDataEnterer target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ScanDataEntererOperations.validateScanDataEntererTemplateId( + (ScanDataEnterer) objectToTest, diagnostician, map); + } + + }; + + validateScanDataEntererTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateScanDataEntererTime() { + OperationsTestCase validateScanDataEntererTimeTestCase = new OperationsTestCase( + "validateScanDataEntererTime", + operationsForOCL.getOCLValue("VALIDATE_SCAN_DATA_ENTERER_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ScanDataEnterer target) { + target.init(); + } + + @Override + protected void updateToPass(ScanDataEnterer target) { + TS value = DatatypesFactory.eINSTANCE.createTS("time"); + target.setTime(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ScanDataEntererOperations.validateScanDataEntererTime( + (ScanDataEnterer) objectToTest, diagnostician, map); + } + + }; + + validateScanDataEntererTimeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ScanDataEntererOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public ScanDataEnterer create() { + return IHEFactory.eINSTANCE.createScanDataEnterer(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ScanDataEntererOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ScanDataEntererOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ScanOriginalAuthorTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ScanOriginalAuthorTest.java new file mode 100644 index 000000000..0d1781990 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ScanOriginalAuthorTest.java @@ -0,0 +1,236 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.AssignedAuthor; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Organization; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.ScanOriginalAuthor; +import org.openhealthtools.mdht.uml.cda.ihe.operations.ScanOriginalAuthorOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; + +/** + * + * A static utility class that provides operations related to 'Scan Original Author' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ScanOriginalAuthor#validateScanOriginalAuthorHasAssignedAuthorId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Scan Original Author Has Assigned Author Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ScanOriginalAuthor#validateScanOriginalAuthorHasAssignedAuthorRepresentedOrganizationId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Scan Original Author Has Assigned Author Represented Organization Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ScanOriginalAuthor#validateScanOriginalAuthorTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Scan Original Author Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class ScanOriginalAuthorTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateScanOriginalAuthorHasAssignedAuthorId() { + OperationsTestCase validateScanOriginalAuthorHasAssignedAuthorIdTestCase = new OperationsTestCase( + "validateScanOriginalAuthorHasAssignedAuthorId", + operationsForOCL.getOCLValue("VALIDATE_SCAN_ORIGINAL_AUTHOR_HAS_ASSIGNED_AUTHOR_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ScanOriginalAuthor target) { + target.init(); + AssignedAuthor a = CDAFactory.eINSTANCE.createAssignedAuthor(); + II ii = DatatypesFactory.eINSTANCE.createII(); + a.getIds().add(ii); + target.setAssignedAuthor(a); + + } + + @Override + protected void updateToPass(ScanOriginalAuthor target) { + for (II ii : target.getAssignedAuthor().getIds()) { + ii.setRoot("root"); + ii.setExtension("ext"); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ScanOriginalAuthorOperations.validateScanOriginalAuthorHasAssignedAuthorId( + (ScanOriginalAuthor) objectToTest, diagnostician, map); + } + + }; + + validateScanOriginalAuthorHasAssignedAuthorIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateScanOriginalAuthorHasAssignedAuthorRepresentedOrganizationId() { + OperationsTestCase validateScanOriginalAuthorHasAssignedAuthorRepresentedOrganizationIdTestCase = new OperationsTestCase( + "validateScanOriginalAuthorHasAssignedAuthorRepresentedOrganizationId", + operationsForOCL.getOCLValue("VALIDATE_SCAN_ORIGINAL_AUTHOR_HAS_ASSIGNED_AUTHOR_REPRESENTED_ORGANIZATION_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ScanOriginalAuthor target) { + target.init(); + AssignedAuthor a = CDAFactory.eINSTANCE.createAssignedAuthor(); + Organization o = CDAFactory.eINSTANCE.createOrganization(); + + a.setRepresentedOrganization(o); + II ii = DatatypesFactory.eINSTANCE.createII(); + o.getIds().add(ii); + target.setAssignedAuthor(a); + + } + + @Override + protected void updateToPass(ScanOriginalAuthor target) { + for (II ii : target.getAssignedAuthor().getRepresentedOrganization().getIds()) { + ii.setRoot("root"); + ii.setExtension("ext"); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ScanOriginalAuthorOperations.validateScanOriginalAuthorHasAssignedAuthorRepresentedOrganizationId( + (ScanOriginalAuthor) objectToTest, diagnostician, map); + } + + }; + + validateScanOriginalAuthorHasAssignedAuthorRepresentedOrganizationIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateScanOriginalAuthorTemplateId() { + OperationsTestCase validateScanOriginalAuthorTemplateIdTestCase = new OperationsTestCase( + "validateScanOriginalAuthorTemplateId", + operationsForOCL.getOCLValue("VALIDATE_SCAN_ORIGINAL_AUTHOR_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ScanOriginalAuthor target) { + + } + + @Override + protected void updateToPass(ScanOriginalAuthor target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ScanOriginalAuthorOperations.validateScanOriginalAuthorTemplateId( + (ScanOriginalAuthor) objectToTest, diagnostician, map); + } + + }; + + validateScanOriginalAuthorTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ScanOriginalAuthorOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public ScanOriginalAuthor create() { + return IHEFactory.eINSTANCE.createScanOriginalAuthor(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ScanOriginalAuthorOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ScanOriginalAuthorOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ScannedDocumentTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ScannedDocumentTest.java new file mode 100644 index 000000000..3506a0457 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ScannedDocumentTest.java @@ -0,0 +1,1342 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.AssignedAuthor; +import org.openhealthtools.mdht.uml.cda.AssignedCustodian; +import org.openhealthtools.mdht.uml.cda.AssignedEntity; +import org.openhealthtools.mdht.uml.cda.Author; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Component2; +import org.openhealthtools.mdht.uml.cda.Custodian; +import org.openhealthtools.mdht.uml.cda.CustodianOrganization; +import org.openhealthtools.mdht.uml.cda.InfrastructureRootTypeId; +import org.openhealthtools.mdht.uml.cda.LegalAuthenticator; +import org.openhealthtools.mdht.uml.cda.NonXMLBody; +import org.openhealthtools.mdht.uml.cda.Patient; +import org.openhealthtools.mdht.uml.cda.PatientRole; +import org.openhealthtools.mdht.uml.cda.Person; +import org.openhealthtools.mdht.uml.cda.RecordTarget; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.ScanDataEnterer; +import org.openhealthtools.mdht.uml.cda.ihe.ScanOriginalAuthor; +import org.openhealthtools.mdht.uml.cda.ihe.ScannedDocument; +import org.openhealthtools.mdht.uml.cda.ihe.ScanningDevice; +import org.openhealthtools.mdht.uml.cda.ihe.operations.ScannedDocumentOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.AD; +import org.openhealthtools.mdht.uml.hl7.datatypes.BinaryDataEncoding; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.datatypes.ON; +import org.openhealthtools.mdht.uml.hl7.datatypes.PN; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; +import org.openhealthtools.mdht.uml.hl7.datatypes.TS; + +/** + * + * A static utility class that provides operations related to 'Scanned Document' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ScannedDocument#validateScannedDocumentTypeIdFixed(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Scanned Document Type Id Fixed}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ScannedDocument#validateScannedDocumentHasOneRecordTarget(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Scanned Document Has One Record Target}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ScannedDocument#validateScannedDocumentHasAssignedAuthor(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Scanned Document Has Assigned Author}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ScannedDocument#validateScannedDocumentPatientRoleId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Scanned Document Patient Role Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ScannedDocument#validateScannedDocumentHasPatientRoleAddress(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Scanned Document Has Patient Role Address}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ScannedDocument#validateScannedDocumentHasPatientName(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Scanned Document Has Patient Name}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ScannedDocument#validateScannedDocumentHasPatientGenderCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Scanned Document Has Patient Gender Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ScannedDocument#validateScannedDocumentHasPatientBirthYear(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Scanned Document Has Patient Birth Year}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ScannedDocument#validateScannedDocumentHasOriginalAuthor(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Scanned Document Has Original Author}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ScannedDocument#validateScannedDocumentHasScanningDevice(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Scanned Document Has Scanning Device}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ScannedDocument#validateScannedDocumentHasScanDataEnterer(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Scanned Document Has Scan Data Enterer}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ScannedDocument#validateScannedDocumentHasRepresentedCustodianOrganizationName(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Scanned Document Has Represented Custodian Organization Name}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ScannedDocument#validateScannedDocumentHasRepresentedCustodianOrganizationAddr(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Scanned Document Has Represented Custodian Organization Addr}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ScannedDocument#validateScannedDocumentLegalAuthenticatorAssignedEntityId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Scanned Document Legal Authenticator Assigned Entity Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ScannedDocument#validateScannedDocumentHasNonXMLBody(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Scanned Document Has Non XML Body}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ScannedDocument#validateScannedDocumentHasNonXMLBodyBinaryText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Scanned Document Has Non XML Body Binary Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ScannedDocument#validateScannedDocumentHasNonXMLBodyTextMediaType(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Scanned Document Has Non XML Body Text Media Type}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ScannedDocument#validateScannedDocumentHasNonXMLBodyTextRepresentation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Scanned Document Has Non XML Body Text Representation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ScannedDocument#validateScannedDocumentTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Scanned Document Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ScannedDocument#validateScannedDocumentCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Scanned Document Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ScannedDocument#validateScannedDocumentConfidentialityCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Scanned Document Confidentiality Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ScannedDocument#validateScannedDocumentEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Scanned Document Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ScannedDocument#validateScannedDocumentId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Scanned Document Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ScannedDocument#validateScannedDocumentLanguageCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Scanned Document Language Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ScannedDocument#validateScannedDocumentTitle(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Scanned Document Title}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ScannedDocument#validateScannedDocumentTypeId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Scanned Document Type Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ScannedDocument#validateScannedDocumentScanOriginalAuthor(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Scanned Document Scan Original Author}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ScannedDocument#validateScannedDocumentScanningDevice(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Scanned Document Scanning Device}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ScannedDocument#validateScannedDocumentScanDataEnterer(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Scanned Document Scan Data Enterer}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ScannedDocument#validateScannedDocumentLegalAuthenticator(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Scanned Document Legal Authenticator}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ScannedDocument#validateScannedDocumentDocumentationOf(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Scanned Document Documentation Of}
  • + *
+ *

+ * + * @generated + */ + +public class ScannedDocumentTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateScannedDocumentTypeIdFixed() { + OperationsTestCase validateScannedDocumentTypeIdFixedTestCase = new OperationsTestCase( + "validateScannedDocumentTypeIdFixed", + operationsForOCL.getOCLValue("VALIDATE_SCANNED_DOCUMENT_TYPE_ID_FIXED__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ScannedDocument target) { + target.init(); + } + + @Override + protected void updateToPass(ScannedDocument target) { + InfrastructureRootTypeId id = CDAFactory.eINSTANCE.createInfrastructureRootTypeId(); + id.setRoot("2.16.840.1.113883.1.3"); + id.setExtension("POCD_HD000040"); + target.setTypeId(id); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ScannedDocumentOperations.validateScannedDocumentTypeIdFixed( + (ScannedDocument) objectToTest, diagnostician, map); + } + + }; + + validateScannedDocumentTypeIdFixedTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateScannedDocumentHasOneRecordTarget() { + OperationsTestCase validateScannedDocumentHasOneRecordTargetTestCase = new OperationsTestCase( + "validateScannedDocumentHasOneRecordTarget", + operationsForOCL.getOCLValue("VALIDATE_SCANNED_DOCUMENT_HAS_ONE_RECORD_TARGET__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ScannedDocument target) { + target.init(); + } + + @Override + protected void updateToPass(ScannedDocument target) { + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + target.getRecordTargets().add(rt); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ScannedDocumentOperations.validateScannedDocumentHasOneRecordTarget( + (ScannedDocument) objectToTest, diagnostician, map); + } + + }; + + validateScannedDocumentHasOneRecordTargetTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateScannedDocumentHasAssignedAuthor() { + OperationsTestCase validateScannedDocumentHasAssignedAuthorTestCase = new OperationsTestCase( + "validateScannedDocumentHasAssignedAuthor", + operationsForOCL.getOCLValue("VALIDATE_SCANNED_DOCUMENT_HAS_ASSIGNED_AUTHOR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ScannedDocument target) { + target.init(); + + } + + @Override + protected void updateToPass(ScannedDocument target) { + Author author = CDAFactory.eINSTANCE.createAuthor(); + AssignedAuthor assigned = CDAFactory.eINSTANCE.createAssignedAuthor(); + Person person = CDAFactory.eINSTANCE.createPerson(); + assigned.setAssignedPerson(person); + author.setAssignedAuthor(assigned); + target.getAuthors().add(author); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ScannedDocumentOperations.validateScannedDocumentHasAssignedAuthor( + (ScannedDocument) objectToTest, diagnostician, map); + } + + }; + + validateScannedDocumentHasAssignedAuthorTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateScannedDocumentPatientRoleId() { + OperationsTestCase validateScannedDocumentPatientRoleIdTestCase = new OperationsTestCase( + "validateScannedDocumentPatientRoleId", + operationsForOCL.getOCLValue("VALIDATE_SCANNED_DOCUMENT_PATIENT_ROLE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ScannedDocument target) { + target.init(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + target.getRecordTargets().add(rt); + } + + @Override + protected void updateToPass(ScannedDocument target) { + for (RecordTarget rt : target.getRecordTargets()) { + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + rt.setPatientRole(pr); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ScannedDocumentOperations.validateScannedDocumentPatientRoleId( + (ScannedDocument) objectToTest, diagnostician, map); + } + + }; + + validateScannedDocumentPatientRoleIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateScannedDocumentHasPatientRoleAddress() { + OperationsTestCase validateScannedDocumentHasPatientRoleAddressTestCase = new OperationsTestCase( + "validateScannedDocumentHasPatientRoleAddress", + operationsForOCL.getOCLValue("VALIDATE_SCANNED_DOCUMENT_HAS_PATIENT_ROLE_ADDRESS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ScannedDocument target) { + + target.init(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + } + + @Override + protected void updateToPass(ScannedDocument target) { + for (RecordTarget rt : target.getRecordTargets()) { + AD adr = DatatypesFactory.eINSTANCE.createAD(); + adr.addCountry("country"); + rt.getPatientRole().getAddrs().add(adr); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ScannedDocumentOperations.validateScannedDocumentHasPatientRoleAddress( + (ScannedDocument) objectToTest, diagnostician, map); + } + + }; + + validateScannedDocumentHasPatientRoleAddressTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateScannedDocumentHasPatientName() { + OperationsTestCase validateScannedDocumentHasPatientNameTestCase = new OperationsTestCase( + "validateScannedDocumentHasPatientName", + operationsForOCL.getOCLValue("VALIDATE_SCANNED_DOCUMENT_HAS_PATIENT_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ScannedDocument target) { + target.init(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + pr.setPatient(patient); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + + } + + @Override + protected void updateToPass(ScannedDocument target) { + for (RecordTarget rt : target.getRecordTargets()) { + PN name = DatatypesFactory.eINSTANCE.createPN(); + name.addFamily("family"); + name.addGiven("given"); + rt.getPatientRole().getPatient().getNames().add(name); + + } + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ScannedDocumentOperations.validateScannedDocumentHasPatientName( + (ScannedDocument) objectToTest, diagnostician, map); + } + + }; + + validateScannedDocumentHasPatientNameTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateScannedDocumentHasPatientGenderCode() { + OperationsTestCase validateScannedDocumentHasPatientGenderCodeTestCase = new OperationsTestCase( + "validateScannedDocumentHasPatientGenderCode", + operationsForOCL.getOCLValue("VALIDATE_SCANNED_DOCUMENT_HAS_PATIENT_GENDER_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ScannedDocument target) { + target.init(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + pr.setPatient(patient); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + + } + + @Override + protected void updateToPass(ScannedDocument target) { + for (RecordTarget rt : target.getRecordTargets()) { + CE gender = DatatypesFactory.eINSTANCE.createCE(); + rt.getPatientRole().getPatient().setAdministrativeGenderCode(gender); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ScannedDocumentOperations.validateScannedDocumentHasPatientGenderCode( + (ScannedDocument) objectToTest, diagnostician, map); + } + + }; + + validateScannedDocumentHasPatientGenderCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateScannedDocumentHasPatientBirthYear() { + OperationsTestCase validateScannedDocumentHasPatientBirthYearTestCase = new OperationsTestCase( + "validateScannedDocumentHasPatientBirthYear", + operationsForOCL.getOCLValue("VALIDATE_SCANNED_DOCUMENT_HAS_PATIENT_BIRTH_YEAR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ScannedDocument target) { + target.init(); + RecordTarget rt = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pr = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + pr.setPatient(patient); + rt.setPatientRole(pr); + target.getRecordTargets().add(rt); + + } + + @Override + protected void updateToPass(ScannedDocument target) { + for (RecordTarget rt : target.getRecordTargets()) { + TS birth = DatatypesFactory.eINSTANCE.createTS("birth"); + + rt.getPatientRole().getPatient().setBirthTime(birth); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ScannedDocumentOperations.validateScannedDocumentHasPatientBirthYear( + (ScannedDocument) objectToTest, diagnostician, map); + } + + }; + + validateScannedDocumentHasPatientBirthYearTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateScannedDocumentHasOriginalAuthor() { + OperationsTestCase validateScannedDocumentHasOriginalAuthorTestCase = new OperationsTestCase( + "validateScannedDocumentHasOriginalAuthor", + operationsForOCL.getOCLValue("VALIDATE_SCANNED_DOCUMENT_HAS_ORIGINAL_AUTHOR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ScannedDocument target) { + target.init(); + } + + @Override + protected void updateToPass(ScannedDocument target) { + ScanOriginalAuthor soa = IHEFactory.eINSTANCE.createScanOriginalAuthor().init(); + target.getAuthors().add(soa); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ScannedDocumentOperations.validateScannedDocumentHasOriginalAuthor( + (ScannedDocument) objectToTest, diagnostician, map); + } + + }; + + validateScannedDocumentHasOriginalAuthorTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateScannedDocumentHasScanningDevice() { + OperationsTestCase validateScannedDocumentHasScanningDeviceTestCase = new OperationsTestCase( + "validateScannedDocumentHasScanningDevice", + operationsForOCL.getOCLValue("VALIDATE_SCANNED_DOCUMENT_HAS_SCANNING_DEVICE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ScannedDocument target) { + target.init(); + } + + @Override + protected void updateToPass(ScannedDocument target) { + ScanningDevice device = IHEFactory.eINSTANCE.createScanningDevice().init(); + target.getAuthors().add(device); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ScannedDocumentOperations.validateScannedDocumentHasScanningDevice( + (ScannedDocument) objectToTest, diagnostician, map); + } + + }; + + validateScannedDocumentHasScanningDeviceTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateScannedDocumentHasScanDataEnterer() { + OperationsTestCase validateScannedDocumentHasScanDataEntererTestCase = new OperationsTestCase( + "validateScannedDocumentHasScanDataEnterer", + operationsForOCL.getOCLValue("VALIDATE_SCANNED_DOCUMENT_HAS_SCAN_DATA_ENTERER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ScannedDocument target) { + target.init(); + } + + @Override + protected void updateToPass(ScannedDocument target) { + ScanDataEnterer sde = IHEFactory.eINSTANCE.createScanDataEnterer().init(); + target.setDataEnterer(sde); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ScannedDocumentOperations.validateScannedDocumentHasScanDataEnterer( + (ScannedDocument) objectToTest, diagnostician, map); + } + + }; + + validateScannedDocumentHasScanDataEntererTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateScannedDocumentHasRepresentedCustodianOrganizationName() { + OperationsTestCase validateScannedDocumentHasRepresentedCustodianOrganizationNameTestCase = new OperationsTestCase( + "validateScannedDocumentHasRepresentedCustodianOrganizationName", + operationsForOCL.getOCLValue("VALIDATE_SCANNED_DOCUMENT_HAS_REPRESENTED_CUSTODIAN_ORGANIZATION_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ScannedDocument target) { + target.init(); + Custodian custodian = CDAFactory.eINSTANCE.createCustodian(); + AssignedCustodian assignedCustodian = CDAFactory.eINSTANCE.createAssignedCustodian(); + CustodianOrganization organization = CDAFactory.eINSTANCE.createCustodianOrganization(); + assignedCustodian.setRepresentedCustodianOrganization(organization); + custodian.setAssignedCustodian(assignedCustodian); + target.setCustodian(custodian); + + } + + @Override + protected void updateToPass(ScannedDocument target) { + ON name = DatatypesFactory.eINSTANCE.createON(); + target.getCustodian().getAssignedCustodian().getRepresentedCustodianOrganization().setName(name); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ScannedDocumentOperations.validateScannedDocumentHasRepresentedCustodianOrganizationName( + (ScannedDocument) objectToTest, diagnostician, map); + } + + }; + + validateScannedDocumentHasRepresentedCustodianOrganizationNameTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateScannedDocumentHasRepresentedCustodianOrganizationAddr() { + OperationsTestCase validateScannedDocumentHasRepresentedCustodianOrganizationAddrTestCase = new OperationsTestCase( + "validateScannedDocumentHasRepresentedCustodianOrganizationAddr", + operationsForOCL.getOCLValue("VALIDATE_SCANNED_DOCUMENT_HAS_REPRESENTED_CUSTODIAN_ORGANIZATION_ADDR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ScannedDocument target) { + target.init(); + Custodian custodian = CDAFactory.eINSTANCE.createCustodian(); + AssignedCustodian assignedCustodian = CDAFactory.eINSTANCE.createAssignedCustodian(); + CustodianOrganization organization = CDAFactory.eINSTANCE.createCustodianOrganization(); + assignedCustodian.setRepresentedCustodianOrganization(organization); + custodian.setAssignedCustodian(assignedCustodian); + target.setCustodian(custodian); + } + + @Override + protected void updateToPass(ScannedDocument target) { + AD address = DatatypesFactory.eINSTANCE.createAD(); + address.addCountry("country"); + target.getCustodian().getAssignedCustodian().getRepresentedCustodianOrganization().setAddr(address); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ScannedDocumentOperations.validateScannedDocumentHasRepresentedCustodianOrganizationAddr( + (ScannedDocument) objectToTest, diagnostician, map); + } + + }; + + validateScannedDocumentHasRepresentedCustodianOrganizationAddrTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateScannedDocumentLegalAuthenticatorAssignedEntityId() { + OperationsTestCase validateScannedDocumentLegalAuthenticatorAssignedEntityIdTestCase = new OperationsTestCase( + "validateScannedDocumentLegalAuthenticatorAssignedEntityId", + operationsForOCL.getOCLValue("VALIDATE_SCANNED_DOCUMENT_LEGAL_AUTHENTICATOR_ASSIGNED_ENTITY_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ScannedDocument target) { + target.init(); + LegalAuthenticator auth = CDAFactory.eINSTANCE.createLegalAuthenticator(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + II ii = DatatypesFactory.eINSTANCE.createII(); + ae.getIds().add(ii); + auth.setAssignedEntity(ae); + target.setLegalAuthenticator(auth); + + } + + @Override + protected void updateToPass(ScannedDocument target) { + target.getLegalAuthenticator().getAssignedEntity().getIds().clear(); + II ii = DatatypesFactory.eINSTANCE.createII("root", "extension"); + target.getLegalAuthenticator().getAssignedEntity().getIds().add(ii); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ScannedDocumentOperations.validateScannedDocumentLegalAuthenticatorAssignedEntityId( + (ScannedDocument) objectToTest, diagnostician, map); + } + + }; + + validateScannedDocumentLegalAuthenticatorAssignedEntityIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateScannedDocumentHasNonXMLBody() { + OperationsTestCase validateScannedDocumentHasNonXMLBodyTestCase = new OperationsTestCase( + "validateScannedDocumentHasNonXMLBody", + operationsForOCL.getOCLValue("VALIDATE_SCANNED_DOCUMENT_HAS_NON_XML_BODY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ScannedDocument target) { + target.init(); + Component2 comp = CDAFactory.eINSTANCE.createComponent2(); + target.setComponent(comp); + } + + @Override + protected void updateToPass(ScannedDocument target) { + + NonXMLBody nxb = CDAFactory.eINSTANCE.createNonXMLBody(); + target.getComponent().setNonXMLBody(nxb); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ScannedDocumentOperations.validateScannedDocumentHasNonXMLBody( + (ScannedDocument) objectToTest, diagnostician, map); + } + + }; + + validateScannedDocumentHasNonXMLBodyTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateScannedDocumentHasNonXMLBodyBinaryText() { + OperationsTestCase validateScannedDocumentHasNonXMLBodyBinaryTextTestCase = new OperationsTestCase( + "validateScannedDocumentHasNonXMLBodyBinaryText", + operationsForOCL.getOCLValue("VALIDATE_SCANNED_DOCUMENT_HAS_NON_XML_BODY_BINARY_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ScannedDocument target) { + target.init(); + Component2 comp = CDAFactory.eINSTANCE.createComponent2(); + NonXMLBody nxb = CDAFactory.eINSTANCE.createNonXMLBody(); + comp.setNonXMLBody(nxb); + target.setComponent(comp); + + } + + @Override + protected void updateToPass(ScannedDocument target) { + ED text = DatatypesFactory.eINSTANCE.createED("text"); + target.getComponent().getNonXMLBody().setText(text); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ScannedDocumentOperations.validateScannedDocumentHasNonXMLBodyBinaryText( + (ScannedDocument) objectToTest, diagnostician, map); + } + + }; + + validateScannedDocumentHasNonXMLBodyBinaryTextTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateScannedDocumentHasNonXMLBodyTextMediaType() { + OperationsTestCase validateScannedDocumentHasNonXMLBodyTextMediaTypeTestCase = new OperationsTestCase( + "validateScannedDocumentHasNonXMLBodyTextMediaType", + operationsForOCL.getOCLValue("VALIDATE_SCANNED_DOCUMENT_HAS_NON_XML_BODY_TEXT_MEDIA_TYPE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ScannedDocument target) { + target.init(); + Component2 comp = CDAFactory.eINSTANCE.createComponent2(); + NonXMLBody nxb = CDAFactory.eINSTANCE.createNonXMLBody(); + ED text = DatatypesFactory.eINSTANCE.createED("text"); + text.setMediaType("text/html"); // the default is text/plaain, which satisfies the constraint + nxb.setText(text); + comp.setNonXMLBody(nxb); + target.setComponent(comp); + + } + + @Override + protected void updateToPass(ScannedDocument target) { + + target.getComponent().getNonXMLBody().getText().setMediaType("application/pdf"); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ScannedDocumentOperations.validateScannedDocumentHasNonXMLBodyTextMediaType( + (ScannedDocument) objectToTest, diagnostician, map); + } + + }; + + validateScannedDocumentHasNonXMLBodyTextMediaTypeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateScannedDocumentHasNonXMLBodyTextRepresentation() { + OperationsTestCase validateScannedDocumentHasNonXMLBodyTextRepresentationTestCase = new OperationsTestCase( + "validateScannedDocumentHasNonXMLBodyTextRepresentation", + operationsForOCL.getOCLValue("VALIDATE_SCANNED_DOCUMENT_HAS_NON_XML_BODY_TEXT_REPRESENTATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ScannedDocument target) { + target.init(); + Component2 comp = CDAFactory.eINSTANCE.createComponent2(); + NonXMLBody nxb = CDAFactory.eINSTANCE.createNonXMLBody(); + ED text = DatatypesFactory.eINSTANCE.createED("text"); + nxb.setText(text); + comp.setNonXMLBody(nxb); + target.setComponent(comp); + target.getComponent().getNonXMLBody().getText().setRepresentation(BinaryDataEncoding.TXT); + } + + @Override + protected void updateToPass(ScannedDocument target) { + + target.getComponent().getNonXMLBody().getText().setRepresentation(BinaryDataEncoding.B64); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ScannedDocumentOperations.validateScannedDocumentHasNonXMLBodyTextRepresentation( + (ScannedDocument) objectToTest, diagnostician, map); + } + + }; + + validateScannedDocumentHasNonXMLBodyTextRepresentationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateScannedDocumentTemplateId() { + OperationsTestCase validateScannedDocumentTemplateIdTestCase = new OperationsTestCase( + "validateScannedDocumentTemplateId", + operationsForOCL.getOCLValue("VALIDATE_SCANNED_DOCUMENT_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ScannedDocument target) { + + } + + @Override + protected void updateToPass(ScannedDocument target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ScannedDocumentOperations.validateScannedDocumentTemplateId( + (ScannedDocument) objectToTest, diagnostician, map); + } + + }; + + validateScannedDocumentTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateScannedDocumentCode() { + OperationsTestCase validateScannedDocumentCodeTestCase = new OperationsTestCase( + "validateScannedDocumentCode", + operationsForOCL.getOCLValue("VALIDATE_SCANNED_DOCUMENT_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ScannedDocument target) { + target.init(); + + } + + @Override + protected void updateToPass(ScannedDocument target) { + CE ce = DatatypesFactory.eINSTANCE.createCE(); + target.setCode(ce); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ScannedDocumentOperations.validateScannedDocumentCode( + (ScannedDocument) objectToTest, diagnostician, map); + } + + }; + + validateScannedDocumentCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateScannedDocumentConfidentialityCode() { + OperationsTestCase validateScannedDocumentConfidentialityCodeTestCase = new OperationsTestCase( + "validateScannedDocumentConfidentialityCode", + operationsForOCL.getOCLValue("VALIDATE_SCANNED_DOCUMENT_CONFIDENTIALITY_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ScannedDocument target) { + target.init(); + } + + @Override + protected void updateToPass(ScannedDocument target) { + CE ce = DatatypesFactory.eINSTANCE.createCE(); + target.setConfidentialityCode(ce); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ScannedDocumentOperations.validateScannedDocumentConfidentialityCode( + (ScannedDocument) objectToTest, diagnostician, map); + } + + }; + + validateScannedDocumentConfidentialityCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateScannedDocumentEffectiveTime() { + OperationsTestCase validateScannedDocumentEffectiveTimeTestCase = new OperationsTestCase( + "validateScannedDocumentEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_SCANNED_DOCUMENT_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ScannedDocument target) { + + } + + @Override + protected void updateToPass(ScannedDocument target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ScannedDocumentOperations.validateScannedDocumentEffectiveTime( + (ScannedDocument) objectToTest, diagnostician, map); + } + + }; + + validateScannedDocumentEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateScannedDocumentId() { + OperationsTestCase validateScannedDocumentIdTestCase = new OperationsTestCase( + "validateScannedDocumentId", + operationsForOCL.getOCLValue("VALIDATE_SCANNED_DOCUMENT_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(ScannedDocument target) { + target.init(); + } + + @Override + protected void updateToPass(ScannedDocument target) { + II ii = DatatypesFactory.eINSTANCE.createII(); + target.setId(ii); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ScannedDocumentOperations.validateScannedDocumentId( + (ScannedDocument) objectToTest, diagnostician, map); + } + + }; + + validateScannedDocumentIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateScannedDocumentLanguageCode() { + OperationsTestCase validateScannedDocumentLanguageCodeTestCase = new OperationsTestCase( + "validateScannedDocumentLanguageCode", + operationsForOCL.getOCLValue("VALIDATE_SCANNED_DOCUMENT_LANGUAGE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ScannedDocument target) { + target.init(); + } + + @Override + protected void updateToPass(ScannedDocument target) { + CS cs = DatatypesFactory.eINSTANCE.createCS(); + target.setLanguageCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ScannedDocumentOperations.validateScannedDocumentLanguageCode( + (ScannedDocument) objectToTest, diagnostician, map); + } + + }; + + validateScannedDocumentLanguageCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateScannedDocumentTitle() { + OperationsTestCase validateScannedDocumentTitleTestCase = new OperationsTestCase( + "validateScannedDocumentTitle", + operationsForOCL.getOCLValue("VALIDATE_SCANNED_DOCUMENT_TITLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ScannedDocument target) { + target.init(); + } + + @Override + protected void updateToPass(ScannedDocument target) { + ST title = DatatypesFactory.eINSTANCE.createST(); + target.setTitle(title); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ScannedDocumentOperations.validateScannedDocumentTitle( + (ScannedDocument) objectToTest, diagnostician, map); + } + + }; + + validateScannedDocumentTitleTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateScannedDocumentTypeId() { + OperationsTestCase validateScannedDocumentTypeIdTestCase = new OperationsTestCase( + "validateScannedDocumentTypeId", + operationsForOCL.getOCLValue("VALIDATE_SCANNED_DOCUMENT_TYPE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ScannedDocument target) { + target.init(); + + } + + @Override + protected void updateToPass(ScannedDocument target) { + InfrastructureRootTypeId id = CDAFactory.eINSTANCE.createInfrastructureRootTypeId(); + target.setTypeId(id); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ScannedDocumentOperations.validateScannedDocumentTypeId( + (ScannedDocument) objectToTest, diagnostician, map); + } + + }; + + validateScannedDocumentTypeIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateScannedDocumentScanOriginalAuthor() { + OperationsTestCase validateScannedDocumentScanOriginalAuthorTestCase = new OperationsTestCase( + "validateScannedDocumentScanOriginalAuthor", + operationsForOCL.getOCLValue("VALIDATE_SCANNED_DOCUMENT_SCAN_ORIGINAL_AUTHOR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ScannedDocument target) { + target.init(); + } + + @Override + protected void updateToPass(ScannedDocument target) { + + target.getAuthors().add(IHEFactory.eINSTANCE.createScanOriginalAuthor().init()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ScannedDocumentOperations.validateScannedDocumentScanOriginalAuthor( + (ScannedDocument) objectToTest, diagnostician, map); + } + + }; + + validateScannedDocumentScanOriginalAuthorTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateScannedDocumentScanningDevice() { + OperationsTestCase validateScannedDocumentScanningDeviceTestCase = new OperationsTestCase( + "validateScannedDocumentScanningDevice", + operationsForOCL.getOCLValue("VALIDATE_SCANNED_DOCUMENT_SCANNING_DEVICE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ScannedDocument target) { + target.init(); + } + + @Override + protected void updateToPass(ScannedDocument target) { + target.getAuthors().add(IHEFactory.eINSTANCE.createScanningDevice().init()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ScannedDocumentOperations.validateScannedDocumentScanningDevice( + (ScannedDocument) objectToTest, diagnostician, map); + } + + }; + + validateScannedDocumentScanningDeviceTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateScannedDocumentScanDataEnterer() { + OperationsTestCase validateScannedDocumentScanDataEntererTestCase = new OperationsTestCase( + "validateScannedDocumentScanDataEnterer", + operationsForOCL.getOCLValue("VALIDATE_SCANNED_DOCUMENT_SCAN_DATA_ENTERER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ScannedDocument target) { + target.init(); + } + + @Override + protected void updateToPass(ScannedDocument target) { + target.setDataEnterer(IHEFactory.eINSTANCE.createScanDataEnterer().init()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ScannedDocumentOperations.validateScannedDocumentScanDataEnterer( + (ScannedDocument) objectToTest, diagnostician, map); + } + + }; + + validateScannedDocumentScanDataEntererTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateScannedDocumentLegalAuthenticator() { + OperationsTestCase validateScannedDocumentLegalAuthenticatorTestCase = new OperationsTestCase( + "validateScannedDocumentLegalAuthenticator", + operationsForOCL.getOCLValue("VALIDATE_SCANNED_DOCUMENT_LEGAL_AUTHENTICATOR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ScannedDocument target) { + target.init(); + } + + @Override + protected void updateToPass(ScannedDocument target) { + target.setLegalAuthenticator(CDAFactory.eINSTANCE.createLegalAuthenticator()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ScannedDocumentOperations.validateScannedDocumentLegalAuthenticator( + (ScannedDocument) objectToTest, diagnostician, map); + } + + }; + + validateScannedDocumentLegalAuthenticatorTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateScannedDocumentDocumentationOf() { + OperationsTestCase validateScannedDocumentDocumentationOfTestCase = new OperationsTestCase( + "validateScannedDocumentDocumentationOf", + operationsForOCL.getOCLValue("VALIDATE_SCANNED_DOCUMENT_DOCUMENTATION_OF__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ScannedDocument target) { + target.init(); + } + + @Override + protected void updateToPass(ScannedDocument target) { + + target.getDocumentationOfs().add(CDAFactory.eINSTANCE.createDocumentationOf()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ScannedDocumentOperations.validateScannedDocumentDocumentationOf( + (ScannedDocument) objectToTest, diagnostician, map); + } + + }; + + validateScannedDocumentDocumentationOfTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ScannedDocumentOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public ScannedDocument create() { + return IHEFactory.eINSTANCE.createScannedDocument(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ScannedDocumentOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ScannedDocumentOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ScanningDeviceTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ScanningDeviceTest.java new file mode 100644 index 000000000..64aa336fe --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ScanningDeviceTest.java @@ -0,0 +1,414 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.AssignedAuthor; +import org.openhealthtools.mdht.uml.cda.AuthoringDevice; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.ClinicalDocument; +import org.openhealthtools.mdht.uml.cda.Organization; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.ScanningDevice; +import org.openhealthtools.mdht.uml.cda.ihe.operations.ScanningDeviceOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.datatypes.SC; +import org.openhealthtools.mdht.uml.hl7.datatypes.TS; + +/** + * + * A static utility class that provides operations related to 'Scanning Device' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ScanningDevice#validateScanningDeviceTimeEqualsDocumentEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Scanning Device Time Equals Document Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ScanningDevice#validateScanningDeviceHasAssignedAuthorId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Scanning Device Has Assigned Author Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ScanningDevice#validateScanningDeviceHasAssignedAuthoringDeviceCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Scanning Device Has Assigned Authoring Device Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ScanningDevice#validateScanningDeviceHasDeviceManufacturerModelName(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Scanning Device Has Device Manufacturer Model Name}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ScanningDevice#validateScanningDeviceHasDeviceSoftwareName(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Scanning Device Has Device Software Name}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ScanningDevice#validateScanningDeviceHasAssignedAuthorRepresentedOrganizationId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Scanning Device Has Assigned Author Represented Organization Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ScanningDevice#validateScanningDeviceTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Scanning Device Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class ScanningDeviceTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateScanningDeviceTimeEqualsDocumentEffectiveTime() { + OperationsTestCase validateScanningDeviceTimeEqualsDocumentEffectiveTimeTestCase = new OperationsTestCase( + "validateScanningDeviceTimeEqualsDocumentEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_SCANNING_DEVICE_TIME_EQUALS_DOCUMENT_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ScanningDevice target) { + + target.init(); + TS ts = DatatypesFactory.eINSTANCE.createTS("20071204103022-0500"); + target.setTime(ts); + ClinicalDocument cd = CDAFactory.eINSTANCE.createClinicalDocument(); + TS docts = DatatypesFactory.eINSTANCE.createTS("20081204103022-0500"); + ; + cd.setEffectiveTime(docts); + cd.getAuthors().add(target); + // cd.setd + // cd.getd .setDataEnterer(target); + + } + + @Override + protected void updateToPass(ScanningDevice target) { + TS ts = DatatypesFactory.eINSTANCE.createTS("20071204103022-0500"); + target.setTime(ts); + ClinicalDocument cd = CDAFactory.eINSTANCE.createClinicalDocument(); + cd.setEffectiveTime(EcoreUtil.copy(ts)); // one TS cannot have two containers + cd.getAuthors().add(target); + // cd.setDataEnterer(target); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ScanningDeviceOperations.validateScanningDeviceTimeEqualsDocumentEffectiveTime( + (ScanningDevice) objectToTest, diagnostician, map); + } + + }; + + validateScanningDeviceTimeEqualsDocumentEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateScanningDeviceHasAssignedAuthorId() { + OperationsTestCase validateScanningDeviceHasAssignedAuthorIdTestCase = new OperationsTestCase( + "validateScanningDeviceHasAssignedAuthorId", + operationsForOCL.getOCLValue("VALIDATE_SCANNING_DEVICE_HAS_ASSIGNED_AUTHOR_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ScanningDevice target) { + target.init(); + } + + @Override + protected void updateToPass(ScanningDevice target) { + target.init(); + AssignedAuthor value = CDAFactory.eINSTANCE.createAssignedAuthor(); + target.setAssignedAuthor(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ScanningDeviceOperations.validateScanningDeviceHasAssignedAuthorId( + (ScanningDevice) objectToTest, diagnostician, map); + } + + }; + + validateScanningDeviceHasAssignedAuthorIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateScanningDeviceHasAssignedAuthoringDeviceCode() { + OperationsTestCase validateScanningDeviceHasAssignedAuthoringDeviceCodeTestCase = new OperationsTestCase( + "validateScanningDeviceHasAssignedAuthoringDeviceCode", + operationsForOCL.getOCLValue("VALIDATE_SCANNING_DEVICE_HAS_ASSIGNED_AUTHORING_DEVICE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ScanningDevice target) { + target.init(); + AssignedAuthor value = CDAFactory.eINSTANCE.createAssignedAuthor(); + AuthoringDevice device = CDAFactory.eINSTANCE.createAuthoringDevice(); + value.setAssignedAuthoringDevice(device); + target.setAssignedAuthor(value); + } + + @Override + protected void updateToPass(ScanningDevice target) { + + CE ce = DatatypesFactory.eINSTANCE.createCE("", "1.2.840.10008.2.16.4"); + ce.setCode("CAPTURE"); + ce.setDisplayName("PDF Capture"); + + target.getAssignedAuthor().getAssignedAuthoringDevice().setCode(ce); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ScanningDeviceOperations.validateScanningDeviceHasAssignedAuthoringDeviceCode( + (ScanningDevice) objectToTest, diagnostician, map); + } + + }; + + validateScanningDeviceHasAssignedAuthoringDeviceCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateScanningDeviceHasDeviceManufacturerModelName() { + OperationsTestCase validateScanningDeviceHasDeviceManufacturerModelNameTestCase = new OperationsTestCase( + "validateScanningDeviceHasDeviceManufacturerModelName", + operationsForOCL.getOCLValue("VALIDATE_SCANNING_DEVICE_HAS_DEVICE_MANUFACTURER_MODEL_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + @Override + protected void updateToFail(ScanningDevice target) { + target.init(); + AssignedAuthor value = CDAFactory.eINSTANCE.createAssignedAuthor(); + AuthoringDevice device = CDAFactory.eINSTANCE.createAuthoringDevice(); + + value.setAssignedAuthoringDevice(device); + target.setAssignedAuthor(value); + } + + @Override + protected void updateToPass(ScanningDevice target) { + SC sc = DatatypesFactory.eINSTANCE.createSC(); + sc.addText("model name"); + target.getAssignedAuthor().getAssignedAuthoringDevice().setManufacturerModelName(sc); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ScanningDeviceOperations.validateScanningDeviceHasDeviceManufacturerModelName( + (ScanningDevice) objectToTest, diagnostician, map); + } + + }; + + validateScanningDeviceHasDeviceManufacturerModelNameTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateScanningDeviceHasDeviceSoftwareName() { + OperationsTestCase validateScanningDeviceHasDeviceSoftwareNameTestCase = new OperationsTestCase( + "validateScanningDeviceHasDeviceSoftwareName", + operationsForOCL.getOCLValue("VALIDATE_SCANNING_DEVICE_HAS_DEVICE_SOFTWARE_NAME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ScanningDevice target) { + target.init(); + AssignedAuthor value = CDAFactory.eINSTANCE.createAssignedAuthor(); + AuthoringDevice device = CDAFactory.eINSTANCE.createAuthoringDevice(); + + value.setAssignedAuthoringDevice(device); + target.setAssignedAuthor(value); + } + + @Override + protected void updateToPass(ScanningDevice target) { + + SC sc = DatatypesFactory.eINSTANCE.createSC(); + sc.addText("software"); + target.getAssignedAuthor().getAssignedAuthoringDevice().setSoftwareName(sc); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ScanningDeviceOperations.validateScanningDeviceHasDeviceSoftwareName( + (ScanningDevice) objectToTest, diagnostician, map); + } + + }; + + validateScanningDeviceHasDeviceSoftwareNameTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateScanningDeviceHasAssignedAuthorRepresentedOrganizationId() { + OperationsTestCase validateScanningDeviceHasAssignedAuthorRepresentedOrganizationIdTestCase = new OperationsTestCase( + "validateScanningDeviceHasAssignedAuthorRepresentedOrganizationId", + operationsForOCL.getOCLValue("VALIDATE_SCANNING_DEVICE_HAS_ASSIGNED_AUTHOR_REPRESENTED_ORGANIZATION_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ScanningDevice target) { + target.init(); + AssignedAuthor value = CDAFactory.eINSTANCE.createAssignedAuthor(); + Organization reporg = CDAFactory.eINSTANCE.createOrganization(); + II ii = DatatypesFactory.eINSTANCE.createII(); + + reporg.getIds().add(ii); + value.setRepresentedOrganization(reporg); + target.setAssignedAuthor(value); + } + + @Override + protected void updateToPass(ScanningDevice target) { + + for (II ii : target.getAssignedAuthor().getRepresentedOrganization().getIds()) { + ii.setRoot("root"); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ScanningDeviceOperations.validateScanningDeviceHasAssignedAuthorRepresentedOrganizationId( + (ScanningDevice) objectToTest, diagnostician, map); + } + + }; + + validateScanningDeviceHasAssignedAuthorRepresentedOrganizationIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateScanningDeviceTemplateId() { + OperationsTestCase validateScanningDeviceTemplateIdTestCase = new OperationsTestCase( + "validateScanningDeviceTemplateId", + operationsForOCL.getOCLValue("VALIDATE_SCANNING_DEVICE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ScanningDevice target) { + + } + + @Override + protected void updateToPass(ScanningDevice target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ScanningDeviceOperations.validateScanningDeviceTemplateId( + (ScanningDevice) objectToTest, diagnostician, map); + } + + }; + + validateScanningDeviceTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ScanningDeviceOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public ScanningDevice create() { + return IHEFactory.eINSTANCE.createScanningDevice(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ScanningDeviceOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ScanningDeviceOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/SeverityTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/SeverityTest.java new file mode 100644 index 000000000..27e4a4336 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/SeverityTest.java @@ -0,0 +1,291 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ccd.operations.SeverityObservationOperations; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.Severity; +import org.openhealthtools.mdht.uml.cda.ihe.operations.SeverityOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; +import org.openhealthtools.mdht.uml.hl7.datatypes.TEL; + +/** + * + * A static utility class that provides operations related to 'Severity' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.Severity#validateSeverityHasTextReference(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Severity Has Text Reference}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.Severity#validateSeverityTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Severity Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.Severity#validateSeverityText(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Severity Text}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.Severity#validateSeverityValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Severity Value}
  • + *
+ *

+ * + * @generated + */ + +public class SeverityTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateSeverityHasTextReference() { + OperationsTestCase validateSeverityHasTextReferenceTestCase = new OperationsTestCase( + "validateSeverityHasTextReference", + operationsForOCL.getOCLValue("VALIDATE_SEVERITY_HAS_TEXT_REFERENCE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Severity target) { + target.init(); + + ED value = DatatypesFactory.eINSTANCE.createED(); + target.setText(value); + } + + @Override + protected void updateToPass(Severity target) { + TEL value = DatatypesFactory.eINSTANCE.createTEL(); + target.getText().setReference(value); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SeverityOperations.validateSeverityHasTextReference((Severity) objectToTest, diagnostician, map); + } + + }; + + validateSeverityHasTextReferenceTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSeverityTemplateId() { + OperationsTestCase validateSeverityTemplateIdTestCase = new OperationsTestCase( + "validateSeverityTemplateId", + operationsForOCL.getOCLValue("VALIDATE_SEVERITY_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Severity target) { + + } + + @Override + protected void updateToPass(Severity target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SeverityOperations.validateSeverityTemplateId((Severity) objectToTest, diagnostician, map); + } + + }; + + validateSeverityTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSeverityText() { + OperationsTestCase validateSeverityTextTestCase = new OperationsTestCase( + "validateSeverityText", + operationsForOCL.getOCLValue("VALIDATE_SEVERITY_TEXT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(Severity target) { + target.init(); + } + + @Override + protected void updateToPass(Severity target) { + + ED value = DatatypesFactory.eINSTANCE.createED(); + target.setText(value); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SeverityOperations.validateSeverityText((Severity) objectToTest, diagnostician, map); + } + + }; + + validateSeverityTextTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateSeverityValue() { + OperationsTestCase validateSeverityValueTestCase = new OperationsTestCase( + "validateSeverityValue", + operationsForOCL.getOCLValue("VALIDATE_SEVERITY_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), objectFactory) { + + @Override + protected void updateToFail(Severity target) { + + } + + @Override + protected void updateToPass(Severity target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD(); + value.setCodeSystem("2.16.840.1.113883.5.1063"); + value.setCode("H"); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SeverityOperations.validateSeverityValue((Severity) objectToTest, diagnostician, map); + } + + }; + + validateSeverityValueTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSeverityObservationValue() { + OperationsTestCase validateSeverityObservationValueTestCase = new OperationsTestCase( + "validateSeverityObservationValue", + operationsForOCL.getOCLValue("VALIDATE_SEVERITY_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(Severity target) { + target.init(); + } + + @Override + protected void updateToPass(Severity target) { + CD ce = DatatypesFactory.eINSTANCE.createCD(); + ce.setCodeSystem("2.16.840.1.113883.5.1063"); + ce.setCode("H"); + target.getValues().add(ce); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SeverityObservationOperations.validateSeverityObservationValue( + (Severity) objectToTest, diagnostician, map); + } + + }; + + validateSeverityObservationValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends SeverityOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public Severity create() { + return IHEFactory.eINSTANCE.createSeverity(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends SeverityOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // SeverityOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/SimpleObservationTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/SimpleObservationTest.java new file mode 100644 index 000000000..a7e8821a8 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/SimpleObservationTest.java @@ -0,0 +1,221 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.SimpleObservation; +import org.openhealthtools.mdht.uml.cda.ihe.operations.SimpleObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; + +/** + * + * A static utility class that provides operations related to 'Simple Observation' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.SimpleObservation#validateSimpleObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Simple Observation Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.SimpleObservation#validateSimpleObservationId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Simple Observation Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.SimpleObservation#validateSimpleObservationStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Simple Observation Status Code}
  • + *
+ *

+ * + * @generated + */ + +public class SimpleObservationTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateSimpleObservationTemplateId() { + OperationsTestCase validateSimpleObservationTemplateIdTestCase = new OperationsTestCase( + "validateSimpleObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_SIMPLE_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SimpleObservation target) { + + } + + @Override + protected void updateToPass(SimpleObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SimpleObservationOperations.validateSimpleObservationTemplateId( + (SimpleObservation) objectToTest, diagnostician, map); + } + + }; + + validateSimpleObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSimpleObservationId() { + OperationsTestCase validateSimpleObservationIdTestCase = new OperationsTestCase( + "validateSimpleObservationId", + operationsForOCL.getOCLValue("VALIDATE_SIMPLE_OBSERVATION_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SimpleObservation target) { + + } + + @Override + protected void updateToPass(SimpleObservation target) { + target.init(); + + II ii = DatatypesFactory.eINSTANCE.createII(); + target.getIds().add(ii); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SimpleObservationOperations.validateSimpleObservationId( + (SimpleObservation) objectToTest, diagnostician, map); + } + + }; + + validateSimpleObservationIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSimpleObservationStatusCode() { + OperationsTestCase validateSimpleObservationStatusCodeTestCase = new OperationsTestCase( + "validateSimpleObservationStatusCode", + operationsForOCL.getOCLValue("VALIDATE_SIMPLE_OBSERVATION_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SimpleObservation target) { + + } + + @Override + protected void updateToPass(SimpleObservation target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SimpleObservationOperations.validateSimpleObservationStatusCode( + (SimpleObservation) objectToTest, diagnostician, map); + } + + }; + + validateSimpleObservationStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends SimpleObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public SimpleObservation create() { + return IHEFactory.eINSTANCE.createPregnancyObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends SimpleObservationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // SimpleObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/SocialHistoryObservationTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/SocialHistoryObservationTest.java new file mode 100644 index 000000000..f9747ec38 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/SocialHistoryObservationTest.java @@ -0,0 +1,323 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.SocialHistoryObservation; +import org.openhealthtools.mdht.uml.cda.ihe.operations.SocialHistoryObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; + +/** + * + * A static utility class that provides operations related to 'Social History Observation' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.SocialHistoryObservation#validateIHESocialHistoryObservationNoRepeatNumber(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Social History Observation No Repeat Number}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.SocialHistoryObservation#validateIHESocialHistoryObservationNoInterpretationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Social History Observation No Interpretation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.SocialHistoryObservation#validateIHESocialHistoryObservationNoMethodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Social History Observation No Method Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.SocialHistoryObservation#validateIHESocialHistoryObservationNoTargetSiteCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Social History Observation No Target Site Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.SocialHistoryObservation#validateIHESocialHistoryObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Social History Observation Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.SocialHistoryObservation#validateIHESocialHistoryObservationValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Social History Observation Value}
  • + *
+ *

+ * + * @generated + */ + +public class SocialHistoryObservationTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateIHESocialHistoryObservationNoRepeatNumber() { + OperationsTestCase validateIHESocialHistoryObservationNoRepeatNumberTestCase = new OperationsTestCase( + "validateIHESocialHistoryObservationNoRepeatNumber", + operationsForOCL.getOCLValue("VALIDATE_IHE_SOCIAL_HISTORY_OBSERVATION_NO_REPEAT_NUMBER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistoryObservation target) { + target.init(); + target.setRepeatNumber(DatatypesFactory.eINSTANCE.createIVL_INT()); + } + + @Override + protected void updateToPass(SocialHistoryObservation target) { + target.setRepeatNumber(null); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistoryObservationOperations.validateIHESocialHistoryObservationNoRepeatNumber( + (SocialHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateIHESocialHistoryObservationNoRepeatNumberTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateIHESocialHistoryObservationNoInterpretationCode() { + OperationsTestCase validateIHESocialHistoryObservationNoInterpretationCodeTestCase = new OperationsTestCase( + "validateIHESocialHistoryObservationNoInterpretationCode", + operationsForOCL.getOCLValue("VALIDATE_IHE_SOCIAL_HISTORY_OBSERVATION_NO_INTERPRETATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistoryObservation target) { + target.init(); + target.getInterpretationCodes().add(DatatypesFactory.eINSTANCE.createCE()); + } + + @Override + protected void updateToPass(SocialHistoryObservation target) { + target.getInterpretationCodes().clear(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistoryObservationOperations.validateIHESocialHistoryObservationNoInterpretationCode( + (SocialHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateIHESocialHistoryObservationNoInterpretationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateIHESocialHistoryObservationNoMethodCode() { + OperationsTestCase validateIHESocialHistoryObservationNoMethodCodeTestCase = new OperationsTestCase( + "validateIHESocialHistoryObservationNoMethodCode", + operationsForOCL.getOCLValue("VALIDATE_IHE_SOCIAL_HISTORY_OBSERVATION_NO_METHOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistoryObservation target) { + target.init(); + target.getMethodCodes().add(DatatypesFactory.eINSTANCE.createCE()); + } + + @Override + protected void updateToPass(SocialHistoryObservation target) { + target.getMethodCodes().clear(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistoryObservationOperations.validateIHESocialHistoryObservationNoMethodCode( + (SocialHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateIHESocialHistoryObservationNoMethodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateIHESocialHistoryObservationNoTargetSiteCode() { + OperationsTestCase validateIHESocialHistoryObservationNoTargetSiteCodeTestCase = new OperationsTestCase( + "validateIHESocialHistoryObservationNoTargetSiteCode", + operationsForOCL.getOCLValue("VALIDATE_IHE_SOCIAL_HISTORY_OBSERVATION_NO_TARGET_SITE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistoryObservation target) { + target.init(); + target.getTargetSiteCodes().add(DatatypesFactory.eINSTANCE.createCD()); + } + + @Override + protected void updateToPass(SocialHistoryObservation target) { + target.getTargetSiteCodes().clear(); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistoryObservationOperations.validateIHESocialHistoryObservationNoTargetSiteCode( + (SocialHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateIHESocialHistoryObservationNoTargetSiteCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateIHESocialHistoryObservationTemplateId() { + OperationsTestCase validateIHESocialHistoryObservationTemplateIdTestCase = new OperationsTestCase( + "validateIHESocialHistoryObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_IHE_SOCIAL_HISTORY_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistoryObservation target) { + + } + + @Override + protected void updateToPass(SocialHistoryObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistoryObservationOperations.validateIHESocialHistoryObservationTemplateId( + (SocialHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateIHESocialHistoryObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateIHESocialHistoryObservationValue() { + OperationsTestCase validateIHESocialHistoryObservationValueTestCase = new OperationsTestCase( + "validateIHESocialHistoryObservationValue", + operationsForOCL.getOCLValue("VALIDATE_IHE_SOCIAL_HISTORY_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistoryObservation target) { + + } + + @Override + protected void updateToPass(SocialHistoryObservation target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD(); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistoryObservationOperations.validateIHESocialHistoryObservationValue( + (SocialHistoryObservation) objectToTest, diagnostician, map); + } + + }; + + validateIHESocialHistoryObservationValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends SocialHistoryObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public SocialHistoryObservation create() { + return IHEFactory.eINSTANCE.createSocialHistoryObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends SocialHistoryObservationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // SocialHistoryObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/SocialHistorySectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/SocialHistorySectionTest.java new file mode 100644 index 000000000..749244bed --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/SocialHistorySectionTest.java @@ -0,0 +1,142 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.SocialHistorySection; +import org.openhealthtools.mdht.uml.cda.ihe.operations.SocialHistorySectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Social History Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.SocialHistorySection#validateIHESocialHistorySectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Social History Section Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class SocialHistorySectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateIHESocialHistorySectionTemplateId() { + OperationsTestCase validateIHESocialHistorySectionTemplateIdTestCase = new OperationsTestCase( + "validateIHESocialHistorySectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_IHE_SOCIAL_HISTORY_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistorySection target) { + + } + + @Override + protected void updateToPass(SocialHistorySection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistorySectionOperations.validateIHESocialHistorySectionTemplateId( + (SocialHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateIHESocialHistorySectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends SocialHistorySectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public SocialHistorySection create() { + return IHEFactory.eINSTANCE.createSocialHistorySection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends SocialHistorySectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // SocialHistorySectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/SplitDoseTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/SplitDoseTest.java new file mode 100644 index 000000000..66ca86b59 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/SplitDoseTest.java @@ -0,0 +1,179 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.SubstanceAdministration; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.SplitDose; +import org.openhealthtools.mdht.uml.cda.ihe.operations.SplitDoseOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Split Dose' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.SplitDose#validateSplitDoseSplitDosingSubstanceAdministration(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Split Dose Split Dosing Substance Administration}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.SplitDose#validateSplitDoseTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Split Dose Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class SplitDoseTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateSplitDoseSplitDosingSubstanceAdministration() { + OperationsTestCase validateSplitDoseSplitDosingSubstanceAdministrationTestCase = new OperationsTestCase( + "validateSplitDoseSplitDosingSubstanceAdministration", + operationsForOCL.getOCLValue("VALIDATE_SPLIT_DOSE_SPLIT_DOSING_SUBSTANCE_ADMINISTRATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SplitDose target) { + target.init(); + } + + @Override + protected void updateToPass(SplitDose target) { + + SubstanceAdministration sa = CDAFactory.eINSTANCE.createSubstanceAdministration(); + target.addSubstanceAdministration(sa); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SplitDoseOperations.validateSplitDoseSplitDosingSubstanceAdministration( + (SplitDose) objectToTest, diagnostician, map); + } + + }; + + validateSplitDoseSplitDosingSubstanceAdministrationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSplitDoseTemplateId() { + OperationsTestCase validateSplitDoseTemplateIdTestCase = new OperationsTestCase( + "validateSplitDoseTemplateId", + operationsForOCL.getOCLValue("VALIDATE_SPLIT_DOSE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SplitDose target) { + + } + + @Override + protected void updateToPass(SplitDose target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SplitDoseOperations.validateSplitDoseTemplateId((SplitDose) objectToTest, diagnostician, map); + } + + }; + + validateSplitDoseTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends SplitDoseOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public SplitDose create() { + return IHEFactory.eINSTANCE.createSplitDose(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends SplitDoseOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // SplitDoseOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/SupplyEntryTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/SupplyEntryTest.java new file mode 100644 index 000000000..6b220d13c --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/SupplyEntryTest.java @@ -0,0 +1,819 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.math.BigDecimal; +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.AssignedAuthor; +import org.openhealthtools.mdht.uml.cda.AssignedEntity; +import org.openhealthtools.mdht.uml.cda.Author; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; +import org.openhealthtools.mdht.uml.cda.Organization; +import org.openhealthtools.mdht.uml.cda.Performer2; +import org.openhealthtools.mdht.uml.cda.Person; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.SupplyEntry; +import org.openhealthtools.mdht.uml.cda.ihe.operations.SupplyEntryOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_INT; +import org.openhealthtools.mdht.uml.hl7.datatypes.PQ; +import org.openhealthtools.mdht.uml.hl7.vocab.ActClassSupply; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; +import org.openhealthtools.mdht.uml.hl7.vocab.x_DocumentSubstanceMood; + +/** + * + * A static utility class that provides operations related to 'Supply Entry' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.SupplyEntry#validateSupplyEntryHasIntentAuthor(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Supply Entry Has Intent Author}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.SupplyEntry#validateSupplyEntryHasAuthorTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Supply Entry Has Author Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.SupplyEntry#validateSupplyEntryHasAssignedAuthor(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Supply Entry Has Assigned Author}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.SupplyEntry#validateSupplyEntryHasAssignedAuthorID(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Supply Entry Has Assigned Author ID}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.SupplyEntry#validateSupplyEntryHasAssignedAuthorPersonOrOrg(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Supply Entry Has Assigned Author Person Or Org}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.SupplyEntry#validateSupplyEntryHasPerformerTimeEvent(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Supply Entry Has Performer Time Event}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.SupplyEntry#validateSupplyEntryHasPerformerTimeIntent(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Supply Entry Has Performer Time Intent}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.SupplyEntry#validateSupplyEntryHasPerformerAssignedEntity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Supply Entry Has Performer Assigned Entity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.SupplyEntry#validateSupplyEntryHasPerformerAssignedEntityID(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Supply Entry Has Performer Assigned Entity ID}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.SupplyEntry#validateSupplyEntryHasPerformerEntityPersonOrOrg(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Supply Entry Has Performer Entity Person Or Org}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.SupplyEntry#validateSupplyEntryQuantityHasValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Supply Entry Quantity Has Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.SupplyEntry#validateSupplyEntryTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Supply Entry Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.SupplyEntry#validateSupplyEntryQuantity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Supply Entry Quantity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.SupplyEntry#validateSupplyEntryRepeatNumber(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Supply Entry Repeat Number}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.SupplyEntry#validateSupplyEntryMedicationFullfillmentInstructions(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Supply Entry Medication Fullfillment Instructions}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.SupplyEntry#getMedicationFullfillmentInstructions() Get Medication Fullfillment Instructions}
  • + *
+ *

+ * + * @generated + */ + +public class SupplyEntryTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateSupplyEntryHasIntentAuthor() { + OperationsTestCase validateSupplyEntryHasIntentAuthorTestCase = new OperationsTestCase( + "validateSupplyEntryHasIntentAuthor", + operationsForOCL.getOCLValue("VALIDATE_SUPPLY_ENTRY_HAS_INTENT_AUTHOR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SupplyEntry target) { + target.init(); + target.setClassCode(ActClassSupply.SPLY); + target.setMoodCode(x_DocumentSubstanceMood.INT); + } + + @Override + protected void updateToPass(SupplyEntry target) { + target.setClassCode(ActClassSupply.SPLY); + target.setMoodCode(x_DocumentSubstanceMood.INT); + target.getAuthors().add(CDAFactory.eINSTANCE.createAuthor()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SupplyEntryOperations.validateSupplyEntryHasIntentAuthor( + (SupplyEntry) objectToTest, diagnostician, map); + } + + }; + + validateSupplyEntryHasIntentAuthorTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSupplyEntryHasAuthorTime() { + OperationsTestCase validateSupplyEntryHasAuthorTimeTestCase = new OperationsTestCase( + "validateSupplyEntryHasAuthorTime", + operationsForOCL.getOCLValue("VALIDATE_SUPPLY_ENTRY_HAS_AUTHOR_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SupplyEntry target) { + target.init(); + Author auth = CDAFactory.eINSTANCE.createAuthor(); + + target.getAuthors().add(auth); + } + + @Override + protected void updateToPass(SupplyEntry target) { + + for (Author author : target.getAuthors()) { + author.setTime(DatatypesFactory.eINSTANCE.createTS()); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SupplyEntryOperations.validateSupplyEntryHasAuthorTime( + (SupplyEntry) objectToTest, diagnostician, map); + } + + }; + + validateSupplyEntryHasAuthorTimeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSupplyEntryHasAssignedAuthor() { + OperationsTestCase validateSupplyEntryHasAssignedAuthorTestCase = new OperationsTestCase( + "validateSupplyEntryHasAssignedAuthor", + operationsForOCL.getOCLValue("VALIDATE_SUPPLY_ENTRY_HAS_ASSIGNED_AUTHOR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SupplyEntry target) { + + target.init(); + Author auth = CDAFactory.eINSTANCE.createAuthor(); + // auth.setAssignedAuthor(CDAFactory.eINSTANCE.createAssignedAuthor()); + target.getAuthors().add(auth); + } + + @Override + protected void updateToPass(SupplyEntry target) { + + for (Author auth : target.getAuthors()) { + auth.setAssignedAuthor(CDAFactory.eINSTANCE.createAssignedAuthor()); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SupplyEntryOperations.validateSupplyEntryHasAssignedAuthor( + (SupplyEntry) objectToTest, diagnostician, map); + } + + }; + + validateSupplyEntryHasAssignedAuthorTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSupplyEntryHasAssignedAuthorID() { + OperationsTestCase validateSupplyEntryHasAssignedAuthorIDTestCase = new OperationsTestCase( + "validateSupplyEntryHasAssignedAuthorID", + operationsForOCL.getOCLValue("VALIDATE_SUPPLY_ENTRY_HAS_ASSIGNED_AUTHOR_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SupplyEntry target) { + + target.init(); + Author auth = CDAFactory.eINSTANCE.createAuthor(); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + // aa.getIds().add(DatatypesFactory.eINSTANCE.createII()); + auth.setAssignedAuthor(aa); + target.getAuthors().add(auth); + + } + + @Override + protected void updateToPass(SupplyEntry target) { + + for (Author auth : target.getAuthors()) { + auth.getAssignedAuthor().getIds().add(DatatypesFactory.eINSTANCE.createII()); + + } + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SupplyEntryOperations.validateSupplyEntryHasAssignedAuthorID( + (SupplyEntry) objectToTest, diagnostician, map); + } + + }; + + validateSupplyEntryHasAssignedAuthorIDTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSupplyEntryHasAssignedAuthorPersonOrOrg() { + OperationsTestCase validateSupplyEntryHasAssignedAuthorPersonOrOrgTestCase = new OperationsTestCase( + "validateSupplyEntryHasAssignedAuthorPersonOrOrg", + operationsForOCL.getOCLValue("VALIDATE_SUPPLY_ENTRY_HAS_ASSIGNED_AUTHOR_PERSON_OR_ORG__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SupplyEntry target) { + target.init(); + Author auth = CDAFactory.eINSTANCE.createAuthor(); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + aa.setAssignedPerson(CDAFactory.eINSTANCE.createPerson()); + aa.setRepresentedOrganization(CDAFactory.eINSTANCE.createOrganization()); + auth.setAssignedAuthor(aa); + target.getAuthors().add(auth); + } + + @Override + protected void updateToPass(SupplyEntry target) { + Author auth = CDAFactory.eINSTANCE.createAuthor(); + AssignedAuthor aa = CDAFactory.eINSTANCE.createAssignedAuthor(); + Person per = CDAFactory.eINSTANCE.createPerson(); + per.getNames().add(DatatypesFactory.eINSTANCE.createPN()); + aa.setAssignedPerson(per); + aa.setRepresentedOrganization(CDAFactory.eINSTANCE.createOrganization()); + auth.setAssignedAuthor(aa); + target.getAuthors().add(auth); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SupplyEntryOperations.validateSupplyEntryHasAssignedAuthorPersonOrOrg( + (SupplyEntry) objectToTest, diagnostician, map); + } + + }; + + validateSupplyEntryHasAssignedAuthorPersonOrOrgTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSupplyEntryHasPerformerTimeEvent() { + OperationsTestCase validateSupplyEntryHasPerformerTimeEventTestCase = new OperationsTestCase( + "validateSupplyEntryHasPerformerTimeEvent", + operationsForOCL.getOCLValue("VALIDATE_SUPPLY_ENTRY_HAS_PERFORMER_TIME_EVENT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SupplyEntry target) { + + target.init(); + target.setMoodCode(x_DocumentSubstanceMood.EVN); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + + target.getPerformers().add(per); + + } + + @Override + protected void updateToPass(SupplyEntry target) { + + for (Performer2 per : target.getPerformers()) { + per.setTime(DatatypesFactory.eINSTANCE.createIVL_TS()); + } + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SupplyEntryOperations.validateSupplyEntryHasPerformerTimeEvent( + (SupplyEntry) objectToTest, diagnostician, map); + } + + }; + + validateSupplyEntryHasPerformerTimeEventTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSupplyEntryHasPerformerTimeIntent() { + OperationsTestCase validateSupplyEntryHasPerformerTimeIntentTestCase = new OperationsTestCase( + "validateSupplyEntryHasPerformerTimeIntent", + operationsForOCL.getOCLValue("VALIDATE_SUPPLY_ENTRY_HAS_PERFORMER_TIME_INTENT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SupplyEntry target) { + + target.init(); + target.setMoodCode(x_DocumentSubstanceMood.INT); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + target.getPerformers().add(per); + } + + @Override + protected void updateToPass(SupplyEntry target) { + + for (Performer2 per : target.getPerformers()) { + per.setTime(DatatypesFactory.eINSTANCE.createIVL_TS()); + } + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SupplyEntryOperations.validateSupplyEntryHasPerformerTimeIntent( + (SupplyEntry) objectToTest, diagnostician, map); + } + + }; + + validateSupplyEntryHasPerformerTimeIntentTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSupplyEntryHasPerformerAssignedEntity() { + OperationsTestCase validateSupplyEntryHasPerformerAssignedEntityTestCase = new OperationsTestCase( + "validateSupplyEntryHasPerformerAssignedEntity", + operationsForOCL.getOCLValue("VALIDATE_SUPPLY_ENTRY_HAS_PERFORMER_ASSIGNED_ENTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SupplyEntry target) { + + target.init(); + target.setMoodCode(x_DocumentSubstanceMood.INT); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + target.getPerformers().add(per); + + } + + @Override + protected void updateToPass(SupplyEntry target) { + + for (Performer2 per : target.getPerformers()) { + per.setAssignedEntity(CDAFactory.eINSTANCE.createAssignedEntity()); + } + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SupplyEntryOperations.validateSupplyEntryHasPerformerAssignedEntity( + (SupplyEntry) objectToTest, diagnostician, map); + } + + }; + + validateSupplyEntryHasPerformerAssignedEntityTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSupplyEntryHasPerformerAssignedEntityID() { + OperationsTestCase validateSupplyEntryHasPerformerAssignedEntityIDTestCase = new OperationsTestCase( + "validateSupplyEntryHasPerformerAssignedEntityID", + operationsForOCL.getOCLValue("VALIDATE_SUPPLY_ENTRY_HAS_PERFORMER_ASSIGNED_ENTITY_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SupplyEntry target) { + + target.init(); + target.setMoodCode(x_DocumentSubstanceMood.INT); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + per.setAssignedEntity(CDAFactory.eINSTANCE.createAssignedEntity()); + target.getPerformers().add(per); + + } + + @Override + protected void updateToPass(SupplyEntry target) { + + for (Performer2 per : target.getPerformers()) { + per.getAssignedEntity().getIds().add(DatatypesFactory.eINSTANCE.createII()); + } + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SupplyEntryOperations.validateSupplyEntryHasPerformerAssignedEntityID( + (SupplyEntry) objectToTest, diagnostician, map); + } + + }; + + validateSupplyEntryHasPerformerAssignedEntityIDTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSupplyEntryHasPerformerEntityPersonOrOrg() { + OperationsTestCase validateSupplyEntryHasPerformerEntityPersonOrOrgTestCase = new OperationsTestCase( + "validateSupplyEntryHasPerformerEntityPersonOrOrg", + operationsForOCL.getOCLValue("VALIDATE_SUPPLY_ENTRY_HAS_PERFORMER_ENTITY_PERSON_OR_ORG__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + public void addFailTests() { + + addFailTest(new FailTest() { + + @Override + public void updateToFail(SupplyEntry target) { + target.init(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(SupplyEntry target) { + target.init(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.setAssignedPerson(CDAFactory.eINSTANCE.createPerson()); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + + } + }); + + addFailTest(new FailTest() { + + @Override + public void updateToFail(SupplyEntry target) { + target.init(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + ae.getRepresentedOrganizations().add(CDAFactory.eINSTANCE.createOrganization()); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + + } + }); + + } + + @Override + public void addPassTests() { + + addPassTest(new PassTest() { + + @Override + public void updateToPass(SupplyEntry target) { + target.init(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + Person person = CDAFactory.eINSTANCE.createPerson(); + person.getNames().add(DatatypesFactory.eINSTANCE.createPN()); + ae.setAssignedPerson(person); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + + } + }); + + addPassTest(new PassTest() { + + @Override + public void updateToPass(SupplyEntry target) { + target.init(); + Performer2 per = CDAFactory.eINSTANCE.createPerformer2(); + AssignedEntity ae = CDAFactory.eINSTANCE.createAssignedEntity(); + Organization organization = CDAFactory.eINSTANCE.createOrganization(); + organization.getNames().add(DatatypesFactory.eINSTANCE.createON()); + ae.getRepresentedOrganizations().add(organization); + per.setAssignedEntity(ae); + target.getPerformers().add(per); + + } + }); + + } + + @Override + protected void updateToPass(SupplyEntry target) { + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SupplyEntryOperations.validateSupplyEntryHasPerformerEntityPersonOrOrg( + (SupplyEntry) objectToTest, diagnostician, map); + } + + }; + + validateSupplyEntryHasPerformerEntityPersonOrOrgTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSupplyEntryQuantityHasValue() { + OperationsTestCase validateSupplyEntryQuantityHasValueTestCase = new OperationsTestCase( + "validateSupplyEntryQuantityHasValue", + operationsForOCL.getOCLValue("VALIDATE_SUPPLY_ENTRY_QUANTITY_HAS_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SupplyEntry target) { + target.init(); + PQ pq = DatatypesFactory.eINSTANCE.createPQ(); + target.setQuantity(pq); + } + + @Override + protected void updateToPass(SupplyEntry target) { + + target.getQuantity().setValue(new BigDecimal(1234)); + + // CD value = DatatypesFactory.eINSTANCE.createCD(); + // target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SupplyEntryOperations.validateSupplyEntryQuantityHasValue( + (SupplyEntry) objectToTest, diagnostician, map); + } + + }; + + validateSupplyEntryQuantityHasValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSupplyEntryTemplateId() { + OperationsTestCase validateSupplyEntryTemplateIdTestCase = new OperationsTestCase( + "validateSupplyEntryTemplateId", + operationsForOCL.getOCLValue("VALIDATE_SUPPLY_ENTRY_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SupplyEntry target) { + + } + + @Override + protected void updateToPass(SupplyEntry target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SupplyEntryOperations.validateSupplyEntryTemplateId( + (SupplyEntry) objectToTest, diagnostician, map); + } + + }; + + validateSupplyEntryTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSupplyEntryQuantity() { + OperationsTestCase validateSupplyEntryQuantityTestCase = new OperationsTestCase( + "validateSupplyEntryQuantity", + operationsForOCL.getOCLValue("VALIDATE_SUPPLY_ENTRY_QUANTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SupplyEntry target) { + target.init(); + } + + @Override + protected void updateToPass(SupplyEntry target) { + PQ pq = DatatypesFactory.eINSTANCE.createPQ(); + target.setQuantity(pq); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SupplyEntryOperations.validateSupplyEntryQuantity((SupplyEntry) objectToTest, diagnostician, map); + } + + }; + + validateSupplyEntryQuantityTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSupplyEntryRepeatNumber() { + OperationsTestCase validateSupplyEntryRepeatNumberTestCase = new OperationsTestCase( + "validateSupplyEntryRepeatNumber", + operationsForOCL.getOCLValue("VALIDATE_SUPPLY_ENTRY_REPEAT_NUMBER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SupplyEntry target) { + target.init(); + } + + @Override + protected void updateToPass(SupplyEntry target) { + + IVL_INT value = DatatypesFactory.eINSTANCE.createIVL_INT(); + target.setRepeatNumber(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SupplyEntryOperations.validateSupplyEntryRepeatNumber( + (SupplyEntry) objectToTest, diagnostician, map); + } + + }; + + validateSupplyEntryRepeatNumberTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSupplyEntryMedicationFullfillmentInstructions() { + OperationsTestCase validateSupplyEntryMedicationFullfillmentInstructionsTestCase = new OperationsTestCase( + "validateSupplyEntryMedicationFullfillmentInstructions", + operationsForOCL.getOCLValue("VALIDATE_SUPPLY_ENTRY_MEDICATION_FULLFILLMENT_INSTRUCTIONS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SupplyEntry target) { + target.init(); + } + + @Override + protected void updateToPass(SupplyEntry target) { + + target.addAct(IHEFactory.eINSTANCE.createMedicationFullfillmentInstructions().init()); + + for (EntryRelationship entryRelationship : target.getEntryRelationships()) { + entryRelationship.setTypeCode(x_ActRelationshipEntryRelationship.SUBJ); + + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SupplyEntryOperations.validateSupplyEntryMedicationFullfillmentInstructions( + (SupplyEntry) objectToTest, diagnostician, map); + } + + }; + + validateSupplyEntryMedicationFullfillmentInstructionsTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetMedicationFullfillmentInstructions() { + + SupplyEntry target = objectFactory.create(); + target.getMedicationFullfillmentInstructions(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends SupplyEntryOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public SupplyEntry create() { + return IHEFactory.eINSTANCE.createSupplyEntry(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends SupplyEntryOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // SupplyEntryOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/SurgeriesSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/SurgeriesSectionTest.java new file mode 100644 index 000000000..8cff83894 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/SurgeriesSectionTest.java @@ -0,0 +1,142 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.SurgeriesSection; +import org.openhealthtools.mdht.uml.cda.ihe.operations.SurgeriesSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Surgeries Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.SurgeriesSection#validateSurgeriesSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Surgeries Section Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class SurgeriesSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateSurgeriesSectionTemplateId() { + OperationsTestCase validateSurgeriesSectionTemplateIdTestCase = new OperationsTestCase( + "validateSurgeriesSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_SURGERIES_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SurgeriesSection target) { + + } + + @Override + protected void updateToPass(SurgeriesSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SurgeriesSectionOperations.validateSurgeriesSectionTemplateId( + (SurgeriesSection) objectToTest, diagnostician, map); + } + + }; + + validateSurgeriesSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends SurgeriesSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public SurgeriesSection create() { + return IHEFactory.eINSTANCE.createSurgeriesSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends SurgeriesSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // SurgeriesSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/TaperedDoseTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/TaperedDoseTest.java new file mode 100644 index 000000000..49ce1f769 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/TaperedDoseTest.java @@ -0,0 +1,180 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.SubstanceAdministration; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.TaperedDose; +import org.openhealthtools.mdht.uml.cda.ihe.operations.TaperedDoseOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Tapered Dose' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.TaperedDose#validateTaperedDoseTaperedDosingSubstanceAdministration(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Tapered Dose Tapered Dosing Substance Administration}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.TaperedDose#validateTaperedDoseTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Tapered Dose Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class TaperedDoseTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateTaperedDoseTaperedDosingSubstanceAdministration() { + OperationsTestCase validateTaperedDoseTaperedDosingSubstanceAdministrationTestCase = new OperationsTestCase( + "validateTaperedDoseTaperedDosingSubstanceAdministration", + operationsForOCL.getOCLValue("VALIDATE_TAPERED_DOSE_TAPERED_DOSING_SUBSTANCE_ADMINISTRATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(TaperedDose target) { + target.init(); + + } + + @Override + protected void updateToPass(TaperedDose target) { + SubstanceAdministration substanceAdministration = IHEFactory.eINSTANCE.createNormalDose().init(); // CDAFactory.eINSTANCE.createSubstanceAdministration(); + target.addSubstanceAdministration(substanceAdministration); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return TaperedDoseOperations.validateTaperedDoseTaperedDosingSubstanceAdministration( + (TaperedDose) objectToTest, diagnostician, map); + } + + }; + + validateTaperedDoseTaperedDosingSubstanceAdministrationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateTaperedDoseTemplateId() { + OperationsTestCase validateTaperedDoseTemplateIdTestCase = new OperationsTestCase( + "validateTaperedDoseTemplateId", + operationsForOCL.getOCLValue("VALIDATE_TAPERED_DOSE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(TaperedDose target) { + + } + + @Override + protected void updateToPass(TaperedDose target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return TaperedDoseOperations.validateTaperedDoseTemplateId( + (TaperedDose) objectToTest, diagnostician, map); + } + + }; + + validateTaperedDoseTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends TaperedDoseOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public TaperedDose create() { + return IHEFactory.eINSTANCE.createTaperedDose(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends TaperedDoseOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // TaperedDoseOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ThoraxLungsSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ThoraxLungsSectionTest.java new file mode 100644 index 000000000..8a216fd65 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/ThoraxLungsSectionTest.java @@ -0,0 +1,223 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.ThoraxLungsSection; +import org.openhealthtools.mdht.uml.cda.ihe.operations.ThoraxLungsSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Thorax Lungs Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ThoraxLungsSection#validateThoraxLungsSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Thorax Lungs Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ThoraxLungsSection#validateThoraxLungsSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Thorax Lungs Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ThoraxLungsSection#validateThoraxLungsSectionProblemEntry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Thorax Lungs Section Problem Entry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.ThoraxLungsSection#getProblemEntry() Get Problem Entry}
  • + *
+ *

+ * + * @generated + */ + +public class ThoraxLungsSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateThoraxLungsSectionTemplateId() { + OperationsTestCase validateThoraxLungsSectionTemplateIdTestCase = new OperationsTestCase( + "validateThoraxLungsSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_THORAX_LUNGS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ThoraxLungsSection target) { + + } + + @Override + protected void updateToPass(ThoraxLungsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ThoraxLungsSectionOperations.validateThoraxLungsSectionTemplateId( + (ThoraxLungsSection) objectToTest, diagnostician, map); + } + + }; + + validateThoraxLungsSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateThoraxLungsSectionCode() { + OperationsTestCase validateThoraxLungsSectionCodeTestCase = new OperationsTestCase( + "validateThoraxLungsSectionCode", + operationsForOCL.getOCLValue("VALIDATE_THORAX_LUNGS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ThoraxLungsSection target) { + + } + + @Override + protected void updateToPass(ThoraxLungsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ThoraxLungsSectionOperations.validateThoraxLungsSectionCode( + (ThoraxLungsSection) objectToTest, diagnostician, map); + } + + }; + + validateThoraxLungsSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateThoraxLungsSectionProblemEntry() { + OperationsTestCase validateThoraxLungsSectionProblemEntryTestCase = new OperationsTestCase( + "validateThoraxLungsSectionProblemEntry", + operationsForOCL.getOCLValue("VALIDATE_THORAX_LUNGS_SECTION_PROBLEM_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ThoraxLungsSection target) { + target.init(); + } + + @Override + protected void updateToPass(ThoraxLungsSection target) { + + target.addObservation(IHEFactory.eINSTANCE.createProblemEntry().init()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ThoraxLungsSectionOperations.validateThoraxLungsSectionProblemEntry( + (ThoraxLungsSection) objectToTest, diagnostician, map); + } + + }; + + validateThoraxLungsSectionProblemEntryTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemEntry() { + + ThoraxLungsSection target = objectFactory.create(); + target.getProblemEntry(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ThoraxLungsSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public ThoraxLungsSection create() { + return IHEFactory.eINSTANCE.createThoraxLungsSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends ThoraxLungsSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ThoraxLungsSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/VesselsSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/VesselsSectionTest.java new file mode 100644 index 000000000..3917475cb --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/VesselsSectionTest.java @@ -0,0 +1,223 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.VesselsSection; +import org.openhealthtools.mdht.uml.cda.ihe.operations.VesselsSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Vessels Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.VesselsSection#validateVesselsSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vessels Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.VesselsSection#validateVesselsSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vessels Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.VesselsSection#validateVesselsSectionProblemEntry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vessels Section Problem Entry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.VesselsSection#getProblemEntry() Get Problem Entry}
  • + *
+ *

+ * + * @generated + */ + +public class VesselsSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateVesselsSectionTemplateId() { + OperationsTestCase validateVesselsSectionTemplateIdTestCase = new OperationsTestCase( + "validateVesselsSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_VESSELS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VesselsSection target) { + + } + + @Override + protected void updateToPass(VesselsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VesselsSectionOperations.validateVesselsSectionTemplateId( + (VesselsSection) objectToTest, diagnostician, map); + } + + }; + + validateVesselsSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateVesselsSectionCode() { + OperationsTestCase validateVesselsSectionCodeTestCase = new OperationsTestCase( + "validateVesselsSectionCode", + operationsForOCL.getOCLValue("VALIDATE_VESSELS_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VesselsSection target) { + + } + + @Override + protected void updateToPass(VesselsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VesselsSectionOperations.validateVesselsSectionCode( + (VesselsSection) objectToTest, diagnostician, map); + } + + }; + + validateVesselsSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateVesselsSectionProblemEntry() { + OperationsTestCase validateVesselsSectionProblemEntryTestCase = new OperationsTestCase( + "validateVesselsSectionProblemEntry", + operationsForOCL.getOCLValue("VALIDATE_VESSELS_SECTION_PROBLEM_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VesselsSection target) { + target.init(); + } + + @Override + protected void updateToPass(VesselsSection target) { + + target.addObservation(IHEFactory.eINSTANCE.createProblemEntry().init()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VesselsSectionOperations.validateVesselsSectionProblemEntry( + (VesselsSection) objectToTest, diagnostician, map); + } + + }; + + validateVesselsSectionProblemEntryTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemEntry() { + + VesselsSection target = objectFactory.create(); + target.getProblemEntry(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends VesselsSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public VesselsSection create() { + return IHEFactory.eINSTANCE.createVesselsSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends VesselsSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // VesselsSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/VisibleImplantedMedicalDevicesSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/VisibleImplantedMedicalDevicesSectionTest.java new file mode 100644 index 000000000..5441885ce --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/VisibleImplantedMedicalDevicesSectionTest.java @@ -0,0 +1,223 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.VisibleImplantedMedicalDevicesSection; +import org.openhealthtools.mdht.uml.cda.ihe.operations.VisibleImplantedMedicalDevicesSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Visible Implanted Medical Devices Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.VisibleImplantedMedicalDevicesSection#validateVisibleImplantedMedicalDevicesSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Visible Implanted Medical Devices Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.VisibleImplantedMedicalDevicesSection#validateVisibleImplantedMedicalDevicesSectionCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Visible Implanted Medical Devices Section Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.VisibleImplantedMedicalDevicesSection#validateVisibleImplantedMedicalDevicesSectionProblemEntry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Visible Implanted Medical Devices Section Problem Entry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.VisibleImplantedMedicalDevicesSection#getProblemEntry() Get Problem Entry}
  • + *
+ *

+ * + * @generated + */ + +public class VisibleImplantedMedicalDevicesSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateVisibleImplantedMedicalDevicesSectionTemplateId() { + OperationsTestCase validateVisibleImplantedMedicalDevicesSectionTemplateIdTestCase = new OperationsTestCase( + "validateVisibleImplantedMedicalDevicesSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_VISIBLE_IMPLANTED_MEDICAL_DEVICES_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VisibleImplantedMedicalDevicesSection target) { + + } + + @Override + protected void updateToPass(VisibleImplantedMedicalDevicesSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VisibleImplantedMedicalDevicesSectionOperations.validateVisibleImplantedMedicalDevicesSectionTemplateId( + (VisibleImplantedMedicalDevicesSection) objectToTest, diagnostician, map); + } + + }; + + validateVisibleImplantedMedicalDevicesSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateVisibleImplantedMedicalDevicesSectionCode() { + OperationsTestCase validateVisibleImplantedMedicalDevicesSectionCodeTestCase = new OperationsTestCase( + "validateVisibleImplantedMedicalDevicesSectionCode", + operationsForOCL.getOCLValue("VALIDATE_VISIBLE_IMPLANTED_MEDICAL_DEVICES_SECTION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VisibleImplantedMedicalDevicesSection target) { + + } + + @Override + protected void updateToPass(VisibleImplantedMedicalDevicesSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VisibleImplantedMedicalDevicesSectionOperations.validateVisibleImplantedMedicalDevicesSectionCode( + (VisibleImplantedMedicalDevicesSection) objectToTest, diagnostician, map); + } + + }; + + validateVisibleImplantedMedicalDevicesSectionCodeTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateVisibleImplantedMedicalDevicesSectionProblemEntry() { + OperationsTestCase validateVisibleImplantedMedicalDevicesSectionProblemEntryTestCase = new OperationsTestCase( + "validateVisibleImplantedMedicalDevicesSectionProblemEntry", + operationsForOCL.getOCLValue("VALIDATE_VISIBLE_IMPLANTED_MEDICAL_DEVICES_SECTION_PROBLEM_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VisibleImplantedMedicalDevicesSection target) { + target.init(); + } + + @Override + protected void updateToPass(VisibleImplantedMedicalDevicesSection target) { + target.addObservation(IHEFactory.eINSTANCE.createProblemEntry().init()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VisibleImplantedMedicalDevicesSectionOperations.validateVisibleImplantedMedicalDevicesSectionProblemEntry( + (VisibleImplantedMedicalDevicesSection) objectToTest, diagnostician, map); + } + + }; + + validateVisibleImplantedMedicalDevicesSectionProblemEntryTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemEntry() { + + VisibleImplantedMedicalDevicesSection target = objectFactory.create(); + target.getProblemEntry(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends VisibleImplantedMedicalDevicesSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + public VisibleImplantedMedicalDevicesSection create() { + return IHEFactory.eINSTANCE.createVisibleImplantedMedicalDevicesSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends VisibleImplantedMedicalDevicesSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // VisibleImplantedMedicalDevicesSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/VitalSignObservationTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/VitalSignObservationTest.java new file mode 100644 index 000000000..029193421 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/VitalSignObservationTest.java @@ -0,0 +1,369 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ccd.operations.ResultObservationOperations; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.VitalSignObservation; +import org.openhealthtools.mdht.uml.cda.ihe.operations.VitalSignObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.PQ; + +/** + * + * A static utility class that provides operations related to 'Vital Sign Observation' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.VitalSignObservation#validateVitalSignObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Sign Observation Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.VitalSignObservation#validateVitalSignObservationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Sign Observation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.VitalSignObservation#validateVitalSignObservationInterpretationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Sign Observation Interpretation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.VitalSignObservation#validateVitalSignObservationMethodCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Sign Observation Method Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.VitalSignObservation#validateVitalSignObservationTargetSiteCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Sign Observation Target Site Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.VitalSignObservation#validateVitalSignObservationValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Vital Sign Observation Value}
  • + *
+ *

+ * + * @generated + */ + +public class VitalSignObservationTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateVitalSignObservationTemplateId() { + OperationsTestCase validateVitalSignObservationTemplateIdTestCase = new OperationsTestCase( + "validateVitalSignObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGN_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignObservation target) { + + } + + @Override + protected void updateToPass(VitalSignObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignObservationOperations.validateVitalSignObservationTemplateId( + (VitalSignObservation) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateVitalSignObservationCode() { + OperationsTestCase validateVitalSignObservationCodeTestCase = new OperationsTestCase( + "validateVitalSignObservationCode", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGN_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignObservation target) { + + } + + @Override + protected void updateToPass(VitalSignObservation target) { + target.init(); + + CD cd = DatatypesFactory.eINSTANCE.createCD(); + cd.setCodeSystem("2.16.840.1.113883.6.1"); + cd.setCode("aaa"); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignObservationOperations.validateVitalSignObservationCode( + (VitalSignObservation) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateVitalSignObservationInterpretationCode() { + OperationsTestCase validateVitalSignObservationInterpretationCodeTestCase = new OperationsTestCase( + "validateVitalSignObservationInterpretationCode", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGN_OBSERVATION_INTERPRETATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignObservation target) { + target.init(); + } + + @Override + protected void updateToPass(VitalSignObservation target) { + CE ce = DatatypesFactory.eINSTANCE.createCE(); + target.getInterpretationCodes().add(ce); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignObservationOperations.validateVitalSignObservationInterpretationCode( + (VitalSignObservation) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignObservationInterpretationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateVitalSignObservationMethodCode() { + OperationsTestCase validateVitalSignObservationMethodCodeTestCase = new OperationsTestCase( + "validateVitalSignObservationMethodCode", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGN_OBSERVATION_METHOD_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignObservation target) { + target.init(); + } + + @Override + protected void updateToPass(VitalSignObservation target) { + CE ce = DatatypesFactory.eINSTANCE.createCE(); + target.getMethodCodes().add(ce); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignObservationOperations.validateVitalSignObservationMethodCode( + (VitalSignObservation) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignObservationMethodCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateVitalSignObservationTargetSiteCode() { + OperationsTestCase validateVitalSignObservationTargetSiteCodeTestCase = new OperationsTestCase( + "validateVitalSignObservationTargetSiteCode", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGN_OBSERVATION_TARGET_SITE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignObservation target) { + target.init(); + } + + @Override + protected void updateToPass(VitalSignObservation target) { + CD cd = DatatypesFactory.eINSTANCE.createCD(); + target.getTargetSiteCodes().add(cd); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignObservationOperations.validateVitalSignObservationTargetSiteCode( + (VitalSignObservation) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignObservationTargetSiteCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateVitalSignObservationValue() { + OperationsTestCase validateVitalSignObservationValueTestCase = new OperationsTestCase( + "validateVitalSignObservationValue", + operationsForOCL.getOCLValue("VALIDATE_VITAL_SIGN_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignObservation target) { + target.init(); + CD cd = DatatypesFactory.eINSTANCE.createCD(); + target.getValues().add(cd); + } + + @Override + protected void updateToPass(VitalSignObservation target) { + target.getValues().clear(); + PQ pq = DatatypesFactory.eINSTANCE.createPQ(); + target.getValues().add(pq); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignObservationOperations.validateVitalSignObservationValue( + (VitalSignObservation) objectToTest, diagnostician, map); + } + + }; + + validateVitalSignObservationValueTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateResultObservationCode() { + OperationsTestCase validateResultObservationCodeTestCase = new OperationsTestCase( + "validateResultObservationCode", + operationsForOCL.getOCLValue("VALIDATE_RESULT_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignObservation target) { + + } + + @Override + protected void updateToPass(VitalSignObservation target) { + target.init(); + + CD cd = DatatypesFactory.eINSTANCE.createCD(); + cd.setCodeSystem("2.16.840.1.113883.6.1"); + + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultObservationOperations.validateResultObservationCode( + (VitalSignObservation) objectToTest, diagnostician, map); + } + + }; + + validateResultObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends VitalSignObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public VitalSignObservation create() { + return IHEFactory.eINSTANCE.createVitalSignObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends VitalSignObservationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // VitalSignObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/VitalSignsOrganizerTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/VitalSignsOrganizerTest.java new file mode 100644 index 000000000..d32392c40 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/VitalSignsOrganizerTest.java @@ -0,0 +1,454 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Component4; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.VitalSignObservation; +import org.openhealthtools.mdht.uml.cda.ihe.VitalSignsOrganizer; +import org.openhealthtools.mdht.uml.cda.ihe.operations.VitalSignsOrganizerOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; + +/** + * + * A static utility class that provides operations related to 'Vital Signs Organizer' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.VitalSignsOrganizer#validateIHEVitalSignsOrganizerRequireResultsOrganizerTemplateID(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Vital Signs Organizer Require Results Organizer Template ID}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.VitalSignsOrganizer#validateIHEVitalSignsOrganizerTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Vital Signs Organizer Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.VitalSignsOrganizer#validateIHEVitalSignsOrganizerClassCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Vital Signs Organizer Class Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.VitalSignsOrganizer#validateIHEVitalSignsOrganizerCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Vital Signs Organizer Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.VitalSignsOrganizer#validateIHEVitalSignsOrganizerEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Vital Signs Organizer Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.VitalSignsOrganizer#validateIHEVitalSignsOrganizerStatusCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Vital Signs Organizer Status Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.VitalSignsOrganizer#validateIHEVitalSignsOrganizerId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Vital Signs Organizer Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.VitalSignsOrganizer#validateIHEVitalSignsOrganizerVitalSignObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Vital Signs Organizer Vital Sign Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.VitalSignsOrganizer#validateIHEVitalSignsOrganizerAuthor(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Vital Signs Organizer Author}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.VitalSignsOrganizer#getVitalSignObservations() Get Vital Sign Observations}
  • + *
+ *

+ * + * @generated + */ + +public class VitalSignsOrganizerTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateIHEVitalSignsOrganizerRequireResultsOrganizerTemplateID() { + OperationsTestCase validateIHEVitalSignsOrganizerRequireResultsOrganizerTemplateIDTestCase = new OperationsTestCase( + "validateIHEVitalSignsOrganizerRequireResultsOrganizerTemplateID", + operationsForOCL.getOCLValue("VALIDATE_IHE_VITAL_SIGNS_ORGANIZER_REQUIRE_RESULTS_ORGANIZER_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignsOrganizer target) { + + } + + @Override + protected void updateToPass(VitalSignsOrganizer target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignsOrganizerOperations.validateIHEVitalSignsOrganizerRequireResultsOrganizerTemplateID( + (VitalSignsOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateIHEVitalSignsOrganizerRequireResultsOrganizerTemplateIDTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateIHEVitalSignsOrganizerTemplateId() { + OperationsTestCase validateIHEVitalSignsOrganizerTemplateIdTestCase = new OperationsTestCase( + "validateIHEVitalSignsOrganizerTemplateId", + operationsForOCL.getOCLValue("VALIDATE_IHE_VITAL_SIGNS_ORGANIZER_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignsOrganizer target) { + + } + + @Override + protected void updateToPass(VitalSignsOrganizer target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignsOrganizerOperations.validateIHEVitalSignsOrganizerTemplateId( + (VitalSignsOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateIHEVitalSignsOrganizerTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateIHEVitalSignsOrganizerClassCode() { + OperationsTestCase validateIHEVitalSignsOrganizerClassCodeTestCase = new OperationsTestCase( + "validateIHEVitalSignsOrganizerClassCode", + operationsForOCL.getOCLValue("VALIDATE_IHE_VITAL_SIGNS_ORGANIZER_CLASS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignsOrganizer target) { + + } + + @Override + protected void updateToPass(VitalSignsOrganizer target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignsOrganizerOperations.validateIHEVitalSignsOrganizerClassCode( + (VitalSignsOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateIHEVitalSignsOrganizerClassCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateIHEVitalSignsOrganizerCode() { + OperationsTestCase validateIHEVitalSignsOrganizerCodeTestCase = new OperationsTestCase( + "validateIHEVitalSignsOrganizerCode", + operationsForOCL.getOCLValue("VALIDATE_IHE_VITAL_SIGNS_ORGANIZER_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignsOrganizer target) { + + } + + @Override + protected void updateToPass(VitalSignsOrganizer target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignsOrganizerOperations.validateIHEVitalSignsOrganizerCode( + (VitalSignsOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateIHEVitalSignsOrganizerCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateIHEVitalSignsOrganizerEffectiveTime() { + OperationsTestCase validateIHEVitalSignsOrganizerEffectiveTimeTestCase = new OperationsTestCase( + "validateIHEVitalSignsOrganizerEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_IHE_VITAL_SIGNS_ORGANIZER_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignsOrganizer target) { + + } + + @Override + protected void updateToPass(VitalSignsOrganizer target) { + target.init(); + + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignsOrganizerOperations.validateIHEVitalSignsOrganizerEffectiveTime( + (VitalSignsOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateIHEVitalSignsOrganizerEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateIHEVitalSignsOrganizerStatusCode() { + OperationsTestCase validateIHEVitalSignsOrganizerStatusCodeTestCase = new OperationsTestCase( + "validateIHEVitalSignsOrganizerStatusCode", + operationsForOCL.getOCLValue("VALIDATE_IHE_VITAL_SIGNS_ORGANIZER_STATUS_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignsOrganizer target) { + + } + + @Override + protected void updateToPass(VitalSignsOrganizer target) { + target.init(); + + CS cs = DatatypesFactory.eINSTANCE.createCS("completed"); + target.setStatusCode(cs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignsOrganizerOperations.validateIHEVitalSignsOrganizerStatusCode( + (VitalSignsOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateIHEVitalSignsOrganizerStatusCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateIHEVitalSignsOrganizerId() { + OperationsTestCase validateIHEVitalSignsOrganizerIdTestCase = new OperationsTestCase( + "validateIHEVitalSignsOrganizerId", + operationsForOCL.getOCLValue("VALIDATE_IHE_VITAL_SIGNS_ORGANIZER_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignsOrganizer target) { + target.init(); + } + + @Override + protected void updateToPass(VitalSignsOrganizer target) { + II ii = DatatypesFactory.eINSTANCE.createII(); + target.getIds().add(ii); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignsOrganizerOperations.validateIHEVitalSignsOrganizerId( + (VitalSignsOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateIHEVitalSignsOrganizerIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateIHEVitalSignsOrganizerVitalSignObservation() { + OperationsTestCase validateIHEVitalSignsOrganizerVitalSignObservationTestCase = new OperationsTestCase( + "validateIHEVitalSignsOrganizerVitalSignObservation", + operationsForOCL.getOCLValue("VALIDATE_IHE_VITAL_SIGNS_ORGANIZER_VITAL_SIGN_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignsOrganizer target) { + target.init(); + Component4 component = CDAFactory.eINSTANCE.createComponent4(); + target.getComponents().add(component); + } + + @Override + protected void updateToPass(VitalSignsOrganizer target) { + + for (Component4 component : target.getComponents()) { + VitalSignObservation obv = IHEFactory.eINSTANCE.createVitalSignObservation().init(); + component.setObservation(obv); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignsOrganizerOperations.validateIHEVitalSignsOrganizerVitalSignObservation( + (VitalSignsOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateIHEVitalSignsOrganizerVitalSignObservationTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateIHEVitalSignsOrganizerAuthor() { + OperationsTestCase validateIHEVitalSignsOrganizerAuthorTestCase = new OperationsTestCase( + "validateIHEVitalSignsOrganizerAuthor", + operationsForOCL.getOCLValue("VALIDATE_IHE_VITAL_SIGNS_ORGANIZER_AUTHOR__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignsOrganizer target) { + target.init(); + } + + @Override + protected void updateToPass(VitalSignsOrganizer target) { + + target.getAuthors().add(CDAFactory.eINSTANCE.createAuthor()); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignsOrganizerOperations.validateIHEVitalSignsOrganizerAuthor( + (VitalSignsOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateIHEVitalSignsOrganizerAuthorTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetVitalSignObservations() { + + VitalSignsOrganizer target = objectFactory.create(); + target.getVitalSignObservations(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends VitalSignsOrganizerOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public VitalSignsOrganizer create() { + return IHEFactory.eINSTANCE.createVitalSignsOrganizer(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends VitalSignsOrganizerOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // VitalSignsOrganizerOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/VitalSignsSectionTest.java b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/VitalSignsSectionTest.java new file mode 100644 index 000000000..6eb4d5f04 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/src/org/openhealthtools/mdht/uml/cda/ihe/tests/VitalSignsSectionTest.java @@ -0,0 +1,142 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.ihe.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.ihe.VitalSignsSection; +import org.openhealthtools.mdht.uml.cda.ihe.operations.VitalSignsSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * + * A static utility class that provides operations related to 'Vital Signs Section' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.ihe.VitalSignsSection#validateIHEVitalSignsSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate IHE Vital Signs Section Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class VitalSignsSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testValidateIHEVitalSignsSectionTemplateId() { + OperationsTestCase validateIHEVitalSignsSectionTemplateIdTestCase = new OperationsTestCase( + "validateIHEVitalSignsSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_IHE_VITAL_SIGNS_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VitalSignsSection target) { + + } + + @Override + protected void updateToPass(VitalSignsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VitalSignsSectionOperations.validateIHEVitalSignsSectionTemplateId( + (VitalSignsSection) objectToTest, diagnostician, map); + } + + }; + + validateIHEVitalSignsSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends VitalSignsSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public VitalSignsSection create() { + return IHEFactory.eINSTANCE.createVitalSignsSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + private static class ConstructorTestClass extends VitalSignsSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // VitalSignsSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.ihe.tests/test.xml b/org.openhealthtools.mdht.uml.cda.ihe.tests/test.xml new file mode 100644 index 000000000..205e1331f --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.ihe.tests/test.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/org.openhealthtools.mdht.uml.cda.mu2consol.tests/.classpath b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/.classpath new file mode 100644 index 000000000..ed2bc1287 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.openhealthtools.mdht.uml.cda.mu2consol.tests/.project b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/.project new file mode 100644 index 000000000..4b1feb87a --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/.project @@ -0,0 +1,28 @@ + + + org.openhealthtools.mdht.uml.cda.mu2consol.tests + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.pde.PluginNature + + diff --git a/org.openhealthtools.mdht.uml.cda.mu2consol.tests/.settings/org.eclipse.jdt.core.prefs b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..fd79a3e6c --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,355 @@ +#Mon May 16 10:24:25 EDT 2011 +eclipse.preferences.version=1 +org.eclipse.jdt.core.codeComplete.argumentPrefixes= +org.eclipse.jdt.core.codeComplete.argumentSuffixes= +org.eclipse.jdt.core.codeComplete.fieldPrefixes= +org.eclipse.jdt.core.codeComplete.fieldSuffixes= +org.eclipse.jdt.core.codeComplete.localPrefixes= +org.eclipse.jdt.core.codeComplete.localSuffixes= +org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.5 +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.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning +org.eclipse.jdt.core.compiler.problem.deadCode=warning +org.eclipse.jdt.core.compiler.problem.deprecation=warning +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore +org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=error +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore +org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning +org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +org.eclipse.jdt.core.compiler.problem.nullReference=warning +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore +org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=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 +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedImport=warning +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +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.5 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=36 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=36 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=36 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=36 +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_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=49 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=32 +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_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=0 +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 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=1 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=150 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@fmtOff +org.eclipse.jdt.core.formatter.enabling_tag=@fmtOn +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +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=true +org.eclipse.jdt.core.formatter.indentation.size=4 +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_parameter=do not 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=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +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_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_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 +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +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_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 +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +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_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not 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_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 +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +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_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 +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +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_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_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 +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=false +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=120 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +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=false +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/org.openhealthtools.mdht.uml.cda.mu2consol.tests/.settings/org.eclipse.jdt.ui.prefs b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 000000000..6245d2099 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,120 @@ +#Tue Mar 29 22:38:51 EDT 2011 +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=false +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=false +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=false +cleanup.format_source_code=true +cleanup.format_source_code_changes_only=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=false +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=true +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=true +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=true +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_blocks=true +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_parentheses_in_expressions=false +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup_profile=_MDHT +cleanup_settings_version=2 +eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true +formatter_profile=_MDHT +formatter_settings_version=11 +org.eclipse.jdt.ui.exception.name=e +org.eclipse.jdt.ui.gettersetter.use.is=true +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com; +org.eclipse.jdt.ui.javadoc=true +org.eclipse.jdt.ui.keywordthis=false +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.overrideannotation=true +org.eclipse.jdt.ui.staticondemandthreshold=99 +org.eclipse.jdt.ui.text.custom_code_templates= +sp_cleanup.add_default_serial_version_id=true +sp_cleanup.add_generated_serial_version_id=false +sp_cleanup.add_missing_annotations=true +sp_cleanup.add_missing_deprecated_annotations=true +sp_cleanup.add_missing_methods=false +sp_cleanup.add_missing_nls_tags=false +sp_cleanup.add_missing_override_annotations=true +sp_cleanup.add_missing_override_annotations_interface_methods=false +sp_cleanup.add_serial_version_id=false +sp_cleanup.always_use_blocks=true +sp_cleanup.always_use_parentheses_in_expressions=false +sp_cleanup.always_use_this_for_non_static_field_access=false +sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.convert_to_enhanced_for_loop=false +sp_cleanup.correct_indentation=false +sp_cleanup.format_source_code=true +sp_cleanup.format_source_code_changes_only=false +sp_cleanup.make_local_variable_final=false +sp_cleanup.make_parameters_final=false +sp_cleanup.make_private_fields_final=true +sp_cleanup.make_type_abstract_if_missing_method=false +sp_cleanup.make_variable_declarations_final=false +sp_cleanup.never_use_blocks=false +sp_cleanup.never_use_parentheses_in_expressions=true +sp_cleanup.on_save_use_additional_actions=true +sp_cleanup.organize_imports=true +sp_cleanup.qualify_static_field_accesses_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_with_declaring_class=false +sp_cleanup.qualify_static_method_accesses_with_declaring_class=false +sp_cleanup.remove_private_constructors=true +sp_cleanup.remove_trailing_whitespaces=true +sp_cleanup.remove_trailing_whitespaces_all=true +sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +sp_cleanup.remove_unnecessary_casts=true +sp_cleanup.remove_unnecessary_nls_tags=false +sp_cleanup.remove_unused_imports=false +sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_private_fields=true +sp_cleanup.remove_unused_private_members=false +sp_cleanup.remove_unused_private_methods=true +sp_cleanup.remove_unused_private_types=true +sp_cleanup.sort_members=false +sp_cleanup.sort_members_all=false +sp_cleanup.use_blocks=false +sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_parentheses_in_expressions=false +sp_cleanup.use_this_for_non_static_field_access=false +sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true +sp_cleanup.use_this_for_non_static_method_access=false +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/org.openhealthtools.mdht.uml.cda.mu2consol.tests/META-INF/MANIFEST.MF b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/META-INF/MANIFEST.MF new file mode 100644 index 000000000..1665a6e43 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/META-INF/MANIFEST.MF @@ -0,0 +1,22 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: org.openhealthtools.mdht.uml.cda.mu2consol.tests;singleton:=true +Bundle-Version: 1.0.0 +Bundle-ClassPath: . +Bundle-Vendor: %providerName +Bundle-Localization: plugin +Bundle-RequiredExecutionEnvironment: J2SE-1.5 +Export-Package: org.openhealthtools.mdht.uml.cda.mu2consol.tests +Require-Bundle: org.eclipse.core.runtime, + org.openhealthtools.mdht.uml.cda.mu2consol;visibility:=reexport, + org.openhealthtools.mdht.uml.cda;visibility:=reexport, + org.openhealthtools.mdht.uml.cda.consol;visibility:=reexport, + org.openhealthtools.mdht.uml.hl7.datatypes;visibility:=reexport, + org.eclipse.emf.ecore;visibility:=reexport, + org.openhealthtools.mdht.uml.hl7.rim;visibility:=reexport, + org.openhealthtools.mdht.uml.hl7.vocab;visibility:=reexport, + org.eclipse.emf.ecore.xmi;visibility:=reexport, + org.junit;visibility:=reexport, + org.openhealthtools.mdht.uml.cda.test +Bundle-ActivationPolicy: lazy diff --git a/org.openhealthtools.mdht.uml.cda.mu2consol.tests/build.properties b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/build.properties new file mode 100644 index 000000000..e9d6098b4 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/build.properties @@ -0,0 +1,12 @@ + +# +# +# +# $Id$ + +bin.includes = .,\ + META-INF/,\ + plugin.properties +jars.compile.order = . +source.. = src/ +output.. = bin/ diff --git a/org.openhealthtools.mdht.uml.cda.mu2consol.tests/plugin.properties b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/plugin.properties new file mode 100644 index 000000000..42286d2b8 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/plugin.properties @@ -0,0 +1,8 @@ + +# +# +# +# $Id$ + +pluginName = mu2consol_Ecore Tests +providerName = www.example.org diff --git a/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/AssessmentAndPlanSectionTest.java b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/AssessmentAndPlanSectionTest.java new file mode 100644 index 000000000..458d7879a --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/AssessmentAndPlanSectionTest.java @@ -0,0 +1,192 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.mu2consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.mu2consol.AssessmentAndPlanSection; +import org.openhealthtools.mdht.uml.cda.mu2consol.Mu2consolFactory; +import org.openhealthtools.mdht.uml.cda.mu2consol.operations.AssessmentAndPlanSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Assessment And Plan Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.AssessmentAndPlanSection#getPlanOfCareActivityProcedure() Get Plan Of Care Activity Procedure}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.AssessmentAndPlanSection#getPlanOfCareActivitySubstanceAdministration() Get Plan Of Care Activity Substance Administration}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.AssessmentAndPlanSection#getPlanOfCareActivitySupply() Get Plan Of Care Activity Supply}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.AssessmentAndPlanSection#getProblemObservation() Get Problem Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.AssessmentAndPlanSection#validateAssessmentAndPlanSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment And Plan Section Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class AssessmentAndPlanSectionTest extends CDAValidationTest { + + /** + * + * @generated + */ + @Test + public void testGetPlanOfCareActivityProcedure() { + + AssessmentAndPlanSection target = objectFactory.create(); + target.getPlanOfCareActivityProcedure(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPlanOfCareActivitySubstanceAdministration() { + + AssessmentAndPlanSection target = objectFactory.create(); + target.getPlanOfCareActivitySubstanceAdministration(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPlanOfCareActivitySupply() { + + AssessmentAndPlanSection target = objectFactory.create(); + target.getPlanOfCareActivitySupply(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProblemObservation() { + + AssessmentAndPlanSection target = objectFactory.create(); + target.getProblemObservation(); + + } + + /** + * + * @generated + */ + @Test + public void testValidateAssessmentAndPlanSectionTemplateId() { + OperationsTestCase validateAssessmentAndPlanSectionTemplateIdTestCase = new OperationsTestCase( + "validateAssessmentAndPlanSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_AND_PLAN_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentAndPlanSection target) { + + } + + @Override + protected void updateToPass(AssessmentAndPlanSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentAndPlanSectionOperations.validateAssessmentAndPlanSectionTemplateId( + (AssessmentAndPlanSection) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentAndPlanSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends AssessmentAndPlanSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public AssessmentAndPlanSection create() { + return Mu2consolFactory.eINSTANCE.createAssessmentAndPlanSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends AssessmentAndPlanSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // AssessmentAndPlanSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/AssessmentSectionTest.java b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/AssessmentSectionTest.java new file mode 100644 index 000000000..83e806e94 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/AssessmentSectionTest.java @@ -0,0 +1,190 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.mu2consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ProblemObservation; +import org.openhealthtools.mdht.uml.cda.mu2consol.AssessmentSection; +import org.openhealthtools.mdht.uml.cda.mu2consol.Mu2consolFactory; +import org.openhealthtools.mdht.uml.cda.mu2consol.operations.AssessmentSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Assessment Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.AssessmentSection#validateMu2consolAssessmentSectionProblemObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Mu2consol Assessment Section Problem Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.AssessmentSection#getProblemObservation() Get Problem Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.AssessmentSection#validateAssessmentSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Assessment Section Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class AssessmentSectionTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateMu2consolAssessmentSectionProblemObservation() { + OperationsTestCase validateMu2consolAssessmentSectionProblemObservationTestCase = new OperationsTestCase( + "validateMu2consolAssessmentSectionProblemObservation", + operationsForOCL.getOCLValue("VALIDATE_MU2CONSOL_ASSESSMENT_SECTION_PROBLEM_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentSection target) { + + } + + @Override + protected void updateToPass(AssessmentSection target) { + ProblemObservation pObs = ConsolFactory.eINSTANCE.createProblemObservation().init(); + target.addObservation(pObs); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentSectionOperations.validateMu2consolAssessmentSectionProblemObservation( + (AssessmentSection) objectToTest, diagnostician, map); + } + + }; + + validateMu2consolAssessmentSectionProblemObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetProblemObservation() { + + AssessmentSection target = objectFactory.create(); + target.getProblemObservation(); + + } + + /** + * + * @generated + */ + @Test + public void testValidateAssessmentSectionTemplateId() { + OperationsTestCase validateAssessmentSectionTemplateIdTestCase = new OperationsTestCase( + "validateAssessmentSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_ASSESSMENT_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(AssessmentSection target) { + + } + + @Override + protected void updateToPass(AssessmentSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return AssessmentSectionOperations.validateAssessmentSectionTemplateId( + (AssessmentSection) objectToTest, diagnostician, map); + } + + }; + + validateAssessmentSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends AssessmentSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public AssessmentSection create() { + return Mu2consolFactory.eINSTANCE.createAssessmentSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends AssessmentSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // AssessmentSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/ClinicalOfficeVisitSummaryTest.java b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/ClinicalOfficeVisitSummaryTest.java new file mode 100644 index 000000000..dbc342541 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/ClinicalOfficeVisitSummaryTest.java @@ -0,0 +1,1343 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.mu2consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Component1; +import org.openhealthtools.mdht.uml.cda.EncompassingEncounter; +import org.openhealthtools.mdht.uml.cda.Location; +import org.openhealthtools.mdht.uml.cda.ResponsibleParty; +import org.openhealthtools.mdht.uml.cda.consol.AllergiesSection; +import org.openhealthtools.mdht.uml.cda.consol.ChiefComplaintSection; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ImmunizationsSection; +import org.openhealthtools.mdht.uml.cda.consol.Instructions; +import org.openhealthtools.mdht.uml.cda.consol.InstructionsSection; +import org.openhealthtools.mdht.uml.cda.consol.MedicationActivity; +import org.openhealthtools.mdht.uml.cda.consol.MedicationsAdministeredSection; +import org.openhealthtools.mdht.uml.cda.consol.MedicationsSection; +import org.openhealthtools.mdht.uml.cda.consol.PlanOfCareActivityAct; +import org.openhealthtools.mdht.uml.cda.consol.PlanOfCareActivityEncounter; +import org.openhealthtools.mdht.uml.cda.consol.PlanOfCareActivityObservation; +import org.openhealthtools.mdht.uml.cda.consol.ProblemSection; +import org.openhealthtools.mdht.uml.cda.consol.ReasonForVisitSection; +import org.openhealthtools.mdht.uml.cda.consol.VitalSignsSection; +import org.openhealthtools.mdht.uml.cda.mu2consol.AssessmentAndPlanSection; +import org.openhealthtools.mdht.uml.cda.mu2consol.ClinicalOfficeVisitSummary; +import org.openhealthtools.mdht.uml.cda.mu2consol.Mu2consolFactory; +import org.openhealthtools.mdht.uml.cda.mu2consol.PlanOfCareSection; +import org.openhealthtools.mdht.uml.cda.mu2consol.ProceduresSection; +import org.openhealthtools.mdht.uml.cda.mu2consol.ResultsSection; +import org.openhealthtools.mdht.uml.cda.mu2consol.SmokingStatusObservation; +import org.openhealthtools.mdht.uml.cda.mu2consol.SocialHistorySection; +import org.openhealthtools.mdht.uml.cda.mu2consol.operations.ClinicalOfficeVisitSummaryOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; + +/** + * A static utility class that provides operations + * related to 'Clinical Office Visit Summary' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ClinicalOfficeVisitSummary#validateClinicalOfficeVisitSummaryResponsibleParty(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Clinical Office Visit Summary Responsible Party}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ClinicalOfficeVisitSummary#validateClinicalOfficeVisitSummaryReasonForOfficeVisit(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Clinical Office Visit Summary Reason For Office Visit}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ClinicalOfficeVisitSummary#validateClinicalOfficeVisitSummaryCarePlanning(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Clinical Office Visit Summary Care Planning}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ClinicalOfficeVisitSummary#validateClinicalOfficeVisitSummaryEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Clinical Office Visit Summary Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ClinicalOfficeVisitSummary#validateClinicalOfficeVisitSummaryLocation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Clinical Office Visit Summary Location}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ClinicalOfficeVisitSummary#validateClinicalOfficeVisitSummaryPlanOfCareActOrEncounter(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Clinical Office Visit Summary Plan Of Care Act Or Encounter}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ClinicalOfficeVisitSummary#validateClinicalOfficeVisitSummaryInstructionsEntry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Clinical Office Visit Summary Instructions Entry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ClinicalOfficeVisitSummary#validateClinicalOfficeVisitSummaryMedicationsAdministeredEntry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Clinical Office Visit Summary Medications Administered Entry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ClinicalOfficeVisitSummary#validateClinicalOfficeVisitSummaryProblemSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Clinical Office Visit Summary Problem Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ClinicalOfficeVisitSummary#validateClinicalOfficeVisitSummaryMedicationsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Clinical Office Visit Summary Medications Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ClinicalOfficeVisitSummary#validateClinicalOfficeVisitSummaryAllergiesSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Clinical Office Visit Summary Allergies Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ClinicalOfficeVisitSummary#validateClinicalOfficeVisitSummaryResultsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Clinical Office Visit Summary Results Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ClinicalOfficeVisitSummary#validateClinicalOfficeVisitSummaryVitalSignsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Clinical Office Visit Summary Vital Signs Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ClinicalOfficeVisitSummary#validateClinicalOfficeVisitSummaryPlanOfCareSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Clinical Office Visit Summary Plan Of Care Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ClinicalOfficeVisitSummary#validateClinicalOfficeVisitSummaryProceduresSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Clinical Office Visit Summary Procedures Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ClinicalOfficeVisitSummary#validateClinicalOfficeVisitSummaryImmunizationsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Clinical Office Visit Summary Immunizations Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ClinicalOfficeVisitSummary#validateClinicalOfficeVisitSummaryMedicationsAdministeredSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Clinical Office Visit Summary Medications Administered Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ClinicalOfficeVisitSummary#validateClinicalOfficeVisitSummaryInstructionsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Clinical Office Visit Summary Instructions Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ClinicalOfficeVisitSummary#validateClinicalOfficeVisitSummarySocialHistorySection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Clinical Office Visit Summary Social History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ClinicalOfficeVisitSummary#validateClinicalOfficeVisitSummaryMu2consolPlanOfCareSectionCarePlanningForPlanOfCare(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Clinical Office Visit Summary Mu2consol Plan Of Care Section Care Planning For Plan Of Care}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ClinicalOfficeVisitSummary#validateClinicalOfficeVisitSummaryMu2consolPlanOfCareSectionPlanOfCareActivityObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Clinical Office Visit Summary Mu2consol Plan Of Care Section Plan Of Care Activity Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ClinicalOfficeVisitSummary#validateClinicalOfficeVisitSummaryPlanOfCareSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Clinical Office Visit Summary Plan Of Care Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ClinicalOfficeVisitSummary#validateClinicalOfficeVisitSummaryAssessmentAndPlanSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Clinical Office Visit Summary Assessment And Plan Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ClinicalOfficeVisitSummary#validateClinicalOfficeVisitSummarySocialHistorySectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Clinical Office Visit Summary Social History Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ClinicalOfficeVisitSummary#validateClinicalOfficeVisitSummaryMu2consolSocialHistorySectionSmokingStatusObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Clinical Office Visit Summary Mu2consol Social History Section Smoking Status Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ClinicalOfficeVisitSummary#retrievePlanOfCareSection() Retrieve Plan Of Care Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ClinicalOfficeVisitSummary#retrieveInstructionsSection() Retrieve Instructions Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ClinicalOfficeVisitSummary#retrieveMedicationsAdministeredSection() Retrieve Medications Administered Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ClinicalOfficeVisitSummary#getProblemSection() Get Problem Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ClinicalOfficeVisitSummary#getMedicationsSection() Get Medications Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ClinicalOfficeVisitSummary#getAllergiesSection() Get Allergies Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ClinicalOfficeVisitSummary#getResultsSection() Get Results Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ClinicalOfficeVisitSummary#getVitalSignsSection() Get Vital Signs Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ClinicalOfficeVisitSummary#getPlanOfCareSection() Get Plan Of Care Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ClinicalOfficeVisitSummary#getProceduresSection() Get Procedures Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ClinicalOfficeVisitSummary#getImmunizationsSection() Get Immunizations Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ClinicalOfficeVisitSummary#getMedicationsAdministeredSection() Get Medications Administered Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ClinicalOfficeVisitSummary#getReasonForVisitSection() Get Reason For Visit Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ClinicalOfficeVisitSummary#getChiefComplaintSection() Get Chief Complaint Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ClinicalOfficeVisitSummary#getChiefComplaintAndReasonForVisitSection() Get Chief Complaint And Reason For Visit Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ClinicalOfficeVisitSummary#getAssessmentAndPlanSection() Get Assessment And Plan Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ClinicalOfficeVisitSummary#getInstructionsSection() Get Instructions Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ClinicalOfficeVisitSummary#getSocialHistorySection() Get Social History Section}
  • + *
+ *

+ * + * @generated + */ + +public class ClinicalOfficeVisitSummaryTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateClinicalOfficeVisitSummaryResponsibleParty() { + OperationsTestCase validateClinicalOfficeVisitSummaryResponsiblePartyTestCase = new OperationsTestCase( + "validateClinicalOfficeVisitSummaryResponsibleParty", + operationsForOCL.getOCLValue("VALIDATE_CLINICAL_OFFICE_VISIT_SUMMARY_RESPONSIBLE_PARTY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ClinicalOfficeVisitSummary target) { + target.init(); + Component1 comp1 = CDAFactory.eINSTANCE.createComponent1(); + EncompassingEncounter encounter = CDAFactory.eINSTANCE.createEncompassingEncounter(); + comp1.setEncompassingEncounter(encounter); + target.setComponentOf(comp1); + } + + @Override + protected void updateToPass(ClinicalOfficeVisitSummary target) { + ResponsibleParty party = CDAFactory.eINSTANCE.createResponsibleParty(); + target.getComponentOf().getEncompassingEncounter().setResponsibleParty(party); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ClinicalOfficeVisitSummaryOperations.validateClinicalOfficeVisitSummaryResponsibleParty( + (ClinicalOfficeVisitSummary) objectToTest, diagnostician, map); + } + + }; + + validateClinicalOfficeVisitSummaryResponsiblePartyTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateClinicalOfficeVisitSummaryLocation() { + OperationsTestCase validateClinicalOfficeVisitSummaryLocationTestCase = new OperationsTestCase( + "validateClinicalOfficeVisitSummaryLocation", + operationsForOCL.getOCLValue("VALIDATE_CLINICAL_OFFICE_VISIT_SUMMARY_LOCATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ClinicalOfficeVisitSummary target) { + Component1 comp1 = CDAFactory.eINSTANCE.createComponent1(); + EncompassingEncounter encounter = CDAFactory.eINSTANCE.createEncompassingEncounter(); + comp1.setEncompassingEncounter(encounter); + target.setComponentOf(comp1); + } + + @Override + protected void updateToPass(ClinicalOfficeVisitSummary target) { + Location locn = CDAFactory.eINSTANCE.createLocation(); + target.getComponentOf().getEncompassingEncounter().setLocation(locn); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ClinicalOfficeVisitSummaryOperations.validateClinicalOfficeVisitSummaryLocation( + (ClinicalOfficeVisitSummary) objectToTest, diagnostician, map); + } + + }; + + validateClinicalOfficeVisitSummaryLocationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateClinicalOfficeVisitSummaryPlanOfCareActOrEncounter() { + OperationsTestCase validateClinicalOfficeVisitSummaryPlanOfCareActOrEncounterTestCase = new OperationsTestCase( + "validateClinicalOfficeVisitSummaryPlanOfCareActOrEncounter", + operationsForOCL.getOCLValue("VALIDATE_CLINICAL_OFFICE_VISIT_SUMMARY_PLAN_OF_CARE_ACT_OR_ENCOUNTER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ClinicalOfficeVisitSummary target) { + PlanOfCareSection section = Mu2consolFactory.eINSTANCE.createPlanOfCareSection().init(); + target.addSection(section); + + } + + @Override + protected void updateToPass(ClinicalOfficeVisitSummary target) { + PlanOfCareActivityEncounter encounter = ConsolFactory.eINSTANCE.createPlanOfCareActivityEncounter().init(); + target.getPlanOfCareSection().addEncounter(encounter); + PlanOfCareActivityObservation pObs = ConsolFactory.eINSTANCE.createPlanOfCareActivityObservation().init(); + target.getPlanOfCareSection().addObservation(pObs); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ClinicalOfficeVisitSummaryOperations.validateClinicalOfficeVisitSummaryPlanOfCareActOrEncounter( + (ClinicalOfficeVisitSummary) objectToTest, diagnostician, map); + } + + }; + + validateClinicalOfficeVisitSummaryPlanOfCareActOrEncounterTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateClinicalOfficeVisitSummaryInstructionsEntry() { + OperationsTestCase validateClinicalOfficeVisitSummaryInstructionsEntryTestCase = new OperationsTestCase( + "validateClinicalOfficeVisitSummaryInstructionsEntry", + operationsForOCL.getOCLValue("VALIDATE_CLINICAL_OFFICE_VISIT_SUMMARY_INSTRUCTIONS_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ClinicalOfficeVisitSummary target) { + InstructionsSection aSection = ConsolFactory.eINSTANCE.createInstructionsSection().init(); + target.addSection(aSection); + } + + @Override + protected void updateToPass(ClinicalOfficeVisitSummary target) { + Instructions act = ConsolFactory.eINSTANCE.createInstructions().init(); + target.getInstructionsSection().addAct(act); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ClinicalOfficeVisitSummaryOperations.validateClinicalOfficeVisitSummaryInstructionsEntry( + (ClinicalOfficeVisitSummary) objectToTest, diagnostician, map); + } + + }; + + validateClinicalOfficeVisitSummaryInstructionsEntryTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateClinicalOfficeVisitSummaryMedicationsAdministeredEntry() { + OperationsTestCase validateClinicalOfficeVisitSummaryMedicationsAdministeredEntryTestCase = new OperationsTestCase( + "validateClinicalOfficeVisitSummaryMedicationsAdministeredEntry", + operationsForOCL.getOCLValue("VALIDATE_CLINICAL_OFFICE_VISIT_SUMMARY_MEDICATIONS_ADMINISTERED_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ClinicalOfficeVisitSummary target) { + MedicationsAdministeredSection mSection = ConsolFactory.eINSTANCE.createMedicationsAdministeredSection().init(); + target.addSection(mSection); + } + + @Override + protected void updateToPass(ClinicalOfficeVisitSummary target) { + MedicationActivity mActivity = ConsolFactory.eINSTANCE.createMedicationActivity().init(); + target.getMedicationsAdministeredSection().addSubstanceAdministration(mActivity); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ClinicalOfficeVisitSummaryOperations.validateClinicalOfficeVisitSummaryMedicationsAdministeredEntry( + (ClinicalOfficeVisitSummary) objectToTest, diagnostician, map); + } + + }; + + validateClinicalOfficeVisitSummaryMedicationsAdministeredEntryTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateClinicalOfficeVisitSummaryReasonForOfficeVisit() { + OperationsTestCase validateClinicalOfficeVisitSummaryReasonForOfficeVisitTestCase = new OperationsTestCase( + "validateClinicalOfficeVisitSummaryReasonForOfficeVisit", + operationsForOCL.getOCLValue("VALIDATE_CLINICAL_OFFICE_VISIT_SUMMARY_REASON_FOR_OFFICE_VISIT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ClinicalOfficeVisitSummary target) { + + } + + @Override + protected void updateToPass(ClinicalOfficeVisitSummary target) { + ChiefComplaintSection cSection = ConsolFactory.eINSTANCE.createChiefComplaintSection().init(); + ReasonForVisitSection rSection = ConsolFactory.eINSTANCE.createReasonForVisitSection(); + target.addSection(cSection); + target.addSection(rSection); + // ChiefComplaintAndReasonForVisitSection ccSection = + // ConsolFactory.eINSTANCE.createChiefComplaintAndReasonForVisitSection().init(); + // target.addSection(ccSection); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ClinicalOfficeVisitSummaryOperations.validateClinicalOfficeVisitSummaryReasonForOfficeVisit( + (ClinicalOfficeVisitSummary) objectToTest, diagnostician, map); + } + + }; + + validateClinicalOfficeVisitSummaryReasonForOfficeVisitTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateClinicalOfficeVisitSummaryCarePlanning() { + OperationsTestCase validateClinicalOfficeVisitSummaryCarePlanningTestCase = new OperationsTestCase( + "validateClinicalOfficeVisitSummaryCarePlanning", + operationsForOCL.getOCLValue("VALIDATE_CLINICAL_OFFICE_VISIT_SUMMARY_CARE_PLANNING__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ClinicalOfficeVisitSummary target) { + + } + + @Override + protected void updateToPass(ClinicalOfficeVisitSummary target) { + PlanOfCareSection section = Mu2consolFactory.eINSTANCE.createPlanOfCareSection().init(); + target.addSection(section); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ClinicalOfficeVisitSummaryOperations.validateClinicalOfficeVisitSummaryCarePlanning( + (ClinicalOfficeVisitSummary) objectToTest, diagnostician, map); + } + + }; + + validateClinicalOfficeVisitSummaryCarePlanningTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateClinicalOfficeVisitSummaryEffectiveTime() { + OperationsTestCase validateClinicalOfficeVisitSummaryEffectiveTimeTestCase = new OperationsTestCase( + "validateClinicalOfficeVisitSummaryEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_CLINICAL_OFFICE_VISIT_SUMMARY_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ClinicalOfficeVisitSummary target) { + Component1 compOf = CDAFactory.eINSTANCE.createComponent1(); + EncompassingEncounter enCounter = CDAFactory.eINSTANCE.createEncompassingEncounter(); + compOf.setEncompassingEncounter(enCounter); + target.setComponentOf(compOf); + } + + @Override + protected void updateToPass(ClinicalOfficeVisitSummary target) { + IVL_TS effTime = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.getComponentOf().getEncompassingEncounter().setEffectiveTime(effTime); + IVL_TS ts = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.setEffectiveTime(ts); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ClinicalOfficeVisitSummaryOperations.validateClinicalOfficeVisitSummaryEffectiveTime( + (ClinicalOfficeVisitSummary) objectToTest, diagnostician, map); + } + + }; + + validateClinicalOfficeVisitSummaryEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateClinicalOfficeVisitSummarySocialHistorySection() { + OperationsTestCase validateClinicalOfficeVisitSummarySocialHistorySectionTestCase = new OperationsTestCase( + "validateClinicalOfficeVisitSummarySocialHistorySection", + operationsForOCL.getOCLValue("VALIDATE_CLINICAL_OFFICE_VISIT_SUMMARY_SOCIAL_HISTORY_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ClinicalOfficeVisitSummary target) { + + } + + @Override + protected void updateToPass(ClinicalOfficeVisitSummary target) { + target.init(); + + /* SocialHistorySection */ + SocialHistorySection section = + + Mu2consolFactory.eINSTANCE.createSocialHistorySection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ClinicalOfficeVisitSummaryOperations.validateClinicalOfficeVisitSummarySocialHistorySection( + (ClinicalOfficeVisitSummary) objectToTest, diagnostician, map); + } + + }; + + validateClinicalOfficeVisitSummarySocialHistorySectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateClinicalOfficeVisitSummaryProblemSection() { + OperationsTestCase validateClinicalOfficeVisitSummaryProblemSectionTestCase = new OperationsTestCase( + "validateClinicalOfficeVisitSummaryProblemSection", + operationsForOCL.getOCLValue("VALIDATE_CLINICAL_OFFICE_VISIT_SUMMARY_PROBLEM_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ClinicalOfficeVisitSummary target) { + + } + + @Override + protected void updateToPass(ClinicalOfficeVisitSummary target) { + target.init(); + + /* ProblemSection */ + ProblemSection section = + + ConsolFactory.eINSTANCE.createProblemSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ClinicalOfficeVisitSummaryOperations.validateClinicalOfficeVisitSummaryProblemSection( + (ClinicalOfficeVisitSummary) objectToTest, diagnostician, map); + } + + }; + + validateClinicalOfficeVisitSummaryProblemSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateClinicalOfficeVisitSummaryMedicationsSection() { + OperationsTestCase validateClinicalOfficeVisitSummaryMedicationsSectionTestCase = new OperationsTestCase( + "validateClinicalOfficeVisitSummaryMedicationsSection", + operationsForOCL.getOCLValue("VALIDATE_CLINICAL_OFFICE_VISIT_SUMMARY_MEDICATIONS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ClinicalOfficeVisitSummary target) { + + } + + @Override + protected void updateToPass(ClinicalOfficeVisitSummary target) { + target.init(); + + /* MedicationsSection */ + MedicationsSection section = + + ConsolFactory.eINSTANCE.createMedicationsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ClinicalOfficeVisitSummaryOperations.validateClinicalOfficeVisitSummaryMedicationsSection( + (ClinicalOfficeVisitSummary) objectToTest, diagnostician, map); + } + + }; + + validateClinicalOfficeVisitSummaryMedicationsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateClinicalOfficeVisitSummaryAllergiesSection() { + OperationsTestCase validateClinicalOfficeVisitSummaryAllergiesSectionTestCase = new OperationsTestCase( + "validateClinicalOfficeVisitSummaryAllergiesSection", + operationsForOCL.getOCLValue("VALIDATE_CLINICAL_OFFICE_VISIT_SUMMARY_ALLERGIES_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ClinicalOfficeVisitSummary target) { + + } + + @Override + protected void updateToPass(ClinicalOfficeVisitSummary target) { + target.init(); + + /* AllergiesSection */ + AllergiesSection section = + + ConsolFactory.eINSTANCE.createAllergiesSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ClinicalOfficeVisitSummaryOperations.validateClinicalOfficeVisitSummaryAllergiesSection( + (ClinicalOfficeVisitSummary) objectToTest, diagnostician, map); + } + + }; + + validateClinicalOfficeVisitSummaryAllergiesSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateClinicalOfficeVisitSummaryResultsSection() { + OperationsTestCase validateClinicalOfficeVisitSummaryResultsSectionTestCase = new OperationsTestCase( + "validateClinicalOfficeVisitSummaryResultsSection", + operationsForOCL.getOCLValue("VALIDATE_CLINICAL_OFFICE_VISIT_SUMMARY_RESULTS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ClinicalOfficeVisitSummary target) { + + } + + @Override + protected void updateToPass(ClinicalOfficeVisitSummary target) { + target.init(); + + /* ResultsSection */ + ResultsSection section = + + Mu2consolFactory.eINSTANCE.createResultsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ClinicalOfficeVisitSummaryOperations.validateClinicalOfficeVisitSummaryResultsSection( + (ClinicalOfficeVisitSummary) objectToTest, diagnostician, map); + } + + }; + + validateClinicalOfficeVisitSummaryResultsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateClinicalOfficeVisitSummaryVitalSignsSection() { + OperationsTestCase validateClinicalOfficeVisitSummaryVitalSignsSectionTestCase = new OperationsTestCase( + "validateClinicalOfficeVisitSummaryVitalSignsSection", + operationsForOCL.getOCLValue("VALIDATE_CLINICAL_OFFICE_VISIT_SUMMARY_VITAL_SIGNS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ClinicalOfficeVisitSummary target) { + + } + + @Override + protected void updateToPass(ClinicalOfficeVisitSummary target) { + target.init(); + + /* VitalSignsSection */ + VitalSignsSection section = + + ConsolFactory.eINSTANCE.createVitalSignsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ClinicalOfficeVisitSummaryOperations.validateClinicalOfficeVisitSummaryVitalSignsSection( + (ClinicalOfficeVisitSummary) objectToTest, diagnostician, map); + } + + }; + + validateClinicalOfficeVisitSummaryVitalSignsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateClinicalOfficeVisitSummaryPlanOfCareSection() { + OperationsTestCase validateClinicalOfficeVisitSummaryPlanOfCareSectionTestCase = new OperationsTestCase( + "validateClinicalOfficeVisitSummaryPlanOfCareSection", + operationsForOCL.getOCLValue("VALIDATE_CLINICAL_OFFICE_VISIT_SUMMARY_PLAN_OF_CARE_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ClinicalOfficeVisitSummary target) { + + } + + @Override + protected void updateToPass(ClinicalOfficeVisitSummary target) { + target.init(); + + /* PlanOfCareSection */ + PlanOfCareSection section = + + Mu2consolFactory.eINSTANCE.createPlanOfCareSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ClinicalOfficeVisitSummaryOperations.validateClinicalOfficeVisitSummaryPlanOfCareSection( + (ClinicalOfficeVisitSummary) objectToTest, diagnostician, map); + } + + }; + + validateClinicalOfficeVisitSummaryPlanOfCareSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateClinicalOfficeVisitSummaryProceduresSection() { + OperationsTestCase validateClinicalOfficeVisitSummaryProceduresSectionTestCase = new OperationsTestCase( + "validateClinicalOfficeVisitSummaryProceduresSection", + operationsForOCL.getOCLValue("VALIDATE_CLINICAL_OFFICE_VISIT_SUMMARY_PROCEDURES_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ClinicalOfficeVisitSummary target) { + + } + + @Override + protected void updateToPass(ClinicalOfficeVisitSummary target) { + target.init(); + + /* ProceduresSection */ + ProceduresSection section = + + Mu2consolFactory.eINSTANCE.createProceduresSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ClinicalOfficeVisitSummaryOperations.validateClinicalOfficeVisitSummaryProceduresSection( + (ClinicalOfficeVisitSummary) objectToTest, diagnostician, map); + } + + }; + + validateClinicalOfficeVisitSummaryProceduresSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateClinicalOfficeVisitSummaryImmunizationsSection() { + OperationsTestCase validateClinicalOfficeVisitSummaryImmunizationsSectionTestCase = new OperationsTestCase( + "validateClinicalOfficeVisitSummaryImmunizationsSection", + operationsForOCL.getOCLValue("VALIDATE_CLINICAL_OFFICE_VISIT_SUMMARY_IMMUNIZATIONS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ClinicalOfficeVisitSummary target) { + + } + + @Override + protected void updateToPass(ClinicalOfficeVisitSummary target) { + target.init(); + + /* ImmunizationsSection */ + ImmunizationsSection section = + + ConsolFactory.eINSTANCE.createImmunizationsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ClinicalOfficeVisitSummaryOperations.validateClinicalOfficeVisitSummaryImmunizationsSection( + (ClinicalOfficeVisitSummary) objectToTest, diagnostician, map); + } + + }; + + validateClinicalOfficeVisitSummaryImmunizationsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateClinicalOfficeVisitSummaryMedicationsAdministeredSection() { + OperationsTestCase validateClinicalOfficeVisitSummaryMedicationsAdministeredSectionTestCase = new OperationsTestCase( + "validateClinicalOfficeVisitSummaryMedicationsAdministeredSection", + operationsForOCL.getOCLValue("VALIDATE_CLINICAL_OFFICE_VISIT_SUMMARY_MEDICATIONS_ADMINISTERED_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ClinicalOfficeVisitSummary target) { + + } + + @Override + protected void updateToPass(ClinicalOfficeVisitSummary target) { + target.init(); + + /* MedicationsAdministeredSection */ + MedicationsAdministeredSection section = + + ConsolFactory.eINSTANCE.createMedicationsAdministeredSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ClinicalOfficeVisitSummaryOperations.validateClinicalOfficeVisitSummaryMedicationsAdministeredSection( + (ClinicalOfficeVisitSummary) objectToTest, diagnostician, map); + } + + }; + + validateClinicalOfficeVisitSummaryMedicationsAdministeredSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateClinicalOfficeVisitSummaryInstructionsSection() { + OperationsTestCase validateClinicalOfficeVisitSummaryInstructionsSectionTestCase = new OperationsTestCase( + "validateClinicalOfficeVisitSummaryInstructionsSection", + operationsForOCL.getOCLValue("VALIDATE_CLINICAL_OFFICE_VISIT_SUMMARY_INSTRUCTIONS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ClinicalOfficeVisitSummary target) { + + } + + @Override + protected void updateToPass(ClinicalOfficeVisitSummary target) { + target.init(); + + /* InstructionsSection */ + InstructionsSection section = + + ConsolFactory.eINSTANCE.createInstructionsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ClinicalOfficeVisitSummaryOperations.validateClinicalOfficeVisitSummaryInstructionsSection( + (ClinicalOfficeVisitSummary) objectToTest, diagnostician, map); + } + + }; + + validateClinicalOfficeVisitSummaryInstructionsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateClinicalOfficeVisitSummaryMu2consolPlanOfCareSectionCarePlanningForPlanOfCare() { + OperationsTestCase validateClinicalOfficeVisitSummarymu2consolPlanOfCareSectionCarePlanningForPlanOfCareTestCase = new OperationsTestCase( + "validateClinicalOfficeVisitSummarymu2consolPlanOfCareSectionCarePlanningForPlanOfCare", + operationsForOCL.getOCLValue("VALIDATE_CLINICAL_OFFICE_VISIT_SUMMARYMU2CONSOL_PLAN_OF_CARE_SECTION_CARE_PLANNING_FOR_PLAN_OF_CARE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ClinicalOfficeVisitSummary target) { + PlanOfCareSection section = Mu2consolFactory.eINSTANCE.createPlanOfCareSection().init(); + target.addSection(section); + + } + + @Override + protected void updateToPass(ClinicalOfficeVisitSummary target) { + PlanOfCareActivityAct act = ConsolFactory.eINSTANCE.createPlanOfCareActivityAct().init(); + target.getPlanOfCareSection().addAct(act); + PlanOfCareActivityObservation obs = ConsolFactory.eINSTANCE.createPlanOfCareActivityObservation().init(); + target.getPlanOfCareSection().addObservation(obs); + PlanOfCareActivityEncounter encounter = ConsolFactory.eINSTANCE.createPlanOfCareActivityEncounter().init(); + target.getPlanOfCareSection().addEncounter(encounter); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ClinicalOfficeVisitSummaryOperations.validateClinicalOfficeVisitSummaryMu2consolPlanOfCareSectionCarePlanningForPlanOfCare( + (ClinicalOfficeVisitSummary) objectToTest, diagnostician, map); + } + + }; + + validateClinicalOfficeVisitSummarymu2consolPlanOfCareSectionCarePlanningForPlanOfCareTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateClinicalOfficeVisitSummaryMu2consolPlanOfCareSectionPlanOfCareActivityObservation() { + OperationsTestCase validateClinicalOfficeVisitSummarymu2consolPlanOfCareSectionMu2consolPlanOfCareSectionPlanOfCareActivityObservationTestCase = new OperationsTestCase( + "validateClinicalOfficeVisitSummarymu2consolPlanOfCareSectionMu2consolPlanOfCareSectionPlanOfCareActivityObservation", + operationsForOCL.getOCLValue("VALIDATE_CLINICAL_OFFICE_VISIT_SUMMARYMU2CONSOL_PLAN_OF_CARE_SECTION_MU2CONSOL_PLAN_OF_CARE_SECTION_PLAN_OF_CARE_ACTIVITY_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ClinicalOfficeVisitSummary target) { + PlanOfCareSection pSection = Mu2consolFactory.eINSTANCE.createPlanOfCareSection().init(); + target.addSection(pSection); + } + + @Override + protected void updateToPass(ClinicalOfficeVisitSummary target) { + PlanOfCareActivityObservation obs = ConsolFactory.eINSTANCE.createPlanOfCareActivityObservation().init(); + target.getPlanOfCareSection().addObservation(obs); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ClinicalOfficeVisitSummaryOperations.validateClinicalOfficeVisitSummaryMu2consolPlanOfCareSectionPlanOfCareActivityObservation( + (ClinicalOfficeVisitSummary) objectToTest, diagnostician, map); + } + + }; + + validateClinicalOfficeVisitSummarymu2consolPlanOfCareSectionMu2consolPlanOfCareSectionPlanOfCareActivityObservationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateClinicalOfficeVisitSummaryPlanOfCareSectionTemplateId() { + OperationsTestCase validateClinicalOfficeVisitSummaryPlanOfCareSectionTemplateIdTestCase = new OperationsTestCase( + "validateClinicalOfficeVisitSummaryPlanOfCareSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_CLINICAL_OFFICE_VISIT_SUMMARY_PLAN_OF_CARE_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ClinicalOfficeVisitSummary target) { + PlanOfCareSection pSection = Mu2consolFactory.eINSTANCE.createPlanOfCareSection().init(); + target.addSection(pSection); + for (II ii : pSection.getTemplateIds()) { + ii.setRoot(BAD_TEMPLATE_ID); + } + } + + @Override + protected void updateToPass(ClinicalOfficeVisitSummary target) { + PlanOfCareSection pSection = Mu2consolFactory.eINSTANCE.createPlanOfCareSection().init(); + II iiTemp = pSection.getTemplateIds().get(0); + + for (II ii : target.getPlanOfCareSection().getTemplateIds()) { + ii.setRoot(iiTemp.getRoot()); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ClinicalOfficeVisitSummaryOperations.validateClinicalOfficeVisitSummaryPlanOfCareSectionTemplateId( + (ClinicalOfficeVisitSummary) objectToTest, diagnostician, map); + } + + }; + + validateClinicalOfficeVisitSummaryPlanOfCareSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateClinicalOfficeVisitSummaryAssessmentAndPlanSectionTemplateId() { + OperationsTestCase validateClinicalOfficeVisitSummaryAssessmentAndPlanSectionTemplateIdTestCase = new OperationsTestCase( + "validateClinicalOfficeVisitSummaryAssessmentAndPlanSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_CLINICAL_OFFICE_VISIT_SUMMARY_ASSESSMENT_AND_PLAN_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ClinicalOfficeVisitSummary target) { + AssessmentAndPlanSection aSection = Mu2consolFactory.eINSTANCE.createAssessmentAndPlanSection().init(); + target.addSection(aSection); + for (II ii : aSection.getTemplateIds()) { + ii.setRoot(BAD_TEMPLATE_ID); + } + + } + + @Override + protected void updateToPass(ClinicalOfficeVisitSummary target) { + AssessmentAndPlanSection aSection = Mu2consolFactory.eINSTANCE.createAssessmentAndPlanSection().init(); + II iiTemp = aSection.getTemplateIds().get(0); + + for (II ii : target.getAssessmentAndPlanSection().getTemplateIds()) { + ii.setRoot(iiTemp.getRoot()); + } + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ClinicalOfficeVisitSummaryOperations.validateClinicalOfficeVisitSummaryAssessmentAndPlanSectionTemplateId( + (ClinicalOfficeVisitSummary) objectToTest, diagnostician, map); + } + + }; + + validateClinicalOfficeVisitSummaryAssessmentAndPlanSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateClinicalOfficeVisitSummarySocialHistorySectionTemplateId() { + OperationsTestCase validateClinicalOfficeVisitSummarySocialHistorySectionTemplateIdTestCase = new OperationsTestCase( + "validateClinicalOfficeVisitSummarySocialHistorySectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_CLINICAL_OFFICE_VISIT_SUMMARY_SOCIAL_HISTORY_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ClinicalOfficeVisitSummary target) { + SocialHistorySection sSection = Mu2consolFactory.eINSTANCE.createSocialHistorySection().init(); + target.addSection(sSection); + for (II ii : sSection.getTemplateIds()) { + ii.setRoot(BAD_TEMPLATE_ID); + } + } + + @Override + protected void updateToPass(ClinicalOfficeVisitSummary target) { + SocialHistorySection sSection = Mu2consolFactory.eINSTANCE.createSocialHistorySection().init(); + II iiTemp = sSection.getTemplateIds().get(0); + for (II ii : target.getSocialHistorySection().getTemplateIds()) { + ii.setRoot(iiTemp.getRoot()); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ClinicalOfficeVisitSummaryOperations.validateClinicalOfficeVisitSummarySocialHistorySectionTemplateId( + (ClinicalOfficeVisitSummary) objectToTest, diagnostician, map); + } + + }; + + validateClinicalOfficeVisitSummarySocialHistorySectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateClinicalOfficeVisitSummaryMu2consolSocialHistorySectionSmokingStatusObservation() { + OperationsTestCase validateClinicalOfficeVisitSummarymu2consolSocialHistorySectionSmokingStatusObservationTestCase = new OperationsTestCase( + "validateClinicalOfficeVisitSummarymu2consolSocialHistorySectionSmokingStatusObservation", + operationsForOCL.getOCLValue("VALIDATE_CLINICAL_OFFICE_VISIT_SUMMARYMU2CONSOL_SOCIAL_HISTORY_SECTION_SMOKING_STATUS_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ClinicalOfficeVisitSummary target) { + SocialHistorySection sSection = Mu2consolFactory.eINSTANCE.createSocialHistorySection().init(); + target.addSection(sSection); + } + + @Override + protected void updateToPass(ClinicalOfficeVisitSummary target) { + SmokingStatusObservation sObs = Mu2consolFactory.eINSTANCE.createSmokingStatusObservation().init(); + target.getSocialHistorySection().addObservation(sObs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ClinicalOfficeVisitSummaryOperations.validateClinicalOfficeVisitSummaryMu2consolSocialHistorySectionSmokingStatusObservation( + (ClinicalOfficeVisitSummary) objectToTest, diagnostician, map); + } + + }; + + validateClinicalOfficeVisitSummarymu2consolSocialHistorySectionSmokingStatusObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetSocialHistorySection() { + + ClinicalOfficeVisitSummary target = objectFactory.create(); + target.getSocialHistorySection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProblemSection() { + + ClinicalOfficeVisitSummary target = objectFactory.create(); + target.getProblemSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetMedicationsSection() { + + ClinicalOfficeVisitSummary target = objectFactory.create(); + target.getMedicationsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetAllergiesSection() { + + ClinicalOfficeVisitSummary target = objectFactory.create(); + target.getAllergiesSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetResultsSection() { + + ClinicalOfficeVisitSummary target = objectFactory.create(); + target.getResultsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetVitalSignsSection() { + + ClinicalOfficeVisitSummary target = objectFactory.create(); + target.getVitalSignsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPlanOfCareSection() { + + ClinicalOfficeVisitSummary target = objectFactory.create(); + target.getPlanOfCareSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProceduresSection() { + + ClinicalOfficeVisitSummary target = objectFactory.create(); + target.getProceduresSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetImmunizationsSection() { + + ClinicalOfficeVisitSummary target = objectFactory.create(); + target.getImmunizationsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetMedicationsAdministeredSection() { + + ClinicalOfficeVisitSummary target = objectFactory.create(); + target.getMedicationsAdministeredSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetReasonForVisitSection() { + + ClinicalOfficeVisitSummary target = objectFactory.create(); + target.getReasonForVisitSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetChiefComplaintSection() { + + ClinicalOfficeVisitSummary target = objectFactory.create(); + target.getChiefComplaintSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetChiefComplaintAndReasonForVisitSection() { + + ClinicalOfficeVisitSummary target = objectFactory.create(); + target.getChiefComplaintAndReasonForVisitSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetAssessmentAndPlanSection() { + + ClinicalOfficeVisitSummary target = objectFactory.create(); + target.getAssessmentAndPlanSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetInstructionsSection() { + + ClinicalOfficeVisitSummary target = objectFactory.create(); + target.getInstructionsSection(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ClinicalOfficeVisitSummaryOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public ClinicalOfficeVisitSummary create() { + return Mu2consolFactory.eINSTANCE.createClinicalOfficeVisitSummary(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends ClinicalOfficeVisitSummaryOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ClinicalOfficeVisitSummaryOperations diff --git a/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/EncounterActivitiesTest.java b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/EncounterActivitiesTest.java new file mode 100644 index 000000000..1e6f88d20 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/EncounterActivitiesTest.java @@ -0,0 +1,181 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.mu2consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.mu2consol.EncounterActivities; +import org.openhealthtools.mdht.uml.cda.mu2consol.Mu2consolFactory; +import org.openhealthtools.mdht.uml.cda.mu2consol.operations.EncounterActivitiesOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; + +/** + * A static utility class that provides operations + * related to 'Encounter Activities' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.EncounterActivities#validateMu2consolEncounterActivitiesCodeValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Mu2consol Encounter Activities Code Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.EncounterActivities#validateEncounterActivitiesTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounter Activities Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class EncounterActivitiesTest extends CDAValidationTest { + + /** + * + * @generated NoT + */ + @Test + public void testValidateMu2consolEncounterActivitiesCodeValue() { + OperationsTestCase validateMu2consolEncounterActivitiesCodeValueTestCase = new OperationsTestCase( + "validateMu2consolEncounterActivitiesCodeValue", + operationsForOCL.getOCLValue("VALIDATE_MU2CONSOL_ENCOUNTER_ACTIVITIES_CODE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncounterActivities target) { + + } + + @Override + protected void updateToPass(EncounterActivities target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD(); + value.setCodeSystem("2.16.840.1.113883.6.3"); + target.setCode(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncounterActivitiesOperations.validateMu2consolEncounterActivitiesCodeValue( + (EncounterActivities) objectToTest, diagnostician, map); + } + + }; + + validateMu2consolEncounterActivitiesCodeValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateEncounterActivitiesTemplateId() { + OperationsTestCase validateEncounterActivitiesTemplateIdTestCase = new OperationsTestCase( + "validateEncounterActivitiesTemplateId", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTER_ACTIVITIES_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncounterActivities target) { + + } + + @Override + protected void updateToPass(EncounterActivities target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncounterActivitiesOperations.validateEncounterActivitiesTemplateId( + (EncounterActivities) objectToTest, diagnostician, map); + } + + }; + + validateEncounterActivitiesTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends EncounterActivitiesOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public EncounterActivities create() { + return Mu2consolFactory.eINSTANCE.createEncounterActivities(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends EncounterActivitiesOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // EncounterActivitiesOperations diff --git a/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/EncountersSectionTest.java b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/EncountersSectionTest.java new file mode 100644 index 000000000..069b3a68c --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/EncountersSectionTest.java @@ -0,0 +1,188 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.mu2consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.mu2consol.EncountersSection; +import org.openhealthtools.mdht.uml.cda.mu2consol.Mu2consolFactory; +import org.openhealthtools.mdht.uml.cda.mu2consol.operations.EncountersSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Encounters Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.EncountersSection#validateMu2consolEncountersSectionEncounterActivities(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Mu2consol Encounters Section Encounter Activities}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.EncountersSection#getMu2consolEncounterActivitiess() Get Mu2consol Encounter Activitiess}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.EncountersSection#validateEncountersSectionEntriesOptionalTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Encounters Section Entries Optional Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class EncountersSectionTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateMu2consolEncountersSectionEncounterActivities() { + OperationsTestCase validateMu2consolEncountersSectionEncounterActivitiesTestCase = new OperationsTestCase( + "validateMu2consolEncountersSectionEncounterActivities", + operationsForOCL.getOCLValue("VALIDATE_MU2CONSOL_ENCOUNTERS_SECTION_ENCOUNTER_ACTIVITIES__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncountersSection target) { + target.init(); + } + + @Override + protected void updateToPass(EncountersSection target) { + target.addEncounter(Mu2consolFactory.eINSTANCE.createEncounterActivities().init()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncountersSectionOperations.validateMu2consolEncountersSectionEncounterActivities( + (EncountersSection) objectToTest, diagnostician, map); + } + + }; + + validateMu2consolEncountersSectionEncounterActivitiesTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetMu2consolEncounterActivitiess() { + + EncountersSection target = objectFactory.create(); + target.getMu2consolEncounterActivitiess(); + + } + + /** + * + * @generated + */ + @Test + public void testValidateEncountersSectionEntriesOptionalTemplateId() { + OperationsTestCase validateEncountersSectionEntriesOptionalTemplateIdTestCase = new OperationsTestCase( + "validateEncountersSectionEntriesOptionalTemplateId", + operationsForOCL.getOCLValue("VALIDATE_ENCOUNTERS_SECTION_ENTRIES_OPTIONAL_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(EncountersSection target) { + + } + + @Override + protected void updateToPass(EncountersSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return EncountersSectionOperations.validateEncountersSectionEntriesOptionalTemplateId( + (EncountersSection) objectToTest, diagnostician, map); + } + + }; + + validateEncountersSectionEntriesOptionalTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends EncountersSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public EncountersSection create() { + return Mu2consolFactory.eINSTANCE.createEncountersSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends EncountersSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // EncountersSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/GeneralHeaderConstraintsTest.java b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/GeneralHeaderConstraintsTest.java new file mode 100644 index 000000000..6a336c5f0 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/GeneralHeaderConstraintsTest.java @@ -0,0 +1,877 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.mu2consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.AssignedEntity; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Component1; +import org.openhealthtools.mdht.uml.cda.DocumentationOf; +import org.openhealthtools.mdht.uml.cda.EncompassingEncounter; +import org.openhealthtools.mdht.uml.cda.EncounterParticipant; +import org.openhealthtools.mdht.uml.cda.LanguageCommunication; +import org.openhealthtools.mdht.uml.cda.Patient; +import org.openhealthtools.mdht.uml.cda.PatientRole; +import org.openhealthtools.mdht.uml.cda.Performer1; +import org.openhealthtools.mdht.uml.cda.Person; +import org.openhealthtools.mdht.uml.cda.RecordTarget; +import org.openhealthtools.mdht.uml.cda.ServiceEvent; +import org.openhealthtools.mdht.uml.cda.mu2consol.GeneralHeaderConstraints; +import org.openhealthtools.mdht.uml.cda.mu2consol.Mu2consolFactory; +import org.openhealthtools.mdht.uml.cda.mu2consol.operations.GeneralHeaderConstraintsOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; + +/** + * A static utility class that provides operations + * related to 'General Header Constraints' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.GeneralHeaderConstraints#validateMu2consolGeneralHeaderConstraintsRecordTarget(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Mu2consol General Header Constraints Record Target}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.GeneralHeaderConstraints#validateMu2consolGeneralHeaderConstraintsDocumentationOf(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Mu2consol General Header Constraints Documentation Of}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1AssignedEntityAssignedPerson(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Documentation Of Service Event Performer1 Assigned Entity Assigned Person}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsComponent1EncompassingEncounterEncounterParticipant(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Component1 Encompassing Encounter Encounter Participant}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsComponent1EncompassingEncounter(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Component1 Encompassing Encounter}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.GeneralHeaderConstraints#retrieveHospitalAdmissionDiagnosisSection() Retrieve Hospital Admission Diagnosis Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationLanguageCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient Language Communication Language Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationLanguageCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient Language Communication Language Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientEthnicGroupCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient Ethnic Group Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientEthnicGroupCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient Ethnic Group Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientRaceCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient Race Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientRaceCodeP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient Race Code P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunication(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient Language Communication}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRolePatient(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role Patient}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsRecordTargetPatientRole(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Record Target Patient Role}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1AssignedEntity(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Documentation Of Service Event Performer1 Assigned Entity}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Documentation Of Service Event Performer}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.GeneralHeaderConstraints#validateGeneralHeaderConstraintsDocumentationOfServiceEvent(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Documentation Of Service Event}
  • + *
+ *

+ * + * @generated + */ + +public class GeneralHeaderConstraintsTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateMu2consolGeneralHeaderConstraintsRecordTarget() { + OperationsTestCase validateMu2consolGeneralHeaderConstraintsRecordTargetTestCase = new OperationsTestCase( + "validateMu2consolGeneralHeaderConstraintsRecordTarget", + operationsForOCL.getOCLValue("VALIDATE_MU2CONSOL_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + RecordTarget rTarget = CDAFactory.eINSTANCE.createRecordTarget(); + target.getRecordTargets().add(rTarget); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateMu2consolGeneralHeaderConstraintsRecordTarget( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateMu2consolGeneralHeaderConstraintsRecordTargetTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMu2consolGeneralHeaderConstraintsDocumentationOf() { + OperationsTestCase validateMu2consolGeneralHeaderConstraintsDocumentationOfTestCase = new OperationsTestCase( + "validateMu2consolGeneralHeaderConstraintsDocumentationOf", + operationsForOCL.getOCLValue("VALIDATE_MU2CONSOL_GENERAL_HEADER_CONSTRAINTS_DOCUMENTATION_OF__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + DocumentationOf dOf = CDAFactory.eINSTANCE.createDocumentationOf(); + target.getDocumentationOfs().add(dOf); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateMu2consolGeneralHeaderConstraintsDocumentationOf( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateMu2consolGeneralHeaderConstraintsDocumentationOfTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1AssignedEntityAssignedPerson() { + OperationsTestCase validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1AssignedEntityAssignedPersonTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1AssignedEntityAssignedPerson", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_DOCUMENTATION_OF_SERVICE_EVENT_PERFORMER1_ASSIGNED_ENTITY_ASSIGNED_PERSON__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + DocumentationOf dOf = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent sEvent = CDAFactory.eINSTANCE.createServiceEvent(); + Performer1 performer = CDAFactory.eINSTANCE.createPerformer1(); + AssignedEntity aE = CDAFactory.eINSTANCE.createAssignedEntity(); + dOf.setServiceEvent(sEvent); + sEvent.getPerformers().add(performer); + performer.setAssignedEntity(aE); + target.getDocumentationOfs().add(dOf); + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + Person aPerson = CDAFactory.eINSTANCE.createPerson(); + target.getDocumentationOfs().get(0).getServiceEvent().getPerformers().get(0).getAssignedEntity().setAssignedPerson( + aPerson); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1AssignedEntityAssignedPerson( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1AssignedEntityAssignedPersonTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1AssignedEntity() { + OperationsTestCase validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1AssignedEntityTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1AssignedEntity", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_DOCUMENTATION_OF_SERVICE_EVENT_PERFORMER1_ASSIGNED_ENTITY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + DocumentationOf dOf = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent sEvent = CDAFactory.eINSTANCE.createServiceEvent(); + Performer1 performer = CDAFactory.eINSTANCE.createPerformer1(); + dOf.setServiceEvent(sEvent); + sEvent.getPerformers().add(performer); + target.getDocumentationOfs().add(dOf); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + AssignedEntity aE = CDAFactory.eINSTANCE.createAssignedEntity(); + target.getDocumentationOfs().get(0).getServiceEvent().getPerformers().get(0).setAssignedEntity(aE); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1AssignedEntity( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer1AssignedEntityTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer() { + OperationsTestCase validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformerTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_DOCUMENTATION_OF_SERVICE_EVENT_PERFORMER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + DocumentationOf dOf = CDAFactory.eINSTANCE.createDocumentationOf(); + ServiceEvent sEvent = CDAFactory.eINSTANCE.createServiceEvent(); + dOf.setServiceEvent(sEvent); + target.getDocumentationOfs().add(dOf); + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + Performer1 performer = CDAFactory.eINSTANCE.createPerformer1(); + target.getDocumentationOfs().get(0).getServiceEvent().getPerformers().add(performer); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformer( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsDocumentationOfServiceEventPerformerTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateGeneralHeaderConstraintsDocumentationOfServiceEvent() { + OperationsTestCase validateGeneralHeaderConstraintsDocumentationOfServiceEventTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsDocumentationOfServiceEvent", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_DOCUMENTATION_OF_SERVICE_EVENT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + DocumentationOf dOf = CDAFactory.eINSTANCE.createDocumentationOf(); + target.getDocumentationOfs().add(dOf); + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + ServiceEvent sEvent = CDAFactory.eINSTANCE.createServiceEvent(); + target.getDocumentationOfs().get(0).setServiceEvent(sEvent); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsDocumentationOfServiceEvent( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsDocumentationOfServiceEventTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateGeneralHeaderConstraintsComponent1EncompassingEncounterEncounterParticipant() { + OperationsTestCase validateGeneralHeaderConstraintsComponent1EncompassingEncounterEncounterParticipantTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsComponent1EncompassingEncounterEncounterParticipant", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_COMPONENT1_ENCOMPASSING_ENCOUNTER_ENCOUNTER_PARTICIPANT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Component1 comp1 = CDAFactory.eINSTANCE.createComponent1(); + EncompassingEncounter eEncounter = CDAFactory.eINSTANCE.createEncompassingEncounter(); + comp1.setEncompassingEncounter(eEncounter); + target.setComponentOf(comp1); + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + EncounterParticipant participant = CDAFactory.eINSTANCE.createEncounterParticipant(); + target.getComponentOf().getEncompassingEncounter().getEncounterParticipants().add(participant); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsComponent1EncompassingEncounterEncounterParticipant( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsComponent1EncompassingEncounterEncounterParticipantTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateGeneralHeaderConstraintsComponent1EncompassingEncounter() { + OperationsTestCase validateGeneralHeaderConstraintsComponent1EncompassingEncounterTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsComponent1EncompassingEncounter", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_COMPONENT1_ENCOMPASSING_ENCOUNTER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + Component1 compObj = CDAFactory.eINSTANCE.createComponent1(); + target.setComponentOf(compObj); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + EncompassingEncounter eEncounter = CDAFactory.eINSTANCE.createEncompassingEncounter(); + target.getComponentOf().setEncompassingEncounter(eEncounter); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsComponent1EncompassingEncounter( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsComponent1EncompassingEncounterTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateGeneralHeaderConstraintsTemplateId() { + OperationsTestCase validateGeneralHeaderConstraintsTemplateIdTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsTemplateId", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsTemplateId( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationLanguageCodeP() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationLanguageCodePTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationLanguageCodeP", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_LANGUAGE_COMMUNICATION_LANGUAGE_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + RecordTarget rTarget = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pRole = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + LanguageCommunication lComm = CDAFactory.eINSTANCE.createLanguageCommunication(); + patient.getLanguageCommunications().add(lComm); + pRole.setPatient(patient); + rTarget.setPatientRole(pRole); + target.getRecordTargets().add(rTarget); + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + CS csType = DatatypesFactory.eINSTANCE.createCS(); + csType.setCode("amh"); + target.getRecordTargets().get(0).getPatientRole().getPatient().getLanguageCommunications().get(0).setLanguageCode( + csType); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationLanguageCodeP( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationLanguageCodePTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationLanguageCode() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationLanguageCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationLanguageCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_LANGUAGE_COMMUNICATION_LANGUAGE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + RecordTarget rTarget = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pRole = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + LanguageCommunication lComm = CDAFactory.eINSTANCE.createLanguageCommunication(); + patient.getLanguageCommunications().add(lComm); + pRole.setPatient(patient); + rTarget.setPatientRole(pRole); + target.getRecordTargets().add(rTarget); + + CS csType = DatatypesFactory.eINSTANCE.createCS(); + csType.setCode("abcd"); + lComm.setLanguageCode(csType); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + CS csType = DatatypesFactory.eINSTANCE.createCS(); + csType.setCode("zul"); + target.getRecordTargets().get(0).getPatientRole().getPatient().getLanguageCommunications().get(0).setLanguageCode( + csType); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationLanguageCode( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationLanguageCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientEthnicGroupCode() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientEthnicGroupCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientEthnicGroupCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_ETHNIC_GROUP_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget rT = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pRole = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + target.getRecordTargets().add(rT); + rT.setPatientRole(pRole); + pRole.setPatient(patient); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + CE ce = DatatypesFactory.eINSTANCE.createCE(); + ce.setCode("2135-2"); + ce.setCodeSystem("2.16.840.1.113883.6.238"); + target.getRecordTargets().get(0).getPatientRole().getPatient().setEthnicGroupCode(ce); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientEthnicGroupCode( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientEthnicGroupCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientEthnicGroupCodeP() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientEthnicGroupCodePTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientEthnicGroupCodeP", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_ETHNIC_GROUP_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget rT = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pRole = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + target.getRecordTargets().add(rT); + rT.setPatientRole(pRole); + pRole.setPatient(patient); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + CE ce = DatatypesFactory.eINSTANCE.createCE(); + ce.setCode("2135-2"); + ce.setCodeSystem("2.16.840.1.113883.6.238"); + target.getRecordTargets().get(0).getPatientRole().getPatient().setEthnicGroupCode(ce); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientEthnicGroupCodeP( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientEthnicGroupCodePTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientRaceCode() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientRaceCodeTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientRaceCode", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_RACE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget rT = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pRole = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + target.getRecordTargets().add(rT); + rT.setPatientRole(pRole); + pRole.setPatient(patient); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + CE ce = DatatypesFactory.eINSTANCE.createCE(); + ce.setCodeSystem("2.16.840.1.113883.6.238"); + ce.setCode("2054-5"); + target.getRecordTargets().get(0).getPatientRole().getPatient().setRaceCode(ce); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientRaceCode( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientRaceCodeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientRaceCodeP() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientRaceCodePTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientRaceCodeP", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_RACE_CODE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget rT = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pRole = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + target.getRecordTargets().add(rT); + rT.setPatientRole(pRole); + pRole.setPatient(patient); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + CE ce = DatatypesFactory.eINSTANCE.createCE(); + ce.setCodeSystem("2.16.840.1.113883.6.238"); + ce.setCode("1111111111"); + target.getRecordTargets().get(0).getPatientRole().getPatient().setRaceCode(ce); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientRaceCodeP( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientRaceCodePTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunication() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunication", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT_LANGUAGE_COMMUNICATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget rT = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pRole = CDAFactory.eINSTANCE.createPatientRole(); + Patient patient = CDAFactory.eINSTANCE.createPatient(); + target.getRecordTargets().add(rT); + rT.setPatientRole(pRole); + pRole.setPatient(patient); + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + LanguageCommunication lComm = CDAFactory.eINSTANCE.createLanguageCommunication(); + target.getRecordTargets().get(0).getPatientRole().getPatient().getLanguageCommunications().add(lComm); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunication( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientLanguageCommunicationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRolePatient() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRolePatientTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRolePatient", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE_PATIENT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget rT = CDAFactory.eINSTANCE.createRecordTarget(); + PatientRole pRole = CDAFactory.eINSTANCE.createPatientRole(); + target.getRecordTargets().add(rT); + rT.setPatientRole(pRole); + + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + Patient patient = CDAFactory.eINSTANCE.createPatient(); + target.getRecordTargets().get(0).getPatientRole().setPatient(patient); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRolePatient( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRolePatientTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateGeneralHeaderConstraintsRecordTargetPatientRole() { + OperationsTestCase validateGeneralHeaderConstraintsRecordTargetPatientRoleTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsRecordTargetPatientRole", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_RECORD_TARGET_PATIENT_ROLE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(GeneralHeaderConstraints target) { + target.init(); + RecordTarget rT = CDAFactory.eINSTANCE.createRecordTarget(); + target.getRecordTargets().add(rT); + } + + @Override + protected void updateToPass(GeneralHeaderConstraints target) { + PatientRole pRole = CDAFactory.eINSTANCE.createPatientRole(); + target.getRecordTargets().get(0).setPatientRole(pRole); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return GeneralHeaderConstraintsOperations.validateGeneralHeaderConstraintsRecordTargetPatientRole( + (GeneralHeaderConstraints) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsRecordTargetPatientRoleTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends GeneralHeaderConstraintsOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public GeneralHeaderConstraints create() { + return Mu2consolFactory.eINSTANCE.createGeneralHeaderConstraints(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends GeneralHeaderConstraintsOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + + /** + * + * @generated + */ + // + // protected EObject getObjectToTest() { + // return null; + // } + +} // GeneralHeaderConstraintsOperations diff --git a/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/Mu2consolAllTests.java b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/Mu2consolAllTests.java new file mode 100644 index 000000000..7aaa21933 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/Mu2consolAllTests.java @@ -0,0 +1,22 @@ +package org.openhealthtools.mdht.uml.cda.mu2consol.tests; + +import junit.framework.Test; +import junit.framework.TestSuite; +import junit.textui.TestRunner; + +public class Mu2consolAllTests extends TestSuite { + + public static void main(String[] args) { + TestRunner.run(suite()); + } + + public static Test suite() { + TestSuite suite = new Mu2consolAllTests(" Mu2 Consol Tests"); + suite.addTest(Mu2consolTests.suite()); + return suite; + } + + public Mu2consolAllTests(String name) { + super(name); + } +} diff --git a/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/Mu2consolExample.java b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/Mu2consolExample.java new file mode 100644 index 000000000..46af4a936 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/Mu2consolExample.java @@ -0,0 +1,112 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.mu2consol.tests; + +import java.io.File; +import java.io.IOException; + +import org.eclipse.emf.common.util.Diagnostic; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; +import org.eclipse.emf.ecore.util.Diagnostician; +import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl; +import org.openhealthtools.mdht.uml.cda.mu2consol.GeneralHeaderConstraints; +import org.openhealthtools.mdht.uml.cda.mu2consol.Mu2consolFactory; +import org.openhealthtools.mdht.uml.cda.mu2consol.Mu2consolPackage; + +/** + * A sample utility for the 'mu2consol' + * package. + * @generated + */ +public class Mu2consolExample { + /** + * Load all the argument file paths or URIs as + * instances of the model. + * @param args the file paths or URIs. + * @generated + */ + public static void main(String[] args) { + // Create a resource set to hold the resources. + // + ResourceSet resourceSet = new ResourceSetImpl(); + + // Register the appropriate resource factory to handle all file extensions. + // + resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put( + Resource.Factory.Registry.DEFAULT_EXTENSION, new XMIResourceFactoryImpl()); + + // Register the package to ensure it is available during loading. + // + resourceSet.getPackageRegistry().put(Mu2consolPackage.eNS_URI, Mu2consolPackage.eINSTANCE); + + // If there are no arguments, emit an appropriate usage message. + // + if (args.length == 0) { + System.out.println("Enter a list of file paths or URIs that have content like this:"); + try { + Resource resource = resourceSet.createResource(URI.createURI("http:///My.mu2consol")); + GeneralHeaderConstraints root = Mu2consolFactory.eINSTANCE.createGeneralHeaderConstraints(); + resource.getContents().add(root); + resource.save(System.out, null); + } catch (IOException exception) { + exception.printStackTrace(); + } + } else { + // Iterate over all the arguments. + // + for (int i = 0; i < args.length; ++i) { + // Construct the URI for the instance file. + // The argument is treated as a file path only if it denotes an existing file. + // Otherwise, it's directly treated as a URL. + // + File file = new File(args[i]); + URI uri = file.isFile() + ? URI.createFileURI(file.getAbsolutePath()) + : URI.createURI(args[i]); + + try { + // Demand load resource for this file. + // + Resource resource = resourceSet.getResource(uri, true); + System.out.println("Loaded " + uri); + + // Validate the contents of the loaded resource. + // + for (EObject eObject : resource.getContents()) { + Diagnostic diagnostic = Diagnostician.INSTANCE.validate(eObject); + if (diagnostic.getSeverity() != Diagnostic.OK) { + printDiagnostic(diagnostic, ""); + } + } + } catch (RuntimeException exception) { + System.out.println("Problem loading " + uri); + exception.printStackTrace(); + } + } + } + } + + /** + * Prints diagnostics with indentation. + * @param diagnostic the diagnostic to print. + * @param indent the indentation for printing. + * @generated + */ + protected static void printDiagnostic(Diagnostic diagnostic, String indent) { + System.out.print(indent); + System.out.println(diagnostic.getMessage()); + for (Diagnostic child : diagnostic.getChildren()) { + printDiagnostic(child, indent + " "); + } + } + +} // Mu2consolExample diff --git a/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/Mu2consolTests.java b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/Mu2consolTests.java new file mode 100644 index 000000000..88203d5c4 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/Mu2consolTests.java @@ -0,0 +1,38 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.mu2consol.tests; + +import junit.framework.JUnit4TestAdapter; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +/** + * A test suite for the 'mu2consol' + * package. + * + + * @generated + */ +@RunWith(Suite.class) +@Suite.SuiteClasses({ + SummaryOfCareRecordTest.class, ClinicalOfficeVisitSummaryTest.class, + TransitionOfCareAmbulatorySummaryTest.class, TransitionOfCareInpatientSummaryTest.class, + ViewDownloadTransmitSummaryTest.class, VDTAmbulatorySummaryTest.class, VDTInpatientSummaryTest.class, + SmokingStatusObservationTest.class, AssessmentSectionTest.class, GeneralHeaderConstraintsTest.class, + ProcedureActivityProcedureTest.class, ResultObservationTest.class }) +public class Mu2consolTests { + + /** + * + * @generated + */ + public static junit.framework.Test suite() { + return new JUnit4TestAdapter(Mu2consolTests.class); + } + +} // Mu2consolTests diff --git a/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/PlanOfCareSectionTest.java b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/PlanOfCareSectionTest.java new file mode 100644 index 000000000..01acbe8c7 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/PlanOfCareSectionTest.java @@ -0,0 +1,231 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.mu2consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.mu2consol.Mu2consolFactory; +import org.openhealthtools.mdht.uml.cda.mu2consol.PlanOfCareSection; +import org.openhealthtools.mdht.uml.cda.mu2consol.operations.PlanOfCareSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +public class PlanOfCareSectionTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateMu2consolPlanOfCareSectionCarePlanningForPlanOfCare() { + OperationsTestCase validateMu2consolPlanOfCareSectionCarePlanningForPlanOfCareTestCase = new OperationsTestCase( + "validateMu2consolPlanOfCareSectionCarePlanningForPlanOfCare", + operationsForOCL.getOCLValue("VALIDATE_MU2CONSOL_PLAN_OF_CARE_SECTION_CARE_PLANNING_FOR_PLAN_OF_CARE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareSection target) { + target.init(); + } + + @Override + protected void updateToPass(PlanOfCareSection target) { + target.addObservation(ConsolFactory.eINSTANCE.createPlanOfCareActivityObservation().init()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareSectionOperations.validateMu2consolPlanOfCareSectionCarePlanningForPlanOfCare( + (PlanOfCareSection) objectToTest, diagnostician, map); + } + + }; + + validateMu2consolPlanOfCareSectionCarePlanningForPlanOfCareTestCase.doValidationTest(); + } + + /** + * + * @generated not + */ + @Test + public void testValidateMu2consolPlanOfCareSectionPlanOfCareActivityObservation() { + OperationsTestCase validateMu2consolPlanOfCareSectionPlanOfCareActivityObservationTestCase = new OperationsTestCase( + "validateMu2consolPlanOfCareSectionPlanOfCareActivityObservation", + operationsForOCL.getOCLValue("VALIDATE_MU2CONSOL_PLAN_OF_CARE_SECTION_PLAN_OF_CARE_ACTIVITY_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareSection target) { + target.init(); + } + + @Override + protected void updateToPass(PlanOfCareSection target) { + + target.addObservation(ConsolFactory.eINSTANCE.createPlanOfCareActivityObservation().init()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareSectionOperations.validateMu2consolPlanOfCareSectionPlanOfCareActivityObservation( + (PlanOfCareSection) objectToTest, diagnostician, map); + } + + }; + + validateMu2consolPlanOfCareSectionPlanOfCareActivityObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetMu2consolPlanOfCareActivityActs() { + + PlanOfCareSection target = objectFactory.create(); + target.getMu2consolPlanOfCareActivityActs(); + + } + + /** + * + * @generated + */ + @Test + public void testGetMu2consolPlanOfCareActivityEncounters() { + + PlanOfCareSection target = objectFactory.create(); + target.getMu2consolPlanOfCareActivityEncounters(); + + } + + /** + * + * @generated + */ + @Test + public void testGetMu2consolPlanOfCareActivityObservations() { + + PlanOfCareSection target = objectFactory.create(); + target.getMu2consolPlanOfCareActivityObservations(); + + } + + /** + * + * @generated + */ + @Test + public void testValidatePlanOfCareSectionTemplateId() { + OperationsTestCase validatePlanOfCareSectionTemplateIdTestCase = new OperationsTestCase( + "validatePlanOfCareSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PLAN_OF_CARE_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(PlanOfCareSection target) { + + } + + @Override + protected void updateToPass(PlanOfCareSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return PlanOfCareSectionOperations.validatePlanOfCareSectionTemplateId( + (PlanOfCareSection) objectToTest, diagnostician, map); + } + + }; + + validatePlanOfCareSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends PlanOfCareSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public PlanOfCareSection create() { + return Mu2consolFactory.eINSTANCE.createPlanOfCareSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends PlanOfCareSectionOperations { + } + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // PlanOfCareSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/ProcedureActivityProcedureTest.java b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/ProcedureActivityProcedureTest.java new file mode 100644 index 000000000..e31082120 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/ProcedureActivityProcedureTest.java @@ -0,0 +1,219 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.mu2consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.mu2consol.Mu2consolFactory; +import org.openhealthtools.mdht.uml.cda.mu2consol.ProcedureActivityProcedure; +import org.openhealthtools.mdht.uml.cda.mu2consol.operations.ProcedureActivityProcedureOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; + +/** + * A static utility class that provides operations + * related to 'Procedure Activity Procedure' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ProcedureActivityProcedure#validateMu2consolProcedureActivityProcedureCodeValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Mu2consol Procedure Activity Procedure Code Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ProcedureActivityProcedure#validateMu2consolProcedureActivityProcedureCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Mu2consol Procedure Activity Procedure Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ProcedureActivityProcedure#validateProcedureActivityProcedureTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedure Activity Procedure Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class ProcedureActivityProcedureTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateMu2consolProcedureActivityProcedureCodeValue() { + OperationsTestCase validateMu2consolProcedureActivityProcedureCodeValueTestCase = new OperationsTestCase( + "validateMu2consolProcedureActivityProcedureCodeValue", + operationsForOCL.getOCLValue("VALIDATE_MU2CONSOL_PROCEDURE_ACTIVITY_PROCEDURE_CODE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD(); + value.setCode("testCode"); + value.setCodeSystem("2.16.840.1.113883.6.96"); + target.setCode(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateMu2consolProcedureActivityProcedureCodeValue( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateMu2consolProcedureActivityProcedureCodeValueTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMu2consolProcedureActivityProcedureCode() { + OperationsTestCase validateMu2consolProcedureActivityProcedureCodeTestCase = new OperationsTestCase( + "validateMu2consolProcedureActivityProcedureCode", + operationsForOCL.getOCLValue("VALIDATE_MU2CONSOL_PROCEDURE_ACTIVITY_PROCEDURE_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + target.init(); + CD cd = DatatypesFactory.eINSTANCE.createCD(); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateMu2consolProcedureActivityProcedureCode( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateMu2consolProcedureActivityProcedureCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateProcedureActivityProcedureTemplateId() { + OperationsTestCase validateProcedureActivityProcedureTemplateIdTestCase = new OperationsTestCase( + "validateProcedureActivityProcedureTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURE_ACTIVITY_PROCEDURE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProcedureActivityProcedure target) { + + } + + @Override + protected void updateToPass(ProcedureActivityProcedure target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProcedureActivityProcedureOperations.validateProcedureActivityProcedureTemplateId( + (ProcedureActivityProcedure) objectToTest, diagnostician, map); + } + + }; + + validateProcedureActivityProcedureTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ProcedureActivityProcedureOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public ProcedureActivityProcedure create() { + return Mu2consolFactory.eINSTANCE.createProcedureActivityProcedure(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends ProcedureActivityProcedureOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ProcedureActivityProcedureOperations diff --git a/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/ProceduresSectionTest.java b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/ProceduresSectionTest.java new file mode 100644 index 000000000..1f43f3850 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/ProceduresSectionTest.java @@ -0,0 +1,190 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.mu2consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.mu2consol.Mu2consolFactory; +import org.openhealthtools.mdht.uml.cda.mu2consol.ProceduresSection; +import org.openhealthtools.mdht.uml.cda.mu2consol.operations.ProceduresSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Procedures Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ProceduresSection#validateMu2consolProceduresSectionProcedureActivityProcedure(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Mu2consol Procedures Section Procedure Activity Procedure}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ProceduresSection#getMu2consolProcedureActivityProcedures() Get Mu2consol Procedure Activity Procedures}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ProceduresSection#validateProceduresSectionEntriesOptionalTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Procedures Section Entries Optional Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class ProceduresSectionTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateMu2consolProceduresSectionProcedureActivityProcedure() { + OperationsTestCase validateMu2consolProceduresSectionProcedureActivityProcedureTestCase = new OperationsTestCase( + "validateMu2consolProceduresSectionProcedureActivityProcedure", + operationsForOCL.getOCLValue("VALIDATE_MU2CONSOL_PROCEDURES_SECTION_PROCEDURE_ACTIVITY_PROCEDURE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProceduresSection target) { + target.init(); + + } + + @Override + protected void updateToPass(ProceduresSection target) { + + target.addProcedure(Mu2consolFactory.eINSTANCE.createProcedureActivityProcedure().init()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProceduresSectionOperations.validateMu2consolProceduresSectionProcedureActivityProcedure( + (ProceduresSection) objectToTest, diagnostician, map); + } + + }; + + validateMu2consolProceduresSectionProcedureActivityProcedureTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetMu2consolProcedureActivityProcedures() { + + ProceduresSection target = objectFactory.create(); + target.getMu2consolProcedureActivityProcedures(); + + } + + /** + * + * @generated + */ + @Test + public void testValidateProceduresSectionEntriesOptionalTemplateId() { + OperationsTestCase validateProceduresSectionEntriesOptionalTemplateIdTestCase = new OperationsTestCase( + "validateProceduresSectionEntriesOptionalTemplateId", + operationsForOCL.getOCLValue("VALIDATE_PROCEDURES_SECTION_ENTRIES_OPTIONAL_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ProceduresSection target) { + + } + + @Override + protected void updateToPass(ProceduresSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ProceduresSectionOperations.validateProceduresSectionEntriesOptionalTemplateId( + (ProceduresSection) objectToTest, diagnostician, map); + } + + }; + + validateProceduresSectionEntriesOptionalTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ProceduresSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public ProceduresSection create() { + return Mu2consolFactory.eINSTANCE.createProceduresSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends ProceduresSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ProceduresSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/ResultObservationTest.java b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/ResultObservationTest.java new file mode 100644 index 000000000..d4dc15cf1 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/ResultObservationTest.java @@ -0,0 +1,220 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.mu2consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.mu2consol.Mu2consolFactory; +import org.openhealthtools.mdht.uml.cda.mu2consol.ResultObservation; +import org.openhealthtools.mdht.uml.cda.mu2consol.operations.ResultObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; + +/** + * A static utility class that provides operations + * related to 'Result Observation' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ResultObservation#validateMu2consolResultObservationResultObservationCodeValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Mu2consol Result Observation Result Observation Code Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ResultObservation#validateMu2consolResultObservationCode(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Mu2consol Result Observation Code}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ResultObservation#validateResultObservationTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Observation Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class ResultObservationTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateMu2consolResultObservationResultObservationCodeValue() { + OperationsTestCase validateMu2consolResultObservationResultObservationCodeValueTestCase = new OperationsTestCase( + "validateMu2consolResultObservationResultObservationCodeValue", + operationsForOCL.getOCLValue("VALIDATE_MU2CONSOL_RESULT_OBSERVATION_RESULT_OBSERVATION_CODE_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultObservation target) { + + } + + @Override + protected void updateToPass(ResultObservation target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD(); + target.setCode(value); + value.setCodeSystem("2.16.840.1.113883.6.1"); + value.setCode("testValue"); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultObservationOperations.validateMu2consolResultObservationResultObservationCodeValue( + (ResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateMu2consolResultObservationResultObservationCodeValueTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateMu2consolResultObservationCode() { + OperationsTestCase validateMu2consolResultObservationCodeTestCase = new OperationsTestCase( + "validateMu2consolResultObservationCode", + operationsForOCL.getOCLValue("VALIDATE_MU2CONSOL_RESULT_OBSERVATION_CODE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultObservation target) { + + } + + @Override + protected void updateToPass(ResultObservation target) { + target.init(); + + CD cd = DatatypesFactory.eINSTANCE.createCD(); + target.setCode(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultObservationOperations.validateMu2consolResultObservationCode( + (ResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateMu2consolResultObservationCodeTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateResultObservationTemplateId() { + OperationsTestCase validateResultObservationTemplateIdTestCase = new OperationsTestCase( + "validateResultObservationTemplateId", + operationsForOCL.getOCLValue("VALIDATE_RESULT_OBSERVATION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultObservation target) { + + } + + @Override + protected void updateToPass(ResultObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultObservationOperations.validateResultObservationTemplateId( + (ResultObservation) objectToTest, diagnostician, map); + } + + }; + + validateResultObservationTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ResultObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public ResultObservation create() { + return Mu2consolFactory.eINSTANCE.createResultObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends ResultObservationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ResultObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/ResultOrganizerTest.java b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/ResultOrganizerTest.java new file mode 100644 index 000000000..d3a7bde51 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/ResultOrganizerTest.java @@ -0,0 +1,188 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.mu2consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.mu2consol.Mu2consolFactory; +import org.openhealthtools.mdht.uml.cda.mu2consol.ResultOrganizer; +import org.openhealthtools.mdht.uml.cda.mu2consol.operations.ResultOrganizerOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Result Organizer' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ResultOrganizer#validateMu2consolResultOrganizerResultObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Mu2consol Result Organizer Result Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ResultOrganizer#getMu2consolResultObservations() Get Mu2consol Result Observations}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ResultOrganizer#validateResultOrganizerTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Result Organizer Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class ResultOrganizerTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateMu2consolResultOrganizerResultObservation() { + OperationsTestCase validateMu2consolResultOrganizerResultObservationTestCase = new OperationsTestCase( + "validateMu2consolResultOrganizerResultObservation", + operationsForOCL.getOCLValue("VALIDATE_MU2CONSOL_RESULT_ORGANIZER_RESULT_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultOrganizer target) { + target.init(); + } + + @Override + protected void updateToPass(ResultOrganizer target) { + target.addObservation(Mu2consolFactory.eINSTANCE.createResultObservation().init()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultOrganizerOperations.validateMu2consolResultOrganizerResultObservation( + (ResultOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateMu2consolResultOrganizerResultObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetMu2consolResultObservations() { + + ResultOrganizer target = objectFactory.create(); + target.getMu2consolResultObservations(); + + } + + /** + * + * @generated + */ + @Test + public void testValidateResultOrganizerTemplateId() { + OperationsTestCase validateResultOrganizerTemplateIdTestCase = new OperationsTestCase( + "validateResultOrganizerTemplateId", + operationsForOCL.getOCLValue("VALIDATE_RESULT_ORGANIZER_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultOrganizer target) { + + } + + @Override + protected void updateToPass(ResultOrganizer target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultOrganizerOperations.validateResultOrganizerTemplateId( + (ResultOrganizer) objectToTest, diagnostician, map); + } + + }; + + validateResultOrganizerTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ResultOrganizerOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public ResultOrganizer create() { + return Mu2consolFactory.eINSTANCE.createResultOrganizer(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends ResultOrganizerOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ResultOrganizerOperations diff --git a/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/ResultsSectionTest.java b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/ResultsSectionTest.java new file mode 100644 index 000000000..103f4dfeb --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/ResultsSectionTest.java @@ -0,0 +1,194 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.mu2consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.mu2consol.Mu2consolFactory; +import org.openhealthtools.mdht.uml.cda.mu2consol.ResultsSection; +import org.openhealthtools.mdht.uml.cda.mu2consol.operations.ResultsSectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Results Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • + * {@link org.openhealthtools.mdht.uml.cda.mu2consol.ResultsSection#validateMu2consolResultsSectionResultOrganizer(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Mu2consol Results Section Result Organizer}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.mu2consol.ResultsSection#getMu2consolResultOrganizers() + * Get Mu2consol Result Organizers}
  • + *
  • + * {@link org.openhealthtools.mdht.uml.cda.mu2consol.ResultsSection#validateResultsSectionEntriesOptionalTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) + * Validate Results Section Entries Optional Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class ResultsSectionTest extends CDAValidationTest { + + /** + * + * @generated not + */ + @Test + public void testValidateMu2consolResultsSectionResultOrganizer() { + OperationsTestCase validateMu2consolResultsSectionResultOrganizerTestCase = new OperationsTestCase( + "validateMu2consolResultsSectionResultOrganizer", + operationsForOCL.getOCLValue("VALIDATE_MU2CONSOL_RESULTS_SECTION_RESULT_ORGANIZER__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultsSection target) { + target.init(); + } + + @Override + protected void updateToPass(ResultsSection target) { + target.addOrganizer(Mu2consolFactory.eINSTANCE.createResultOrganizer().init()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultsSectionOperations.validateMu2consolResultsSectionResultOrganizer( + (ResultsSection) objectToTest, diagnostician, map); + } + + }; + + validateMu2consolResultsSectionResultOrganizerTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetMu2consolResultOrganizers() { + + ResultsSection target = objectFactory.create(); + target.getMu2consolResultOrganizers(); + + } + + /** + * + * @generated + */ + @Test + public void testValidateResultsSectionEntriesOptionalTemplateId() { + OperationsTestCase validateResultsSectionEntriesOptionalTemplateIdTestCase = new OperationsTestCase( + "validateResultsSectionEntriesOptionalTemplateId", + operationsForOCL.getOCLValue("VALIDATE_RESULTS_SECTION_ENTRIES_OPTIONAL_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ResultsSection target) { + + } + + @Override + protected void updateToPass(ResultsSection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ResultsSectionOperations.validateResultsSectionEntriesOptionalTemplateId( + (ResultsSection) objectToTest, diagnostician, map); + } + + }; + + validateResultsSectionEntriesOptionalTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ResultsSectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public ResultsSection create() { + return Mu2consolFactory.eINSTANCE.createResultsSection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends ResultsSectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ResultsSectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/SmokingStatusObservationTest.java b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/SmokingStatusObservationTest.java new file mode 100644 index 000000000..73b248161 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/SmokingStatusObservationTest.java @@ -0,0 +1,217 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.mu2consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.mu2consol.Mu2consolFactory; +import org.openhealthtools.mdht.uml.cda.mu2consol.SmokingStatusObservation; +import org.openhealthtools.mdht.uml.cda.mu2consol.operations.SmokingStatusObservationOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; + +/** + * A static utility class that provides operations + * related to 'Smoking Status Observation' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.SmokingStatusObservation#validateSmokingStatusObservationValueP(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Smoking Status Observation Value P}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.SmokingStatusObservation#validateSmokingStatusObservationValue(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Smoking Status Observation Value}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.SmokingStatusObservation#validateTobaccoUseTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Tobacco Use Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class SmokingStatusObservationTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateSmokingStatusObservationValueP() { + OperationsTestCase validateSmokingStatusObservationValuePTestCase = new OperationsTestCase( + "validateSmokingStatusObservationValueP", + operationsForOCL.getOCLValue("VALIDATE_SMOKING_STATUS_OBSERVATION_VALUE_P__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SmokingStatusObservation target) { + + } + + @Override + protected void updateToPass(SmokingStatusObservation target) { + target.init(); + CD cd = DatatypesFactory.eINSTANCE.createCD(); + target.getValues().add(cd); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SmokingStatusObservationOperations.validateSmokingStatusObservationValueP( + (SmokingStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateSmokingStatusObservationValuePTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSmokingStatusObservationValue() { + OperationsTestCase validateSmokingStatusObservationValueTestCase = new OperationsTestCase( + "validateSmokingStatusObservationValue", + operationsForOCL.getOCLValue("VALIDATE_SMOKING_STATUS_OBSERVATION_VALUE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SmokingStatusObservation target) { + + } + + @Override + protected void updateToPass(SmokingStatusObservation target) { + target.init(); + + CD value = DatatypesFactory.eINSTANCE.createCD("428061000124105", "2.16.840.1.113883.6.96", null, null); + target.getValues().add(value); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SmokingStatusObservationOperations.validateSmokingStatusObservationValue( + (SmokingStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateSmokingStatusObservationValueTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateTobaccoUseTemplateId() { + OperationsTestCase validateTobaccoUseTemplateIdTestCase = new OperationsTestCase( + "validateTobaccoUseTemplateId", + operationsForOCL.getOCLValue("VALIDATE_TOBACCO_USE_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SmokingStatusObservation target) { + + } + + @Override + protected void updateToPass(SmokingStatusObservation target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SmokingStatusObservationOperations.validateTobaccoUseTemplateId( + (SmokingStatusObservation) objectToTest, diagnostician, map); + } + + }; + + validateTobaccoUseTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends SmokingStatusObservationOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public SmokingStatusObservation create() { + return Mu2consolFactory.eINSTANCE.createSmokingStatusObservation(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends SmokingStatusObservationOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // SmokingStatusObservationOperations diff --git a/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/SocialHistorySectionTest.java b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/SocialHistorySectionTest.java new file mode 100644 index 000000000..33e3da239 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/SocialHistorySectionTest.java @@ -0,0 +1,190 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.mu2consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.mu2consol.Mu2consolFactory; +import org.openhealthtools.mdht.uml.cda.mu2consol.SmokingStatusObservation; +import org.openhealthtools.mdht.uml.cda.mu2consol.SocialHistorySection; +import org.openhealthtools.mdht.uml.cda.mu2consol.operations.SocialHistorySectionOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Social History Section' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.SocialHistorySection#validateMu2consolSocialHistorySectionSmokingStatusObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Mu2consol Social History Section Smoking Status Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.SocialHistorySection#getMu2consolSmokingStatusObservations() Get Mu2consol Smoking Status Observations}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.SocialHistorySection#validateSocialHistorySectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Social History Section Template Id}
  • + *
+ *

+ * + * @generated + */ + +public class SocialHistorySectionTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateMu2consolSocialHistorySectionSmokingStatusObservation() { + OperationsTestCase validateMu2consolSocialHistorySectionSmokingStatusObservationTestCase = new OperationsTestCase( + "validateMu2consolSocialHistorySectionSmokingStatusObservation", + operationsForOCL.getOCLValue("VALIDATE_MU2CONSOL_SOCIAL_HISTORY_SECTION_SMOKING_STATUS_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistorySection target) { + + } + + @Override + protected void updateToPass(SocialHistorySection target) { + SmokingStatusObservation sObs = Mu2consolFactory.eINSTANCE.createSmokingStatusObservation().init(); + target.addObservation(sObs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistorySectionOperations.validateMu2consolSocialHistorySectionSmokingStatusObservation( + (SocialHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateMu2consolSocialHistorySectionSmokingStatusObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetMu2consolSmokingStatusObservations() { + + SocialHistorySection target = objectFactory.create(); + target.getMu2consolSmokingStatusObservations(); + + } + + /** + * + * @generated + */ + @Test + public void testValidateSocialHistorySectionTemplateId() { + OperationsTestCase validateSocialHistorySectionTemplateIdTestCase = new OperationsTestCase( + "validateSocialHistorySectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_SOCIAL_HISTORY_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SocialHistorySection target) { + + } + + @Override + protected void updateToPass(SocialHistorySection target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SocialHistorySectionOperations.validateSocialHistorySectionTemplateId( + (SocialHistorySection) objectToTest, diagnostician, map); + } + + }; + + validateSocialHistorySectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends SocialHistorySectionOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public SocialHistorySection create() { + return Mu2consolFactory.eINSTANCE.createSocialHistorySection(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends SocialHistorySectionOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // SocialHistorySectionOperations diff --git a/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/SummaryOfCareRecordTest.java b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/SummaryOfCareRecordTest.java new file mode 100644 index 000000000..6f8a0194c --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/SummaryOfCareRecordTest.java @@ -0,0 +1,1171 @@ +package org.openhealthtools.mdht.uml.cda.mu2consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.consol.AllergiesSection; +import org.openhealthtools.mdht.uml.cda.consol.CognitiveStatusProblemObservation; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusProblemObservation; +import org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusResultOrganizer; +import org.openhealthtools.mdht.uml.cda.consol.FunctionalStatusSection; +import org.openhealthtools.mdht.uml.cda.consol.ImmunizationsSection; +import org.openhealthtools.mdht.uml.cda.consol.MedicationsSection; +import org.openhealthtools.mdht.uml.cda.consol.PlanOfCareActivityAct; +import org.openhealthtools.mdht.uml.cda.consol.PlanOfCareActivityObservation; +import org.openhealthtools.mdht.uml.cda.consol.ProblemObservation; +import org.openhealthtools.mdht.uml.cda.consol.ProblemSection; +import org.openhealthtools.mdht.uml.cda.consol.VitalSignsSection; +import org.openhealthtools.mdht.uml.cda.mu2consol.AssessmentAndPlanSection; +import org.openhealthtools.mdht.uml.cda.mu2consol.AssessmentSection; +import org.openhealthtools.mdht.uml.cda.mu2consol.Mu2consolFactory; +import org.openhealthtools.mdht.uml.cda.mu2consol.PlanOfCareSection; +import org.openhealthtools.mdht.uml.cda.mu2consol.ProceduresSection; +import org.openhealthtools.mdht.uml.cda.mu2consol.ResultsSection; +import org.openhealthtools.mdht.uml.cda.mu2consol.SmokingStatusObservation; +import org.openhealthtools.mdht.uml.cda.mu2consol.SocialHistorySection; +import org.openhealthtools.mdht.uml.cda.mu2consol.SummaryOfCareRecord; +import org.openhealthtools.mdht.uml.cda.mu2consol.operations.SummaryOfCareRecordOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; + +/** + * A static utility class that provides operations + * related to 'Summary Of Care Record' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.SummaryOfCareRecord#validateSummaryOfCareRecordCarePlanning(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Summary Of Care Record Care Planning}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.SummaryOfCareRecord#validateSummaryOfCareRecordCognitiveStatusEntries(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Summary Of Care Record Cognitive Status Entries}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.SummaryOfCareRecord#validateSummaryOfCareRecordFunctionalStatusEntries(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Summary Of Care Record Functional Status Entries}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.SummaryOfCareRecord#validateSummaryOfCareRecordPlanOfCareSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Summary Of Care Record Plan Of Care Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.SummaryOfCareRecord#validateSummaryOfCareRecordProblemSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Summary Of Care Record Problem Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.SummaryOfCareRecord#validateSummaryOfCareRecordAllergiesSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Summary Of Care Record Allergies Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.SummaryOfCareRecord#validateSummaryOfCareRecordImmunizationsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Summary Of Care Record Immunizations Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.SummaryOfCareRecord#validateSummaryOfCareRecordMedicationsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Summary Of Care Record Medications Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.SummaryOfCareRecord#validateSummaryOfCareRecordSocialHistorySection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Summary Of Care Record Social History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.SummaryOfCareRecord#validateSummaryOfCareRecordResultsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Summary Of Care Record Results Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.SummaryOfCareRecord#validateSummaryOfCareRecordVitalSignsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Summary Of Care Record Vital Signs Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.SummaryOfCareRecord#validateSummaryOfCareRecordProceduresSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Summary Of Care Record Procedures Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.SummaryOfCareRecord#validateSummaryOfCareRecordSocialHistorySectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Summary Of Care Record Social History Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.SummaryOfCareRecord#validateSummaryOfCareRecordMu2consolSocialHistorySectionSmokingStatusObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Summary Of Care Record Mu2consol Social History Section Smoking Status Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.SummaryOfCareRecord#validateSummaryOfCareRecordMu2consolPlanOfCareSectionCarePlanningForPlanOfCare(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Summary Of Care Record Mu2consol Plan Of Care Section Care Planning For Plan Of Care}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.SummaryOfCareRecord#validateSummaryOfCareRecordMu2consolPlanOfCareSectionPlanOfCareActivityObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Summary Of Care Record Mu2consol Plan Of Care Section Plan Of Care Activity Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.SummaryOfCareRecord#validateSummaryOfCareRecordPlanOfCareSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Summary Of Care Record Plan Of Care Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.SummaryOfCareRecord#validateSummaryOfCareRecordAssessmentAndPlanSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Summary Of Care Record Assessment And Plan Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.SummaryOfCareRecord#validateSummaryOfCareRecordAssessmentSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Summary Of Care Record Assessment Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.SummaryOfCareRecord#validateSummaryOfCareRecordMu2consolAssessmentSectionProblemObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Summary Of Care Record Mu2consol Assessment Section Problem Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.SummaryOfCareRecord#retrieveFunctionalStatusSection() Retrieve Functional Status Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.SummaryOfCareRecord#retrieveHospitalDischargeDiagnosisSection() Retrieve Hospital Discharge Diagnosis Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.SummaryOfCareRecord#retrievePostoperativeDiagnosisSection() Retrieve Postoperative Diagnosis Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.SummaryOfCareRecord#retrievePostprocedureDiagnosisSection() Retrieve Postprocedure Diagnosis Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.SummaryOfCareRecord#getEncountersSection() Get Encounters Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.SummaryOfCareRecord#getPlanOfCareSection() Get Plan Of Care Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.SummaryOfCareRecord#getAssessmentAndPlanSection() Get Assessment And Plan Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.SummaryOfCareRecord#getAssessmentSection() Get Assessment Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.SummaryOfCareRecord#getPostoperativeDiagnosisSection() Get Postoperative Diagnosis Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.SummaryOfCareRecord#getProblemSection() Get Problem Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.SummaryOfCareRecord#getAllergiesSection() Get Allergies Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.SummaryOfCareRecord#getHistoryOfPastIllnessSection() Get History Of Past Illness Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.SummaryOfCareRecord#getPreoperativeDiagnosisSection() Get Preoperative Diagnosis Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.SummaryOfCareRecord#getImmunizationsSection() Get Immunizations Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.SummaryOfCareRecord#getMedicationsSection() Get Medications Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.SummaryOfCareRecord#getSocialHistorySection() Get Social History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.SummaryOfCareRecord#getResultsSection() Get Results Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.SummaryOfCareRecord#getVitalSignsSection() Get Vital Signs Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.SummaryOfCareRecord#getProceduresSection() Get Procedures Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.SummaryOfCareRecord#getPostprocedureDiagnosisSection() Get Postprocedure Diagnosis Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.SummaryOfCareRecord#getFunctionalStatusSection() Get Functional Status Section}
  • + *
+ *

+ * + * @generated + */ + +public class SummaryOfCareRecordTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateSummaryOfCareRecordCarePlanning() { + OperationsTestCase validateSummaryOfCareRecordCarePlanningTestCase = new OperationsTestCase( + "validateSummaryOfCareRecordCarePlanning", + operationsForOCL.getOCLValue("VALIDATE_SUMMARY_OF_CARE_RECORD_CARE_PLANNING__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SummaryOfCareRecord target) { + target.init(); + org.openhealthtools.mdht.uml.cda.consol.PlanOfCareSection pSection = ConsolFactory.eINSTANCE.createPlanOfCareSection().init(); + target.addSection(pSection); + } + + @Override + protected void updateToPass(SummaryOfCareRecord target) { + AssessmentAndPlanSection aSection = Mu2consolFactory.eINSTANCE.createAssessmentAndPlanSection().init(); + target.addSection(aSection); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SummaryOfCareRecordOperations.validateSummaryOfCareRecordCarePlanning( + (SummaryOfCareRecord) objectToTest, diagnostician, map); + } + + }; + + validateSummaryOfCareRecordCarePlanningTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSummaryOfCareRecordCognitiveStatusEntries() { + OperationsTestCase validateSummaryOfCareRecordCognitiveStatusEntriesTestCase = new OperationsTestCase( + "validateSummaryOfCareRecordCognitiveStatusEntries", + operationsForOCL.getOCLValue("VALIDATE_SUMMARY_OF_CARE_RECORD_COGNITIVE_STATUS_ENTRIES__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SummaryOfCareRecord target) { + target.init(); + FunctionalStatusSection fSection = ConsolFactory.eINSTANCE.createFunctionalStatusSection().init(); + target.addSection(fSection); + } + + @Override + protected void updateToPass(SummaryOfCareRecord target) { + CognitiveStatusProblemObservation obs1 = ConsolFactory.eINSTANCE.createCognitiveStatusProblemObservation().init(); + FunctionalStatusProblemObservation obs2 = ConsolFactory.eINSTANCE.createFunctionalStatusProblemObservation().init(); + target.getFunctionalStatusSection().addObservation(obs1); + target.getFunctionalStatusSection().addObservation(obs2); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SummaryOfCareRecordOperations.validateSummaryOfCareRecordCognitiveStatusEntries( + (SummaryOfCareRecord) objectToTest, diagnostician, map); + } + + }; + + validateSummaryOfCareRecordCognitiveStatusEntriesTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSummaryOfCareRecordFunctionalStatusEntries() { + OperationsTestCase validateSummaryOfCareRecordFunctionalStatusEntriesTestCase = new OperationsTestCase( + "validateSummaryOfCareRecordFunctionalStatusEntries", + operationsForOCL.getOCLValue("VALIDATE_SUMMARY_OF_CARE_RECORD_FUNCTIONAL_STATUS_ENTRIES__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SummaryOfCareRecord target) { + target.init(); + FunctionalStatusSection sSection = ConsolFactory.eINSTANCE.createFunctionalStatusSection().init(); + target.addSection(sSection); + } + + @Override + protected void updateToPass(SummaryOfCareRecord target) { + CognitiveStatusProblemObservation cObs = ConsolFactory.eINSTANCE.createCognitiveStatusProblemObservation().init(); + target.getFunctionalStatusSection().addObservation(cObs); + FunctionalStatusResultOrganizer fOrg = ConsolFactory.eINSTANCE.createFunctionalStatusResultOrganizer().init(); + target.getFunctionalStatusSection().addOrganizer(fOrg); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SummaryOfCareRecordOperations.validateSummaryOfCareRecordFunctionalStatusEntries( + (SummaryOfCareRecord) objectToTest, diagnostician, map); + } + + }; + + validateSummaryOfCareRecordFunctionalStatusEntriesTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testValidateSummaryOfCareRecordPlanOfCareSection() { + OperationsTestCase validateSummaryOfCareRecordPlanOfCareSectionTestCase = new OperationsTestCase( + "validateSummaryOfCareRecordPlanOfCareSection", + operationsForOCL.getOCLValue("VALIDATE_SUMMARY_OF_CARE_RECORD_PLAN_OF_CARE_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SummaryOfCareRecord target) { + + } + + @Override + protected void updateToPass(SummaryOfCareRecord target) { + target.init(); + + /* PlanOfCareSection */ + PlanOfCareSection section = + + Mu2consolFactory.eINSTANCE.createPlanOfCareSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SummaryOfCareRecordOperations.validateSummaryOfCareRecordPlanOfCareSection( + (SummaryOfCareRecord) objectToTest, diagnostician, map); + } + + }; + + validateSummaryOfCareRecordPlanOfCareSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSummaryOfCareRecordProblemSection() { + OperationsTestCase validateSummaryOfCareRecordProblemSectionTestCase = new OperationsTestCase( + "validateSummaryOfCareRecordProblemSection", + operationsForOCL.getOCLValue("VALIDATE_SUMMARY_OF_CARE_RECORD_PROBLEM_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SummaryOfCareRecord target) { + + } + + @Override + protected void updateToPass(SummaryOfCareRecord target) { + target.init(); + + /* ProblemSection */ + ProblemSection section = + + ConsolFactory.eINSTANCE.createProblemSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SummaryOfCareRecordOperations.validateSummaryOfCareRecordProblemSection( + (SummaryOfCareRecord) objectToTest, diagnostician, map); + } + + }; + + validateSummaryOfCareRecordProblemSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSummaryOfCareRecordAllergiesSection() { + OperationsTestCase validateSummaryOfCareRecordAllergiesSectionTestCase = new OperationsTestCase( + "validateSummaryOfCareRecordAllergiesSection", + operationsForOCL.getOCLValue("VALIDATE_SUMMARY_OF_CARE_RECORD_ALLERGIES_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SummaryOfCareRecord target) { + + } + + @Override + protected void updateToPass(SummaryOfCareRecord target) { + target.init(); + + /* AllergiesSection */ + AllergiesSection section = + + ConsolFactory.eINSTANCE.createAllergiesSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SummaryOfCareRecordOperations.validateSummaryOfCareRecordAllergiesSection( + (SummaryOfCareRecord) objectToTest, diagnostician, map); + } + + }; + + validateSummaryOfCareRecordAllergiesSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSummaryOfCareRecordImmunizationsSection() { + OperationsTestCase validateSummaryOfCareRecordImmunizationsSectionTestCase = new OperationsTestCase( + "validateSummaryOfCareRecordImmunizationsSection", + operationsForOCL.getOCLValue("VALIDATE_SUMMARY_OF_CARE_RECORD_IMMUNIZATIONS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SummaryOfCareRecord target) { + + } + + @Override + protected void updateToPass(SummaryOfCareRecord target) { + target.init(); + + /* ImmunizationsSection */ + ImmunizationsSection section = + + ConsolFactory.eINSTANCE.createImmunizationsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SummaryOfCareRecordOperations.validateSummaryOfCareRecordImmunizationsSection( + (SummaryOfCareRecord) objectToTest, diagnostician, map); + } + + }; + + validateSummaryOfCareRecordImmunizationsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSummaryOfCareRecordMedicationsSection() { + OperationsTestCase validateSummaryOfCareRecordMedicationsSectionTestCase = new OperationsTestCase( + "validateSummaryOfCareRecordMedicationsSection", + operationsForOCL.getOCLValue("VALIDATE_SUMMARY_OF_CARE_RECORD_MEDICATIONS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SummaryOfCareRecord target) { + + } + + @Override + protected void updateToPass(SummaryOfCareRecord target) { + target.init(); + + /* MedicationsSection */ + MedicationsSection section = + + ConsolFactory.eINSTANCE.createMedicationsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SummaryOfCareRecordOperations.validateSummaryOfCareRecordMedicationsSection( + (SummaryOfCareRecord) objectToTest, diagnostician, map); + } + + }; + + validateSummaryOfCareRecordMedicationsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSummaryOfCareRecordSocialHistorySection() { + OperationsTestCase validateSummaryOfCareRecordSocialHistorySectionTestCase = new OperationsTestCase( + "validateSummaryOfCareRecordSocialHistorySection", + operationsForOCL.getOCLValue("VALIDATE_SUMMARY_OF_CARE_RECORD_SOCIAL_HISTORY_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SummaryOfCareRecord target) { + + } + + @Override + protected void updateToPass(SummaryOfCareRecord target) { + target.init(); + + /* SocialHistorySection */ + SocialHistorySection section = + + Mu2consolFactory.eINSTANCE.createSocialHistorySection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SummaryOfCareRecordOperations.validateSummaryOfCareRecordSocialHistorySection( + (SummaryOfCareRecord) objectToTest, diagnostician, map); + } + + }; + + validateSummaryOfCareRecordSocialHistorySectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSummaryOfCareRecordResultsSection() { + OperationsTestCase validateSummaryOfCareRecordResultsSectionTestCase = new OperationsTestCase( + "validateSummaryOfCareRecordResultsSection", + operationsForOCL.getOCLValue("VALIDATE_SUMMARY_OF_CARE_RECORD_RESULTS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SummaryOfCareRecord target) { + + } + + @Override + protected void updateToPass(SummaryOfCareRecord target) { + target.init(); + + /* ResultsSection */ + ResultsSection section = + + Mu2consolFactory.eINSTANCE.createResultsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SummaryOfCareRecordOperations.validateSummaryOfCareRecordResultsSection( + (SummaryOfCareRecord) objectToTest, diagnostician, map); + } + + }; + + validateSummaryOfCareRecordResultsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSummaryOfCareRecordVitalSignsSection() { + OperationsTestCase validateSummaryOfCareRecordVitalSignsSectionTestCase = new OperationsTestCase( + "validateSummaryOfCareRecordVitalSignsSection", + operationsForOCL.getOCLValue("VALIDATE_SUMMARY_OF_CARE_RECORD_VITAL_SIGNS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SummaryOfCareRecord target) { + + } + + @Override + protected void updateToPass(SummaryOfCareRecord target) { + target.init(); + + /* VitalSignsSection */ + VitalSignsSection section = + + ConsolFactory.eINSTANCE.createVitalSignsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SummaryOfCareRecordOperations.validateSummaryOfCareRecordVitalSignsSection( + (SummaryOfCareRecord) objectToTest, diagnostician, map); + } + + }; + + validateSummaryOfCareRecordVitalSignsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSummaryOfCareRecordProceduresSection() { + OperationsTestCase validateSummaryOfCareRecordProceduresSectionTestCase = new OperationsTestCase( + "validateSummaryOfCareRecordProceduresSection", + operationsForOCL.getOCLValue("VALIDATE_SUMMARY_OF_CARE_RECORD_PROCEDURES_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SummaryOfCareRecord target) { + + } + + @Override + protected void updateToPass(SummaryOfCareRecord target) { + target.init(); + + /* ProceduresSection */ + ProceduresSection section = + + Mu2consolFactory.eINSTANCE.createProceduresSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SummaryOfCareRecordOperations.validateSummaryOfCareRecordProceduresSection( + (SummaryOfCareRecord) objectToTest, diagnostician, map); + } + + }; + + validateSummaryOfCareRecordProceduresSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSummaryOfCareRecordSocialHistorySectionTemplateId() { + OperationsTestCase validateSummaryOfCareRecordSocialHistorySectionTemplateIdTestCase = new OperationsTestCase( + "validateSummaryOfCareRecordSocialHistorySectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_SUMMARY_OF_CARE_RECORD_SOCIAL_HISTORY_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SummaryOfCareRecord target) { + SocialHistorySection section = Mu2consolFactory.eINSTANCE.createSocialHistorySection().init(); + for (II ii : section.getTemplateIds()) { + ii.setRoot(BAD_TEMPLATE_ID); + } + target.addSection(section); + } + + @Override + protected void updateToPass(SummaryOfCareRecord target) { + target.init(); + SocialHistorySection section = Mu2consolFactory.eINSTANCE.createSocialHistorySection().init(); + II iiTemp = section.getTemplateIds().get(0); + + SocialHistorySection s = target.getSocialHistorySection(); + for (II ii : s.getTemplateIds()) { + ii.setRoot(iiTemp.getRoot()); + } + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SummaryOfCareRecordOperations.validateSummaryOfCareRecordSocialHistorySectionTemplateId( + (SummaryOfCareRecord) objectToTest, diagnostician, map); + } + + }; + + validateSummaryOfCareRecordSocialHistorySectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSummaryOfCareRecordMu2consolSocialHistorySectionSmokingStatusObservation() { + OperationsTestCase validateSummaryOfCareRecordmu2consolSocialHistorySectionSmokingStatusObservationTestCase = new OperationsTestCase( + "validateSummaryOfCareRecordmu2consolSocialHistorySectionSmokingStatusObservation", + operationsForOCL.getOCLValue("VALIDATE_SUMMARY_OF_CARE_RECORDMU2CONSOL_SOCIAL_HISTORY_SECTION_SMOKING_STATUS_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SummaryOfCareRecord target) { + SocialHistorySection section = Mu2consolFactory.eINSTANCE.createSocialHistorySection().init(); + target.addSection(section); + } + + @Override + protected void updateToPass(SummaryOfCareRecord target) { + SmokingStatusObservation sObs = Mu2consolFactory.eINSTANCE.createSmokingStatusObservation().init(); + target.getSocialHistorySection().addObservation(sObs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SummaryOfCareRecordOperations.validateSummaryOfCareRecordMu2consolSocialHistorySectionSmokingStatusObservation( + (SummaryOfCareRecord) objectToTest, diagnostician, map); + } + + }; + + validateSummaryOfCareRecordmu2consolSocialHistorySectionSmokingStatusObservationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSummaryOfCareRecordMu2consolPlanOfCareSectionCarePlanningForPlanOfCare() { + OperationsTestCase validateSummaryOfCareRecordmu2consolPlanOfCareSectionCarePlanningForPlanOfCareTestCase = new OperationsTestCase( + "validateSummaryOfCareRecordmu2consolPlanOfCareSectionCarePlanningForPlanOfCare", + operationsForOCL.getOCLValue("VALIDATE_SUMMARY_OF_CARE_RECORDMU2CONSOL_PLAN_OF_CARE_SECTION_CARE_PLANNING_FOR_PLAN_OF_CARE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SummaryOfCareRecord target) { + PlanOfCareSection pSection = Mu2consolFactory.eINSTANCE.createPlanOfCareSection().init(); + target.addSection(pSection); + + } + + @Override + protected void updateToPass(SummaryOfCareRecord target) { + // target.init(); + PlanOfCareActivityAct act = ConsolFactory.eINSTANCE.createPlanOfCareActivityAct().init(); + PlanOfCareSection pSection = target.getPlanOfCareSection(); + pSection.addAct(act); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SummaryOfCareRecordOperations.validateSummaryOfCareRecordMu2consolPlanOfCareSectionCarePlanningForPlanOfCare( + (SummaryOfCareRecord) objectToTest, diagnostician, map); + } + + }; + + validateSummaryOfCareRecordmu2consolPlanOfCareSectionCarePlanningForPlanOfCareTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSummaryOfCareRecordMu2consolPlanOfCareSectionPlanOfCareActivityObservation() { + OperationsTestCase validateSummaryOfCareRecordmu2consolPlanOfCareSectionMu2consolPlanOfCareSectionPlanOfCareActivityObservationTestCase = new OperationsTestCase( + "validateSummaryOfCareRecordmu2consolPlanOfCareSectionMu2consolPlanOfCareSectionPlanOfCareActivityObservation", + operationsForOCL.getOCLValue("VALIDATE_SUMMARY_OF_CARE_RECORDMU2CONSOL_PLAN_OF_CARE_SECTION_MU2CONSOL_PLAN_OF_CARE_SECTION_PLAN_OF_CARE_ACTIVITY_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SummaryOfCareRecord target) { + PlanOfCareSection pSection = Mu2consolFactory.eINSTANCE.createPlanOfCareSection().init(); + target.addSection(pSection); + + } + + @Override + protected void updateToPass(SummaryOfCareRecord target) { + PlanOfCareActivityObservation pObs = ConsolFactory.eINSTANCE.createPlanOfCareActivityObservation().init(); + target.getPlanOfCareSection().addObservation(pObs); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SummaryOfCareRecordOperations.validateSummaryOfCareRecordMu2consolPlanOfCareSectionPlanOfCareActivityObservation( + (SummaryOfCareRecord) objectToTest, diagnostician, map); + } + + }; + + validateSummaryOfCareRecordmu2consolPlanOfCareSectionMu2consolPlanOfCareSectionPlanOfCareActivityObservationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSummaryOfCareRecordPlanOfCareSectionTemplateId() { + OperationsTestCase validateSummaryOfCareRecordPlanOfCareSectionTemplateIdTestCase = new OperationsTestCase( + "validateSummaryOfCareRecordPlanOfCareSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_SUMMARY_OF_CARE_RECORD_PLAN_OF_CARE_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SummaryOfCareRecord target) { + PlanOfCareSection pSection = Mu2consolFactory.eINSTANCE.createPlanOfCareSection().init(); + target.addSection(pSection); + for (II ii : pSection.getTemplateIds()) { + ii.setRoot(BAD_TEMPLATE_ID); + } + } + + @Override + protected void updateToPass(SummaryOfCareRecord target) { + PlanOfCareSection pSection = Mu2consolFactory.eINSTANCE.createPlanOfCareSection().init(); + II iiTemp = pSection.getTemplateIds().get(0); + + PlanOfCareSection section = target.getPlanOfCareSection(); + for (II ii : section.getTemplateIds()) { + ii.setRoot(iiTemp.getRoot()); + } + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SummaryOfCareRecordOperations.validateSummaryOfCareRecordPlanOfCareSectionTemplateId( + (SummaryOfCareRecord) objectToTest, diagnostician, map); + } + + }; + + validateSummaryOfCareRecordPlanOfCareSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSummaryOfCareRecordAssessmentAndPlanSectionTemplateId() { + OperationsTestCase validateSummaryOfCareRecordAssessmentAndPlanSectionTemplateIdTestCase = new OperationsTestCase( + "validateSummaryOfCareRecordAssessmentAndPlanSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_SUMMARY_OF_CARE_RECORD_ASSESSMENT_AND_PLAN_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SummaryOfCareRecord target) { + + AssessmentAndPlanSection aSection = Mu2consolFactory.eINSTANCE.createAssessmentAndPlanSection().init(); + for (II ii : aSection.getTemplateIds()) { + ii.setRoot(BAD_TEMPLATE_ID); + } + target.addSection(aSection); + } + + @Override + protected void updateToPass(SummaryOfCareRecord target) { + AssessmentAndPlanSection aSection = Mu2consolFactory.eINSTANCE.createAssessmentAndPlanSection().init(); + II iiTemp = aSection.getTemplateIds().get(0); + + AssessmentAndPlanSection asSection = target.getAssessmentAndPlanSection(); + for (II ii : asSection.getTemplateIds()) { + ii.setRoot(iiTemp.getRoot()); + } + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SummaryOfCareRecordOperations.validateSummaryOfCareRecordAssessmentAndPlanSectionTemplateId( + (SummaryOfCareRecord) objectToTest, diagnostician, map); + } + + }; + + validateSummaryOfCareRecordAssessmentAndPlanSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSummaryOfCareRecordAssessmentSectionTemplateId() { + OperationsTestCase validateSummaryOfCareRecordAssessmentSectionTemplateIdTestCase = new OperationsTestCase( + "validateSummaryOfCareRecordAssessmentSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_SUMMARY_OF_CARE_RECORD_ASSESSMENT_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SummaryOfCareRecord target) { + AssessmentSection aSection = Mu2consolFactory.eINSTANCE.createAssessmentSection().init(); + for (II ii : aSection.getTemplateIds()) { + ii.setRoot(BAD_TEMPLATE_ID); + } + target.addSection(aSection); + } + + @Override + protected void updateToPass(SummaryOfCareRecord target) { + AssessmentSection tempSection = Mu2consolFactory.eINSTANCE.createAssessmentSection().init(); + II iiTemp = tempSection.getTemplateIds().get(0); + AssessmentSection aSection = target.getAssessmentSection(); + for (II ii : aSection.getTemplateIds()) { + ii.setRoot(iiTemp.getRoot()); + } + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SummaryOfCareRecordOperations.validateSummaryOfCareRecordAssessmentSectionTemplateId( + (SummaryOfCareRecord) objectToTest, diagnostician, map); + } + + }; + + validateSummaryOfCareRecordAssessmentSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateSummaryOfCareRecordMu2consolAssessmentSectionProblemObservation() { + OperationsTestCase validateSummaryOfCareRecordmu2consolAssessmentSectionProblemObservationTestCase = new OperationsTestCase( + "validateSummaryOfCareRecordmu2consolAssessmentSectionProblemObservation", + operationsForOCL.getOCLValue("VALIDATE_SUMMARY_OF_CARE_RECORDMU2CONSOL_ASSESSMENT_SECTION_PROBLEM_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(SummaryOfCareRecord target) { + target.init(); + AssessmentSection aSection = Mu2consolFactory.eINSTANCE.createAssessmentSection().init(); + target.addSection(aSection); + + } + + @Override + protected void updateToPass(SummaryOfCareRecord target) { + AssessmentSection aSection = target.getAssessmentSection(); + ProblemObservation pObs = ConsolFactory.eINSTANCE.createProblemObservation().init(); + aSection.addObservation(pObs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return SummaryOfCareRecordOperations.validateSummaryOfCareRecordMu2consolAssessmentSectionProblemObservation( + (SummaryOfCareRecord) objectToTest, diagnostician, map); + } + + }; + + validateSummaryOfCareRecordmu2consolAssessmentSectionProblemObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetEncountersSection() { + + SummaryOfCareRecord target = objectFactory.create(); + target.getEncountersSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPlanOfCareSection() { + + SummaryOfCareRecord target = objectFactory.create(); + target.getPlanOfCareSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetAssessmentAndPlanSection() { + + SummaryOfCareRecord target = objectFactory.create(); + target.getAssessmentAndPlanSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetAssessmentSection() { + + SummaryOfCareRecord target = objectFactory.create(); + target.getAssessmentSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPostoperativeDiagnosisSection() { + + SummaryOfCareRecord target = objectFactory.create(); + target.getPostoperativeDiagnosisSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProblemSection() { + + SummaryOfCareRecord target = objectFactory.create(); + target.getProblemSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetAllergiesSection() { + + SummaryOfCareRecord target = objectFactory.create(); + target.getAllergiesSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetHistoryOfPastIllnessSection() { + + SummaryOfCareRecord target = objectFactory.create(); + target.getHistoryOfPastIllnessSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPreoperativeDiagnosisSection() { + + SummaryOfCareRecord target = objectFactory.create(); + target.getPreoperativeDiagnosisSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetImmunizationsSection() { + + SummaryOfCareRecord target = objectFactory.create(); + target.getImmunizationsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetMedicationsSection() { + + SummaryOfCareRecord target = objectFactory.create(); + target.getMedicationsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetSocialHistorySection() { + + SummaryOfCareRecord target = objectFactory.create(); + target.getSocialHistorySection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetResultsSection() { + + SummaryOfCareRecord target = objectFactory.create(); + target.getResultsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetVitalSignsSection() { + + SummaryOfCareRecord target = objectFactory.create(); + target.getVitalSignsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProceduresSection() { + + SummaryOfCareRecord target = objectFactory.create(); + target.getProceduresSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPostprocedureDiagnosisSection() { + + SummaryOfCareRecord target = objectFactory.create(); + target.getPostprocedureDiagnosisSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetFunctionalStatusSection() { + + SummaryOfCareRecord target = objectFactory.create(); + target.getFunctionalStatusSection(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends SummaryOfCareRecordOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public SummaryOfCareRecord create() { + return Mu2consolFactory.eINSTANCE.createSummaryOfCareRecord(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends SummaryOfCareRecordOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // SummaryOfCareRecordOperations diff --git a/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/TransitionOfCareAmbulatorySummaryTest.java b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/TransitionOfCareAmbulatorySummaryTest.java new file mode 100644 index 000000000..0d792aa16 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/TransitionOfCareAmbulatorySummaryTest.java @@ -0,0 +1,243 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.mu2consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Component1; +import org.openhealthtools.mdht.uml.cda.EncompassingEncounter; +import org.openhealthtools.mdht.uml.cda.ResponsibleParty; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.ReasonForReferralSection; +import org.openhealthtools.mdht.uml.cda.mu2consol.AssessmentSection; +import org.openhealthtools.mdht.uml.cda.mu2consol.Mu2consolFactory; +import org.openhealthtools.mdht.uml.cda.mu2consol.TransitionOfCareAmbulatorySummary; +import org.openhealthtools.mdht.uml.cda.mu2consol.operations.TransitionOfCareAmbulatorySummaryOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Transition Of Care Ambulatory Summary' model + * objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.TransitionOfCareAmbulatorySummary#validateTransitionOfCareAmbulatorySummaryResponsibleParty(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Transition Of Care Ambulatory Summary Responsible Party}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.TransitionOfCareAmbulatorySummary#validateTransitionOfCareAmbulatorySummaryAmbulatoryEncounterDiagnoses(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Transition Of Care Ambulatory Summary Ambulatory Encounter Diagnoses}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.TransitionOfCareAmbulatorySummary#validateTransitionOfCareAmbulatorySummaryReasonForReferralSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Transition Of Care Ambulatory Summary Reason For Referral Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.TransitionOfCareAmbulatorySummary#getReasonForReferralSection() Get Reason For Referral Section}
  • + *
+ *

+ * + * @generated + */ + +public class TransitionOfCareAmbulatorySummaryTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateTransitionOfCareAmbulatorySummaryResponsibleParty() { + OperationsTestCase validateTransitionOfCareAmbulatorySummaryResponsiblePartyTestCase = new OperationsTestCase( + "validateTransitionOfCareAmbulatorySummaryResponsibleParty", + operationsForOCL.getOCLValue("VALIDATE_TRANSITION_OF_CARE_AMBULATORY_SUMMARY_RESPONSIBLE_PARTY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(TransitionOfCareAmbulatorySummary target) { + + Component1 compOf = CDAFactory.eINSTANCE.createComponent1(); + EncompassingEncounter eEncounter = CDAFactory.eINSTANCE.createEncompassingEncounter(); + compOf.setEncompassingEncounter(eEncounter); + target.setComponentOf(compOf); + System.out.println(compOf); + } + + @Override + protected void updateToPass(TransitionOfCareAmbulatorySummary target) { + + ResponsibleParty party = CDAFactory.eINSTANCE.createResponsibleParty(); + target.getComponentOf().getEncompassingEncounter().setResponsibleParty(party); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return TransitionOfCareAmbulatorySummaryOperations.validateTransitionOfCareAmbulatorySummaryResponsibleParty( + (TransitionOfCareAmbulatorySummary) objectToTest, diagnostician, map); + } + + }; + + validateTransitionOfCareAmbulatorySummaryResponsiblePartyTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateTransitionOfCareAmbulatorySummaryAmbulatoryEncounterDiagnoses() { + OperationsTestCase validateTransitionOfCareAmbulatorySummaryAmbulatoryEncounterDiagnosesTestCase = new OperationsTestCase( + "validateTransitionOfCareAmbulatorySummaryAmbulatoryEncounterDiagnoses", + operationsForOCL.getOCLValue("VALIDATE_TRANSITION_OF_CARE_AMBULATORY_SUMMARY_AMBULATORY_ENCOUNTER_DIAGNOSES__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(TransitionOfCareAmbulatorySummary target) { + + } + + @Override + protected void updateToPass(TransitionOfCareAmbulatorySummary target) { + target.init(); + AssessmentSection aSection = Mu2consolFactory.eINSTANCE.createAssessmentSection().init(); + target.addSection(aSection); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return TransitionOfCareAmbulatorySummaryOperations.validateTransitionOfCareAmbulatorySummaryAmbulatoryEncounterDiagnoses( + (TransitionOfCareAmbulatorySummary) objectToTest, diagnostician, map); + } + + }; + + validateTransitionOfCareAmbulatorySummaryAmbulatoryEncounterDiagnosesTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateTransitionOfCareAmbulatorySummaryReasonForReferralSection() { + OperationsTestCase validateTransitionOfCareAmbulatorySummaryReasonForReferralSectionTestCase = new OperationsTestCase( + "validateTransitionOfCareAmbulatorySummaryReasonForReferralSection", + operationsForOCL.getOCLValue("VALIDATE_TRANSITION_OF_CARE_AMBULATORY_SUMMARY_REASON_FOR_REFERRAL_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(TransitionOfCareAmbulatorySummary target) { + + } + + @Override + protected void updateToPass(TransitionOfCareAmbulatorySummary target) { + target.init(); + + /* ReasonForReferralSection */ + ReasonForReferralSection section = ConsolFactory.eINSTANCE.createReasonForReferralSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return TransitionOfCareAmbulatorySummaryOperations.validateTransitionOfCareAmbulatorySummaryReasonForReferralSection( + (TransitionOfCareAmbulatorySummary) objectToTest, diagnostician, map); + } + + }; + + validateTransitionOfCareAmbulatorySummaryReasonForReferralSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetReasonForReferralSection() { + + TransitionOfCareAmbulatorySummary target = objectFactory.create(); + target.getReasonForReferralSection(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends TransitionOfCareAmbulatorySummaryOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public TransitionOfCareAmbulatorySummary create() { + return Mu2consolFactory.eINSTANCE.createTransitionOfCareAmbulatorySummary(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends TransitionOfCareAmbulatorySummaryOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // TransitionOfCareAmbulatorySummaryOperations diff --git a/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/TransitionOfCareInpatientSummaryTest.java b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/TransitionOfCareInpatientSummaryTest.java new file mode 100644 index 000000000..3976b3209 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/TransitionOfCareInpatientSummaryTest.java @@ -0,0 +1,454 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.mu2consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.HospitalAdmissionDiagnosis; +import org.openhealthtools.mdht.uml.cda.consol.HospitalAdmissionDiagnosisSection; +import org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeDiagnosis; +import org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeDiagnosisSection; +import org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeInstructionsSection; +import org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeMedicationsSection; +import org.openhealthtools.mdht.uml.cda.consol.PostoperativeDiagnosisSection; +import org.openhealthtools.mdht.uml.cda.consol.PostprocedureDiagnosisSection; +import org.openhealthtools.mdht.uml.cda.consol.ProblemObservation; +import org.openhealthtools.mdht.uml.cda.mu2consol.Mu2consolFactory; +import org.openhealthtools.mdht.uml.cda.mu2consol.TransitionOfCareInpatientSummary; +import org.openhealthtools.mdht.uml.cda.mu2consol.operations.TransitionOfCareInpatientSummaryOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'Transition Of Care Inpatient Summary' model + * objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.TransitionOfCareInpatientSummary#validateTransitionOfCareInpatientSummaryInpatientEncounterDiagnoses(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Transition Of Care Inpatient Summary Inpatient Encounter Diagnoses}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.TransitionOfCareInpatientSummary#validateTransitionOfCareInpatientSummaryHospitalAdmissionDiagnosisEntry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Transition Of Care Inpatient Summary Hospital Admission Diagnosis Entry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.TransitionOfCareInpatientSummary#validateTransitionOfCareInpatientSummaryHospitalDischargeDiagnosesEntry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Transition Of Care Inpatient Summary Hospital Discharge Diagnoses Entry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.TransitionOfCareInpatientSummary#validateTransitionOfCareInpatientSummaryPostoperativeDiagnosisEntry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Transition Of Care Inpatient Summary Postoperative Diagnosis Entry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.TransitionOfCareInpatientSummary#validateTransitionOfCareInpatientSummaryPostprocedureDiagnosisEntry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Transition Of Care Inpatient Summary Postprocedure Diagnosis Entry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.TransitionOfCareInpatientSummary#validateTransitionOfCareInpatientSummaryHospitalDischargeInstructionsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Transition Of Care Inpatient Summary Hospital Discharge Instructions Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.TransitionOfCareInpatientSummary#validateTransitionOfCareInpatientSummaryHospitalDischargeMedicationsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Transition Of Care Inpatient Summary Hospital Discharge Medications Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.TransitionOfCareInpatientSummary#getHospitalDischargeInstructionsSection() Get Hospital Discharge Instructions Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.TransitionOfCareInpatientSummary#getHospitalDischargeMedicationsSection() Get Hospital Discharge Medications Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.TransitionOfCareInpatientSummary#getHospitalAdmissionDiagnosisSection() Get Hospital Admission Diagnosis Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.TransitionOfCareInpatientSummary#getHospitalDischargeDiagnosisSection() Get Hospital Discharge Diagnosis Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.TransitionOfCareInpatientSummary#getHospitalAdmissionMedicationsSectionEntriesOptional() Get Hospital Admission Medications Section Entries Optional}
  • + *
+ *

+ * + * @generated + */ + +public class TransitionOfCareInpatientSummaryTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateTransitionOfCareInpatientSummaryInpatientEncounterDiagnoses() { + OperationsTestCase validateTransitionOfCareInpatientSummaryInpatientEncounterDiagnosesTestCase = new OperationsTestCase( + "validateTransitionOfCareInpatientSummaryInpatientEncounterDiagnoses", + operationsForOCL.getOCLValue("VALIDATE_TRANSITION_OF_CARE_INPATIENT_SUMMARY_INPATIENT_ENCOUNTER_DIAGNOSES__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(TransitionOfCareInpatientSummary target) { + + } + + @Override + protected void updateToPass(TransitionOfCareInpatientSummary target) { + target.init(); + HospitalAdmissionDiagnosisSection hSection = ConsolFactory.eINSTANCE.createHospitalAdmissionDiagnosisSection().init(); + target.addSection(hSection); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return TransitionOfCareInpatientSummaryOperations.validateTransitionOfCareInpatientSummaryInpatientEncounterDiagnoses( + (TransitionOfCareInpatientSummary) objectToTest, diagnostician, map); + } + + }; + + validateTransitionOfCareInpatientSummaryInpatientEncounterDiagnosesTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateTransitionOfCareInpatientSummaryHospitalAdmissionDiagnosisEntry() { + OperationsTestCase validateTransitionOfCareInpatientSummaryHospitalAdmissionDiagnosisEntryTestCase = new OperationsTestCase( + "validateTransitionOfCareInpatientSummaryHospitalAdmissionDiagnosisEntry", + operationsForOCL.getOCLValue("VALIDATE_TRANSITION_OF_CARE_INPATIENT_SUMMARY_HOSPITAL_ADMISSION_DIAGNOSIS_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(TransitionOfCareInpatientSummary target) { + target.init(); + HospitalAdmissionDiagnosisSection aSection = ConsolFactory.eINSTANCE.createHospitalAdmissionDiagnosisSection().init(); + target.addSection(aSection); + // HospitalAdmissionDiagnosis section = + // ConsolFactory.eINSTANCE.createHospitalAdmissionDiagnosis().init(); + } + + @Override + protected void updateToPass(TransitionOfCareInpatientSummary target) { + HospitalAdmissionDiagnosis act = ConsolFactory.eINSTANCE.createHospitalAdmissionDiagnosis().init(); + target.getHospitalAdmissionDiagnosisSection().addAct(act); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return TransitionOfCareInpatientSummaryOperations.validateTransitionOfCareInpatientSummaryHospitalAdmissionDiagnosisEntry( + (TransitionOfCareInpatientSummary) objectToTest, diagnostician, map); + } + + }; + + validateTransitionOfCareInpatientSummaryHospitalAdmissionDiagnosisEntryTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateTransitionOfCareInpatientSummaryHospitalDischargeDiagnosesEntry() { + OperationsTestCase validateTransitionOfCareInpatientSummaryHospitalDischargeDiagnosesEntryTestCase = new OperationsTestCase( + "validateTransitionOfCareInpatientSummaryHospitalDischargeDiagnosesEntry", + operationsForOCL.getOCLValue("VALIDATE_TRANSITION_OF_CARE_INPATIENT_SUMMARY_HOSPITAL_DISCHARGE_DIAGNOSES_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(TransitionOfCareInpatientSummary target) { + target.init(); + HospitalDischargeDiagnosisSection aSection = ConsolFactory.eINSTANCE.createHospitalDischargeDiagnosisSection().init(); + target.addSection(aSection); + } + + @Override + protected void updateToPass(TransitionOfCareInpatientSummary target) { + HospitalDischargeDiagnosis act = ConsolFactory.eINSTANCE.createHospitalDischargeDiagnosis().init(); + target.getHospitalDischargeDiagnosisSection().addAct(act); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return TransitionOfCareInpatientSummaryOperations.validateTransitionOfCareInpatientSummaryHospitalDischargeDiagnosesEntry( + (TransitionOfCareInpatientSummary) objectToTest, diagnostician, map); + } + + }; + + validateTransitionOfCareInpatientSummaryHospitalDischargeDiagnosesEntryTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateTransitionOfCareInpatientSummaryPostoperativeDiagnosisEntry() { + OperationsTestCase validateTransitionOfCareInpatientSummaryPostoperativeDiagnosisEntryTestCase = new OperationsTestCase( + "validateTransitionOfCareInpatientSummaryPostoperativeDiagnosisEntry", + operationsForOCL.getOCLValue("VALIDATE_TRANSITION_OF_CARE_INPATIENT_SUMMARY_POSTOPERATIVE_DIAGNOSIS_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(TransitionOfCareInpatientSummary target) { + target.init(); + PostoperativeDiagnosisSection aSection = ConsolFactory.eINSTANCE.createPostoperativeDiagnosisSection().init(); + target.addSection(aSection); + } + + @Override + protected void updateToPass(TransitionOfCareInpatientSummary target) { + ProblemObservation obs = ConsolFactory.eINSTANCE.createProblemObservation().init(); + target.getPostoperativeDiagnosisSection().addObservation(obs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return TransitionOfCareInpatientSummaryOperations.validateTransitionOfCareInpatientSummaryPostoperativeDiagnosisEntry( + (TransitionOfCareInpatientSummary) objectToTest, diagnostician, map); + } + + }; + + validateTransitionOfCareInpatientSummaryPostoperativeDiagnosisEntryTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateTransitionOfCareInpatientSummaryPostprocedureDiagnosisEntry() { + OperationsTestCase validateTransitionOfCareInpatientSummaryPostprocedureDiagnosisEntryTestCase = new OperationsTestCase( + "validateTransitionOfCareInpatientSummaryPostprocedureDiagnosisEntry", + operationsForOCL.getOCLValue("VALIDATE_TRANSITION_OF_CARE_INPATIENT_SUMMARY_POSTPROCEDURE_DIAGNOSIS_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(TransitionOfCareInpatientSummary target) { + target.init(); + PostprocedureDiagnosisSection aSection = ConsolFactory.eINSTANCE.createPostprocedureDiagnosisSection().init(); + target.addSection(aSection); + } + + @Override + protected void updateToPass(TransitionOfCareInpatientSummary target) { + ProblemObservation pObs = ConsolFactory.eINSTANCE.createProblemObservation().init(); + target.getPostprocedureDiagnosisSection().addObservation(pObs); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return TransitionOfCareInpatientSummaryOperations.validateTransitionOfCareInpatientSummaryPostprocedureDiagnosisEntry( + (TransitionOfCareInpatientSummary) objectToTest, diagnostician, map); + } + + }; + + validateTransitionOfCareInpatientSummaryPostprocedureDiagnosisEntryTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateTransitionOfCareInpatientSummaryHospitalDischargeInstructionsSection() { + OperationsTestCase validateTransitionOfCareInpatientSummaryHospitalDischargeInstructionsSectionTestCase = new OperationsTestCase( + "validateTransitionOfCareInpatientSummaryHospitalDischargeInstructionsSection", + operationsForOCL.getOCLValue("VALIDATE_TRANSITION_OF_CARE_INPATIENT_SUMMARY_HOSPITAL_DISCHARGE_INSTRUCTIONS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(TransitionOfCareInpatientSummary target) { + + } + + @Override + protected void updateToPass(TransitionOfCareInpatientSummary target) { + target.init(); + + /* HospitalDischargeInstructionsSection */ + HospitalDischargeInstructionsSection section = + + ConsolFactory.eINSTANCE.createHospitalDischargeInstructionsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return TransitionOfCareInpatientSummaryOperations.validateTransitionOfCareInpatientSummaryHospitalDischargeInstructionsSection( + (TransitionOfCareInpatientSummary) objectToTest, diagnostician, map); + } + + }; + + validateTransitionOfCareInpatientSummaryHospitalDischargeInstructionsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateTransitionOfCareInpatientSummaryHospitalDischargeMedicationsSection() { + OperationsTestCase validateTransitionOfCareInpatientSummaryHospitalDischargeMedicationsSectionTestCase = new OperationsTestCase( + "validateTransitionOfCareInpatientSummaryHospitalDischargeMedicationsSection", + operationsForOCL.getOCLValue("VALIDATE_TRANSITION_OF_CARE_INPATIENT_SUMMARY_HOSPITAL_DISCHARGE_MEDICATIONS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(TransitionOfCareInpatientSummary target) { + + } + + @Override + protected void updateToPass(TransitionOfCareInpatientSummary target) { + target.init(); + + /* HospitalDischargeMedicationsSection */ + HospitalDischargeMedicationsSection section = + + ConsolFactory.eINSTANCE.createHospitalDischargeMedicationsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return TransitionOfCareInpatientSummaryOperations.validateTransitionOfCareInpatientSummaryHospitalDischargeMedicationsSection( + (TransitionOfCareInpatientSummary) objectToTest, diagnostician, map); + } + + }; + + validateTransitionOfCareInpatientSummaryHospitalDischargeMedicationsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetHospitalDischargeInstructionsSection() { + + TransitionOfCareInpatientSummary target = objectFactory.create(); + target.getHospitalDischargeInstructionsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetHospitalDischargeMedicationsSection() { + + TransitionOfCareInpatientSummary target = objectFactory.create(); + target.getHospitalDischargeMedicationsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetHospitalAdmissionDiagnosisSection() { + + TransitionOfCareInpatientSummary target = objectFactory.create(); + target.getHospitalAdmissionDiagnosisSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetHospitalDischargeDiagnosisSection() { + + TransitionOfCareInpatientSummary target = objectFactory.create(); + target.getHospitalDischargeDiagnosisSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetHospitalAdmissionMedicationsSectionEntriesOptional() { + + TransitionOfCareInpatientSummary target = objectFactory.create(); + target.getHospitalAdmissionMedicationsSectionEntriesOptional(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends TransitionOfCareInpatientSummaryOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public TransitionOfCareInpatientSummary create() { + return Mu2consolFactory.eINSTANCE.createTransitionOfCareInpatientSummary(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends TransitionOfCareInpatientSummaryOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // TransitionOfCareInpatientSummaryOperations diff --git a/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/VDTAmbulatorySummaryTest.java b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/VDTAmbulatorySummaryTest.java new file mode 100644 index 000000000..c8ab1f302 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/VDTAmbulatorySummaryTest.java @@ -0,0 +1,149 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.mu2consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Component1; +import org.openhealthtools.mdht.uml.cda.EncompassingEncounter; +import org.openhealthtools.mdht.uml.cda.ResponsibleParty; +import org.openhealthtools.mdht.uml.cda.mu2consol.Mu2consolFactory; +import org.openhealthtools.mdht.uml.cda.mu2consol.VDTAmbulatorySummary; +import org.openhealthtools.mdht.uml.cda.mu2consol.operations.VDTAmbulatorySummaryOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; + +/** + * A static utility class that provides operations + * related to 'VDT Ambulatory Summary' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.VDTAmbulatorySummary#validateVDTAmbulatorySummaryResponsibleParty(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate VDT Ambulatory Summary Responsible Party}
  • + *
+ *

+ * + * @generated + */ + +public class VDTAmbulatorySummaryTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateVDTAmbulatorySummaryResponsibleParty() { + OperationsTestCase validateVDTAmbulatorySummaryResponsiblePartyTestCase = new OperationsTestCase( + "validateVDTAmbulatorySummaryResponsibleParty", + operationsForOCL.getOCLValue("VALIDATE_VDT_AMBULATORY_SUMMARY_RESPONSIBLE_PARTY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VDTAmbulatorySummary target) { + target.init(); + Component1 comp1 = CDAFactory.eINSTANCE.createComponent1(); + EncompassingEncounter encounter = CDAFactory.eINSTANCE.createEncompassingEncounter(); + comp1.setEncompassingEncounter(encounter); + target.setComponentOf(comp1); + } + + @Override + protected void updateToPass(VDTAmbulatorySummary target) { + ResponsibleParty party = CDAFactory.eINSTANCE.createResponsibleParty(); + target.getComponentOf().getEncompassingEncounter().setResponsibleParty(party); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VDTAmbulatorySummaryOperations.validateVDTAmbulatorySummaryResponsibleParty( + (VDTAmbulatorySummary) objectToTest, diagnostician, map); + } + + }; + + validateVDTAmbulatorySummaryResponsiblePartyTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends VDTAmbulatorySummaryOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public VDTAmbulatorySummary create() { + return Mu2consolFactory.eINSTANCE.createVDTAmbulatorySummary(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends VDTAmbulatorySummaryOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // VDTAmbulatorySummaryOperations diff --git a/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/VDTInpatientSummaryTest.java b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/VDTInpatientSummaryTest.java new file mode 100644 index 000000000..91109cc90 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/VDTInpatientSummaryTest.java @@ -0,0 +1,549 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.mu2consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Component1; +import org.openhealthtools.mdht.uml.cda.Component2; +import org.openhealthtools.mdht.uml.cda.EncompassingEncounter; +import org.openhealthtools.mdht.uml.cda.Location; +import org.openhealthtools.mdht.uml.cda.consol.ChiefComplaintAndReasonForVisitSection; +import org.openhealthtools.mdht.uml.cda.consol.ChiefComplaintSection; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.HospitalAdmissionDiagnosis; +import org.openhealthtools.mdht.uml.cda.consol.HospitalAdmissionDiagnosisSection; +import org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeInstructionsSection; +import org.openhealthtools.mdht.uml.cda.consol.HospitalDischargeMedicationsSection; +import org.openhealthtools.mdht.uml.cda.consol.PreoperativeDiagnosis; +import org.openhealthtools.mdht.uml.cda.consol.PreoperativeDiagnosisSection; +import org.openhealthtools.mdht.uml.cda.consol.ReasonForVisitSection; +import org.openhealthtools.mdht.uml.cda.mu2consol.Mu2consolFactory; +import org.openhealthtools.mdht.uml.cda.mu2consol.VDTInpatientSummary; +import org.openhealthtools.mdht.uml.cda.mu2consol.operations.VDTInpatientSummaryOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; + +/** + * A static utility class that provides operations + * related to 'VDT Inpatient Summary' model objects. + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.VDTInpatientSummary#validateVDTInpatientSummaryEffectiveTime(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate VDT Inpatient Summary Effective Time}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.VDTInpatientSummary#validateVDTInpatientSummaryLocation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate VDT Inpatient Summary Location}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.VDTInpatientSummary#validateVDTInpatientSummaryChiefComplaintOrReasonForVisit(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate VDT Inpatient Summary Chief Complaint Or Reason For Visit}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.VDTInpatientSummary#validateVDTInpatientSummaryHospitalAdmissionDiagnosisEntry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate VDT Inpatient Summary Hospital Admission Diagnosis Entry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.VDTInpatientSummary#validateVDTInpatientSummaryPreoperativeDiagnosisEntry(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate VDT Inpatient Summary Preoperative Diagnosis Entry}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.VDTInpatientSummary#validateVDTInpatientSummaryHospitalDischargeInstructionsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate VDT Inpatient Summary Hospital Discharge Instructions Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.VDTInpatientSummary#validateVDTInpatientSummaryHospitalAdmissionDiagnosisSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate VDT Inpatient Summary Hospital Admission Diagnosis Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.VDTInpatientSummary#validateVDTInpatientSummaryHospitalDischargeMedicationsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate VDT Inpatient Summary Hospital Discharge Medications Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.VDTInpatientSummary#getHospitalDischargeInstructionsSection() Get Hospital Discharge Instructions Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.VDTInpatientSummary#getHospitalAdmissionDiagnosisSection() Get Hospital Admission Diagnosis Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.VDTInpatientSummary#getChiefComplaintSection() Get Chief Complaint Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.VDTInpatientSummary#getReasonForVisitSection() Get Reason For Visit Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.VDTInpatientSummary#getChiefComplaintAndReasonForVisitSection() Get Chief Complaint And Reason For Visit Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.VDTInpatientSummary#getHospitalDischargeMedicationsSection() Get Hospital Discharge Medications Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.VDTInpatientSummary#getPreoperativeDiagnosisSection() Get Preoperative Diagnosis Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.VDTInpatientSummary#getHospitalAdmissionMedicationsSectionEntriesOptional() Get Hospital Admission Medications Section Entries Optional}
  • + *
+ *

+ * + * @generated + */ + +public class VDTInpatientSummaryTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateVDTInpatientSummaryEffectiveTime() { + OperationsTestCase validateVDTInpatientSummaryEffectiveTimeTestCase = new OperationsTestCase( + "validateVDTInpatientSummaryEffectiveTime", + operationsForOCL.getOCLValue("VALIDATE_VDT_INPATIENT_SUMMARY_EFFECTIVE_TIME__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VDTInpatientSummary target) { + Component1 compOf = CDAFactory.eINSTANCE.createComponent1(); + EncompassingEncounter enCounter = CDAFactory.eINSTANCE.createEncompassingEncounter(); + compOf.setEncompassingEncounter(enCounter); + target.setComponentOf(compOf); + + } + + @Override + protected void updateToPass(VDTInpatientSummary target) { + IVL_TS effTime = DatatypesFactory.eINSTANCE.createIVL_TS(); + target.getComponentOf().getEncompassingEncounter().setEffectiveTime(effTime); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VDTInpatientSummaryOperations.validateVDTInpatientSummaryEffectiveTime( + (VDTInpatientSummary) objectToTest, diagnostician, map); + } + + }; + + validateVDTInpatientSummaryEffectiveTimeTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateVDTInpatientSummaryLocation() { + OperationsTestCase validateVDTInpatientSummaryLocationTestCase = new OperationsTestCase( + "validateVDTInpatientSummaryLocation", + operationsForOCL.getOCLValue("VALIDATE_VDT_INPATIENT_SUMMARY_LOCATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VDTInpatientSummary target) { + Component1 comp1 = CDAFactory.eINSTANCE.createComponent1(); + EncompassingEncounter encounter = CDAFactory.eINSTANCE.createEncompassingEncounter(); + comp1.setEncompassingEncounter(encounter); + target.setComponentOf(comp1); + } + + @Override + protected void updateToPass(VDTInpatientSummary target) { + Location locn = CDAFactory.eINSTANCE.createLocation(); + target.getComponentOf().getEncompassingEncounter().setLocation(locn); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VDTInpatientSummaryOperations.validateVDTInpatientSummaryLocation( + (VDTInpatientSummary) objectToTest, diagnostician, map); + } + + }; + + validateVDTInpatientSummaryLocationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateVDTInpatientSummaryChiefComplaintOrReasonForVisit() { + OperationsTestCase validateVDTInpatientSummaryChiefComplaintOrReasonForVisitTestCase = new OperationsTestCase( + "validateVDTInpatientSummaryChiefComplaintOrReasonForVisit", + operationsForOCL.getOCLValue("VALIDATE_VDT_INPATIENT_SUMMARY_CHIEF_COMPLAINT_OR_REASON_FOR_VISIT__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VDTInpatientSummary target) { + target.init(); + ChiefComplaintSection ccSection = ConsolFactory.eINSTANCE.createChiefComplaintSection().init(); + ReasonForVisitSection rvsSection = ConsolFactory.eINSTANCE.createReasonForVisitSection().init(); + ChiefComplaintAndReasonForVisitSection ccRvsSection = ConsolFactory.eINSTANCE.createChiefComplaintAndReasonForVisitSection().init(); + target.addSection(ccRvsSection); + target.addSection(rvsSection); + target.addSection(ccSection); + } + + @Override + protected void updateToPass(VDTInpatientSummary target) { + Component2 comp2 = CDAFactory.eINSTANCE.createComponent2(); + target.setComponent(comp2); + ChiefComplaintSection ccSection = ConsolFactory.eINSTANCE.createChiefComplaintSection().init(); + ReasonForVisitSection rvsSection = ConsolFactory.eINSTANCE.createReasonForVisitSection().init(); + target.addSection(rvsSection); + target.addSection(ccSection); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VDTInpatientSummaryOperations.validateVDTInpatientSummaryChiefComplaintOrReasonForVisit( + (VDTInpatientSummary) objectToTest, diagnostician, map); + } + + }; + + validateVDTInpatientSummaryChiefComplaintOrReasonForVisitTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateVDTInpatientSummaryHospitalAdmissionDiagnosisEntry() { + OperationsTestCase validateVDTInpatientSummaryHospitalAdmissionDiagnosisEntryTestCase = new OperationsTestCase( + "validateVDTInpatientSummaryHospitalAdmissionDiagnosisEntry", + operationsForOCL.getOCLValue("VALIDATE_VDT_INPATIENT_SUMMARY_HOSPITAL_ADMISSION_DIAGNOSIS_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VDTInpatientSummary target) { + HospitalAdmissionDiagnosisSection aSection = ConsolFactory.eINSTANCE.createHospitalAdmissionDiagnosisSection().init(); + target.addSection(aSection); + } + + @Override + protected void updateToPass(VDTInpatientSummary target) { + HospitalAdmissionDiagnosis act = ConsolFactory.eINSTANCE.createHospitalAdmissionDiagnosis().init(); + target.getHospitalAdmissionDiagnosisSection().addAct(act); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VDTInpatientSummaryOperations.validateVDTInpatientSummaryHospitalAdmissionDiagnosisEntry( + (VDTInpatientSummary) objectToTest, diagnostician, map); + } + + }; + + validateVDTInpatientSummaryHospitalAdmissionDiagnosisEntryTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateVDTInpatientSummaryPreoperativeDiagnosisEntry() { + OperationsTestCase validateVDTInpatientSummaryPreoperativeDiagnosisEntryTestCase = new OperationsTestCase( + "validateVDTInpatientSummaryPreoperativeDiagnosisEntry", + operationsForOCL.getOCLValue("VALIDATE_VDT_INPATIENT_SUMMARY_PREOPERATIVE_DIAGNOSIS_ENTRY__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VDTInpatientSummary target) { + PreoperativeDiagnosisSection aSection = ConsolFactory.eINSTANCE.createPreoperativeDiagnosisSection().init(); + target.addSection(aSection); + } + + @Override + protected void updateToPass(VDTInpatientSummary target) { + PreoperativeDiagnosis act = ConsolFactory.eINSTANCE.createPreoperativeDiagnosis().init(); + target.getPreoperativeDiagnosisSection().addAct(act); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VDTInpatientSummaryOperations.validateVDTInpatientSummaryPreoperativeDiagnosisEntry( + (VDTInpatientSummary) objectToTest, diagnostician, map); + } + + }; + + validateVDTInpatientSummaryPreoperativeDiagnosisEntryTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateVDTInpatientSummaryHospitalDischargeInstructionsSection() { + OperationsTestCase validateVDTInpatientSummaryHospitalDischargeInstructionsSectionTestCase = new OperationsTestCase( + "validateVDTInpatientSummaryHospitalDischargeInstructionsSection", + operationsForOCL.getOCLValue("VALIDATE_VDT_INPATIENT_SUMMARY_HOSPITAL_DISCHARGE_INSTRUCTIONS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VDTInpatientSummary target) { + + } + + @Override + protected void updateToPass(VDTInpatientSummary target) { + target.init(); + + /* HospitalDischargeInstructionsSection */ + HospitalDischargeInstructionsSection section = + + ConsolFactory.eINSTANCE.createHospitalDischargeInstructionsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VDTInpatientSummaryOperations.validateVDTInpatientSummaryHospitalDischargeInstructionsSection( + (VDTInpatientSummary) objectToTest, diagnostician, map); + } + + }; + + validateVDTInpatientSummaryHospitalDischargeInstructionsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateVDTInpatientSummaryHospitalAdmissionDiagnosisSection() { + OperationsTestCase validateVDTInpatientSummaryHospitalAdmissionDiagnosisSectionTestCase = new OperationsTestCase( + "validateVDTInpatientSummaryHospitalAdmissionDiagnosisSection", + operationsForOCL.getOCLValue("VALIDATE_VDT_INPATIENT_SUMMARY_HOSPITAL_ADMISSION_DIAGNOSIS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VDTInpatientSummary target) { + + } + + @Override + protected void updateToPass(VDTInpatientSummary target) { + target.init(); + + /* HospitalAdmissionDiagnosisSection */ + HospitalAdmissionDiagnosisSection section = + + ConsolFactory.eINSTANCE.createHospitalAdmissionDiagnosisSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VDTInpatientSummaryOperations.validateVDTInpatientSummaryHospitalAdmissionDiagnosisSection( + (VDTInpatientSummary) objectToTest, diagnostician, map); + } + + }; + + validateVDTInpatientSummaryHospitalAdmissionDiagnosisSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateVDTInpatientSummaryHospitalDischargeMedicationsSection() { + OperationsTestCase validateVDTInpatientSummaryHospitalDischargeMedicationsSectionTestCase = new OperationsTestCase( + "validateVDTInpatientSummaryHospitalDischargeMedicationsSection", + operationsForOCL.getOCLValue("VALIDATE_VDT_INPATIENT_SUMMARY_HOSPITAL_DISCHARGE_MEDICATIONS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(VDTInpatientSummary target) { + + } + + @Override + protected void updateToPass(VDTInpatientSummary target) { + target.init(); + + /* HospitalDischargeMedicationsSection */ + HospitalDischargeMedicationsSection section = + + ConsolFactory.eINSTANCE.createHospitalDischargeMedicationsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return VDTInpatientSummaryOperations.validateVDTInpatientSummaryHospitalDischargeMedicationsSection( + (VDTInpatientSummary) objectToTest, diagnostician, map); + } + + }; + + validateVDTInpatientSummaryHospitalDischargeMedicationsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetHospitalDischargeInstructionsSection() { + + VDTInpatientSummary target = objectFactory.create(); + target.getHospitalDischargeInstructionsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetHospitalAdmissionDiagnosisSection() { + + VDTInpatientSummary target = objectFactory.create(); + target.getHospitalAdmissionDiagnosisSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetChiefComplaintSection() { + + VDTInpatientSummary target = objectFactory.create(); + target.getChiefComplaintSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetReasonForVisitSection() { + + VDTInpatientSummary target = objectFactory.create(); + target.getReasonForVisitSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetChiefComplaintAndReasonForVisitSection() { + + VDTInpatientSummary target = objectFactory.create(); + target.getChiefComplaintAndReasonForVisitSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetHospitalDischargeMedicationsSection() { + + VDTInpatientSummary target = objectFactory.create(); + target.getHospitalDischargeMedicationsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPreoperativeDiagnosisSection() { + + VDTInpatientSummary target = objectFactory.create(); + target.getPreoperativeDiagnosisSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetHospitalAdmissionMedicationsSectionEntriesOptional() { + + VDTInpatientSummary target = objectFactory.create(); + target.getHospitalAdmissionMedicationsSectionEntriesOptional(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends VDTInpatientSummaryOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public VDTInpatientSummary create() { + return Mu2consolFactory.eINSTANCE.createVDTInpatientSummary(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends VDTInpatientSummaryOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // VDTInpatientSummaryOperations diff --git a/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/ViewDownloadTransmitSummaryTest.java b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/ViewDownloadTransmitSummaryTest.java new file mode 100644 index 000000000..24c8e0bfd --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/ViewDownloadTransmitSummaryTest.java @@ -0,0 +1,846 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.mu2consol.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.consol.AllergiesSection; +import org.openhealthtools.mdht.uml.cda.consol.ConsolFactory; +import org.openhealthtools.mdht.uml.cda.consol.MedicationsSection; +import org.openhealthtools.mdht.uml.cda.consol.PlanOfCareActivityAct; +import org.openhealthtools.mdht.uml.cda.consol.PlanOfCareActivityObservation; +import org.openhealthtools.mdht.uml.cda.consol.ProblemSection; +import org.openhealthtools.mdht.uml.cda.consol.VitalSignsSection; +import org.openhealthtools.mdht.uml.cda.mu2consol.AssessmentAndPlanSection; +import org.openhealthtools.mdht.uml.cda.mu2consol.Mu2consolFactory; +import org.openhealthtools.mdht.uml.cda.mu2consol.PlanOfCareSection; +import org.openhealthtools.mdht.uml.cda.mu2consol.ProceduresSection; +import org.openhealthtools.mdht.uml.cda.mu2consol.ResultsSection; +import org.openhealthtools.mdht.uml.cda.mu2consol.SmokingStatusObservation; +import org.openhealthtools.mdht.uml.cda.mu2consol.SocialHistorySection; +import org.openhealthtools.mdht.uml.cda.mu2consol.ViewDownloadTransmitSummary; +import org.openhealthtools.mdht.uml.cda.mu2consol.operations.ViewDownloadTransmitSummaryOperations; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; + +/** + * A static utility class that provides operations + * related to 'View Download Transmit Summary' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ViewDownloadTransmitSummary#validateViewDownloadTransmitSummaryCarePlanFields(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate View Download Transmit Summary Care Plan Fields}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ViewDownloadTransmitSummary#validateViewDownloadTransmitSummaryAllergiesSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate View Download Transmit Summary Allergies Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ViewDownloadTransmitSummary#validateViewDownloadTransmitSummaryMedicationsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate View Download Transmit Summary Medications Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ViewDownloadTransmitSummary#validateViewDownloadTransmitSummaryProblemSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate View Download Transmit Summary Problem Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ViewDownloadTransmitSummary#validateViewDownloadTransmitSummaryProceduresSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate View Download Transmit Summary Procedures Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ViewDownloadTransmitSummary#validateViewDownloadTransmitSummaryVitalSignsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate View Download Transmit Summary Vital Signs Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ViewDownloadTransmitSummary#validateViewDownloadTransmitSummaryResultsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate View Download Transmit Summary Results Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ViewDownloadTransmitSummary#validateViewDownloadTransmitSummaryPlanOfCareSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate View Download Transmit Summary Plan Of Care Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ViewDownloadTransmitSummary#validateViewDownloadTransmitSummarySocialHistorySection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate View Download Transmit Summary Social History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ViewDownloadTransmitSummary#validateViewDownloadTransmitSummaryAssessmentAndPlanSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate View Download Transmit Summary Assessment And Plan Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ViewDownloadTransmitSummary#validateViewDownloadTransmitSummaryMu2consolPlanOfCareSectionCarePlanningForPlanOfCare(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate View Download Transmit Summary Mu2consol Plan Of Care Section Care Planning For Plan Of Care}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ViewDownloadTransmitSummary#validateViewDownloadTransmitSummaryMu2consolPlanOfCareSectionPlanOfCareActivityObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate View Download Transmit Summary Mu2consol Plan Of Care Section Plan Of Care Activity Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ViewDownloadTransmitSummary#validateViewDownloadTransmitSummaryPlanOfCareSectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate View Download Transmit Summary Plan Of Care Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ViewDownloadTransmitSummary#validateViewDownloadTransmitSummarySocialHistorySectionTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate View Download Transmit Summary Social History Section Template Id}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ViewDownloadTransmitSummary#validateViewDownloadTransmitSummaryMu2consolSocialHistorySectionSmokingStatusObservation(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate View Download Transmit Summary Mu2consol Social History Section Smoking Status Observation}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ViewDownloadTransmitSummary#retrievePreoperativeDiagnosisSection() Retrieve Preoperative Diagnosis Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ViewDownloadTransmitSummary#getAllergiesSection() Get Allergies Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ViewDownloadTransmitSummary#getMedicationsSection() Get Medications Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ViewDownloadTransmitSummary#getProblemSection() Get Problem Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ViewDownloadTransmitSummary#getProceduresSection() Get Procedures Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ViewDownloadTransmitSummary#getVitalSignsSection() Get Vital Signs Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ViewDownloadTransmitSummary#getResultsSection() Get Results Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ViewDownloadTransmitSummary#getAssessmentAndPlanSection() Get Assessment And Plan Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ViewDownloadTransmitSummary#getPlanOfCareSection() Get Plan Of Care Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.mu2consol.ViewDownloadTransmitSummary#getSocialHistorySection() Get Social History Section}
  • + *
+ *

+ * + * @generated + */ + +public class ViewDownloadTransmitSummaryTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateViewDownloadTransmitSummaryCarePlanFields() { + OperationsTestCase validateViewDownloadTransmitSummaryCarePlanFieldsTestCase = new OperationsTestCase( + "validateViewDownloadTransmitSummaryCarePlanFields", + operationsForOCL.getOCLValue("VALIDATE_VIEW_DOWNLOAD_TRANSMIT_SUMMARY_CARE_PLAN_FIELDS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ViewDownloadTransmitSummary target) { + + } + + @Override + protected void updateToPass(ViewDownloadTransmitSummary target) { + target.init(); + AssessmentAndPlanSection aSection = Mu2consolFactory.eINSTANCE.createAssessmentAndPlanSection().init(); + target.addSection(aSection); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ViewDownloadTransmitSummaryOperations.validateViewDownloadTransmitSummaryCarePlanFields( + (ViewDownloadTransmitSummary) objectToTest, diagnostician, map); + } + + }; + + validateViewDownloadTransmitSummaryCarePlanFieldsTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateViewDownloadTransmitSummaryAllergiesSection() { + OperationsTestCase validateViewDownloadTransmitSummaryAllergiesSectionTestCase = new OperationsTestCase( + "validateViewDownloadTransmitSummaryAllergiesSection", + operationsForOCL.getOCLValue("VALIDATE_VIEW_DOWNLOAD_TRANSMIT_SUMMARY_ALLERGIES_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ViewDownloadTransmitSummary target) { + + } + + @Override + protected void updateToPass(ViewDownloadTransmitSummary target) { + target.init(); + + /* AllergiesSection */ + AllergiesSection section = + + ConsolFactory.eINSTANCE.createAllergiesSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ViewDownloadTransmitSummaryOperations.validateViewDownloadTransmitSummaryAllergiesSection( + (ViewDownloadTransmitSummary) objectToTest, diagnostician, map); + } + + }; + + validateViewDownloadTransmitSummaryAllergiesSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateViewDownloadTransmitSummaryMedicationsSection() { + OperationsTestCase validateViewDownloadTransmitSummaryMedicationsSectionTestCase = new OperationsTestCase( + "validateViewDownloadTransmitSummaryMedicationsSection", + operationsForOCL.getOCLValue("VALIDATE_VIEW_DOWNLOAD_TRANSMIT_SUMMARY_MEDICATIONS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ViewDownloadTransmitSummary target) { + + } + + @Override + protected void updateToPass(ViewDownloadTransmitSummary target) { + target.init(); + + /* MedicationsSection */ + MedicationsSection section = + + ConsolFactory.eINSTANCE.createMedicationsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ViewDownloadTransmitSummaryOperations.validateViewDownloadTransmitSummaryMedicationsSection( + (ViewDownloadTransmitSummary) objectToTest, diagnostician, map); + } + + }; + + validateViewDownloadTransmitSummaryMedicationsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateViewDownloadTransmitSummaryProblemSection() { + OperationsTestCase validateViewDownloadTransmitSummaryProblemSectionTestCase = new OperationsTestCase( + "validateViewDownloadTransmitSummaryProblemSection", + operationsForOCL.getOCLValue("VALIDATE_VIEW_DOWNLOAD_TRANSMIT_SUMMARY_PROBLEM_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ViewDownloadTransmitSummary target) { + + } + + @Override + protected void updateToPass(ViewDownloadTransmitSummary target) { + target.init(); + + /* ProblemSection */ + ProblemSection section = + + ConsolFactory.eINSTANCE.createProblemSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ViewDownloadTransmitSummaryOperations.validateViewDownloadTransmitSummaryProblemSection( + (ViewDownloadTransmitSummary) objectToTest, diagnostician, map); + } + + }; + + validateViewDownloadTransmitSummaryProblemSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateViewDownloadTransmitSummaryProceduresSection() { + OperationsTestCase validateViewDownloadTransmitSummaryProceduresSectionTestCase = new OperationsTestCase( + "validateViewDownloadTransmitSummaryProceduresSection", + operationsForOCL.getOCLValue("VALIDATE_VIEW_DOWNLOAD_TRANSMIT_SUMMARY_PROCEDURES_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ViewDownloadTransmitSummary target) { + + } + + @Override + protected void updateToPass(ViewDownloadTransmitSummary target) { + target.init(); + + /* ProceduresSection */ + ProceduresSection section = + + Mu2consolFactory.eINSTANCE.createProceduresSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ViewDownloadTransmitSummaryOperations.validateViewDownloadTransmitSummaryProceduresSection( + (ViewDownloadTransmitSummary) objectToTest, diagnostician, map); + } + + }; + + validateViewDownloadTransmitSummaryProceduresSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateViewDownloadTransmitSummaryVitalSignsSection() { + OperationsTestCase validateViewDownloadTransmitSummaryVitalSignsSectionTestCase = new OperationsTestCase( + "validateViewDownloadTransmitSummaryVitalSignsSection", + operationsForOCL.getOCLValue("VALIDATE_VIEW_DOWNLOAD_TRANSMIT_SUMMARY_VITAL_SIGNS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ViewDownloadTransmitSummary target) { + + } + + @Override + protected void updateToPass(ViewDownloadTransmitSummary target) { + target.init(); + + /* VitalSignsSection */ + VitalSignsSection section = + + ConsolFactory.eINSTANCE.createVitalSignsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ViewDownloadTransmitSummaryOperations.validateViewDownloadTransmitSummaryVitalSignsSection( + (ViewDownloadTransmitSummary) objectToTest, diagnostician, map); + } + + }; + + validateViewDownloadTransmitSummaryVitalSignsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateViewDownloadTransmitSummaryResultsSection() { + OperationsTestCase validateViewDownloadTransmitSummaryResultsSectionTestCase = new OperationsTestCase( + "validateViewDownloadTransmitSummaryResultsSection", + operationsForOCL.getOCLValue("VALIDATE_VIEW_DOWNLOAD_TRANSMIT_SUMMARY_RESULTS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ViewDownloadTransmitSummary target) { + + } + + @Override + protected void updateToPass(ViewDownloadTransmitSummary target) { + target.init(); + + /* ResultsSection */ + ResultsSection section = + + Mu2consolFactory.eINSTANCE.createResultsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ViewDownloadTransmitSummaryOperations.validateViewDownloadTransmitSummaryResultsSection( + (ViewDownloadTransmitSummary) objectToTest, diagnostician, map); + } + + }; + + validateViewDownloadTransmitSummaryResultsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateViewDownloadTransmitSummaryPlanOfCareSection() { + OperationsTestCase validateViewDownloadTransmitSummaryPlanOfCareSectionTestCase = new OperationsTestCase( + "validateViewDownloadTransmitSummaryPlanOfCareSection", + operationsForOCL.getOCLValue("VALIDATE_VIEW_DOWNLOAD_TRANSMIT_SUMMARY_PLAN_OF_CARE_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ViewDownloadTransmitSummary target) { + + } + + @Override + protected void updateToPass(ViewDownloadTransmitSummary target) { + target.init(); + + /* PlanOfCareSection */ + PlanOfCareSection section = + + Mu2consolFactory.eINSTANCE.createPlanOfCareSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ViewDownloadTransmitSummaryOperations.validateViewDownloadTransmitSummaryPlanOfCareSection( + (ViewDownloadTransmitSummary) objectToTest, diagnostician, map); + } + + }; + + validateViewDownloadTransmitSummaryPlanOfCareSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateViewDownloadTransmitSummarySocialHistorySection() { + OperationsTestCase validateViewDownloadTransmitSummarySocialHistorySectionTestCase = new OperationsTestCase( + "validateViewDownloadTransmitSummarySocialHistorySection", + operationsForOCL.getOCLValue("VALIDATE_VIEW_DOWNLOAD_TRANSMIT_SUMMARY_SOCIAL_HISTORY_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ViewDownloadTransmitSummary target) { + + } + + @Override + protected void updateToPass(ViewDownloadTransmitSummary target) { + target.init(); + + /* SocialHistorySection */ + SocialHistorySection section = + + Mu2consolFactory.eINSTANCE.createSocialHistorySection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ViewDownloadTransmitSummaryOperations.validateViewDownloadTransmitSummarySocialHistorySection( + (ViewDownloadTransmitSummary) objectToTest, diagnostician, map); + } + + }; + + validateViewDownloadTransmitSummarySocialHistorySectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateViewDownloadTransmitSummaryAssessmentAndPlanSectionTemplateId() { + OperationsTestCase validateViewDownloadTransmitSummaryAssessmentAndPlanSectionTemplateIdTestCase = new OperationsTestCase( + "validateViewDownloadTransmitSummaryAssessmentAndPlanSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_VIEW_DOWNLOAD_TRANSMIT_SUMMARY_ASSESSMENT_AND_PLAN_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ViewDownloadTransmitSummary target) { + AssessmentAndPlanSection aSection = Mu2consolFactory.eINSTANCE.createAssessmentAndPlanSection().init(); + for (II ii : aSection.getTemplateIds()) { + ii.setRoot(BAD_TEMPLATE_ID); + } + target.addSection(aSection); + } + + @Override + protected void updateToPass(ViewDownloadTransmitSummary target) { + AssessmentAndPlanSection aSection = Mu2consolFactory.eINSTANCE.createAssessmentAndPlanSection().init(); + II iiTemp = aSection.getTemplateIds().get(0); + + for (II ii : target.getAssessmentAndPlanSection().getTemplateIds()) { + ii.setRoot(iiTemp.getRoot()); + } + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ViewDownloadTransmitSummaryOperations.validateViewDownloadTransmitSummaryAssessmentAndPlanSectionTemplateId( + (ViewDownloadTransmitSummary) objectToTest, diagnostician, map); + } + + }; + + validateViewDownloadTransmitSummaryAssessmentAndPlanSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateViewDownloadTransmitSummaryMu2consolPlanOfCareSectionCarePlanningForPlanOfCare() { + OperationsTestCase validateViewDownloadTransmitSummarymu2consolPlanOfCareSectionCarePlanningForPlanOfCareTestCase = new OperationsTestCase( + "validateViewDownloadTransmitSummarymu2consolPlanOfCareSectionCarePlanningForPlanOfCare", + operationsForOCL.getOCLValue("VALIDATE_VIEW_DOWNLOAD_TRANSMIT_SUMMARYMU2CONSOL_PLAN_OF_CARE_SECTION_CARE_PLANNING_FOR_PLAN_OF_CARE__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ViewDownloadTransmitSummary target) { + PlanOfCareSection aSection = Mu2consolFactory.eINSTANCE.createPlanOfCareSection().init(); + target.addSection(aSection); + } + + @Override + protected void updateToPass(ViewDownloadTransmitSummary target) { + PlanOfCareActivityAct pAct = ConsolFactory.eINSTANCE.createPlanOfCareActivityAct().init(); + target.getPlanOfCareSection().addAct(pAct); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ViewDownloadTransmitSummaryOperations.validateViewDownloadTransmitSummaryMu2consolPlanOfCareSectionCarePlanningForPlanOfCare( + (ViewDownloadTransmitSummary) objectToTest, diagnostician, map); + } + + }; + + validateViewDownloadTransmitSummarymu2consolPlanOfCareSectionCarePlanningForPlanOfCareTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateViewDownloadTransmitSummaryMu2consolPlanOfCareSectionPlanOfCareActivityObservation() { + OperationsTestCase validateViewDownloadTransmitSummarymu2consolPlanOfCareSectionMu2consolPlanOfCareSectionPlanOfCareActivityObservationTestCase = new OperationsTestCase( + "validateViewDownloadTransmitSummarymu2consolPlanOfCareSectionMu2consolPlanOfCareSectionPlanOfCareActivityObservation", + operationsForOCL.getOCLValue("VALIDATE_VIEW_DOWNLOAD_TRANSMIT_SUMMARYMU2CONSOL_PLAN_OF_CARE_SECTION_MU2CONSOL_PLAN_OF_CARE_SECTION_PLAN_OF_CARE_ACTIVITY_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ViewDownloadTransmitSummary target) { + PlanOfCareSection pSection = Mu2consolFactory.eINSTANCE.createPlanOfCareSection().init(); + target.addSection(pSection); + } + + @Override + protected void updateToPass(ViewDownloadTransmitSummary target) { + PlanOfCareActivityObservation pObs = ConsolFactory.eINSTANCE.createPlanOfCareActivityObservation().init(); + target.getPlanOfCareSection().addObservation(pObs); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ViewDownloadTransmitSummaryOperations.validateViewDownloadTransmitSummaryMu2consolPlanOfCareSectionPlanOfCareActivityObservation( + (ViewDownloadTransmitSummary) objectToTest, diagnostician, map); + } + + }; + + validateViewDownloadTransmitSummarymu2consolPlanOfCareSectionMu2consolPlanOfCareSectionPlanOfCareActivityObservationTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateViewDownloadTransmitSummaryPlanOfCareSectionTemplateId() { + OperationsTestCase validateViewDownloadTransmitSummaryPlanOfCareSectionTemplateIdTestCase = new OperationsTestCase( + "validateViewDownloadTransmitSummaryPlanOfCareSectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_VIEW_DOWNLOAD_TRANSMIT_SUMMARY_PLAN_OF_CARE_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ViewDownloadTransmitSummary target) { + PlanOfCareSection pSection = Mu2consolFactory.eINSTANCE.createPlanOfCareSection().init(); + target.addSection(pSection); + for (II ii : pSection.getTemplateIds()) { + ii.setRoot(BAD_TEMPLATE_ID); + } + } + + @Override + protected void updateToPass(ViewDownloadTransmitSummary target) { + PlanOfCareSection pSection = Mu2consolFactory.eINSTANCE.createPlanOfCareSection().init(); + II iiTemp = pSection.getTemplateIds().get(0); + for (II ii : target.getPlanOfCareSection().getTemplateIds()) { + ii.setRoot(iiTemp.getRoot()); + } + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ViewDownloadTransmitSummaryOperations.validateViewDownloadTransmitSummaryPlanOfCareSectionTemplateId( + (ViewDownloadTransmitSummary) objectToTest, diagnostician, map); + } + + }; + + validateViewDownloadTransmitSummaryPlanOfCareSectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateViewDownloadTransmitSummarySocialHistorySectionTemplateId() { + OperationsTestCase validateViewDownloadTransmitSummarySocialHistorySectionTemplateIdTestCase = new OperationsTestCase( + "validateViewDownloadTransmitSummarySocialHistorySectionTemplateId", + operationsForOCL.getOCLValue("VALIDATE_VIEW_DOWNLOAD_TRANSMIT_SUMMARY_SOCIAL_HISTORY_SECTION_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ViewDownloadTransmitSummary target) { + SocialHistorySection sSection = Mu2consolFactory.eINSTANCE.createSocialHistorySection().init(); + target.addSection(sSection); + for (II ii : sSection.getTemplateIds()) { + ii.setRoot(BAD_TEMPLATE_ID); + } + } + + @Override + protected void updateToPass(ViewDownloadTransmitSummary target) { + SocialHistorySection sSection = Mu2consolFactory.eINSTANCE.createSocialHistorySection().init(); + II iiTemp = sSection.getTemplateIds().get(0); + + for (II ii : target.getSocialHistorySection().getTemplateIds()) { + ii.setRoot(iiTemp.getRoot()); + } + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ViewDownloadTransmitSummaryOperations.validateViewDownloadTransmitSummarySocialHistorySectionTemplateId( + (ViewDownloadTransmitSummary) objectToTest, diagnostician, map); + } + + }; + + validateViewDownloadTransmitSummarySocialHistorySectionTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateViewDownloadTransmitSummaryMu2consolSocialHistorySectionSmokingStatusObservation() { + OperationsTestCase validateViewDownloadTransmitSummarymu2consolSocialHistorySectionSmokingStatusObservationTestCase = new OperationsTestCase( + "validateViewDownloadTransmitSummarymu2consolSocialHistorySectionSmokingStatusObservation", + operationsForOCL.getOCLValue("VALIDATE_VIEW_DOWNLOAD_TRANSMIT_SUMMARYMU2CONSOL_SOCIAL_HISTORY_SECTION_SMOKING_STATUS_OBSERVATION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ViewDownloadTransmitSummary target) { + SocialHistorySection sSection = Mu2consolFactory.eINSTANCE.createSocialHistorySection().init(); + target.addSection(sSection); + } + + @Override + protected void updateToPass(ViewDownloadTransmitSummary target) { + SmokingStatusObservation sObs = Mu2consolFactory.eINSTANCE.createSmokingStatusObservation().init(); + target.getSocialHistorySection().addObservation(sObs); + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ViewDownloadTransmitSummaryOperations.validateViewDownloadTransmitSummaryMu2consolSocialHistorySectionSmokingStatusObservation( + (ViewDownloadTransmitSummary) objectToTest, diagnostician, map); + } + + }; + + validateViewDownloadTransmitSummarymu2consolSocialHistorySectionSmokingStatusObservationTestCase.doValidationTest(); + } + + /** + * + * @generated + */ + @Test + public void testGetAllergiesSection() { + + ViewDownloadTransmitSummary target = objectFactory.create(); + target.getAllergiesSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetMedicationsSection() { + + ViewDownloadTransmitSummary target = objectFactory.create(); + target.getMedicationsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProblemSection() { + + ViewDownloadTransmitSummary target = objectFactory.create(); + target.getProblemSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetProceduresSection() { + + ViewDownloadTransmitSummary target = objectFactory.create(); + target.getProceduresSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetVitalSignsSection() { + + ViewDownloadTransmitSummary target = objectFactory.create(); + target.getVitalSignsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetResultsSection() { + + ViewDownloadTransmitSummary target = objectFactory.create(); + target.getResultsSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetAssessmentAndPlanSection() { + + ViewDownloadTransmitSummary target = objectFactory.create(); + target.getAssessmentAndPlanSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetPlanOfCareSection() { + + ViewDownloadTransmitSummary target = objectFactory.create(); + target.getPlanOfCareSection(); + + } + + /** + * + * @generated + */ + @Test + public void testGetSocialHistorySection() { + + ViewDownloadTransmitSummary target = objectFactory.create(); + target.getSocialHistorySection(); + + } + + /** + * + * @generated + */ + private static class OperationsForOCL extends ViewDownloadTransmitSummaryOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated + */ + private static class ObjectFactory implements TestObjectFactory { + + public ViewDownloadTransmitSummary create() { + return Mu2consolFactory.eINSTANCE.createViewDownloadTransmitSummary(); + } + } + + /** + * + * @generated + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + private static class ConstructorTestClass extends ViewDownloadTransmitSummaryOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * + * @generated + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ViewDownloadTransmitSummaryOperations diff --git a/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/mu2consol_EcoreAllTests.java b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/mu2consol_EcoreAllTests.java new file mode 100644 index 000000000..fad590244 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.mu2consol.tests/src/org/openhealthtools/mdht/uml/cda/mu2consol/tests/mu2consol_EcoreAllTests.java @@ -0,0 +1,46 @@ +/** + * + * + * + * $Id$ + */ +package org.openhealthtools.mdht.uml.cda.mu2consol.tests; + +import junit.framework.Test; +import junit.framework.TestSuite; +import junit.textui.TestRunner; + +/** + * A test suite for the 'mu2consol_Ecore + * ' model. + * @generated + */ +public class mu2consol_EcoreAllTests extends TestSuite { + + /** + * + * @generated + */ + public static void main(String[] args) { + TestRunner.run(suite()); + } + + /** + * + * @generated + */ + public static Test suite() { + TestSuite suite = new mu2consol_EcoreAllTests("mu2consol_Ecore Tests"); + suite.addTest(Mu2consolTests.suite()); + return suite; + } + + /** + * + * @generated + */ + public mu2consol_EcoreAllTests(String name) { + super(name); + } + +} // mu2consol_EcoreAllTests diff --git a/org.openhealthtools.mdht.uml.cda.test/.classpath b/org.openhealthtools.mdht.uml.cda.test/.classpath new file mode 100644 index 000000000..64c5e31b7 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.openhealthtools.mdht.uml.cda.test/.project b/org.openhealthtools.mdht.uml.cda.test/.project new file mode 100644 index 000000000..71eeba654 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/.project @@ -0,0 +1,28 @@ + + + org.openhealthtools.mdht.uml.cda.test + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/org.openhealthtools.mdht.uml.cda.test/.settings/org.eclipse.jdt.core.prefs b/org.openhealthtools.mdht.uml.cda.test/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..fd79a3e6c --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,355 @@ +#Mon May 16 10:24:25 EDT 2011 +eclipse.preferences.version=1 +org.eclipse.jdt.core.codeComplete.argumentPrefixes= +org.eclipse.jdt.core.codeComplete.argumentSuffixes= +org.eclipse.jdt.core.codeComplete.fieldPrefixes= +org.eclipse.jdt.core.codeComplete.fieldSuffixes= +org.eclipse.jdt.core.codeComplete.localPrefixes= +org.eclipse.jdt.core.codeComplete.localSuffixes= +org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.5 +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.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning +org.eclipse.jdt.core.compiler.problem.deadCode=warning +org.eclipse.jdt.core.compiler.problem.deprecation=warning +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore +org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=error +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore +org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning +org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +org.eclipse.jdt.core.compiler.problem.nullReference=warning +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore +org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=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 +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedImport=warning +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +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.5 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=36 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=36 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=36 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=36 +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_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=49 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=32 +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_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=0 +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 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=1 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=150 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@fmtOff +org.eclipse.jdt.core.formatter.enabling_tag=@fmtOn +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +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=true +org.eclipse.jdt.core.formatter.indentation.size=4 +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_parameter=do not 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=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +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_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_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 +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +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_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 +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +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_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not 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_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 +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +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_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 +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +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_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_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 +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=false +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=120 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +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=false +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/org.openhealthtools.mdht.uml.cda.test/.settings/org.eclipse.jdt.ui.prefs b/org.openhealthtools.mdht.uml.cda.test/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 000000000..6245d2099 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,120 @@ +#Tue Mar 29 22:38:51 EDT 2011 +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=false +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=false +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=false +cleanup.format_source_code=true +cleanup.format_source_code_changes_only=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=false +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=true +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=true +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=true +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_blocks=true +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_parentheses_in_expressions=false +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup_profile=_MDHT +cleanup_settings_version=2 +eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true +formatter_profile=_MDHT +formatter_settings_version=11 +org.eclipse.jdt.ui.exception.name=e +org.eclipse.jdt.ui.gettersetter.use.is=true +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com; +org.eclipse.jdt.ui.javadoc=true +org.eclipse.jdt.ui.keywordthis=false +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.overrideannotation=true +org.eclipse.jdt.ui.staticondemandthreshold=99 +org.eclipse.jdt.ui.text.custom_code_templates= +sp_cleanup.add_default_serial_version_id=true +sp_cleanup.add_generated_serial_version_id=false +sp_cleanup.add_missing_annotations=true +sp_cleanup.add_missing_deprecated_annotations=true +sp_cleanup.add_missing_methods=false +sp_cleanup.add_missing_nls_tags=false +sp_cleanup.add_missing_override_annotations=true +sp_cleanup.add_missing_override_annotations_interface_methods=false +sp_cleanup.add_serial_version_id=false +sp_cleanup.always_use_blocks=true +sp_cleanup.always_use_parentheses_in_expressions=false +sp_cleanup.always_use_this_for_non_static_field_access=false +sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.convert_to_enhanced_for_loop=false +sp_cleanup.correct_indentation=false +sp_cleanup.format_source_code=true +sp_cleanup.format_source_code_changes_only=false +sp_cleanup.make_local_variable_final=false +sp_cleanup.make_parameters_final=false +sp_cleanup.make_private_fields_final=true +sp_cleanup.make_type_abstract_if_missing_method=false +sp_cleanup.make_variable_declarations_final=false +sp_cleanup.never_use_blocks=false +sp_cleanup.never_use_parentheses_in_expressions=true +sp_cleanup.on_save_use_additional_actions=true +sp_cleanup.organize_imports=true +sp_cleanup.qualify_static_field_accesses_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_with_declaring_class=false +sp_cleanup.qualify_static_method_accesses_with_declaring_class=false +sp_cleanup.remove_private_constructors=true +sp_cleanup.remove_trailing_whitespaces=true +sp_cleanup.remove_trailing_whitespaces_all=true +sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +sp_cleanup.remove_unnecessary_casts=true +sp_cleanup.remove_unnecessary_nls_tags=false +sp_cleanup.remove_unused_imports=false +sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_private_fields=true +sp_cleanup.remove_unused_private_members=false +sp_cleanup.remove_unused_private_methods=true +sp_cleanup.remove_unused_private_types=true +sp_cleanup.sort_members=false +sp_cleanup.sort_members_all=false +sp_cleanup.use_blocks=false +sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_parentheses_in_expressions=false +sp_cleanup.use_this_for_non_static_field_access=false +sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true +sp_cleanup.use_this_for_non_static_method_access=false +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/org.openhealthtools.mdht.uml.cda.test/META-INF/MANIFEST.MF b/org.openhealthtools.mdht.uml.cda.test/META-INF/MANIFEST.MF new file mode 100644 index 000000000..cb93bc1a1 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/META-INF/MANIFEST.MF @@ -0,0 +1,17 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Test +Bundle-SymbolicName: org.openhealthtools.mdht.uml.cda.test +Bundle-Version: 1.1.0.qualifier +Bundle-RequiredExecutionEnvironment: J2SE-1.5 +Require-Bundle: org.junit4, + org.eclipse.core.runtime, + org.eclipse.emf.ecore;visibility:=reexport, + org.eclipse.emf.ecore.xmi;visibility:=reexport, + org.openhealthtools.mdht.uml.cda;visibility:=reexport, + org.openhealthtools.mdht.uml.hl7.datatypes;visibility:=reexport, + org.openhealthtools.mdht.uml.hl7.vocab;visibility:=reexport, + org.eclipse.ocl.ecore;visibility:=reexport, + org.apache.commons.lang;visibility:=reexport +Export-Package: org.openhealthtools.mdht.uml.cda.operations, + org.openhealthtools.mdht.uml.cda.tests diff --git a/org.openhealthtools.mdht.uml.cda.test/build.properties b/org.openhealthtools.mdht.uml.cda.test/build.properties new file mode 100644 index 000000000..9ce54df75 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/build.properties @@ -0,0 +1,17 @@ +############################################################################### +# Copyright (c) 2010, 2011 IBM Corporation and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# IBM Corporation - initial API and implementation +############################################################################### +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + junit-frames.xsl,\ + end.tag,\ + start.tag diff --git a/org.openhealthtools.mdht.uml.cda.test/end.tag b/org.openhealthtools.mdht.uml.cda.test/end.tag new file mode 100644 index 000000000..a30c9acbc --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/end.tag @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/org.openhealthtools.mdht.uml.cda.test/junit-frames.xsl b/org.openhealthtools.mdht.uml.cda.test/junit-frames.xsl new file mode 100644 index 000000000..6b1278f27 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/junit-frames.xsl @@ -0,0 +1,1001 @@ + + + + + + + + + + + + + + +Unit Test Results. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + . + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <xsl:value-of select="$TITLE"/> + + + + + + + + + <h2>Frame Alert</h2> + <p> + This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. + </p> + + + + + + + +body { + font:normal 68% verdana,arial,helvetica; + color:#000000; +} +table tr td, table tr th { + font-size: 68%; +} +table.details tr th{ + font-weight: bold; + text-align:left; + background:#a6caf0; +} +table.details tr td{ + background:#eeeee0; +} + +p { + line-height:1.5em; + margin-top:0.5em; margin-bottom:1.0em; +} +h1 { + margin: 0px 0px 5px; font: 165% verdana,arial,helvetica +} +h2 { + margin-top: 1em; margin-bottom: 0.5em; font: bold 125% verdana,arial,helvetica +} +h3 { + margin-bottom: 0.5em; font: bold 115% verdana,arial,helvetica +} +h4 { + margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica +} +h5 { + margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica +} +h6 { + margin-bottom: 0.5em; font: bold 100% verdana,arial,helvetica +} +.Error { + font-weight:bold; color:red; +} +.Failure { + font-weight:bold; color:purple; +} +.Properties { + text-align:right; +} + + + + + + + + + + All Failures + + + All Errors + + + All Tests + + + + + Unit Test Results: <xsl:value-of select="$title"/> + + + + + + open('allclasses-frame.html','classListFrame') + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + +
+ + + + + + + . + + + Unit Test Results: <xsl:value-of select="$class.name"/> + + + + + + + + +

Class

+ + + + + +
+ + + +

Failures

+
+ +

Errors

+
+ +

Tests

+
+
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ + + + cur = TestCases['.'] = new Array(); + + + cur[''] = ''; + + + + + + + + + + + Unit Test Classes: <xsl:value-of select="$name"/> + + + + + + + + + +
+

+ + <none> +

+
+ +

Classes

+ + + + + + + +
+ +
+ + +
+ + + + + + + All Unit Test Classes + + + + + +

Classes

+ + + + +
+ + +
+ + + + + + + + + / + _.html + + + + + + + + + + + + + All Unit Test Packages + + + + + +

Home

+

Packages

+ + + + +
+ + +
+ + + + + + + <none> + + + + + + + + + + Unit Test Results: Summary + + + + + + open('allclasses-frame.html','classListFrame') + +

Summary

+ + + + + + + + + + + + + + + + + Error + Failure + Pass + + + + + + + + +
TestsFailuresErrorsSuccess rateTime
+ + + + + + + +
+ + + + +
+ Note: failures are anticipated and checked for with assertions while errors are unanticipated. +
+ +

Packages

+ + + + + + + + + + + Error + Failure + Pass + + + + + + + + + + + +
+ + <none> + + + + +
+ + +
+ + + + + + + + + + + + open('package-frame.html','classListFrame') + +

Package

+ + + + + +

Classes

+

+ + + + + +
+

+
+ + +
+ + + + + + + ../ + + + + + + ../ + + + + + + + + stylesheet.css + + + + + +

+ + + + + +
Designed for use with JUnit and Ant.
+
+
+ + + + + Name + Tests + Errors + Failures + Time(s) + Time Stamp + Host + + + + + + + + + Class + + Name + Status + Result + + + Time(s) + + + + + + + + + + Error + Failure + Pass + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Error + Failure + TableRowColor + + + + + + + + + + + + + + + + +

Constraint

+

+

+ + + + + +

+

+

OCL
+

+

+ + + + +

+
+ + + + + Failure + Invalid XML +

+ + + +

+ Valid XML +

+ + + +

+
+ + Error + Invalid XML +

+ + + +

+ Valid XML +

+ + + +

+
+ + Success + + Invalid XML +

+ + + +

+ Valid XML +

+ + + +

+ +
+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + N/A + + + + + +

+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ + + + + + + + +

+
+ + + +

+ + + + + + + + +

+
+ + + +

+ + + + + + + + +

+
+ + + +

+ + + + + + + + + +

+
+ + +
diff --git a/org.openhealthtools.mdht.uml.cda.test/plugin.properties b/org.openhealthtools.mdht.uml.cda.test/plugin.properties new file mode 100644 index 000000000..261df1118 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/plugin.properties @@ -0,0 +1,12 @@ +############################################################################### +# Copyright (c) 2010, 2011 IBM Corporation and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# IBM Corporation - initial API and implementation +############################################################################### +pluginName = CDA Tests +providerName = www.example.org diff --git a/org.openhealthtools.mdht.uml.cda.test/resources/SampleCDADocument.xml b/org.openhealthtools.mdht.uml.cda.test/resources/SampleCDADocument.xml new file mode 100644 index 000000000..83ddcffbf --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/resources/SampleCDADocument.xml @@ -0,0 +1,1098 @@ + + + + + + + + + + Good Health Clinic Consultation Note + + + + + + + + + + + Henry + Levin + the 7th + + + + + + + + + + + + + + + + Good Health Clinic + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + History of Present Illness + + Henry Levin, the 7th + is a 67 year old male referred for further asthma management. Onset of asthma in his twenties + teens. He was hospitalized twice last year, and already twice this year. He has not been able to be weaned off steroids for the past several months. + +
+
+ + +
+ + Past Medical History + + + + Asthma + + + Hypertension (see HTN.cda for details) + + + Osteoarthritis, + right knee + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + Medications + + + Theodur 200mg BID + Proventil inhaler 2puffs QID PRN + Prednisone 20mg qd + HCTZ 25mg qd + + + + + Theodur 200mg BID + + + + + + + + + + + + + + + + + Proventil inhaler 2puffs QID PRN + + + + + + + + + + + + + + + + + + + Prednisone 20mg qd + + + + + + + + + + + + + + + + + HCTZ 25mg qd + + + + + + + + + + + + + +
+
+ + +
+ + Allergies and Adverse Reactions + + + Penicillin - Hives + Aspirin - Wheezing + Codeine - Itching and nausea + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + Family history + + + Father had fatal MI in his early 50's. + No cancer or diabetes. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + Social History + + + Smoking :: 1 PPD between the ages of 20 and 55, and then he quit. + Alcohol :: rare + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + Physical Examination + + +
+ + Vital Signs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Date / TimeApril 7, 2000 14:30April 7, 2000 15:30
Height177 cm (69.7 in)
Weight194.0 lbs (88.0 kg)
BMI28.1 kg/m2
BSA2.05 m2
Temperature36.9 C (98.5 F)36.9 C (98.5 F)
Pulse86 / minute84 / minute
RhythmRegularRegular
Respirations16 / minute, unlabored14 / minute
Systolic132 mmHg135 mmHg
Diastolic86 mmHg88 mmHg
Position / CuffLeft ArmLeft Arm
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + Skin Exam + Erythematous rash, palmar surface, left index finger. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + Lungs + Clear with no wheeze. Good air flow. + + + + + + + + + + + + + + +
+
+ + +
+ + Cardiac + RRR with no murmur, no S3, no S4. + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + +
+ + Labs + + + CXR 02/03/1999: Hyperinflated. Normal cardiac silhouette, clear lungs. + Peak Flow today: 260 l/m + + + + + + + + + + + + + + + + + normal cardiac silhouette + + + + + + + + radiopacities + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + In-office Procedures + + + Suture removal, left forearm. + + + + + + + + + + +
+
+ + +
+ + Assessment + + + Asthma, with prior smoking history. Difficulty weaning off steroids. Will try gradual taper. + Hypertension, well-controlled. + Contact dermatitis on finger. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + Plan + + + Complete PFTs with lung volumes. + Chem-7 tomorrow. + Teach peak flow rate measurement. + Decrease prednisone to 20qOD alternating with 18qOD. + Hydrocortisone cream to finger BID. + RTC 1 week. + + + + + + + Complete PFTs with lung volumes. + + + + + + + + + + + Chem-7 + + + Chem-7 tomorrow + + + + + + + + + + + + + + + + + prednisone 20qOD alternating with 18qOD. + + + + + + + + + + + + + Hydrocortisone cream to finger BID. + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
diff --git a/org.openhealthtools.mdht.uml.cda.test/resources/emx2uml.xsl b/org.openhealthtools.mdht.uml.cda.test/resources/emx2uml.xsl new file mode 100644 index 000000000..8274f31aa --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/resources/emx2uml.xsl @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/ActOperationsTest.java b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/ActOperationsTest.java new file mode 100644 index 000000000..c5799e867 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/ActOperationsTest.java @@ -0,0 +1,777 @@ +/******************************************************************************* + * Copyright (c) 2010, 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.operations; + +import static org.junit.Assert.assertTrue; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.openhealthtools.mdht.uml.cda.Act; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.CDAPackage; +import org.openhealthtools.mdht.uml.cda.ClinicalDocument; +import org.openhealthtools.mdht.uml.cda.Encounter; +import org.openhealthtools.mdht.uml.cda.Observation; +import org.openhealthtools.mdht.uml.cda.ObservationMedia; +import org.openhealthtools.mdht.uml.cda.Organizer; +import org.openhealthtools.mdht.uml.cda.Procedure; +import org.openhealthtools.mdht.uml.cda.RegionOfInterest; +import org.openhealthtools.mdht.uml.cda.Section; +import org.openhealthtools.mdht.uml.cda.SubstanceAdministration; +import org.openhealthtools.mdht.uml.cda.Supply; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; + +/** + * This class is a JUnit4 test case. + */ +public class ActOperationsTest extends ClinicalStatementOperationsTest { + + @SuppressWarnings("nls") + private static final CDATestCase TEST_CASE_ARRAY[] = { + // Act + // ------------------------------------------------------------- + new CDAAddTestCase("Act") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createAct(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addAct((Act) objectToTest, (Act) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_Act(); + } + }, + + // Encounter + // ------------------------------------------------------------- + new CDAAddTestCase("Encounter") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createEncounter(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addEncounter((Act) objectToTest, (Encounter) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_Encounter(); + } + }, + + // Observation + // ------------------------------------------------------------- + new CDAAddTestCase("Observation") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservation(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addObservation((Act) objectToTest, (Observation) eObjectToAdd); + + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_Observation(); + } + }, + + // ObservationMedia + // ------------------------------------------------------------- + new CDAAddTestCase("ObservationMedia") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservationMedia(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addObservationMedia((Act) objectToTest, (ObservationMedia) eObjectToAdd); + + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_ObservationMedia(); + } + }, + + // Organizer + // ------------------------------------------------------------- + new CDAAddTestCase("Organizer") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createOrganizer(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addOrganizer((Act) objectToTest, (Organizer) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_Organizer(); + } + }, + + // Procedure + // ------------------------------------------------------------- + new CDAAddTestCase("Procedure") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createProcedure(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addProcedure((Act) objectToTest, (Procedure) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_Procedure(); + } + }, + + // RegionOfInterest + // ------------------------------------------------------------- + new CDAAddTestCase("RegionOfInterest") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createRegionOfInterest(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addRegionOfInterest((Act) objectToTest, (RegionOfInterest) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_RegionOfInterest(); + } + }, + + // SubstanceAdministration + // ------------------------------------------------------------- + new CDAAddTestCase("SubstanceAdministration") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSubstanceAdministration(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addSubstanceAdministration( + (Act) objectToTest, (SubstanceAdministration) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_SubstanceAdministration(); + } + }, + + // Supply + // ------------------------------------------------------------- + new CDAAddTestCase("Supply") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSupply(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addSupply((Act) objectToTest, (Supply) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_Supply(); + } + }, + // ************************************************************************* + // Act + // ------------------------------------------------------------- + new CDAGetTestCase("Act") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createAct(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addAct((Act) objectToTest, (Act) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getActs((Act) objectToTest); + } + }, + + // Encounter + // ------------------------------------------------------------- + new CDAGetTestCase("Encounter") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createEncounter(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addEncounter((Act) objectToTest, (Encounter) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getEncounters((Act) objectToTest); + } + + }, + + // Observation + // ------------------------------------------------------------- + new CDAGetTestCase("Observation") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservation(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addObservation((Act) objectToTest, (Observation) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getObservations((Act) objectToTest); + } + }, + + // ObservationMedia + // ------------------------------------------------------------- + new CDAGetTestCase("ObservationMedia") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservationMedia(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addObservationMedia((Act) objectToTest, (ObservationMedia) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getObservationMedia((Act) objectToTest); + } + }, + + // Organizer + // ------------------------------------------------------------- + new CDAGetTestCase("Organizer") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createOrganizer(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addOrganizer((Act) objectToTest, (Organizer) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getOrganizers((Act) objectToTest); + } + }, + + // Procedure + // ------------------------------------------------------------- + new CDAGetTestCase("Procedure") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createProcedure(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addProcedure((Act) objectToTest, (Procedure) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getProcedures((Act) objectToTest); + } + }, + + // RegionOfInterest + // ------------------------------------------------------------- + new CDAGetTestCase("RegionOfInterest") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createRegionOfInterest(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addRegionOfInterest((Act) objectToTest, (RegionOfInterest) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getRegionsOfInterest((Act) objectToTest); + } + }, + + // SubstanceAdministration + // ------------------------------------------------------------- + new CDAGetTestCase("SubstanceAdministration") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSubstanceAdministration(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addSubstanceAdministration( + (Act) objectToTest, (SubstanceAdministration) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getSubstanceAdministrations((Act) objectToTest); + } + }, + + // Supply + // ------------------------------------------------------------- + new CDAGetTestCase("Supply") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSupply(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addSupply((Act) objectToTest, (Supply) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getSupplies((Act) objectToTest); + } + }, + + // ClinicalDocument + // ------------------------------------------------------------- + new CDAGetTestCase("ClinicalDocument") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createClinicalDocument(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + // The Add is reversed, the objectToTest is added to the + // clinical document + final Section section = CDAFactory.eINSTANCE.createSection(); + section.addAct((Act) objectToTest); + ((ClinicalDocument) eObjectToAdd).addSection(section); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getClinicalDocument((Act) objectToTest); + } + + @Override + protected boolean isGetGood(final EObject eObjectToAdd, final Object value) { + return eObjectToAdd.equals(value); + } + }, + + // Section + // ------------------------------------------------------------- + new CDAGetTestCase("Section") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSection(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + // The Add is reversed, the objectToTest is added to the + // clinical document + ((Section) eObjectToAdd).addAct((Act) objectToTest); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getSection((Act) objectToTest); + } + + @Override + protected boolean isGetGood(final EObject eObjectToAdd, final Object value) { + return eObjectToAdd.equals(value); + } + }, + + // ************************************************************************* + // Act + // ------------------------------------------------------------- + new CDAHasTestCase("Act") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createAct(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addAct((Act) objectToTest, (Act) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasActTemplate((Act) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Act) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Encounter + // ------------------------------------------------------------- + new CDAHasTestCase("Encounter") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createEncounter(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addEncounter((Act) objectToTest, (Encounter) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasEncounterTemplate((Act) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Encounter) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Code + // ------------------------------------------------------------- + new CDAHasTestCase("Code") { + + @Override + protected void doTest(final EObject objectToTest, final BasicDiagnostic diagnostician, + final Map map) { + ((Act) objectToTest).setCode(THE_CODE); + final boolean hasIsGood = doHas(objectToTest, TEMPLATE_ID); + assertTrue("Has \"" + getTestTargetDescription() + "\" failed for \"" + + objectToTest.eClass().getName() + "\"", hasIsGood); + } + + @Override + protected EObject getEObjectToAdd() { + return null; + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addEncounter((Act) objectToTest, (Encounter) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasCode((Act) objectToTest, CODE, CODE_SYSTEM, CODE_SYSTEM_NAME); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Encounter) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Observation + // ------------------------------------------------------------- + new CDAHasTestCase("Observation") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservation(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addObservation((Act) objectToTest, (Observation) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasObservationTemplate((Act) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Observation) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // ObservationMedia + // ------------------------------------------------------------- + new CDAHasTestCase("ObservationMedia") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservationMedia(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addObservationMedia((Act) objectToTest, (ObservationMedia) eObjectToAdd); + + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasObservationMediaTemplate((Act) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((ObservationMedia) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Organizer + // ------------------------------------------------------------- + new CDAHasTestCase("Organizer") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createOrganizer(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addOrganizer((Act) objectToTest, (Organizer) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasOrganizerTemplate((Act) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Organizer) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Procedure + // ------------------------------------------------------------- + new CDAHasTestCase("Procedure") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createProcedure(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addProcedure((Act) objectToTest, (Procedure) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasProcedureTemplate((Act) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Procedure) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // RegionOfInterest + // ------------------------------------------------------------- + new CDAHasTestCase("RegionOfInterest") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createRegionOfInterest(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addRegionOfInterest((Act) objectToTest, (RegionOfInterest) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasRegionOfInterestTemplate((Act) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((RegionOfInterest) eObjectToAdd).getTemplateIds().add(theIi); + } + + }, + + // SubstanceAdministration + // ------------------------------------------------------------- + new CDAHasTestCase("SubstanceAdministration") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSubstanceAdministration(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addSubstanceAdministration( + (Act) objectToTest, (SubstanceAdministration) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasSubstanceAdministrationTemplate( + (Act) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((SubstanceAdministration) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Supply + // ------------------------------------------------------------- + new CDAHasTestCase("Supply") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSupply(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addSupply((Act) objectToTest, (Supply) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasSupplyTemplate((Act) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Supply) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // TemplateID + // ------------------------------------------------------------- + new CDAHasTestCase("TemplateID") { + + @Override + protected void doTest(final EObject objectToTest, final BasicDiagnostic diagnostician, + final Map map) { + ((Act) objectToTest).getTemplateIds().add(THE_II); + final boolean hasIsGood = doHas(objectToTest, TEMPLATE_ID); + assertTrue("Has \"" + getTestTargetDescription() + "\" failed for \"" + + objectToTest.eClass().getName() + "\"", hasIsGood); + } + + @Override + protected EObject getEObjectToAdd() { + return null; + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + // Nothing + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasTemplateId((Act) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + // Nothing + } + } }; + + @Override + protected List getTestCases() { + // Return a new List because the one returned by Arrays.asList is + // unmodifiable so a sub-class can't append their test cases. + final List retValue = super.getTestCases(); + retValue.addAll(Arrays.asList(TEST_CASE_ARRAY)); + return retValue; + } + + @Override + protected EObject getObjectToTest() { + return CDAFactory.eINSTANCE.createAct(); + } + +} // ActOperationsTest diff --git a/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/AllCDAOperationsTests.java b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/AllCDAOperationsTests.java new file mode 100644 index 000000000..be769d48e --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/AllCDAOperationsTests.java @@ -0,0 +1,32 @@ +/******************************************************************************* + * Copyright (c) 2010, 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.operations; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +/** + * This class represents a suite of JUnit 4 test cases for CDA document + * processing. + */ +@RunWith(Suite.class) +@Suite.SuiteClasses({ + ActOperationsTest.class, AssignedAuthorOperationsTest.class, ClinicalDocumentOperationsTest.class, + Component2OperationsTest.class, Component4OperationsTest.class, EncounterOperationsTest.class, + EntryOperationsTest.class, EntryRelationshipOperationsTest.class, GuardianOperationsTest.class, + Informant12OperationsTest.class, ManufacturedProductOperationsTest.class, ObservationMediaOperationsTest.class, + ObservationOperationsTest.class, OrganizerOperationsTest.class, ParticipantRoleOperationsTest.class, + ProcedureOperationsTest.class, ReferenceOperationsTest.class, RegionOfInterestOperationsTest.class, + SectionOperationsTest.class, StrucDocTextOperationsTest.class, SubstanceAdministrationOperationsTest.class, + SupplyOperationsTest.class }) +public class AllCDAOperationsTests { + // Nothing +} // AllCDATests diff --git a/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/AssignedAuthorOperationsTest.java b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/AssignedAuthorOperationsTest.java new file mode 100644 index 000000000..e3b174ec9 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/AssignedAuthorOperationsTest.java @@ -0,0 +1,79 @@ +/******************************************************************************* + * Copyright (c) 2010, 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.operations; + +import static org.junit.Assert.assertTrue; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.AssignedAuthor; +import org.openhealthtools.mdht.uml.cda.CDAFactory; + +/** + * This class is a JUnit4 test case. + */ +@SuppressWarnings("nls") +public class AssignedAuthorOperationsTest extends CDAValidationTest { + + /** + * The names of the references to include in the test. + */ + public static final Set EREFERENCE_NAMES = new HashSet(Arrays.asList( + "assignedPerson", "assignedAuthoringDevice")); + + private static final CDATestCase TEST_CASE_ARRAY[] = { + // UndefinedOR + // ------------------------------------------------------------- + new UndefinedORValidationTestCase("AssignedAuthor", EREFERENCE_NAMES) { + + @Override + protected boolean validate(final EObject objectToTest, final BasicDiagnostic diagnostician, + final Map map) { + return AssignedAuthorOperations.validateAssignedAuthorChoice( + (AssignedAuthor) objectToTest, diagnostician, map); + } + } }; + + @Override + protected List getTestCases() { + // Return a new List because the one returned by Arrays.asList is + // unmodifiable so a sub-class can't append their test cases. + final List retValue = super.getTestCases(); + retValue.addAll(Arrays.asList(TEST_CASE_ARRAY)); + return retValue; + } + + /** + * Not a real test, needed for EMMA to report 100% method coverage. + */ + @SuppressWarnings("unused") + @Test + public final void testConstructor() { + AssignedAuthorOperations obj = new AssignedAuthorOperations(); + assertTrue(true); + } // testConstructor + + /** + * @see org.openhealthtools.mdht.uml.cda.operations.MutualExclusionValidationTest#getObjectToTest() + */ + @Override + protected EObject getObjectToTest() { + return CDAFactory.eINSTANCE.createAssignedAuthor(); + } + +} // AssignedAuthorOperationsTest diff --git a/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/CDAValidationTest.java b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/CDAValidationTest.java new file mode 100644 index 000000000..c27e899d5 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/CDAValidationTest.java @@ -0,0 +1,998 @@ +/******************************************************************************* + * Copyright (c) 2010, 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + * Sean Muir (JKM Software) -Operation Test and generation + * Christian W. Damus - Add NarrativeReferenceTestCase for constraints on CDA R2 narrative text references (artf2815) + * + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.operations; + +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import java.io.BufferedWriter; +import java.io.ByteArrayOutputStream; +import java.io.FileWriter; +import java.io.OutputStream; +import java.io.StringReader; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.apache.commons.lang.StringEscapeUtils; +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.common.util.Diagnostic; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EClassifier; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.util.Diagnostician; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.emf.ecore.util.ExtendedMetaData; +import org.eclipse.emf.ecore.util.FeatureMapUtil; +import org.eclipse.emf.ecore.xmi.XMLResource; +import org.eclipse.emf.ecore.xmi.util.XMLProcessor; +import org.eclipse.emf.ecore.xml.type.AnyType; +import org.junit.Assert; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.ClinicalDocument; +import org.openhealthtools.mdht.uml.cda.ClinicalStatement; +import org.openhealthtools.mdht.uml.cda.Entry; +import org.openhealthtools.mdht.uml.cda.Section; +import org.openhealthtools.mdht.uml.cda.StrucDocText; +import org.openhealthtools.mdht.uml.cda.util.CDAUtil; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.CS; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.rim.InfrastructureRoot; +import org.xml.sax.InputSource; + +/** + * This class is the super class for all JUnit4 test cases for CDA based + * classes. + */ +@SuppressWarnings("nls") +public abstract class CDAValidationTest { + + protected abstract EObject getObjectToTest(); + + /** + * This is not currently used, but is implemented in many subclasses. + * + * @return the initialized EObject instance to test + */ + protected EObject getObjectInitToTest() { + return null; + } + + /** + * The template id to use for the has* tests. + */ + protected static final String BAD_TEMPLATE_ID = "1.2.3.4"; + + protected static final II THE_BAD_II = DatatypesFactory.eINSTANCE.createII(); + + static { + THE_BAD_II.setRoot(BAD_TEMPLATE_ID); + } + + // protected static int count = 0; + + protected static Map map = new HashMap(); + + protected List getTestCases() { + return new ArrayList(); + } + + static abstract protected class CDATestCase { + private final String testTargetDescription; + + /** + * @param testTargetDescription + */ + protected CDATestCase(final String testTargetDescription) { + this.testTargetDescription = testTargetDescription; + + } + + abstract protected void doTest(final EObject objectToTest, final BasicDiagnostic diagnostician, + final Map map); + + protected String getTestTargetDescription() { + return testTargetDescription; + } + + @Override + public String toString() { + return getTestTargetDescription(); + } + + } // CDATestCase + + static abstract protected class CDAOperationsTestCase extends CDATestCase { + + protected CDAOperationsTestCase(final String testTargetDescription) { + super(testTargetDescription); + } + + abstract protected void doAdd(EObject objectToTest, EObject eObjectToAdd); + + abstract protected EObject getEObjectToAdd(); + + } // CDAOperationsTestCase + + static abstract protected class CDAAddTestCase extends CDAOperationsTestCase { + + protected CDAAddTestCase(final String testTargetDescription) { + super(testTargetDescription); + } + + @Override + protected void doTest(final EObject objectToTest, final BasicDiagnostic diagnostician, + final Map map) { + final EObject eObjectToAdd = getEObjectToAdd(); + doAdd(objectToTest, eObjectToAdd); + final boolean isFound = isFound(objectToTest, eObjectToAdd, getFeature()); + assertTrue("Add \"" + getTestTargetDescription() + "\" failed for \"" + objectToTest.eClass().getName() + + "\"", isFound); + } // doTest + + abstract protected EStructuralFeature getFeature(); + + protected boolean isFound(final EObject objectToTest, final EObject eObjectToFind, + final EStructuralFeature feature) { + return eObjectToFind.eContainingFeature().equals(feature) && + eObjectToFind.eContainer().eContainer().equals(objectToTest); + } // isFound + } // CDAAddTestCase + + static abstract protected class CDAGetTestCase extends CDAOperationsTestCase { + + protected CDAGetTestCase(final String testTargetDescription) { + super(testTargetDescription); + } + + @Override + protected void doTest(final EObject objectToTest, final BasicDiagnostic diagnostician, + final Map map) { + final EObject eObjectToAdd = getEObjectToAdd(); + doAdd(objectToTest, eObjectToAdd); + final Object value = doGet(objectToTest); + + final boolean getIsGood = isGetGood(eObjectToAdd, value); + assertTrue("Get \"" + getTestTargetDescription() + "\" failed for \"" + objectToTest.eClass().getName() + + "\"", getIsGood); + } // doTest + + protected boolean isGetGood(final EObject eObjectToAdd, final Object value) { + final EList list = (EList) value; + return list.size() == 1 && list.get(0).equals(eObjectToAdd); + } + + abstract protected Object doGet(EObject objectToTest); + + } // CDAGetTestCase + + static abstract protected class CDAHasTestCase extends CDAOperationsTestCase { + + protected static final String TEMPLATE_ID = "1.2.3.4"; + + protected static final II THE_II = DatatypesFactory.eINSTANCE.createII(); + + protected static final String CODE = "code"; + + protected static final String CODE_SYSTEM = "codeSystem"; + + protected static final String CODE_SYSTEM_NAME = "codeSystemName"; + + protected static final String CODE_DISPLAY_NAME = "codeDisplayName"; + + protected static final CD THE_CODE = DatatypesFactory.eINSTANCE.createCD( + CODE, CODE_SYSTEM, CODE_SYSTEM_NAME, CODE_DISPLAY_NAME); + + protected static final CE THE_CE_CODE = DatatypesFactory.eINSTANCE.createCE( + CODE, CODE_SYSTEM, CODE_SYSTEM_NAME, CODE_DISPLAY_NAME); + + protected static final CS THE_CS_CODE = DatatypesFactory.eINSTANCE.createCS(CODE); + + protected CDAHasTestCase(final String testTargetDescription) { + super(testTargetDescription); + THE_II.setRoot(TEMPLATE_ID); + } + + @Override + protected void doTest(final EObject objectToTest, final BasicDiagnostic diagnostician, + final Map map) { + final EObject eObjectToAdd = getEObjectToAdd(); + doAddTemplateId(eObjectToAdd, THE_II); + + doAdd(objectToTest, eObjectToAdd); + + final boolean hasIsGood = doHas(objectToTest, TEMPLATE_ID); + assertTrue("Has \"" + getTestTargetDescription() + "\" failed for \"" + objectToTest.eClass().getName() + + "\"", hasIsGood); + } // doTest + + protected abstract void doAddTemplateId(EObject objectToTest, II theIi); + + protected abstract boolean doHas(EObject eObjectToAdd, String templateId); + + } // CDAHasTestCase + + static abstract protected class CDAValidationTestCase extends CDATestCase { + + public CDAValidationTestCase(final String testTargetDescription) { + super(testTargetDescription); + } + + abstract protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map); + + protected void validateExpectSkip(final EObject objectToTest, final BasicDiagnostic diagnostician, + final Map map) { + final boolean isValid = validate(objectToTest, diagnostician, map); + + assertTrue( + "ERROR EXPECT IGNORE " + + CDAValidationTest.createAssertionFailureMessage(diagnostician, getTestTargetDescription()), + isValid); + + } + + protected void validateExpectPass(final EObject objectToTest, final BasicDiagnostic diagnostician, + final Map map) { + final boolean isValid = validate(objectToTest, diagnostician, map); + + assertTrue( + "ERROR EXPECT PASS " + + CDAValidationTest.createAssertionFailureMessage(diagnostician, getTestTargetDescription()), + isValid); + + } + + protected void validateExpectFail(final EObject objectToTest, final BasicDiagnostic diagnostician, + final Map map) { + final boolean isValid = validate(objectToTest, diagnostician, map); + + ByteArrayOutputStream out = new ByteArrayOutputStream(); + + String xml = ""; + + try { + CDAValidationTest.saveTestSnippet((InfrastructureRoot) objectToTest, out); + xml = out.toString(); + } catch (Exception e) { + } + + assertTrue("ERROR EXPECT FAIL " + getTestTargetDescription() + "\" passed when it was expected to fail." + + xml, !isValid); + } + + } // CDAValidationTestCase + + // TemplateID Test Case + protected abstract static class TemplateIDValidationTest extends CDAValidationTestCase { + private static final String TEMPLATE_ID_FEATURE_NAME = "templateId"; + + private final String templateID; + + /** + * @param templateID + */ + public TemplateIDValidationTest(final String templateID) { + super(TEMPLATE_ID_FEATURE_NAME); + this.templateID = templateID; + } + + @Override + public void doTest(final EObject objectToTest, final BasicDiagnostic diagnostician, + final Map map) { + try { + validateExpectFail(objectToTest, diagnostician, map); + getTemplateIds(objectToTest).add(THE_BAD_II); + validateExpectFail(objectToTest, diagnostician, map); + getTemplateIds(objectToTest).add(createTheValidII()); + validateExpectPass(objectToTest, diagnostician, map); + } catch (final UnsupportedOperationException uoe) { + fail(CDAValidationTest.createUnsupportedOperationFailureMessage(TEMPLATE_ID_FEATURE_NAME, uoe)); + } + } + + @SuppressWarnings("unchecked") + private EList getTemplateIds(final EObject objectToTest) { + return (EList) objectToTest.eGet(objectToTest.eClass().getEStructuralFeature(TEMPLATE_ID_FEATURE_NAME)); + } + + private II createTheValidII() { + final II retValue = DatatypesFactory.eINSTANCE.createII(); + retValue.setRoot(templateID); + return retValue; + } + + } // TemplateIDValidationTest + + static abstract protected class UndefinedValidationTestCase extends CDAValidationTestCase { + + private final Set eReferenceNames; + + protected UndefinedValidationTestCase(final String testTargetDescription, final Set eReferenceNames) { + super(testTargetDescription); + this.eReferenceNames = eReferenceNames; + } + + protected Set getEReferenceNames() { + return eReferenceNames; + } + + protected String createEReferenceNotFoundMessage(final EObject objectToTest, final String eReferenceName) { + return "EReference \"" + eReferenceName + "\" not found in \"" + objectToTest.eClass().getName() + "\""; + } + + } // UndefinedValidationTestCase + + static abstract protected class UndefinedORValidationTestCase extends UndefinedValidationTestCase { + + public UndefinedORValidationTestCase(final String validationTargetDescription, final Set eReferenceNames) { + super(validationTargetDescription, eReferenceNames); + } + + @Override + protected void doTest(final EObject objectToTest, final BasicDiagnostic diagnostician, + final Map map) { + // Validation should pass here as none of the references are set + validateExpectPass(objectToTest, diagnostician, map); + + // Go through the references of the eObjectToValidate looking for + // those which we will set and set them all. those which we will set + // and test for validation failure. + for (final String eReferenceName : getEReferenceNames()) { + final EReference eReference = (EReference) objectToTest.eClass().getEStructuralFeature(eReferenceName); + + assertNotNull(createEReferenceNotFoundMessage(objectToTest, eReferenceName), eReference); + + objectToTest.eSet(eReference, CDAFactory.eINSTANCE.create((EClass) (eReference.getEType()))); + + } // for each reference + + // Validation should fail here because not one is invalid + validateExpectFail(objectToTest, diagnostician, map); + + // Now go through the same set unsetting, each in turn and + // validating those which we will set and test for validation + // failure. + for (final String eReferenceName : getEReferenceNames()) { + final EReference eReference = (EReference) objectToTest.eClass().getEStructuralFeature(eReferenceName); + final EObject temp = (EObject) objectToTest.eGet(eReference); + objectToTest.eUnset(eReference); + validateExpectPass(objectToTest, diagnostician, map); + objectToTest.eSet(eReference, temp); + } // for each reference + + } // doTest + + } // UndefinedORValidationTestCase + + static abstract protected class UndefinedXORValidationTestCase extends UndefinedValidationTestCase { + + public UndefinedXORValidationTestCase(final String validationTargetDescription, + final Set eReferenceNames) { + super(validationTargetDescription, eReferenceNames); + } + + @Override + protected void doTest(final EObject objectToTest, final BasicDiagnostic diagnostician, + final Map map) { + // Validation should fail here as none of the references are set + validateExpectFail(objectToTest, diagnostician, map); + + // Go through the references of the eObjectToValidate looking for + // those which we will set and set them all. + for (final String eReferenceName : getEReferenceNames()) { + final EReference eReference = (EReference) objectToTest.eClass().getEStructuralFeature(eReferenceName); + assertNotNull(createEReferenceNotFoundMessage(objectToTest, eReferenceName), eReference); + objectToTest.eSet(eReference, CDAFactory.eINSTANCE.create((EClass) (eReference.getEType()))); + } // for each reference + + // Validation should fail here because not one is invalid + validateExpectFail(objectToTest, diagnostician, map); + + // Now go through the same set unsetting, each in turn and + // validating + for (final String eReferenceName : getEReferenceNames()) { + final EReference eReference = (EReference) objectToTest.eClass().getEStructuralFeature(eReferenceName); + final EObject temp = (EObject) objectToTest.eGet(eReference); + objectToTest.eUnset(eReference); + validateExpectPass(objectToTest, diagnostician, map); + objectToTest.eSet(eReference, temp); + } // for each reference + + } // doTest + + } // UndefinedXORValidationTestCase + + static abstract protected class MutualExclusionValidationTestCase extends UndefinedValidationTestCase { + + public MutualExclusionValidationTestCase(final String validationTargetDescription, + final Set eReferenceNames) { + super(validationTargetDescription, eReferenceNames); + } + + @Override + protected void doTest(final EObject objectToTest, final BasicDiagnostic diagnostician, + final Map map) { + // Validation should fail here as none of the references are set + validateExpectFail(objectToTest, diagnostician, map); + + initializeobjectToTest(objectToTest); + + // Make sure everything is valid now + validateExpectPass(objectToTest, diagnostician, map); + + // Go through the references of the eObjectToValidate set them and + // test for validation failure. + for (final String eReferenceName : getEReferenceNames()) { + final EReference eReference = (EReference) objectToTest.eClass().getEStructuralFeature(eReferenceName); + + assertNotNull(createEReferenceNotFoundMessage(objectToTest, eReferenceName), eReference); + + // This should cause validation failure + objectToTest.eSet(eReference, CDAFactory.eINSTANCE.create((EClass) (eReference.getEType()))); + // Which we are expecting + validateExpectFail(objectToTest, diagnostician, map); + + // Undo for the next reference + objectToTest.eUnset(eReference); + } // for each reference + } // doTest + + abstract protected void initializeobjectToTest(EObject objectToTest); + } // MutualExclusionValidationTestCase + + static abstract protected class CDAMutualExclusionValidationTestCase extends MutualExclusionValidationTestCase { + + /** + * This is the list of the names of the EReferences that cannot be set + * simultaneously. It is missing the name "act" because that reference + * is always set, and the others are set individually in sequence (and + * then unSet) to test that they invalidate the test. + */ + private static final Set MUTUALLY_EXCLUSIVE_EREFERENCE_NAMES = new HashSet(Arrays.asList( + /* + * "act" + * , + */"encounter", "observation", "observationMedia", "organizer", "procedure", "regionOfInterest", + "substanceAdministration", "supply")); + + protected CDAMutualExclusionValidationTestCase(final String validationTargetDescription) { + super(validationTargetDescription, MUTUALLY_EXCLUSIVE_EREFERENCE_NAMES); + } + + } // CDAMutualExclusionValidationTestCase + + static protected String createUnsupportedOperationFailureMessage(final String testTargetDescription, + final UnsupportedOperationException uoe) { + return "The test \"" + testTargetDescription + "\" failed because of \"" + uoe.getMessage() + + "\". This is likely due to errors in the OCL."; + } + + static protected String createAssertionFailureMessage(final BasicDiagnostic diagnostician) { + return createAssertionFailureMessage(diagnostician, ""); + } + + static protected String createAssertionFailureMessage(final BasicDiagnostic diagnostician, final String source) { + final StringBuilder sb = new StringBuilder(source); + sb.append(": "); + for (final Diagnostic diagnostic : diagnostician.getChildren()) { + sb.append(" "); + sb.append(diagnostic.getMessage()); + } + + return sb.toString(); + } + + private static void saveTestSnippet(InfrastructureRoot snippet, OutputStream out) throws Exception { + + ClinicalDocument containerDocument = CDAUtil.getClinicalDocument(snippet); + + if (containerDocument != null) { + CDAUtil.save(EcoreUtil.copy(containerDocument), out); + } else { + CDAUtil.saveSnippet(EcoreUtil.copy(snippet), out); + } + + } + + public interface TestObjectFactory { + public TestObject create(); + } + + protected abstract static class OperationsTestCase extends CDAValidationTestCase { + + private boolean skipFailsTest = false; + + private boolean skipPassTest = false; + + public void skipFailsTest() { + skipFailsTest = true; + } + + public void skipPassTest() { + skipPassTest = true; + } + + public abstract class PassTest { + abstract public void updateToPass(ValidationTarget target); + } + + public abstract class FailTest { + abstract public void updateToFail(ValidationTarget target); + } + + public void addPassTest(PassTest passTest) { + passTests.add(passTest); + } + + public void addFailTests() { + + } + + public void addPassTests() { + + } + + public void addFailTest(FailTest failTest) { + failTests.add(failTest); + } + + ArrayList passTests = new ArrayList(); + + ArrayList failTests = new ArrayList(); + + private static final String[] ENDTAGS = { "", "", "", "" }; + + private static final int FAILSNIPPET = 0; + + private static final int PASSSNIPPET = 2; + + private static String escapeXML(int snippetType, InfrastructureRoot objectToTest) { + String xml = ""; + try { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + CDAValidationTest.saveTestSnippet(objectToTest, out); + + xml = StringEscapeUtils.escapeHtml(out.toString()); + + xml = xml.replace(System.getProperty("line.separator"), "
"); + + } catch (Exception e) { + } + + xml = ENDTAGS[snippetType] + "
" + xml + "
" + ENDTAGS[snippetType + 1]; + + return xml; + } + + private static String generateSkipMessage(int snippetType, String message) { + return ENDTAGS[snippetType] + "
" + message + "
" + ENDTAGS[snippetType + 1]; + } + + TestObjectFactory testObjectFactory; + + String testLogDir = null; + + public OperationsTestCase(String testTargetDescription, String ocl, TestObjectFactory testObjectFactory) { + super(testTargetDescription); + this.ocl = ocl; + this.testObjectFactory = testObjectFactory; + testLogDir = System.getProperty("testlogdir"); + + if (testLogDir == null) { + System.out.println(); + System.out.println("Running " + getTestTargetDescription()); + System.out.println(); + } + + } + + private void runFails(StringBuffer xmlSnippetsBuffer) { + + boolean gotDiagnostic = false; + + for (FailTest failTest : failTests) { + + ValidationTarget target = (ValidationTarget) testObjectFactory.create(); + + BasicDiagnostic diagnostician = Diagnostician.INSTANCE.createDefaultDiagnostic((EObject) target); + + failTest.updateToFail(target); + + if (target instanceof InfrastructureRoot) { + if (testLogDir != null) { + xmlSnippetsBuffer.append(escapeXML(FAILSNIPPET, (InfrastructureRoot) target)); + } else { + try { + CDAValidationTest.saveTestSnippet((InfrastructureRoot) target, System.out); + } catch (Exception e) { + + } + } + } + + validateExpectFail((EObject) target, diagnostician, map); + + if (!gotDiagnostic) { + gotDiagnostic = true; + for (Diagnostic d : diagnostician.getChildren()) { + + String message = d.getMessage(); + + xmlSnippetsBuffer.append(""); + + message = StringEscapeUtils.escapeHtml(message); + + message = message.replace(System.getProperty("line.separator"), "
"); + + xmlSnippetsBuffer.append(message); + xmlSnippetsBuffer.append("
"); + } + } + } + + } + + private void runPasses(StringBuffer xmlSnippetsBuffer) { + for (PassTest passTest : passTests) { + + ValidationTarget target = (ValidationTarget) testObjectFactory.create(); + + BasicDiagnostic diagnostician = Diagnostician.INSTANCE.createDefaultDiagnostic((EObject) target); + + passTest.updateToPass(target); + + if (target instanceof InfrastructureRoot) { + if (testLogDir != null) { + xmlSnippetsBuffer.append(escapeXML(PASSSNIPPET, (InfrastructureRoot) target)); + } else { + try { + CDAValidationTest.saveTestSnippet((InfrastructureRoot) target, System.out); + } catch (Exception e) { + + } + } + } + + validateExpectPass((EObject) target, diagnostician, map); + + } + } + + private void appendToBuffer(StringBuffer xmlSnippetsBuffer, String startTag, String contents, String endTag) { + + if (testLogDir != null) { + xmlSnippetsBuffer.append(startTag); + + contents = StringEscapeUtils.escapeHtml(contents); + + contents = contents.replace(System.getProperty("line.separator"), "
"); + + xmlSnippetsBuffer.append(contents); + + xmlSnippetsBuffer.append(endTag); + } else { + System.out.println(); + System.out.println(startTag); + System.out.println(contents); + System.out.println(endTag); + System.out.println(); + } + } + + String ocl = null; + + protected EObject getObjectToSerialze() { + return null; + } + + @SuppressWarnings("unchecked") + @Override + public void doTest(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + StringBuffer xmlSnippetsBuffer = new StringBuffer(); + + try { + + appendToBuffer(xmlSnippetsBuffer, "", ocl, ""); + + if (!skipFailsTest) { + if (!failTests.isEmpty()) { + runFails(xmlSnippetsBuffer); + } else { + updateToFail((ValidationTarget) objectToTest); + + EObject objectToSerialize = (getObjectToSerialze() != null + ? getObjectToSerialze() + : objectToTest); + + if (objectToSerialize instanceof InfrastructureRoot) { + if (testLogDir != null) { + xmlSnippetsBuffer.append(escapeXML(FAILSNIPPET, (InfrastructureRoot) objectToSerialize)); + } else { + try { + System.out.println(); + System.out.println("Fail Snippet"); + CDAValidationTest.saveTestSnippet( + (InfrastructureRoot) objectToSerialize, System.out); + System.out.println(); + } catch (Exception e) { + + } + } + } + + validateExpectFail(objectToTest, diagnostician, map); + + for (Diagnostic d : diagnostician.getChildren()) { + + String message = d.getMessage(); + + appendToBuffer(xmlSnippetsBuffer, "", message, ""); + + } + } + } else { + + if (testLogDir != null) { + xmlSnippetsBuffer.append(generateSkipMessage(FAILSNIPPET, "Skip Fail Test")); + } else { + System.out.println(); + System.out.println("Skipped Fail Test"); + System.out.println(); + } + } + + if (!skipPassTest) { + if (!passTests.isEmpty()) { + runPasses(xmlSnippetsBuffer); + } else { + + updateToPass((ValidationTarget) objectToTest); + + EObject objectToSerialize = (getObjectToSerialze() != null + ? getObjectToSerialze() + : objectToTest); + + if (objectToSerialize instanceof InfrastructureRoot) { + if (testLogDir != null) { + xmlSnippetsBuffer.append(escapeXML(PASSSNIPPET, (InfrastructureRoot) objectToSerialize)); + } else { + try { + System.out.println(); + System.out.println("Pass Snippet"); + CDAValidationTest.saveTestSnippet( + (InfrastructureRoot) objectToSerialize, System.out); + System.out.println(); + } catch (Exception e) { + + } + } + } + validateExpectPass(objectToTest, diagnostician, map); + } + } else { + + if (testLogDir != null) { + xmlSnippetsBuffer.append(generateSkipMessage(FAILSNIPPET, "Skip Pass Test")); + } else { + System.out.println(); + System.out.println("Skipped Pass Test"); + System.out.println(); + } + } + + } finally { + + try { + String testName = String.format("test%s", getTestTargetDescription().substring(0, 1).toUpperCase() + + getTestTargetDescription().substring(1)); + + if (testLogDir != null) { + String logFileName = String.format( + "%s/test%s", testLogDir, getTestTargetDescription().substring(0, 1).toUpperCase() + + getTestTargetDescription().substring(1) + ".xml"); + FileWriter fstream = new FileWriter(logFileName); + BufferedWriter out = new BufferedWriter(fstream); + out.flush(); + out.write("" + xmlSnippetsBuffer.toString() + + ""); + out.close(); + } else { + // System.out.println("" + xmlSnippetsBuffer.toString() + + // ""); + } + } catch (Exception e) { + System.err.println("Error: " + e.getMessage()); + } + } + + } + + public void doValidationTest() { + + addFailTests(); + addPassTests(); + + EObject objectToTest = (EObject) testObjectFactory.create(); + BasicDiagnostic diagnostician = Diagnostician.INSTANCE.createDefaultDiagnostic(objectToTest); + doTest(objectToTest, diagnostician, map); + } + + protected void updateToFail(ValidationTarget target) { + }; + + protected void updateToPass(ValidationTarget target) { + }; + + } + + /** + * An extension of the validation test case framework for testing the constraints that check the resolvability of references to narrative text as + * defined in CDA Release 2 Section 4.3.5.1. + */ + protected static abstract class NarrativeReferenceTestCase extends OperationsTestCase { + + Section sectionToSerialize = null; + + @Override + protected EObject getObjectToSerialze() { + return sectionToSerialize; + } + + public NarrativeReferenceTestCase(String testTargetDescription, String ocl, + TestObjectFactory testObjectFactory) { + super(testTargetDescription, ocl, testObjectFactory); + } + + protected static EClass getEClass(EPackage epackage, Class instanceClass) { + EClass result = null; + for (EClassifier next : epackage.getEClassifiers()) { + if (next.getInstanceClass() == instanceClass) { + result = (EClass) next; + break; + } + } + + assertNotNull( + String.format( + "Instance class not found in package %s for %s.", epackage.getName(), instanceClass.getName()), + result); + + return result; + } + + protected static void addContainedElement(EObject container, EObject contained) { + EReference best = null; + + for (EReference next : container.eClass().getEAllContainments()) { + if (next.getEReferenceType().isInstance(contained)) { + // a candidate. Is it better than the one we already have? + if (best == null) { + best = next; + } else if (best.isMany() && !next.isMany()) { + // always prefer scalar containment + best = next; + } else if (best.getEReferenceType().isSuperTypeOf(next.getEReferenceType())) { + // prefer the more specific type + best = next; + } + } + } + + assertNotNull(String.format( + "Could not find containment reference for %s in %s.", contained.eClass().getName(), + container.eClass().getName()), best); + + if (FeatureMapUtil.isMany(container, best)) { + @SuppressWarnings("unchecked") + Collection list = (Collection) best.eGet(best); + list.add(contained); + } else { + container.eSet(best, contained); + } + } + + protected S createSectionForClinicalStatement(ClinicalStatement statement, + EPackage epackage, Class sectionType) { + + @SuppressWarnings("unchecked") + S result = (S) epackage.getEFactoryInstance().create(getEClass(epackage, sectionType)); + + try { + Method initMethod = result.getClass().getDeclaredMethod("init", new java.lang.Class[0]); + if (initMethod != null) { + initMethod.invoke(result, new Object[0]); + } + } catch (Exception e) { + // e.printStackTrace(); + } + + // create an entry for the statement and add the entry to the section + Entry entry = CDAFactory.eINSTANCE.createEntry(); + addContainedElement(entry, statement); + result.getEntries().add(entry); + + return result; + } + + protected CD createCDWithOriginalTextReference(String text, String reference) { + CD result = DatatypesFactory.eINSTANCE.createCD(); + result.setOriginalText(createEDWithReference(text, reference)); + return result; + } + + protected CE createCEWithOriginalTextReference(String text, String reference) { + CE result = DatatypesFactory.eINSTANCE.createCE(); + result.setOriginalText(createEDWithReference(text, reference)); + return result; + } + + protected ED createEDWithReference(String text, String reference) { + ED result = DatatypesFactory.eINSTANCE.createED(text); + + if (!reference.startsWith("#")) { + reference = "#" + reference; + } + + result.setReference(DatatypesFactory.eINSTANCE.createTEL(reference)); + + return result; + } + + protected StrucDocText createStrucDocText(String id, String text) { + StrucDocText result = (CDAFactory.eINSTANCE.createStrucDocText()); + + try { + Map loadOptions = new java.util.HashMap(); + loadOptions.put(XMLResource.OPTION_RECORD_UNKNOWN_FEATURE, true); + loadOptions.put(XMLResource.OPTION_SUPPRESS_DOCUMENT_ROOT, true); + + Resource xml = new XMLProcessor().load(new InputSource(new StringReader(String.format( + "\n" + // + "\n" + // + " %s\n" + // + "\n", id, text))), loadOptions); + AnyType stuff = (AnyType) xml.getContents().get(0); + result.getMixed().add(ExtendedMetaData.INSTANCE.demandFeature("urn:hl7-org:v3", "content", true), stuff); + } catch (Exception e) { + Assert.fail("Failed to set up structured document text: " + e.getLocalizedMessage()); + } + + return result; + } + + protected void addText(Section section, String id, String text) { + section.setText(createStrucDocText(id, text)); + sectionToSerialize = section; + + } + } + +} // CDAValidationTest diff --git a/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/ClinicalDocumentOperationsTest.java b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/ClinicalDocumentOperationsTest.java new file mode 100644 index 000000000..ec2c8517a --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/ClinicalDocumentOperationsTest.java @@ -0,0 +1,261 @@ +/******************************************************************************* + * Copyright (c) 2010, 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.operations; + +import static org.junit.Assert.assertTrue; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.ClinicalDocument; +import org.openhealthtools.mdht.uml.cda.Patient; +import org.openhealthtools.mdht.uml.cda.PatientRole; +import org.openhealthtools.mdht.uml.cda.Section; +import org.openhealthtools.mdht.uml.cda.StructuredBody; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; + +/** + * This class is a JUnit4 test case. + */ +@SuppressWarnings("nls") +public class ClinicalDocumentOperationsTest extends CDAValidationTest { + + /** + * The template id to use for the has* tests. + */ + protected static final String TEMPLATE_ID = "1.2.3.4"; + + protected static final II THE_II = DatatypesFactory.eINSTANCE.createII(); + + protected static final String CODE = "code"; + + protected static final String CODE_SYSTEM = "codeSystem"; + + protected static final String CODE_SYSTEM_NAME = "codeSystemName"; + + protected static final String CODE_DISPLAY_NAME = "codeDisplayName"; + + protected static final CD THE_CODE = DatatypesFactory.eINSTANCE.createCD( + CODE, CODE_SYSTEM, CODE_SYSTEM_NAME, CODE_DISPLAY_NAME); + + static { + THE_II.setRoot(TEMPLATE_ID); + } + + private static final CDATestCase TEST_CASE_ARRAY[] = { + + // Section + // ------------------------------------------------------------- + new CDAAddTestCase("Section") { + + @Override + protected void doTest(final EObject objectToTest, final BasicDiagnostic diagnostician, + final Map map) { + + final Section section = (Section) getEObjectToAdd(); + + ClinicalDocumentOperations.addSection((ClinicalDocument) objectToTest, section); + + assertTrue(ClinicalDocumentOperations.getSections((ClinicalDocument) objectToTest).get(0).equals( + section)); + } + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSection(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + // Nothing + } + + @Override + protected EStructuralFeature getFeature() { + return null; + } + + }, + + // Section + // ------------------------------------------------------------- + new CDAGetTestCase("Section") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSection(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ((ClinicalDocument) objectToTest).addSection((Section) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalDocumentOperations.getSections((ClinicalDocument) objectToTest); + } + + @SuppressWarnings("unchecked") + @Override + protected boolean isGetGood(final EObject eObjectToAdd, final Object value) { + return ((EList
) value).get(0).equals(eObjectToAdd); + } + }, + + // Code + // ------------------------------------------------------------- + new CDAHasTestCase("Code") { + + @Override + protected void doTest(final EObject objectToTest, final BasicDiagnostic diagnostician, + final Map map) { + + final CE code = DatatypesFactory.eINSTANCE.createCE(CODE, CODE_SYSTEM); + code.setCodeSystemName(CODE_SYSTEM_NAME); + ((ClinicalDocument) objectToTest).setCode(code); + final boolean hasIsGood = doHas(objectToTest, TEMPLATE_ID); + assertTrue("Has \"" + getTestTargetDescription() + "\" failed for \"" + + objectToTest.eClass().getName() + "\"", hasIsGood); + } + + @Override + protected EObject getEObjectToAdd() { + return null; + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + // Nothing + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalDocumentOperations.hasCode( + (ClinicalDocument) objectToTest, CODE, CODE_SYSTEM, CODE_SYSTEM_NAME); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + // Nothing + } + }, + + // TemplateID + // ------------------------------------------------------------- + new CDAHasTestCase("TemplateID") { + + @Override + protected void doTest(final EObject objectToTest, final BasicDiagnostic diagnostician, + final Map map) { + ((ClinicalDocument) objectToTest).getTemplateIds().add(THE_II); + final boolean hasIsGood = doHas(objectToTest, TEMPLATE_ID); + assertTrue("Has \"" + getTestTargetDescription() + "\" failed for \"" + + objectToTest.eClass().getName() + "\"", hasIsGood); + } + + @Override + protected EObject getEObjectToAdd() { + return null; + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + // Nothing + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalDocumentOperations.hasTemplateId((ClinicalDocument) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + // Nothing + } + }, + + // SetStructureBody + // ------------------------------------------------------------- + new CDATestCase("SetStructureBody") { + + @Override + protected void doTest(final EObject objectToTest, final BasicDiagnostic diagnostician, + final Map map) { + final StructuredBody sb = CDAFactory.eINSTANCE.createStructuredBody(); + ClinicalDocumentOperations.setStructuredBody((ClinicalDocument) objectToTest, sb); + assertTrue(((ClinicalDocument) objectToTest).getComponent().getStructuredBody().equals(sb)); + } + }, + + // GetPatients + // ------------------------------------------------------------- + new CDATestCase("GetPatients") { + + @Override + protected void doTest(final EObject objectToTest, final BasicDiagnostic diagnostician, + final Map map) { + assertTrue(ClinicalDocumentOperations.getPatients((ClinicalDocument) objectToTest).isEmpty()); + final Patient patient = CDAFactory.eINSTANCE.createPatient(); + ClinicalDocumentOperations.addPatient((ClinicalDocument) objectToTest, patient); + assertTrue(!ClinicalDocumentOperations.getPatients((ClinicalDocument) objectToTest).isEmpty()); + } + }, + + // GetPatientRoles + // ------------------------------------------------------------- + new CDATestCase("GetPatientRoles") { + + @Override + protected void doTest(final EObject objectToTest, final BasicDiagnostic diagnostician, + final Map map) { + assertTrue(ClinicalDocumentOperations.getPatientRoles((ClinicalDocument) objectToTest).isEmpty()); + final PatientRole patientRole = CDAFactory.eINSTANCE.createPatientRole(); + ClinicalDocumentOperations.addPatientRole((ClinicalDocument) objectToTest, patientRole); + assertTrue(!ClinicalDocumentOperations.getPatientRoles((ClinicalDocument) objectToTest).isEmpty()); + } + }, + // HasSectionTemplate + // ------------------------------------------------------------- + new CDATestCase("HasSectionTemplate") { + + @Override + protected void doTest(final EObject objectToTest, final BasicDiagnostic diagnostician, + final Map map) { + assertTrue(!ClinicalDocumentOperations.hasSectionTemplate( + (ClinicalDocument) objectToTest, TEMPLATE_ID)); + } + } }; + + @Override + protected List getTestCases() { + // Return a new List because the one returned by Arrays.asList is + // unmodifiable so a sub-class can't append their test cases. + final List retValue = super.getTestCases(); + retValue.addAll(Arrays.asList(TEST_CASE_ARRAY)); + return retValue; + } + + @Override + protected EObject getObjectToTest() { + return CDAFactory.eINSTANCE.createClinicalDocument(); + } + +} // ClinicalDocumentOperationsTest diff --git a/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/ClinicalStatementOperationsTest.java b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/ClinicalStatementOperationsTest.java new file mode 100644 index 000000000..1d6ce044c --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/ClinicalStatementOperationsTest.java @@ -0,0 +1,94 @@ +/******************************************************************************* + * Copyright (c) 2010, 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.operations; + +import static org.junit.Assert.assertTrue; + +import java.util.Arrays; +import java.util.List; + +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.ClinicalStatement; +import org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship; + +/** + * This class is a JUnit 4 test case for ClinicalStatementOperations. + */ +@SuppressWarnings("nls") +public abstract class ClinicalStatementOperationsTest extends CDAValidationTest { + + private static final CDATestCase TEST_CASE_ARRAY[] = {}; + + @Override + protected List getTestCases() { + // Return a new List because the one returned by Arrays.asList is + // unmodifiable so a sub-class can't append their test cases. + final List retValue = super.getTestCases(); + retValue.addAll(Arrays.asList(TEST_CASE_ARRAY)); + return retValue; + } + + /** + * Not a real test, needed for EMMA to report 100% method coverage. + */ + @SuppressWarnings("unused") + @Test + public void testConstructor() { + ClinicalStatementOperations obj = new ClinicalStatementOperations(); + assertTrue(true); + } // testConstructor + + /** + * Test method for + * {@link org.openhealthtools.mdht.uml.cda.operations.ClinicalStatementOperations#getEntryRelationshipTargets(org.openhealthtools.mdht.uml.cda.ClinicalStatement, org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship, java.lang.Object)} + * . + */ + @Test + public void testGetEntryRelationshipTargetsClinicalStatementX_ActRelationshipEntryRelationshipObject() { + // final ClinicalStatement cs = (ClinicalStatement) getObjectToTest(); + // x_ActRelationshipEntryRelationship typeCode = x_ActRelationshipEntryRelationship.CAUS; + // final EList result = ClinicalStatementOperations + // .getEntryRelationshipTargets(cs, typeCode, null); + // + // assertTrue(result != null); + // assertTrue(result.size() != 0); + // fail("Not yet implemented"); + } + + /** + * Test method for + * {@link org.openhealthtools.mdht.uml.cda.operations.ClinicalStatementOperations#getEntryRelationshipTargets(org.openhealthtools.mdht.uml.cda.ClinicalStatement, java.lang.Object)} + * . + */ + @Test + public void testGetEntryRelationshipTargetsClinicalStatementObject() { + // final ClinicalStatement cs = (ClinicalStatement) getObjectToTest(); + // final EList result = ClinicalStatementOperations + // .getEntryRelationshipTargets(cs, cs); + // + // assertTrue(result != null); + // assertTrue(result.size() != 0); + // fail("Not yet implemented"); + } + + /** + * Test method for + * {@link org.openhealthtools.mdht.uml.cda.operations.ClinicalStatementOperations#getEntryRelationshipTargets(org.openhealthtools.mdht.uml.cda.ClinicalStatement, org.openhealthtools.mdht.uml.hl7.vocab.x_ActRelationshipEntryRelationship, java.lang.Object)} + * . + */ + @Test(expected = IllegalArgumentException.class) + public void testGetEntryRelationshipTargetsClinicalStatementIllegalArgumentException() { + final ClinicalStatement cs = (ClinicalStatement) getObjectToTest(); + // The "CAUS" argument was chosen at random. + ClinicalStatementOperations.getEntryRelationshipTargets(cs, x_ActRelationshipEntryRelationship.CAUS, cs); + } + +} // ClinicalStatementOperationsTest diff --git a/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/Component2OperationsTest.java b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/Component2OperationsTest.java new file mode 100644 index 000000000..7dc6ad67e --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/Component2OperationsTest.java @@ -0,0 +1,75 @@ +/******************************************************************************* + * Copyright (c) 2010, 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.operations; + +import static org.junit.Assert.assertTrue; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Component2; + +/** + * This class is a JUnit4 test case. + */ +@SuppressWarnings("nls") +public class Component2OperationsTest extends CDAValidationTest { + + /** + * The names of the references to include in the test. + */ + public static final Set EREFERENCE_NAMES = new HashSet( + Arrays.asList("structuredBody", "nonXMLBody")); + + private static final CDATestCase TEST_CASE_ARRAY[] = { + // UndefinedXOR + // ------------------------------------------------------------- + new UndefinedXORValidationTestCase("Component2Operations", EREFERENCE_NAMES) { + + @Override + protected boolean validate(final EObject objectToTest, final BasicDiagnostic diagnostician, + final Map map) { + return Component2Operations.validateBodyChoice((Component2) objectToTest, diagnostician, map); + } + } }; + + @Override + protected List getTestCases() { + // Return a new List because the one returned by Arrays.asList is + // unmodifiable so a sub-class can't append their test cases. + final List retValue = super.getTestCases(); + retValue.addAll(Arrays.asList(TEST_CASE_ARRAY)); + return retValue; + } + + /** + * Not a real test, needed for EMMA to report 100% method coverage. + */ + @SuppressWarnings("unused") + @Test + public final void testConstructor() { + Component2Operations obj = new Component2Operations(); + assertTrue(true); + } // testConstructor + + @Override + protected EObject getObjectToTest() { + return CDAFactory.eINSTANCE.createComponent2(); + } + +} // Component2OperationsTest diff --git a/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/Component4OperationsTest.java b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/Component4OperationsTest.java new file mode 100644 index 000000000..7f0a8953d --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/Component4OperationsTest.java @@ -0,0 +1,75 @@ +/******************************************************************************* + * Copyright (c) 2010, 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.operations; + +import static org.junit.Assert.assertTrue; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Component4; + +/** + * This class is a JUnit4 test case. + */ +public class Component4OperationsTest extends CDAValidationTest { + + @SuppressWarnings("nls") + private static final CDATestCase TEST_CASE_ARRAY[] = { + // CDAMutualExclusionValidationTestCase + // ------------------------------------------------------------- + new CDAMutualExclusionValidationTestCase("Component4") { + + @Override + protected boolean validate(final EObject objectToTest, final BasicDiagnostic diagnostician, + final Map map) { + return Component4Operations.validateClinicalStatement((Component4) objectToTest, diagnostician, map); + } + + @Override + protected void initializeobjectToTest(final EObject objectToTest) { + ((Component4) objectToTest).setAct(CDAFactory.eINSTANCE.createAct()); + } + } }; + + @Override + protected List getTestCases() { + // Return a new List because the one returned by Arrays.asList is + // unmodifiable so a sub-class can't append their test cases. + final List retValue = super.getTestCases(); + retValue.addAll(Arrays.asList(TEST_CASE_ARRAY)); + return retValue; + } + + /** + * Not a real test, needed for EMMA to report 100% method coverage. + */ + @SuppressWarnings("unused") + @Test + public final void testConstructor() { + Component4Operations obj = new Component4Operations(); + assertTrue(true); + } // testConstructor + + /** + * @return the EObject instance to be validated + */ + @Override + protected EObject getObjectToTest() { + return CDAFactory.eINSTANCE.createComponent4(); + } // getObjectToTest() + +} // Component4OperationsTest diff --git a/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/EncounterOperationsTest.java b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/EncounterOperationsTest.java new file mode 100644 index 000000000..49b4037ec --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/EncounterOperationsTest.java @@ -0,0 +1,783 @@ +/******************************************************************************* + * Copyright (c) 2010, 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.operations; + +import static org.junit.Assert.assertTrue; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.openhealthtools.mdht.uml.cda.Act; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.CDAPackage; +import org.openhealthtools.mdht.uml.cda.ClinicalDocument; +import org.openhealthtools.mdht.uml.cda.Encounter; +import org.openhealthtools.mdht.uml.cda.Observation; +import org.openhealthtools.mdht.uml.cda.ObservationMedia; +import org.openhealthtools.mdht.uml.cda.Organizer; +import org.openhealthtools.mdht.uml.cda.Procedure; +import org.openhealthtools.mdht.uml.cda.RegionOfInterest; +import org.openhealthtools.mdht.uml.cda.Section; +import org.openhealthtools.mdht.uml.cda.SubstanceAdministration; +import org.openhealthtools.mdht.uml.cda.Supply; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; + +/** + * This class is a JUnit4 test case. + */ +public class EncounterOperationsTest extends ClinicalStatementOperationsTest { + + @SuppressWarnings("nls") + private static final CDATestCase TEST_CASE_ARRAY[] = { + // Act + // ------------------------------------------------------------- + new CDAAddTestCase("Act") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createAct(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addAct((Encounter) objectToTest, (Act) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_Act(); + } + }, + + // Encounter + // ------------------------------------------------------------- + new CDAAddTestCase("Encounter") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createEncounter(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addEncounter((Encounter) objectToTest, (Encounter) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_Encounter(); + } + }, + + // Observation + // ------------------------------------------------------------- + new CDAAddTestCase("Observation") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservation(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addObservation((Encounter) objectToTest, (Observation) eObjectToAdd); + + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_Observation(); + } + }, + + // ObservationMedia + // ------------------------------------------------------------- + new CDAAddTestCase("ObservationMedia") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservationMedia(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addObservationMedia( + (Encounter) objectToTest, (ObservationMedia) eObjectToAdd); + + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_ObservationMedia(); + } + }, + + // Organizer + // ------------------------------------------------------------- + new CDAAddTestCase("Organizer") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createOrganizer(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addOrganizer((Encounter) objectToTest, (Organizer) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_Organizer(); + } + }, + + // Procedure + // ------------------------------------------------------------- + new CDAAddTestCase("Procedure") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createProcedure(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addProcedure((Encounter) objectToTest, (Procedure) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_Procedure(); + } + }, + + // RegionOfInterest + // ------------------------------------------------------------- + new CDAAddTestCase("RegionOfInterest") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createRegionOfInterest(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addRegionOfInterest( + (Encounter) objectToTest, (RegionOfInterest) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_RegionOfInterest(); + } + }, + + // SubstanceAdministration + // ------------------------------------------------------------- + new CDAAddTestCase("SubstanceAdministration") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSubstanceAdministration(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addSubstanceAdministration( + (Encounter) objectToTest, (SubstanceAdministration) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_SubstanceAdministration(); + } + }, + + // Supply + // ------------------------------------------------------------- + new CDAAddTestCase("Supply") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSupply(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addSupply((Encounter) objectToTest, (Supply) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_Supply(); + } + }, + // ************************************************************************* + // Act + // ------------------------------------------------------------- + new CDAGetTestCase("Act") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createAct(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addAct((Encounter) objectToTest, (Act) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getActs((Encounter) objectToTest); + } + }, + + // Encounter + // ------------------------------------------------------------- + new CDAGetTestCase("Encounter") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createEncounter(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addEncounter((Encounter) objectToTest, (Encounter) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getEncounters((Encounter) objectToTest); + } + + }, + + // Observation + // ------------------------------------------------------------- + new CDAGetTestCase("Observation") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservation(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addObservation((Encounter) objectToTest, (Observation) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getObservations((Encounter) objectToTest); + } + }, + + // ObservationMedia + // ------------------------------------------------------------- + new CDAGetTestCase("ObservationMedia") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservationMedia(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addObservationMedia( + (Encounter) objectToTest, (ObservationMedia) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getObservationMedia((Encounter) objectToTest); + } + }, + + // Organizer + // ------------------------------------------------------------- + new CDAGetTestCase("Organizer") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createOrganizer(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addOrganizer((Encounter) objectToTest, (Organizer) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getOrganizers((Encounter) objectToTest); + } + }, + + // Procedure + // ------------------------------------------------------------- + new CDAGetTestCase("Procedure") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createProcedure(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addProcedure((Encounter) objectToTest, (Procedure) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getProcedures((Encounter) objectToTest); + } + }, + + // RegionOfInterest + // ------------------------------------------------------------- + new CDAGetTestCase("RegionOfInterest") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createRegionOfInterest(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addRegionOfInterest( + (Encounter) objectToTest, (RegionOfInterest) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getRegionsOfInterest((Encounter) objectToTest); + } + }, + + // SubstanceAdministration + // ------------------------------------------------------------- + new CDAGetTestCase("SubstanceAdministration") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSubstanceAdministration(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addSubstanceAdministration( + (Encounter) objectToTest, (SubstanceAdministration) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getSubstanceAdministrations((Encounter) objectToTest); + } + }, + + // Supply + // ------------------------------------------------------------- + new CDAGetTestCase("Supply") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSupply(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addSupply((Encounter) objectToTest, (Supply) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getSupplies((Encounter) objectToTest); + } + }, + + // ClinicalDocument + // ------------------------------------------------------------- + new CDAGetTestCase("ClinicalDocument") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createClinicalDocument(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + // The Add is reversed, the objectToTest is added to the + // clinical document + final Section section = CDAFactory.eINSTANCE.createSection(); + section.addEncounter((Encounter) objectToTest); + ((ClinicalDocument) eObjectToAdd).addSection(section); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getClinicalDocument((Encounter) objectToTest); + } + + @Override + protected boolean isGetGood(final EObject eObjectToAdd, final Object value) { + return eObjectToAdd.equals(value); + } + }, + + // Section + // ------------------------------------------------------------- + new CDAGetTestCase("Section") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSection(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + // The Add is reversed, the objectToTest is added to the + // clinical document + ((Section) eObjectToAdd).addEncounter((Encounter) objectToTest); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getSection((Encounter) objectToTest); + } + + @Override + protected boolean isGetGood(final EObject eObjectToAdd, final Object value) { + return eObjectToAdd.equals(value); + } + }, + // ************************************************************************* + // Act + // ------------------------------------------------------------- + new CDAHasTestCase("Act") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createAct(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addAct((Encounter) objectToTest, (Act) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasActTemplate((Encounter) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Act) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Encounter + // ------------------------------------------------------------- + new CDAHasTestCase("Encounter") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createEncounter(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addEncounter((Encounter) objectToTest, (Encounter) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasEncounterTemplate((Encounter) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Encounter) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Code + // ------------------------------------------------------------- + new CDAHasTestCase("Code") { + + @Override + protected void doTest(final EObject objectToTest, final BasicDiagnostic diagnostician, + final Map map) { + ((Encounter) objectToTest).setCode(THE_CODE); + final boolean hasIsGood = doHas(objectToTest, TEMPLATE_ID); + assertTrue("Has \"" + getTestTargetDescription() + "\" failed for \"" + + objectToTest.eClass().getName() + "\"", hasIsGood); + } + + @Override + protected EObject getEObjectToAdd() { + return null; + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addEncounter((Encounter) objectToTest, (Encounter) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasCode( + (Encounter) objectToTest, CODE, CODE_SYSTEM, CODE_SYSTEM_NAME); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Encounter) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Observation + // ------------------------------------------------------------- + new CDAHasTestCase("Observation") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservation(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addObservation((Encounter) objectToTest, (Observation) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasObservationTemplate((Encounter) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Observation) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // ObservationMedia + // ------------------------------------------------------------- + new CDAHasTestCase("ObservationMedia") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservationMedia(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addObservationMedia( + (Encounter) objectToTest, (ObservationMedia) eObjectToAdd); + + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasObservationMediaTemplate((Encounter) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((ObservationMedia) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Organizer + // ------------------------------------------------------------- + new CDAHasTestCase("Organizer") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createOrganizer(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addOrganizer((Encounter) objectToTest, (Organizer) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasOrganizerTemplate((Encounter) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Organizer) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Procedure + // ------------------------------------------------------------- + new CDAHasTestCase("Procedure") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createProcedure(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addProcedure((Encounter) objectToTest, (Procedure) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasProcedureTemplate((Encounter) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Procedure) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // RegionOfInterest + // ------------------------------------------------------------- + new CDAHasTestCase("RegionOfInterest") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createRegionOfInterest(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addRegionOfInterest( + (Encounter) objectToTest, (RegionOfInterest) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasRegionOfInterestTemplate((Encounter) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((RegionOfInterest) eObjectToAdd).getTemplateIds().add(theIi); + } + + }, + + // SubstanceAdministration + // ------------------------------------------------------------- + new CDAHasTestCase("SubstanceAdministration") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSubstanceAdministration(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addSubstanceAdministration( + (Encounter) objectToTest, (SubstanceAdministration) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasSubstanceAdministrationTemplate( + (Encounter) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((SubstanceAdministration) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Supply + // ------------------------------------------------------------- + new CDAHasTestCase("Supply") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSupply(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addSupply((Encounter) objectToTest, (Supply) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasSupplyTemplate((Encounter) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Supply) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // TemplateID + // ------------------------------------------------------------- + new CDAHasTestCase("TemplateID") { + + @Override + protected void doTest(final EObject objectToTest, final BasicDiagnostic diagnostician, + final Map map) { + ((Encounter) objectToTest).getTemplateIds().add(THE_II); + final boolean hasIsGood = doHas(objectToTest, TEMPLATE_ID); + assertTrue("Has \"" + getTestTargetDescription() + "\" failed for \"" + + objectToTest.eClass().getName() + "\"", hasIsGood); + } + + @Override + protected EObject getEObjectToAdd() { + return null; + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + // Nothing + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasTemplateId((Encounter) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + // Nothing + } + } }; + + @Override + protected List getTestCases() { + // Return a new List because the one returned by Arrays.asList is + // unmodifiable so a sub-class can't append their test cases. + final List retValue = super.getTestCases(); + retValue.addAll(Arrays.asList(TEST_CASE_ARRAY)); + return retValue; + } + + @Override + protected EObject getObjectToTest() { + return CDAFactory.eINSTANCE.createEncounter(); + } + +} // EncounterOperationsTest diff --git a/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/EntryOperationsTest.java b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/EntryOperationsTest.java new file mode 100644 index 000000000..fd4ba3560 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/EntryOperationsTest.java @@ -0,0 +1,76 @@ +/******************************************************************************* + * Copyright (c) 2010, 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.operations; + +import static org.junit.Assert.assertTrue; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Entry; + +/** + * This class is a JUnit4 test case. + */ +public class EntryOperationsTest extends CDAValidationTest { + + @SuppressWarnings("nls") + private static final CDATestCase TEST_CASE_ARRAY[] = { + // CDAMutualExclusionValidationTestCase + // ------------------------------------------------------------- + new CDAMutualExclusionValidationTestCase("Entry") { + + @Override + protected boolean validate(final EObject objectToTest, final BasicDiagnostic diagnostician, + final Map map) { + return EntryOperations.validateClinicalStatement((Entry) objectToTest, diagnostician, map); + } + + @Override + protected void initializeobjectToTest(final EObject objectToTest) { + ((Entry) objectToTest).setAct(CDAFactory.eINSTANCE.createAct()); + } + } }; + + @Override + protected List getTestCases() { + // Return a new List because the one returned by Arrays.asList is + // unmodifiable so a sub-class can't append their test cases. + final List retValue = super.getTestCases(); + retValue.addAll(Arrays.asList(TEST_CASE_ARRAY)); + return retValue; + } + + /** + * Not a real test, needed for EMMA to report 100% method coverage. + */ + @SuppressWarnings("unused") + @Test + public final void testConstructor() { + EntryOperations obj = new EntryOperations(); + assertTrue(true); + } // testConstructor + + /** + * @return the EObject instance to be validated + */ + @Override + protected EObject getObjectToTest() { + return CDAFactory.eINSTANCE.createEntry(); + } // getObjectToTest() + +} // EntryOperationsTest + diff --git a/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/EntryRelationshipOperationsTest.java b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/EntryRelationshipOperationsTest.java new file mode 100644 index 000000000..558b84fa5 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/EntryRelationshipOperationsTest.java @@ -0,0 +1,76 @@ +/******************************************************************************* + * Copyright (c) 2010, 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.operations; + +import static org.junit.Assert.assertTrue; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.EntryRelationship; + +/** + * This class is a JUnit4 test case. + */ +public class EntryRelationshipOperationsTest extends CDAValidationTest { + + /** + * Not a real test, needed for EMMA to report 100% method coverage. + */ + @SuppressWarnings("unused") + @Test + public final void testConstructor() { + EntryRelationshipOperations obj = new EntryRelationshipOperations(); + assertTrue(true); + } // testConstructor + + @SuppressWarnings("nls") + private static final CDATestCase TEST_CASE_ARRAY[] = { + // CDAMutualExclusionValidationTestCase + // ------------------------------------------------------------- + new CDAMutualExclusionValidationTestCase("EntryRelationship") { + + @Override + protected boolean validate(final EObject objectToTest, final BasicDiagnostic diagnostician, + final Map map) { + return EntryRelationshipOperations.validateClinicalStatement( + (EntryRelationship) objectToTest, diagnostician, map); + } + + @Override + protected void initializeobjectToTest(final EObject objectToTest) { + ((EntryRelationship) objectToTest).setAct(CDAFactory.eINSTANCE.createAct()); + } + } }; + + @Override + protected List getTestCases() { + // Return a new List because the one returned by Arrays.asList is + // unmodifiable so a sub-class can't append their test cases. + final List retValue = super.getTestCases(); + retValue.addAll(Arrays.asList(TEST_CASE_ARRAY)); + return retValue; + } + + /** + * @return the EObject instance to be validated + */ + @Override + protected EObject getObjectToTest() { + return CDAFactory.eINSTANCE.createEntryRelationship(); + } // getObjectToTest() + +} // EntryRelationshipOperationsTest diff --git a/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/GuardianOperationsTest.java b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/GuardianOperationsTest.java new file mode 100644 index 000000000..ab86bcae9 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/GuardianOperationsTest.java @@ -0,0 +1,75 @@ +/******************************************************************************* + * Copyright (c) 2010, 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.operations; + +import static org.junit.Assert.assertTrue; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Guardian; + +/** + * This class is a JUnit4 test case. + */ +@SuppressWarnings("nls") +public class GuardianOperationsTest extends CDAValidationTest { + + /** + * The names of the references to include in the test. + */ + public static final Set EREFERENCE_NAMES = new HashSet(Arrays.asList( + "guardianPerson", "guardianOrganization")); + + /** + * Not a real test, needed for EMMA to report 100% method coverage. + */ + @SuppressWarnings("unused") + @Test + public final void testConstructor() { + GuardianOperations obj = new GuardianOperations(); + assertTrue(true); + } // testConstructor + + private static final CDATestCase TEST_CASE_ARRAY[] = { + // UndefinedXOR + // ------------------------------------------------------------- + new UndefinedXORValidationTestCase("Guardian", EREFERENCE_NAMES) { + + @Override + protected boolean validate(final EObject objectToTest, final BasicDiagnostic diagnostician, + final Map map) { + return GuardianOperations.validateGuardianChoice((Guardian) objectToTest, diagnostician, map); + } + } }; + + @Override + protected List getTestCases() { + // Return a new List because the one returned by Arrays.asList is + // unmodifiable so a sub-class can't append their test cases. + final List retValue = super.getTestCases(); + retValue.addAll(Arrays.asList(TEST_CASE_ARRAY)); + return retValue; + } + + @Override + protected EObject getObjectToTest() { + return CDAFactory.eINSTANCE.createGuardian(); + } + +} // GuardianOperationsTest diff --git a/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/Informant12OperationsTest.java b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/Informant12OperationsTest.java new file mode 100644 index 000000000..fcd4c47cc --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/Informant12OperationsTest.java @@ -0,0 +1,75 @@ +/******************************************************************************* + * Copyright (c) 2010, 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.operations; + +import static org.junit.Assert.assertTrue; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Informant12; + +/** + * This class is a JUnit4 test case. + */ +@SuppressWarnings("nls") +public class Informant12OperationsTest extends CDAValidationTest { + + /** + * The names of the references to include in the test. + */ + public static final Set EREFERENCE_NAMES = new HashSet(Arrays.asList( + "assignedEntity", "relatedEntity")); + + /** + * Not a real test, needed for EMMA to report 100% method coverage. + */ + @SuppressWarnings("unused") + @Test + public final void testConstructor() { + Informant12Operations obj = new Informant12Operations(); + assertTrue(true); + } // testConstructor + + private static final CDATestCase TEST_CASE_ARRAY[] = { + // UndefinedXOR + // ------------------------------------------------------------- + new UndefinedXORValidationTestCase("Informant12", EREFERENCE_NAMES) { + + @Override + protected boolean validate(final EObject objectToTest, final BasicDiagnostic diagnostician, + final Map map) { + return Informant12Operations.validateInformantChoice((Informant12) objectToTest, diagnostician, map); + } + } }; + + @Override + protected List getTestCases() { + // Return a new List because the one returned by Arrays.asList is + // unmodifiable so a sub-class can't append their test cases. + final List retValue = super.getTestCases(); + retValue.addAll(Arrays.asList(TEST_CASE_ARRAY)); + return retValue; + } + + @Override + protected EObject getObjectToTest() { + return CDAFactory.eINSTANCE.createInformant12(); + } + +} // Informant12OperationsTest diff --git a/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/ManufacturedProductOperationsTest.java b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/ManufacturedProductOperationsTest.java new file mode 100644 index 000000000..176712367 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/ManufacturedProductOperationsTest.java @@ -0,0 +1,66 @@ +/******************************************************************************* + * Copyright (c) 2010, 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.operations; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.ManufacturedProduct; + +/** + * This class is a JUnit4 test case. + */ +@SuppressWarnings("nls") +public class ManufacturedProductOperationsTest extends CDAValidationTest { + + /** + * The names of the references to include in the test. + */ + public static final Set EREFERENCE_NAMES = new HashSet(Arrays.asList( + "manufacturedLabeledDrug", "manufacturedMaterial")); + + private static final CDATestCase TEST_CASE_ARRAY[] = { + // UndefinedXOR + // ------------------------------------------------------------- + new UndefinedXORValidationTestCase("Component2Operations", EREFERENCE_NAMES) { + + @Override + protected boolean validate(final EObject objectToTest, final BasicDiagnostic diagnostician, + final Map map) { + return ManufacturedProductOperations.validateManufacturedDrugOrOtherMaterial( + (ManufacturedProduct) objectToTest, diagnostician, map); + } + } }; + + @Override + protected List getTestCases() { + // Return a new List because the one returned by Arrays.asList is + // unmodifiable so a sub-class can't append their test cases. + final List retValue = super.getTestCases(); + retValue.addAll(Arrays.asList(TEST_CASE_ARRAY)); + return retValue; + } + + /** + * @see org.openhealthtools.mdht.uml.cda.operations.MutualExclusionValidationTest#getObjectToTest() + */ + @Override + protected EObject getObjectToTest() { + return CDAFactory.eINSTANCE.createManufacturedProduct(); + } + +} // ManufacturedProductOperationsTest diff --git a/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/ObservationMediaOperationsTest.java b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/ObservationMediaOperationsTest.java new file mode 100644 index 000000000..316836b92 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/ObservationMediaOperationsTest.java @@ -0,0 +1,754 @@ +/******************************************************************************* + * Copyright (c) 2010, 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.operations; + +import static org.junit.Assert.assertTrue; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.openhealthtools.mdht.uml.cda.Act; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.CDAPackage; +import org.openhealthtools.mdht.uml.cda.ClinicalDocument; +import org.openhealthtools.mdht.uml.cda.Encounter; +import org.openhealthtools.mdht.uml.cda.Observation; +import org.openhealthtools.mdht.uml.cda.ObservationMedia; +import org.openhealthtools.mdht.uml.cda.Organizer; +import org.openhealthtools.mdht.uml.cda.Procedure; +import org.openhealthtools.mdht.uml.cda.RegionOfInterest; +import org.openhealthtools.mdht.uml.cda.Section; +import org.openhealthtools.mdht.uml.cda.SubstanceAdministration; +import org.openhealthtools.mdht.uml.cda.Supply; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; + +/** + * This class is a JUnit4 test case. + */ +public class ObservationMediaOperationsTest extends ClinicalStatementOperationsTest { + + @SuppressWarnings("nls") + private static final CDATestCase TEST_CASE_ARRAY[] = { + // Act + // ------------------------------------------------------------- + new CDAAddTestCase("Act") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createAct(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addAct((ObservationMedia) objectToTest, (Act) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_Act(); + } + }, + + // Encounter + // ------------------------------------------------------------- + new CDAAddTestCase("Encounter") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createEncounter(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addEncounter((ObservationMedia) objectToTest, (Encounter) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_Encounter(); + } + }, + + // Observation + // ------------------------------------------------------------- + new CDAAddTestCase("Observation") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservation(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addObservation( + (ObservationMedia) objectToTest, (Observation) eObjectToAdd); + + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_Observation(); + } + }, + + // ObservationMedia + // ------------------------------------------------------------- + new CDAAddTestCase("ObservationMedia") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservationMedia(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addObservationMedia( + (ObservationMedia) objectToTest, (ObservationMedia) eObjectToAdd); + + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_ObservationMedia(); + } + }, + + // Organizer + // ------------------------------------------------------------- + new CDAAddTestCase("Organizer") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createOrganizer(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addOrganizer((ObservationMedia) objectToTest, (Organizer) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_Organizer(); + } + }, + + // Procedure + // ------------------------------------------------------------- + new CDAAddTestCase("Procedure") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createProcedure(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addProcedure((ObservationMedia) objectToTest, (Procedure) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_Procedure(); + } + }, + + // RegionOfInterest + // ------------------------------------------------------------- + new CDAAddTestCase("RegionOfInterest") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createRegionOfInterest(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addRegionOfInterest( + (ObservationMedia) objectToTest, (RegionOfInterest) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_RegionOfInterest(); + } + }, + + // SubstanceAdministration + // ------------------------------------------------------------- + new CDAAddTestCase("SubstanceAdministration") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSubstanceAdministration(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addSubstanceAdministration( + (ObservationMedia) objectToTest, (SubstanceAdministration) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_SubstanceAdministration(); + } + }, + + // Supply + // ------------------------------------------------------------- + new CDAAddTestCase("Supply") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSupply(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addSupply((ObservationMedia) objectToTest, (Supply) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_Supply(); + } + }, + // ************************************************************************* + // Act + // ------------------------------------------------------------- + new CDAGetTestCase("Act") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createAct(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addAct((ObservationMedia) objectToTest, (Act) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getActs((ObservationMedia) objectToTest); + } + }, + + // Encounter + // ------------------------------------------------------------- + new CDAGetTestCase("Encounter") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createEncounter(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addEncounter((ObservationMedia) objectToTest, (Encounter) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getEncounters((ObservationMedia) objectToTest); + } + + }, + + // Observation + // ------------------------------------------------------------- + new CDAGetTestCase("Observation") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservation(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addObservation( + (ObservationMedia) objectToTest, (Observation) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getObservations((ObservationMedia) objectToTest); + } + }, + + // ObservationMedia + // ------------------------------------------------------------- + new CDAGetTestCase("ObservationMedia") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservationMedia(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addObservationMedia( + (ObservationMedia) objectToTest, (ObservationMedia) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getObservationMedia((ObservationMedia) objectToTest); + } + }, + + // Organizer + // ------------------------------------------------------------- + new CDAGetTestCase("Organizer") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createOrganizer(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addOrganizer((ObservationMedia) objectToTest, (Organizer) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getOrganizers((ObservationMedia) objectToTest); + } + }, + + // Procedure + // ------------------------------------------------------------- + new CDAGetTestCase("Procedure") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createProcedure(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addProcedure((ObservationMedia) objectToTest, (Procedure) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getProcedures((ObservationMedia) objectToTest); + } + }, + + // RegionOfInterest + // ------------------------------------------------------------- + new CDAGetTestCase("RegionOfInterest") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createRegionOfInterest(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addRegionOfInterest( + (ObservationMedia) objectToTest, (RegionOfInterest) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getRegionsOfInterest((ObservationMedia) objectToTest); + } + }, + + // SubstanceAdministration + // ------------------------------------------------------------- + new CDAGetTestCase("SubstanceAdministration") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSubstanceAdministration(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addSubstanceAdministration( + (ObservationMedia) objectToTest, (SubstanceAdministration) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getSubstanceAdministrations((ObservationMedia) objectToTest); + } + }, + + // Supply + // ------------------------------------------------------------- + new CDAGetTestCase("Supply") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSupply(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addSupply((ObservationMedia) objectToTest, (Supply) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getSupplies((ObservationMedia) objectToTest); + } + }, + + // ClinicalDocument + // ------------------------------------------------------------- + new CDAGetTestCase("ClinicalDocument") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createClinicalDocument(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + // The Add is reversed, the objectToTest is added to the + // clinical document + final Section section = CDAFactory.eINSTANCE.createSection(); + section.addObservationMedia((ObservationMedia) objectToTest); + ((ClinicalDocument) eObjectToAdd).addSection(section); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getClinicalDocument((ObservationMedia) objectToTest); + } + + @Override + protected boolean isGetGood(final EObject eObjectToAdd, final Object value) { + return eObjectToAdd.equals(value); + } + }, + + // Section + // ------------------------------------------------------------- + new CDAGetTestCase("Section") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSection(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + // The Add is reversed, the objectToTest is added to the + // clinical document + ((Section) eObjectToAdd).addObservationMedia((ObservationMedia) objectToTest); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getSection((ObservationMedia) objectToTest); + } + + @Override + protected boolean isGetGood(final EObject eObjectToAdd, final Object value) { + return eObjectToAdd.equals(value); + } + }, + // ************************************************************************* + // Act + // ------------------------------------------------------------- + new CDAHasTestCase("Act") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createAct(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addAct((ObservationMedia) objectToTest, (Act) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasActTemplate((ObservationMedia) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Act) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Encounter + // ------------------------------------------------------------- + new CDAHasTestCase("Encounter") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createEncounter(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addEncounter((ObservationMedia) objectToTest, (Encounter) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasEncounterTemplate((ObservationMedia) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Encounter) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Observation + // ------------------------------------------------------------- + new CDAHasTestCase("Observation") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservation(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addObservation( + (ObservationMedia) objectToTest, (Observation) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasObservationTemplate( + (ObservationMedia) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Observation) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // ObservationMedia + // ------------------------------------------------------------- + new CDAHasTestCase("ObservationMedia") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservationMedia(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addObservationMedia( + (ObservationMedia) objectToTest, (ObservationMedia) eObjectToAdd); + + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasObservationMediaTemplate( + (ObservationMedia) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((ObservationMedia) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Organizer + // ------------------------------------------------------------- + new CDAHasTestCase("Organizer") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createOrganizer(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addOrganizer((ObservationMedia) objectToTest, (Organizer) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasOrganizerTemplate((ObservationMedia) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Organizer) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Procedure + // ------------------------------------------------------------- + new CDAHasTestCase("Procedure") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createProcedure(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addProcedure((ObservationMedia) objectToTest, (Procedure) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasProcedureTemplate((ObservationMedia) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Procedure) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // RegionOfInterest + // ------------------------------------------------------------- + new CDAHasTestCase("RegionOfInterest") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createRegionOfInterest(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addRegionOfInterest( + (ObservationMedia) objectToTest, (RegionOfInterest) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasRegionOfInterestTemplate( + (ObservationMedia) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((RegionOfInterest) eObjectToAdd).getTemplateIds().add(theIi); + } + + }, + + // SubstanceAdministration + // ------------------------------------------------------------- + new CDAHasTestCase("SubstanceAdministration") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSubstanceAdministration(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addSubstanceAdministration( + (ObservationMedia) objectToTest, (SubstanceAdministration) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasSubstanceAdministrationTemplate( + (ObservationMedia) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((SubstanceAdministration) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Supply + // ------------------------------------------------------------- + new CDAHasTestCase("Supply") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSupply(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addSupply((ObservationMedia) objectToTest, (Supply) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasSupplyTemplate((ObservationMedia) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Supply) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // TemplateID + // ------------------------------------------------------------- + new CDAHasTestCase("TemplateID") { + + @Override + protected void doTest(final EObject objectToTest, final BasicDiagnostic diagnostician, + final Map map) { + ((ObservationMedia) objectToTest).getTemplateIds().add(THE_II); + final boolean hasIsGood = doHas(objectToTest, TEMPLATE_ID); + assertTrue("Has \"" + getTestTargetDescription() + "\" failed for \"" + + objectToTest.eClass().getName() + "\"", hasIsGood); + } + + @Override + protected EObject getEObjectToAdd() { + return null; + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + // Nothing + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasTemplateId((ObservationMedia) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + // Nothing + } + } }; + + @Override + protected List getTestCases() { + // Return a new List because the one returned by Arrays.asList is + // unmodifiable so a sub-class can't append their test cases. + final List retValue = super.getTestCases(); + retValue.addAll(Arrays.asList(TEST_CASE_ARRAY)); + return retValue; + } + + @Override + protected EObject getObjectToTest() { + return CDAFactory.eINSTANCE.createObservationMedia(); + } + +} // ObservationMediaOperationsTest diff --git a/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/ObservationOperationsTest.java b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/ObservationOperationsTest.java new file mode 100644 index 000000000..ef91be398 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/ObservationOperationsTest.java @@ -0,0 +1,785 @@ +/******************************************************************************* + * Copyright (c) 2010, 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.operations; + +import static org.junit.Assert.assertTrue; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.openhealthtools.mdht.uml.cda.Act; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.CDAPackage; +import org.openhealthtools.mdht.uml.cda.ClinicalDocument; +import org.openhealthtools.mdht.uml.cda.Encounter; +import org.openhealthtools.mdht.uml.cda.Observation; +import org.openhealthtools.mdht.uml.cda.ObservationMedia; +import org.openhealthtools.mdht.uml.cda.Organizer; +import org.openhealthtools.mdht.uml.cda.Procedure; +import org.openhealthtools.mdht.uml.cda.RegionOfInterest; +import org.openhealthtools.mdht.uml.cda.Section; +import org.openhealthtools.mdht.uml.cda.SubstanceAdministration; +import org.openhealthtools.mdht.uml.cda.Supply; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; + +/** + * This class is a JUnit4 test case. + */ +public class ObservationOperationsTest extends ClinicalStatementOperationsTest { + + @SuppressWarnings("nls") + private static final CDATestCase TEST_CASE_ARRAY[] = { + // Act + // ------------------------------------------------------------- + new CDAAddTestCase("Act") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createAct(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addAct((Observation) objectToTest, (Act) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_Act(); + } + }, + + // Encounter + // ------------------------------------------------------------- + new CDAAddTestCase("Encounter") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createEncounter(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addEncounter((Observation) objectToTest, (Encounter) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_Encounter(); + } + }, + + // Observation + // ------------------------------------------------------------- + new CDAAddTestCase("Observation") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservation(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addObservation((Observation) objectToTest, (Observation) eObjectToAdd); + + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_Observation(); + } + }, + + // ObservationMedia + // ------------------------------------------------------------- + new CDAAddTestCase("ObservationMedia") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservationMedia(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addObservationMedia( + (Observation) objectToTest, (ObservationMedia) eObjectToAdd); + + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_ObservationMedia(); + } + }, + + // Organizer + // ------------------------------------------------------------- + new CDAAddTestCase("Organizer") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createOrganizer(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addOrganizer((Observation) objectToTest, (Organizer) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_Organizer(); + } + }, + + // Procedure + // ------------------------------------------------------------- + new CDAAddTestCase("Procedure") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createProcedure(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addProcedure((Observation) objectToTest, (Procedure) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_Procedure(); + } + }, + + // RegionOfInterest + // ------------------------------------------------------------- + new CDAAddTestCase("RegionOfInterest") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createRegionOfInterest(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addRegionOfInterest( + (Observation) objectToTest, (RegionOfInterest) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_RegionOfInterest(); + } + }, + + // SubstanceAdministration + // ------------------------------------------------------------- + new CDAAddTestCase("SubstanceAdministration") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSubstanceAdministration(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addSubstanceAdministration( + (Observation) objectToTest, (SubstanceAdministration) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_SubstanceAdministration(); + } + }, + + // Supply + // ------------------------------------------------------------- + new CDAAddTestCase("Supply") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSupply(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addSupply((Observation) objectToTest, (Supply) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_Supply(); + } + }, + // ************************************************************************* + // Act + // ------------------------------------------------------------- + new CDAGetTestCase("Act") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createAct(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addAct((Observation) objectToTest, (Act) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getActs((Observation) objectToTest); + } + }, + + // Encounter + // ------------------------------------------------------------- + new CDAGetTestCase("Encounter") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createEncounter(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addEncounter((Observation) objectToTest, (Encounter) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getEncounters((Observation) objectToTest); + } + + }, + + // Observation + // ------------------------------------------------------------- + new CDAGetTestCase("Observation") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservation(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addObservation((Observation) objectToTest, (Observation) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getObservations((Observation) objectToTest); + } + }, + + // ObservationMedia + // ------------------------------------------------------------- + new CDAGetTestCase("ObservationMedia") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservationMedia(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addObservationMedia( + (Observation) objectToTest, (ObservationMedia) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getObservationMedia((Observation) objectToTest); + } + }, + + // Organizer + // ------------------------------------------------------------- + new CDAGetTestCase("Organizer") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createOrganizer(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addOrganizer((Observation) objectToTest, (Organizer) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getOrganizers((Observation) objectToTest); + } + }, + + // Procedure + // ------------------------------------------------------------- + new CDAGetTestCase("Procedure") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createProcedure(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addProcedure((Observation) objectToTest, (Procedure) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getProcedures((Observation) objectToTest); + } + }, + + // RegionOfInterest + // ------------------------------------------------------------- + new CDAGetTestCase("RegionOfInterest") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createRegionOfInterest(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addRegionOfInterest( + (Observation) objectToTest, (RegionOfInterest) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getRegionsOfInterest((Observation) objectToTest); + } + }, + + // SubstanceAdministration + // ------------------------------------------------------------- + new CDAGetTestCase("SubstanceAdministration") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSubstanceAdministration(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addSubstanceAdministration( + (Observation) objectToTest, (SubstanceAdministration) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getSubstanceAdministrations((Observation) objectToTest); + } + }, + + // Supply + // ------------------------------------------------------------- + new CDAGetTestCase("Supply") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSupply(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addSupply((Observation) objectToTest, (Supply) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getSupplies((Observation) objectToTest); + } + }, + + // ClinicalDocument + // ------------------------------------------------------------- + new CDAGetTestCase("ClinicalDocument") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createClinicalDocument(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + // The Add is reversed, the objectToTest is added to the + // clinical document + final Section section = CDAFactory.eINSTANCE.createSection(); + section.addObservation((Observation) objectToTest); + ((ClinicalDocument) eObjectToAdd).addSection(section); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getClinicalDocument((Observation) objectToTest); + } + + @Override + protected boolean isGetGood(final EObject eObjectToAdd, final Object value) { + return eObjectToAdd.equals(value); + } + }, + + // Section + // ------------------------------------------------------------- + new CDAGetTestCase("Section") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSection(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + // The Add is reversed, the objectToTest is added to the + // clinical document + ((Section) eObjectToAdd).addObservation((Observation) objectToTest); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getSection((Observation) objectToTest); + } + + @Override + protected boolean isGetGood(final EObject eObjectToAdd, final Object value) { + return eObjectToAdd.equals(value); + } + }, + // ************************************************************************* + // Act + // ------------------------------------------------------------- + new CDAHasTestCase("Act") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createAct(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addAct((Observation) objectToTest, (Act) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasActTemplate((Observation) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Act) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Encounter + // ------------------------------------------------------------- + new CDAHasTestCase("Encounter") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createEncounter(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addEncounter((Observation) objectToTest, (Encounter) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasEncounterTemplate((Observation) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Encounter) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Code + // ------------------------------------------------------------- + new CDAHasTestCase("Code") { + + @Override + protected void doTest(final EObject objectToTest, final BasicDiagnostic diagnostician, + final Map map) { + ((Observation) objectToTest).setCode(THE_CODE); + final boolean hasIsGood = doHas(objectToTest, TEMPLATE_ID); + assertTrue("Has \"" + getTestTargetDescription() + "\" failed for \"" + + objectToTest.eClass().getName() + "\"", hasIsGood); + } + + @Override + protected EObject getEObjectToAdd() { + return null; + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addEncounter((Observation) objectToTest, (Encounter) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasCode( + (Observation) objectToTest, CODE, CODE_SYSTEM, CODE_SYSTEM_NAME); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Encounter) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Observation + // ------------------------------------------------------------- + new CDAHasTestCase("Observation") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservation(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addObservation((Observation) objectToTest, (Observation) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasObservationTemplate((Observation) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Observation) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // ObservationMedia + // ------------------------------------------------------------- + new CDAHasTestCase("ObservationMedia") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservationMedia(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addObservationMedia( + (Observation) objectToTest, (ObservationMedia) eObjectToAdd); + + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasObservationMediaTemplate( + (Observation) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((ObservationMedia) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Organizer + // ------------------------------------------------------------- + new CDAHasTestCase("Organizer") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createOrganizer(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addOrganizer((Observation) objectToTest, (Organizer) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasOrganizerTemplate((Observation) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Organizer) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Procedure + // ------------------------------------------------------------- + new CDAHasTestCase("Procedure") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createProcedure(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addProcedure((Observation) objectToTest, (Procedure) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasProcedureTemplate((Observation) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Procedure) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // RegionOfInterest + // ------------------------------------------------------------- + new CDAHasTestCase("RegionOfInterest") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createRegionOfInterest(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addRegionOfInterest( + (Observation) objectToTest, (RegionOfInterest) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasRegionOfInterestTemplate( + (Observation) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((RegionOfInterest) eObjectToAdd).getTemplateIds().add(theIi); + } + + }, + + // SubstanceAdministration + // ------------------------------------------------------------- + new CDAHasTestCase("SubstanceAdministration") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSubstanceAdministration(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addSubstanceAdministration( + (Observation) objectToTest, (SubstanceAdministration) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasSubstanceAdministrationTemplate( + (Observation) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((SubstanceAdministration) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Supply + // ------------------------------------------------------------- + new CDAHasTestCase("Supply") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSupply(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addSupply((Observation) objectToTest, (Supply) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasSupplyTemplate((Observation) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Supply) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // TemplateID + // ------------------------------------------------------------- + new CDAHasTestCase("TemplateID") { + + @Override + protected void doTest(final EObject objectToTest, final BasicDiagnostic diagnostician, + final Map map) { + ((Observation) objectToTest).getTemplateIds().add(THE_II); + final boolean hasIsGood = doHas(objectToTest, TEMPLATE_ID); + assertTrue("Has \"" + getTestTargetDescription() + "\" failed for \"" + + objectToTest.eClass().getName() + "\"", hasIsGood); + } + + @Override + protected EObject getEObjectToAdd() { + return null; + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + // Nothing + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasTemplateId((Observation) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + // Nothing + } + } }; + + @Override + protected List getTestCases() { + // Return a new List because the one returned by Arrays.asList is + // unmodifiable so a sub-class can't append their test cases. + final List retValue = super.getTestCases(); + retValue.addAll(Arrays.asList(TEST_CASE_ARRAY)); + return retValue; + } + + @Override + protected EObject getObjectToTest() { + return CDAFactory.eINSTANCE.createObservation(); + } + +} // ObservationOperationsTest diff --git a/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/OrganizerOperationsTest.java b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/OrganizerOperationsTest.java new file mode 100644 index 000000000..a412ffdda --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/OrganizerOperationsTest.java @@ -0,0 +1,777 @@ +/******************************************************************************* + * Copyright (c) 2010, 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.operations; + +import static org.junit.Assert.assertTrue; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.openhealthtools.mdht.uml.cda.Act; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.CDAPackage; +import org.openhealthtools.mdht.uml.cda.ClinicalDocument; +import org.openhealthtools.mdht.uml.cda.Encounter; +import org.openhealthtools.mdht.uml.cda.Observation; +import org.openhealthtools.mdht.uml.cda.ObservationMedia; +import org.openhealthtools.mdht.uml.cda.Organizer; +import org.openhealthtools.mdht.uml.cda.Procedure; +import org.openhealthtools.mdht.uml.cda.RegionOfInterest; +import org.openhealthtools.mdht.uml.cda.Section; +import org.openhealthtools.mdht.uml.cda.SubstanceAdministration; +import org.openhealthtools.mdht.uml.cda.Supply; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; + +/** + * This class is a JUnit4 test case. + */ +public class OrganizerOperationsTest extends ClinicalStatementOperationsTest { + + @SuppressWarnings("nls") + private static final CDATestCase TEST_CASE_ARRAY[] = { + // Act + // ------------------------------------------------------------- + new CDAAddTestCase("Act") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createAct(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + OrganizerOperations.addAct((Organizer) objectToTest, (Act) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getComponent4_Act(); + } + }, + + // Encounter + // ------------------------------------------------------------- + new CDAAddTestCase("Encounter") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createEncounter(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + OrganizerOperations.addEncounter((Organizer) objectToTest, (Encounter) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getComponent4_Encounter(); + } + }, + + // Observation + // ------------------------------------------------------------- + new CDAAddTestCase("Observation") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservation(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + OrganizerOperations.addObservation((Organizer) objectToTest, (Observation) eObjectToAdd); + + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getComponent4_Observation(); + } + }, + + // ObservationMedia + // ------------------------------------------------------------- + new CDAAddTestCase("ObservationMedia") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservationMedia(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + OrganizerOperations.addObservationMedia((Organizer) objectToTest, (ObservationMedia) eObjectToAdd); + + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getComponent4_ObservationMedia(); + } + }, + + // Organizer + // ------------------------------------------------------------- + new CDAAddTestCase("Organizer") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createOrganizer(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + OrganizerOperations.addOrganizer((Organizer) objectToTest, (Organizer) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getComponent4_Organizer(); + } + }, + + // Procedure + // ------------------------------------------------------------- + new CDAAddTestCase("Procedure") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createProcedure(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + OrganizerOperations.addProcedure((Organizer) objectToTest, (Procedure) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getComponent4_Procedure(); + } + }, + + // RegionOfInterest + // ------------------------------------------------------------- + new CDAAddTestCase("RegionOfInterest") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createRegionOfInterest(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + OrganizerOperations.addRegionOfInterest((Organizer) objectToTest, (RegionOfInterest) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getComponent4_RegionOfInterest(); + } + }, + + // SubstanceAdministration + // ------------------------------------------------------------- + new CDAAddTestCase("SubstanceAdministration") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSubstanceAdministration(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + OrganizerOperations.addSubstanceAdministration( + (Organizer) objectToTest, (SubstanceAdministration) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getComponent4_SubstanceAdministration(); + } + }, + + // Supply + // ------------------------------------------------------------- + new CDAAddTestCase("Supply") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSupply(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + OrganizerOperations.addSupply((Organizer) objectToTest, (Supply) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getComponent4_Supply(); + } + }, + // ************************************************************************* + // Act + // ------------------------------------------------------------- + new CDAGetTestCase("Act") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createAct(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + OrganizerOperations.addAct((Organizer) objectToTest, (Act) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return OrganizerOperations.getActs((Organizer) objectToTest); + } + }, + + // Encounter + // ------------------------------------------------------------- + new CDAGetTestCase("Encounter") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createEncounter(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + OrganizerOperations.addEncounter((Organizer) objectToTest, (Encounter) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return OrganizerOperations.getEncounters((Organizer) objectToTest); + } + + }, + + // Observation + // ------------------------------------------------------------- + new CDAGetTestCase("Observation") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservation(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + OrganizerOperations.addObservation((Organizer) objectToTest, (Observation) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return OrganizerOperations.getObservations((Organizer) objectToTest); + } + }, + + // ObservationMedia + // ------------------------------------------------------------- + new CDAGetTestCase("ObservationMedia") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservationMedia(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + OrganizerOperations.addObservationMedia((Organizer) objectToTest, (ObservationMedia) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return OrganizerOperations.getObservationMedia((Organizer) objectToTest); + } + }, + + // Organizer + // ------------------------------------------------------------- + new CDAGetTestCase("Organizer") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createOrganizer(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + OrganizerOperations.addOrganizer((Organizer) objectToTest, (Organizer) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return OrganizerOperations.getOrganizers((Organizer) objectToTest); + } + }, + + // Procedure + // ------------------------------------------------------------- + new CDAGetTestCase("Procedure") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createProcedure(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + OrganizerOperations.addProcedure((Organizer) objectToTest, (Procedure) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return OrganizerOperations.getProcedures((Organizer) objectToTest); + } + }, + + // RegionOfInterest + // ------------------------------------------------------------- + new CDAGetTestCase("RegionOfInterest") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createRegionOfInterest(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + OrganizerOperations.addRegionOfInterest((Organizer) objectToTest, (RegionOfInterest) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return OrganizerOperations.getRegionsOfInterest((Organizer) objectToTest); + } + }, + + // SubstanceAdministration + // ------------------------------------------------------------- + new CDAGetTestCase("SubstanceAdministration") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSubstanceAdministration(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + OrganizerOperations.addSubstanceAdministration( + (Organizer) objectToTest, (SubstanceAdministration) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return OrganizerOperations.getSubstanceAdministrations((Organizer) objectToTest); + } + }, + + // Supply + // ------------------------------------------------------------- + new CDAGetTestCase("Supply") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSupply(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + OrganizerOperations.addSupply((Organizer) objectToTest, (Supply) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return OrganizerOperations.getSupplies((Organizer) objectToTest); + } + }, + + // ClinicalDocument + // ------------------------------------------------------------- + new CDAGetTestCase("ClinicalDocument") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createClinicalDocument(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + // The Add is reversed, the objectToTest is added to the + // clinical document + final Section section = CDAFactory.eINSTANCE.createSection(); + section.addOrganizer((Organizer) objectToTest); + ((ClinicalDocument) eObjectToAdd).addSection(section); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getClinicalDocument((Organizer) objectToTest); + } + + @Override + protected boolean isGetGood(final EObject eObjectToAdd, final Object value) { + return eObjectToAdd.equals(value); + } + }, + + // Section + // ------------------------------------------------------------- + new CDAGetTestCase("Section") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSection(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + // The Add is reversed, the objectToTest is added to the + // clinical document + ((Section) eObjectToAdd).addOrganizer((Organizer) objectToTest); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getSection((Organizer) objectToTest); + } + + @Override + protected boolean isGetGood(final EObject eObjectToAdd, final Object value) { + return eObjectToAdd.equals(value); + } + }, + // ************************************************************************* + // Act + // ------------------------------------------------------------- + new CDAHasTestCase("Act") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createAct(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + OrganizerOperations.addAct((Organizer) objectToTest, (Act) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasActTemplate((Organizer) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Act) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Encounter + // ------------------------------------------------------------- + new CDAHasTestCase("Encounter") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createEncounter(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + OrganizerOperations.addEncounter((Organizer) objectToTest, (Encounter) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasEncounterTemplate((Organizer) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Encounter) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Code + // ------------------------------------------------------------- + new CDAHasTestCase("Code") { + + @Override + protected void doTest(final EObject objectToTest, final BasicDiagnostic diagnostician, + final Map map) { + ((Organizer) objectToTest).setCode(THE_CODE); + final boolean hasIsGood = doHas(objectToTest, TEMPLATE_ID); + assertTrue("Has \"" + getTestTargetDescription() + "\" failed for \"" + + objectToTest.eClass().getName() + "\"", hasIsGood); + } + + @Override + protected EObject getEObjectToAdd() { + return null; + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + OrganizerOperations.addEncounter((Organizer) objectToTest, (Encounter) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasCode( + (Organizer) objectToTest, CODE, CODE_SYSTEM, CODE_SYSTEM_NAME); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Encounter) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Observation + // ------------------------------------------------------------- + new CDAHasTestCase("Observation") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservation(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + OrganizerOperations.addObservation((Organizer) objectToTest, (Observation) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasObservationTemplate((Organizer) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Observation) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // ObservationMedia + // ------------------------------------------------------------- + new CDAHasTestCase("ObservationMedia") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservationMedia(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + OrganizerOperations.addObservationMedia((Organizer) objectToTest, (ObservationMedia) eObjectToAdd); + + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasObservationMediaTemplate((Organizer) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((ObservationMedia) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Organizer + // ------------------------------------------------------------- + new CDAHasTestCase("Organizer") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createOrganizer(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + OrganizerOperations.addOrganizer((Organizer) objectToTest, (Organizer) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasOrganizerTemplate((Organizer) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Organizer) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Procedure + // ------------------------------------------------------------- + new CDAHasTestCase("Procedure") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createProcedure(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + OrganizerOperations.addProcedure((Organizer) objectToTest, (Procedure) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasProcedureTemplate((Organizer) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Procedure) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // RegionOfInterest + // ------------------------------------------------------------- + new CDAHasTestCase("RegionOfInterest") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createRegionOfInterest(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + OrganizerOperations.addRegionOfInterest((Organizer) objectToTest, (RegionOfInterest) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasRegionOfInterestTemplate((Organizer) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((RegionOfInterest) eObjectToAdd).getTemplateIds().add(theIi); + } + + }, + + // SubstanceAdministration + // ------------------------------------------------------------- + new CDAHasTestCase("SubstanceAdministration") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSubstanceAdministration(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + OrganizerOperations.addSubstanceAdministration( + (Organizer) objectToTest, (SubstanceAdministration) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasSubstanceAdministrationTemplate( + (Organizer) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((SubstanceAdministration) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Supply + // ------------------------------------------------------------- + new CDAHasTestCase("Supply") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSupply(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + OrganizerOperations.addSupply((Organizer) objectToTest, (Supply) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasSupplyTemplate((Organizer) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Supply) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // TemplateID + // ------------------------------------------------------------- + new CDAHasTestCase("TemplateID") { + + @Override + protected void doTest(final EObject objectToTest, final BasicDiagnostic diagnostician, + final Map map) { + ((Organizer) objectToTest).getTemplateIds().add(THE_II); + final boolean hasIsGood = doHas(objectToTest, TEMPLATE_ID); + assertTrue("Has \"" + getTestTargetDescription() + "\" failed for \"" + + objectToTest.eClass().getName() + "\"", hasIsGood); + } + + @Override + protected EObject getEObjectToAdd() { + return null; + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + // Nothing + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasTemplateId((Organizer) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + // Nothing + } + } }; + + @Override + protected List getTestCases() { + // Return a new List because the one returned by Arrays.asList is + // unmodifiable so a sub-class can't append their test cases. + final List retValue = super.getTestCases(); + retValue.addAll(Arrays.asList(TEST_CASE_ARRAY)); + return retValue; + } + + @Override + protected EObject getObjectToTest() { + return CDAFactory.eINSTANCE.createOrganizer(); + } + +} // OrganizerOperationsTest diff --git a/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/ParticipantRoleOperationsTest.java b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/ParticipantRoleOperationsTest.java new file mode 100644 index 000000000..c220cc972 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/ParticipantRoleOperationsTest.java @@ -0,0 +1,79 @@ +/******************************************************************************* + * Copyright (c) 2010, 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.operations; + +import static org.junit.Assert.assertTrue; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.ParticipantRole; + +/** + * This class is a JUnit4 test case. + */ +@SuppressWarnings("nls") +public class ParticipantRoleOperationsTest extends CDAValidationTest { + + /** + * The names of the references to include in the test. + */ + public static final Set EREFERENCE_NAMES = new HashSet(Arrays.asList( + "playingDevice", "playingEntity")); + + /** + * Not a real test, needed for EMMA to report 100% method coverage. + */ + @SuppressWarnings("unused") + @Test + public final void testConstructor() { + ParticipantRoleOperations obj = new ParticipantRoleOperations(); + assertTrue(true); + } // testConstructor + + private static final CDATestCase TEST_CASE_ARRAY[] = { + // UndefinedOR + // ------------------------------------------------------------- + new UndefinedORValidationTestCase("ParticipantRole", EREFERENCE_NAMES) { + + @Override + protected boolean validate(final EObject objectToTest, final BasicDiagnostic diagnostician, + final Map map) { + return ParticipantRoleOperations.validatePlayingEntityChoice( + (ParticipantRole) objectToTest, diagnostician, map); + } + } }; + + @Override + protected List getTestCases() { + // Return a new List because the one returned by Arrays.asList is + // unmodifiable so a sub-class can't append their test cases. + final List retValue = super.getTestCases(); + retValue.addAll(Arrays.asList(TEST_CASE_ARRAY)); + return retValue; + } + + /** + * @see org.openhealthtools.mdht.uml.cda.operations.MutualExclusionValidationTest#getObjectToTest() + */ + @Override + protected EObject getObjectToTest() { + return CDAFactory.eINSTANCE.createParticipantRole(); + } + +} // ParticipantRoleOperationsTest diff --git a/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/ProcedureOperationsTest.java b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/ProcedureOperationsTest.java new file mode 100644 index 000000000..ea682e5bf --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/ProcedureOperationsTest.java @@ -0,0 +1,783 @@ +/******************************************************************************* + * Copyright (c) 2010, 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.operations; + +import static org.junit.Assert.assertTrue; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.openhealthtools.mdht.uml.cda.Act; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.CDAPackage; +import org.openhealthtools.mdht.uml.cda.ClinicalDocument; +import org.openhealthtools.mdht.uml.cda.Encounter; +import org.openhealthtools.mdht.uml.cda.Observation; +import org.openhealthtools.mdht.uml.cda.ObservationMedia; +import org.openhealthtools.mdht.uml.cda.Organizer; +import org.openhealthtools.mdht.uml.cda.Procedure; +import org.openhealthtools.mdht.uml.cda.RegionOfInterest; +import org.openhealthtools.mdht.uml.cda.Section; +import org.openhealthtools.mdht.uml.cda.SubstanceAdministration; +import org.openhealthtools.mdht.uml.cda.Supply; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; + +/** + * This class is a JUnit4 test case. + */ +public class ProcedureOperationsTest extends ClinicalStatementOperationsTest { + + @SuppressWarnings("nls") + private static final CDATestCase TEST_CASE_ARRAY[] = { + // Act + // ------------------------------------------------------------- + new CDAAddTestCase("Act") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createAct(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addAct((Procedure) objectToTest, (Act) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_Act(); + } + }, + + // Encounter + // ------------------------------------------------------------- + new CDAAddTestCase("Encounter") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createEncounter(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addEncounter((Procedure) objectToTest, (Encounter) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_Encounter(); + } + }, + + // Observation + // ------------------------------------------------------------- + new CDAAddTestCase("Observation") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservation(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addObservation((Procedure) objectToTest, (Observation) eObjectToAdd); + + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_Observation(); + } + }, + + // ObservationMedia + // ------------------------------------------------------------- + new CDAAddTestCase("ObservationMedia") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservationMedia(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addObservationMedia( + (Procedure) objectToTest, (ObservationMedia) eObjectToAdd); + + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_ObservationMedia(); + } + }, + + // Organizer + // ------------------------------------------------------------- + new CDAAddTestCase("Organizer") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createOrganizer(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addOrganizer((Procedure) objectToTest, (Organizer) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_Organizer(); + } + }, + + // Procedure + // ------------------------------------------------------------- + new CDAAddTestCase("Procedure") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createProcedure(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addProcedure((Procedure) objectToTest, (Procedure) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_Procedure(); + } + }, + + // RegionOfInterest + // ------------------------------------------------------------- + new CDAAddTestCase("RegionOfInterest") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createRegionOfInterest(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addRegionOfInterest( + (Procedure) objectToTest, (RegionOfInterest) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_RegionOfInterest(); + } + }, + + // SubstanceAdministration + // ------------------------------------------------------------- + new CDAAddTestCase("SubstanceAdministration") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSubstanceAdministration(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addSubstanceAdministration( + (Procedure) objectToTest, (SubstanceAdministration) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_SubstanceAdministration(); + } + }, + + // Supply + // ------------------------------------------------------------- + new CDAAddTestCase("Supply") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSupply(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addSupply((Procedure) objectToTest, (Supply) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_Supply(); + } + }, + // ************************************************************************* + // Act + // ------------------------------------------------------------- + new CDAGetTestCase("Act") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createAct(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addAct((Procedure) objectToTest, (Act) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getActs((Procedure) objectToTest); + } + }, + + // Encounter + // ------------------------------------------------------------- + new CDAGetTestCase("Encounter") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createEncounter(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addEncounter((Procedure) objectToTest, (Encounter) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getEncounters((Procedure) objectToTest); + } + + }, + + // Observation + // ------------------------------------------------------------- + new CDAGetTestCase("Observation") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservation(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addObservation((Procedure) objectToTest, (Observation) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getObservations((Procedure) objectToTest); + } + }, + + // ObservationMedia + // ------------------------------------------------------------- + new CDAGetTestCase("ObservationMedia") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservationMedia(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addObservationMedia( + (Procedure) objectToTest, (ObservationMedia) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getObservationMedia((Procedure) objectToTest); + } + }, + + // Organizer + // ------------------------------------------------------------- + new CDAGetTestCase("Organizer") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createOrganizer(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addOrganizer((Procedure) objectToTest, (Organizer) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getOrganizers((Procedure) objectToTest); + } + }, + + // Procedure + // ------------------------------------------------------------- + new CDAGetTestCase("Procedure") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createProcedure(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addProcedure((Procedure) objectToTest, (Procedure) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getProcedures((Procedure) objectToTest); + } + }, + + // RegionOfInterest + // ------------------------------------------------------------- + new CDAGetTestCase("RegionOfInterest") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createRegionOfInterest(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addRegionOfInterest( + (Procedure) objectToTest, (RegionOfInterest) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getRegionsOfInterest((Procedure) objectToTest); + } + }, + + // SubstanceAdministration + // ------------------------------------------------------------- + new CDAGetTestCase("SubstanceAdministration") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSubstanceAdministration(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addSubstanceAdministration( + (Procedure) objectToTest, (SubstanceAdministration) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getSubstanceAdministrations((Procedure) objectToTest); + } + }, + + // Supply + // ------------------------------------------------------------- + new CDAGetTestCase("Supply") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSupply(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addSupply((Procedure) objectToTest, (Supply) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getSupplies((Procedure) objectToTest); + } + }, + + // ClinicalDocument + // ------------------------------------------------------------- + new CDAGetTestCase("ClinicalDocument") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createClinicalDocument(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + // The Add is reversed, the objectToTest is added to the + // clinical document + final Section section = CDAFactory.eINSTANCE.createSection(); + section.addProcedure((Procedure) objectToTest); + ((ClinicalDocument) eObjectToAdd).addSection(section); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getClinicalDocument((Procedure) objectToTest); + } + + @Override + protected boolean isGetGood(final EObject eObjectToAdd, final Object value) { + return eObjectToAdd.equals(value); + } + }, + + // Section + // ------------------------------------------------------------- + new CDAGetTestCase("Section") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSection(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + // The Add is reversed, the objectToTest is added to the + // clinical document + ((Section) eObjectToAdd).addProcedure((Procedure) objectToTest); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getSection((Procedure) objectToTest); + } + + @Override + protected boolean isGetGood(final EObject eObjectToAdd, final Object value) { + return eObjectToAdd.equals(value); + } + }, + // ************************************************************************* + // Act + // ------------------------------------------------------------- + new CDAHasTestCase("Act") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createAct(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addAct((Procedure) objectToTest, (Act) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasActTemplate((Procedure) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Act) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Encounter + // ------------------------------------------------------------- + new CDAHasTestCase("Encounter") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createEncounter(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addEncounter((Procedure) objectToTest, (Encounter) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasEncounterTemplate((Procedure) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Encounter) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Code + // ------------------------------------------------------------- + new CDAHasTestCase("Code") { + + @Override + protected void doTest(final EObject objectToTest, final BasicDiagnostic diagnostician, + final Map map) { + ((Procedure) objectToTest).setCode(THE_CODE); + final boolean hasIsGood = doHas(objectToTest, TEMPLATE_ID); + assertTrue("Has \"" + getTestTargetDescription() + "\" failed for \"" + + objectToTest.eClass().getName() + "\"", hasIsGood); + } + + @Override + protected EObject getEObjectToAdd() { + return null; + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addEncounter((Procedure) objectToTest, (Encounter) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasCode( + (Procedure) objectToTest, CODE, CODE_SYSTEM, CODE_SYSTEM_NAME); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Encounter) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Observation + // ------------------------------------------------------------- + new CDAHasTestCase("Observation") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservation(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addObservation((Procedure) objectToTest, (Observation) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasObservationTemplate((Procedure) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Observation) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // ObservationMedia + // ------------------------------------------------------------- + new CDAHasTestCase("ObservationMedia") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservationMedia(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addObservationMedia( + (Procedure) objectToTest, (ObservationMedia) eObjectToAdd); + + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasObservationMediaTemplate((Procedure) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((ObservationMedia) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Organizer + // ------------------------------------------------------------- + new CDAHasTestCase("Organizer") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createOrganizer(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addOrganizer((Procedure) objectToTest, (Organizer) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasOrganizerTemplate((Procedure) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Organizer) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Procedure + // ------------------------------------------------------------- + new CDAHasTestCase("Procedure") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createProcedure(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addProcedure((Procedure) objectToTest, (Procedure) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasProcedureTemplate((Procedure) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Procedure) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // RegionOfInterest + // ------------------------------------------------------------- + new CDAHasTestCase("RegionOfInterest") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createRegionOfInterest(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addRegionOfInterest( + (Procedure) objectToTest, (RegionOfInterest) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasRegionOfInterestTemplate((Procedure) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((RegionOfInterest) eObjectToAdd).getTemplateIds().add(theIi); + } + + }, + + // SubstanceAdministration + // ------------------------------------------------------------- + new CDAHasTestCase("SubstanceAdministration") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSubstanceAdministration(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addSubstanceAdministration( + (Procedure) objectToTest, (SubstanceAdministration) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasSubstanceAdministrationTemplate( + (Procedure) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((SubstanceAdministration) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Supply + // ------------------------------------------------------------- + new CDAHasTestCase("Supply") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSupply(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addSupply((Procedure) objectToTest, (Supply) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasSupplyTemplate((Procedure) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Supply) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // TemplateID + // ------------------------------------------------------------- + new CDAHasTestCase("TemplateID") { + + @Override + protected void doTest(final EObject objectToTest, final BasicDiagnostic diagnostician, + final Map map) { + ((Procedure) objectToTest).getTemplateIds().add(THE_II); + final boolean hasIsGood = doHas(objectToTest, TEMPLATE_ID); + assertTrue("Has \"" + getTestTargetDescription() + "\" failed for \"" + + objectToTest.eClass().getName() + "\"", hasIsGood); + } + + @Override + protected EObject getEObjectToAdd() { + return null; + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + // Nothing + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasTemplateId((Procedure) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + // Nothing + } + } }; + + @Override + protected List getTestCases() { + // Return a new List because the one returned by Arrays.asList is + // unmodifiable so a sub-class can't append their test cases. + final List retValue = super.getTestCases(); + retValue.addAll(Arrays.asList(TEST_CASE_ARRAY)); + return retValue; + } + + @Override + protected EObject getObjectToTest() { + return CDAFactory.eINSTANCE.createProcedure(); + } + +} // ProcedureOperationsTest diff --git a/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/ReferenceOperationsTest.java b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/ReferenceOperationsTest.java new file mode 100644 index 000000000..d86c55d18 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/ReferenceOperationsTest.java @@ -0,0 +1,88 @@ +/******************************************************************************* + * Copyright (c) 2010, 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.operations; + +import static org.junit.Assert.assertTrue; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.Reference; + +/** + * This class is a JUnit4 test case. + */ +@SuppressWarnings("nls") +public class ReferenceOperationsTest extends CDAValidationTest { + + /** + * This is the list of the names of the EReferences that cannot be set + * simultaneously. It is missing the name "externalAct" because that + * reference is always set, and the others are set individually in sequence + * (and then unSet) to test that they invalidate the test. + */ + public static final Set MUTUALLY_EXCLUSIVE_EREFERENCE_NAMES = new HashSet(Arrays.asList( + /* "externalAct", */"externalDocument", "externalObservation", "externalProcedure")); + + /** + * Not a real test, needed for EMMA to report 100% method coverage. + */ + @SuppressWarnings("unused") + @Test + public final void testConstructor() { + ReferenceOperations obj = new ReferenceOperations(); + assertTrue(true); + } // testConstructor + + private static final CDATestCase TEST_CASE_ARRAY[] = { + // MutualExclusionValidationTestCase + // ------------------------------------------------------------- + new MutualExclusionValidationTestCase("Entry", MUTUALLY_EXCLUSIVE_EREFERENCE_NAMES) { + + @Override + protected boolean validate(final EObject objectToTest, final BasicDiagnostic diagnostician, + final Map map) { + return ReferenceOperations.validateExternalActChoice((Reference) objectToTest, diagnostician, map); + } + + @Override + protected void initializeobjectToTest(final EObject objectToTest) { + ((Reference) objectToTest).setExternalAct(CDAFactory.eINSTANCE.createExternalAct()); + } + } }; + + @Override + protected List getTestCases() { + // Return a new List because the one returned by Arrays.asList is + // unmodifiable so a sub-class can't append their test cases. + final List retValue = super.getTestCases(); + retValue.addAll(Arrays.asList(TEST_CASE_ARRAY)); + return retValue; + } + + // + + /** + * @return the EObject instance to be validated + */ + @Override + protected EObject getObjectToTest() { + return CDAFactory.eINSTANCE.createReference(); + } // getObjectToTest() + +} // ReferenceOperationsTest diff --git a/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/RegionOfInterestOperationsTest.java b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/RegionOfInterestOperationsTest.java new file mode 100644 index 000000000..f826fe52a --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/RegionOfInterestOperationsTest.java @@ -0,0 +1,788 @@ +/******************************************************************************* + * Copyright (c) 2010, 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.operations; + +import static org.junit.Assert.assertTrue; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.openhealthtools.mdht.uml.cda.Act; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.CDAPackage; +import org.openhealthtools.mdht.uml.cda.ClinicalDocument; +import org.openhealthtools.mdht.uml.cda.Encounter; +import org.openhealthtools.mdht.uml.cda.Observation; +import org.openhealthtools.mdht.uml.cda.ObservationMedia; +import org.openhealthtools.mdht.uml.cda.Organizer; +import org.openhealthtools.mdht.uml.cda.Procedure; +import org.openhealthtools.mdht.uml.cda.RegionOfInterest; +import org.openhealthtools.mdht.uml.cda.Section; +import org.openhealthtools.mdht.uml.cda.SubstanceAdministration; +import org.openhealthtools.mdht.uml.cda.Supply; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; + +/** + * This class is a JUnit4 test case. + */ +public class RegionOfInterestOperationsTest extends ClinicalStatementOperationsTest { + + @SuppressWarnings("nls") + private static final CDATestCase TEST_CASE_ARRAY[] = { + // Act + // ------------------------------------------------------------- + new CDAAddTestCase("Act") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createAct(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addAct((RegionOfInterest) objectToTest, (Act) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_Act(); + } + }, + + // Encounter + // ------------------------------------------------------------- + new CDAAddTestCase("Encounter") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createEncounter(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addEncounter((RegionOfInterest) objectToTest, (Encounter) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_Encounter(); + } + }, + + // Observation + // ------------------------------------------------------------- + new CDAAddTestCase("Observation") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservation(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addObservation( + (RegionOfInterest) objectToTest, (Observation) eObjectToAdd); + + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_Observation(); + } + }, + + // ObservationMedia + // ------------------------------------------------------------- + new CDAAddTestCase("ObservationMedia") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservationMedia(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addObservationMedia( + (RegionOfInterest) objectToTest, (ObservationMedia) eObjectToAdd); + + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_ObservationMedia(); + } + }, + + // Organizer + // ------------------------------------------------------------- + new CDAAddTestCase("Organizer") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createOrganizer(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addOrganizer((RegionOfInterest) objectToTest, (Organizer) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_Organizer(); + } + }, + + // Procedure + // ------------------------------------------------------------- + new CDAAddTestCase("Procedure") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createProcedure(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addProcedure((RegionOfInterest) objectToTest, (Procedure) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_Procedure(); + } + }, + + // RegionOfInterest + // ------------------------------------------------------------- + new CDAAddTestCase("RegionOfInterest") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createRegionOfInterest(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addRegionOfInterest( + (RegionOfInterest) objectToTest, (RegionOfInterest) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_RegionOfInterest(); + } + }, + + // SubstanceAdministration + // ------------------------------------------------------------- + new CDAAddTestCase("SubstanceAdministration") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSubstanceAdministration(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addSubstanceAdministration( + (RegionOfInterest) objectToTest, (SubstanceAdministration) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_SubstanceAdministration(); + } + }, + + // Supply + // ------------------------------------------------------------- + new CDAAddTestCase("Supply") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSupply(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addSupply((RegionOfInterest) objectToTest, (Supply) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_Supply(); + } + }, + // ************************************************************************* + // Act + // ------------------------------------------------------------- + new CDAGetTestCase("Act") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createAct(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addAct((RegionOfInterest) objectToTest, (Act) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getActs((RegionOfInterest) objectToTest); + } + }, + + // Encounter + // ------------------------------------------------------------- + new CDAGetTestCase("Encounter") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createEncounter(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addEncounter((RegionOfInterest) objectToTest, (Encounter) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getEncounters((RegionOfInterest) objectToTest); + } + + }, + + // Observation + // ------------------------------------------------------------- + new CDAGetTestCase("Observation") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservation(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addObservation( + (RegionOfInterest) objectToTest, (Observation) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getObservations((RegionOfInterest) objectToTest); + } + }, + + // ObservationMedia + // ------------------------------------------------------------- + new CDAGetTestCase("ObservationMedia") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservationMedia(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addObservationMedia( + (RegionOfInterest) objectToTest, (ObservationMedia) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getObservationMedia((RegionOfInterest) objectToTest); + } + }, + + // Organizer + // ------------------------------------------------------------- + new CDAGetTestCase("Organizer") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createOrganizer(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addOrganizer((RegionOfInterest) objectToTest, (Organizer) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getOrganizers((RegionOfInterest) objectToTest); + } + }, + + // Procedure + // ------------------------------------------------------------- + new CDAGetTestCase("Procedure") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createProcedure(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addProcedure((RegionOfInterest) objectToTest, (Procedure) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getProcedures((RegionOfInterest) objectToTest); + } + }, + + // RegionOfInterest + // ------------------------------------------------------------- + new CDAGetTestCase("RegionOfInterest") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createRegionOfInterest(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addRegionOfInterest( + (RegionOfInterest) objectToTest, (RegionOfInterest) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getRegionsOfInterest((RegionOfInterest) objectToTest); + } + }, + + // SubstanceAdministration + // ------------------------------------------------------------- + new CDAGetTestCase("SubstanceAdministration") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSubstanceAdministration(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addSubstanceAdministration( + (RegionOfInterest) objectToTest, (SubstanceAdministration) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getSubstanceAdministrations((RegionOfInterest) objectToTest); + } + }, + + // Supply + // ------------------------------------------------------------- + new CDAGetTestCase("Supply") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSupply(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addSupply((RegionOfInterest) objectToTest, (Supply) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getSupplies((RegionOfInterest) objectToTest); + } + }, + + // ClinicalDocument + // ------------------------------------------------------------- + new CDAGetTestCase("ClinicalDocument") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createClinicalDocument(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + // The Add is reversed, the objectToTest is added to the + // clinical document + final Section section = CDAFactory.eINSTANCE.createSection(); + section.addRegionOfInterest((RegionOfInterest) objectToTest); + ((ClinicalDocument) eObjectToAdd).addSection(section); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getClinicalDocument((RegionOfInterest) objectToTest); + } + + @Override + protected boolean isGetGood(final EObject eObjectToAdd, final Object value) { + return eObjectToAdd.equals(value); + } + }, + + // Section + // ------------------------------------------------------------- + new CDAGetTestCase("Section") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSection(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + // The Add is reversed, the objectToTest is added to the + // clinical document + ((Section) eObjectToAdd).addRegionOfInterest((RegionOfInterest) objectToTest); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getSection((RegionOfInterest) objectToTest); + } + + @Override + protected boolean isGetGood(final EObject eObjectToAdd, final Object value) { + return eObjectToAdd.equals(value); + } + }, + // ************************************************************************* + // Act + // ------------------------------------------------------------- + new CDAHasTestCase("Act") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createAct(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addAct((RegionOfInterest) objectToTest, (Act) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasActTemplate((RegionOfInterest) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Act) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Code + // ------------------------------------------------------------- + new CDAHasTestCase("Code") { + + @Override + protected void doTest(final EObject objectToTest, final BasicDiagnostic diagnostician, + final Map map) { + ((RegionOfInterest) objectToTest).setCode(THE_CS_CODE); + final boolean hasIsGood = doHas(objectToTest, TEMPLATE_ID); + assertTrue("Has \"" + getTestTargetDescription() + "\" failed for \"" + + objectToTest.eClass().getName() + "\"", hasIsGood); + } + + @Override + protected EObject getEObjectToAdd() { + return null; + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + // nothing + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasCode((RegionOfInterest) objectToTest, CODE, null, null); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + // nothing + } + }, + + // Encounter + // ------------------------------------------------------------- + new CDAHasTestCase("Encounter") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createEncounter(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addEncounter((RegionOfInterest) objectToTest, (Encounter) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasEncounterTemplate((RegionOfInterest) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Encounter) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Observation + // ------------------------------------------------------------- + new CDAHasTestCase("Observation") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservation(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addObservation( + (RegionOfInterest) objectToTest, (Observation) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasObservationTemplate( + (RegionOfInterest) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Observation) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // ObservationMedia + // ------------------------------------------------------------- + new CDAHasTestCase("ObservationMedia") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservationMedia(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addObservationMedia( + (RegionOfInterest) objectToTest, (ObservationMedia) eObjectToAdd); + + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasObservationMediaTemplate( + (RegionOfInterest) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((ObservationMedia) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Organizer + // ------------------------------------------------------------- + new CDAHasTestCase("Organizer") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createOrganizer(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addOrganizer((RegionOfInterest) objectToTest, (Organizer) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasOrganizerTemplate((RegionOfInterest) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Organizer) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Procedure + // ------------------------------------------------------------- + new CDAHasTestCase("Procedure") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createProcedure(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addProcedure((RegionOfInterest) objectToTest, (Procedure) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasProcedureTemplate((RegionOfInterest) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Procedure) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // RegionOfInterest + // ------------------------------------------------------------- + new CDAHasTestCase("RegionOfInterest") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createRegionOfInterest(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addRegionOfInterest( + (RegionOfInterest) objectToTest, (RegionOfInterest) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasRegionOfInterestTemplate( + (RegionOfInterest) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((RegionOfInterest) eObjectToAdd).getTemplateIds().add(theIi); + } + + }, + + // SubstanceAdministration + // ------------------------------------------------------------- + new CDAHasTestCase("SubstanceAdministration") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSubstanceAdministration(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addSubstanceAdministration( + (RegionOfInterest) objectToTest, (SubstanceAdministration) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasSubstanceAdministrationTemplate( + (RegionOfInterest) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((SubstanceAdministration) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Supply + // ------------------------------------------------------------- + new CDAHasTestCase("Supply") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSupply(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addSupply((RegionOfInterest) objectToTest, (Supply) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasSupplyTemplate((RegionOfInterest) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Supply) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // TemplateID + // ------------------------------------------------------------- + new CDAHasTestCase("TemplateID") { + + @Override + protected void doTest(final EObject objectToTest, final BasicDiagnostic diagnostician, + final Map map) { + ((RegionOfInterest) objectToTest).getTemplateIds().add(THE_II); + final boolean hasIsGood = doHas(objectToTest, TEMPLATE_ID); + assertTrue("Has \"" + getTestTargetDescription() + "\" failed for \"" + + objectToTest.eClass().getName() + "\"", hasIsGood); + } + + @Override + protected EObject getEObjectToAdd() { + return null; + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + // Nothing + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasTemplateId((RegionOfInterest) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + // Nothing + } + } }; + + @Override + protected List getTestCases() { + // Return a new List because the one returned by Arrays.asList is + // unmodifiable so a sub-class can't append their test cases. + final List retValue = super.getTestCases(); + retValue.addAll(Arrays.asList(TEST_CASE_ARRAY)); + return retValue; + } + + @Override + protected EObject getObjectToTest() { + return CDAFactory.eINSTANCE.createRegionOfInterest(); + } + +} // RegionOfInterestOperationsTest diff --git a/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/SectionOperationsTest.java b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/SectionOperationsTest.java new file mode 100644 index 000000000..a15cd9bc6 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/SectionOperationsTest.java @@ -0,0 +1,780 @@ +/******************************************************************************* + * Copyright (c) 2010, 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.operations; + +import static org.junit.Assert.assertTrue; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.openhealthtools.mdht.uml.cda.Act; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.CDAPackage; +import org.openhealthtools.mdht.uml.cda.ClinicalDocument; +import org.openhealthtools.mdht.uml.cda.Encounter; +import org.openhealthtools.mdht.uml.cda.Observation; +import org.openhealthtools.mdht.uml.cda.ObservationMedia; +import org.openhealthtools.mdht.uml.cda.Organizer; +import org.openhealthtools.mdht.uml.cda.Procedure; +import org.openhealthtools.mdht.uml.cda.RegionOfInterest; +import org.openhealthtools.mdht.uml.cda.Section; +import org.openhealthtools.mdht.uml.cda.SubstanceAdministration; +import org.openhealthtools.mdht.uml.cda.Supply; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; + +/** + * This class is a JUnit4 test case. + */ +public class SectionOperationsTest extends CDAValidationTest { + + @SuppressWarnings("nls") + private static final CDATestCase TEST_CASE_ARRAY[] = { + // Act + // ------------------------------------------------------------- + new CDAAddTestCase("Act") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createAct(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + SectionOperations.addAct((Section) objectToTest, (Act) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntry_Act(); + } + }, + + // Encounter + // ------------------------------------------------------------- + new CDAAddTestCase("Encounter") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createEncounter(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + SectionOperations.addEncounter((Section) objectToTest, (Encounter) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntry_Encounter(); + } + }, + + // Observation + // ------------------------------------------------------------- + new CDAAddTestCase("Observation") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservation(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + SectionOperations.addObservation((Section) objectToTest, (Observation) eObjectToAdd); + + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntry_Observation(); + } + }, + + // ObservationMedia + // ------------------------------------------------------------- + new CDAAddTestCase("ObservationMedia") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservationMedia(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + SectionOperations.addObservationMedia((Section) objectToTest, (ObservationMedia) eObjectToAdd); + + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntry_ObservationMedia(); + } + }, + + // Organizer + // ------------------------------------------------------------- + new CDAAddTestCase("Organizer") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createOrganizer(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + SectionOperations.addOrganizer((Section) objectToTest, (Organizer) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntry_Organizer(); + } + }, + + // Procedure + // ------------------------------------------------------------- + new CDAAddTestCase("Procedure") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createProcedure(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + SectionOperations.addProcedure((Section) objectToTest, (Procedure) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntry_Procedure(); + } + }, + + // RegionOfInterest + // ------------------------------------------------------------- + new CDAAddTestCase("RegionOfInterest") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createRegionOfInterest(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + SectionOperations.addRegionOfInterest((Section) objectToTest, (RegionOfInterest) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntry_RegionOfInterest(); + } + }, + + // SubstanceAdministration + // ------------------------------------------------------------- + new CDAAddTestCase("SubstanceAdministration") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSubstanceAdministration(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + SectionOperations.addSubstanceAdministration( + (Section) objectToTest, (SubstanceAdministration) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntry_SubstanceAdministration(); + } + }, + + // Supply + // ------------------------------------------------------------- + new CDAAddTestCase("Supply") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSupply(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + SectionOperations.addSupply((Section) objectToTest, (Supply) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntry_Supply(); + } + }, + // ************************************************************************* + // Act + // ------------------------------------------------------------- + new CDAGetTestCase("Act") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createAct(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + SectionOperations.addAct((Section) objectToTest, (Act) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return SectionOperations.getActs((Section) objectToTest); + } + }, + + // Encounter + // ------------------------------------------------------------- + new CDAGetTestCase("Encounter") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createEncounter(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + SectionOperations.addEncounter((Section) objectToTest, (Encounter) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return SectionOperations.getEncounters((Section) objectToTest); + } + + }, + + // Observation + // ------------------------------------------------------------- + new CDAGetTestCase("Observation") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservation(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + SectionOperations.addObservation((Section) objectToTest, (Observation) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return SectionOperations.getObservations((Section) objectToTest); + } + }, + + // ObservationMedia + // ------------------------------------------------------------- + new CDAGetTestCase("ObservationMedia") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservationMedia(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + SectionOperations.addObservationMedia((Section) objectToTest, (ObservationMedia) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return SectionOperations.getObservationMedia((Section) objectToTest); + } + }, + + // Organizer + // ------------------------------------------------------------- + new CDAGetTestCase("Organizer") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createOrganizer(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + SectionOperations.addOrganizer((Section) objectToTest, (Organizer) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return SectionOperations.getOrganizers((Section) objectToTest); + } + }, + + // Procedure + // ------------------------------------------------------------- + new CDAGetTestCase("Procedure") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createProcedure(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + SectionOperations.addProcedure((Section) objectToTest, (Procedure) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return SectionOperations.getProcedures((Section) objectToTest); + } + }, + + // RegionOfInterest + // ------------------------------------------------------------- + new CDAGetTestCase("RegionOfInterest") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createRegionOfInterest(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + SectionOperations.addRegionOfInterest((Section) objectToTest, (RegionOfInterest) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return SectionOperations.getRegionsOfInterest((Section) objectToTest); + } + }, + + // SubstanceAdministration + // ------------------------------------------------------------- + new CDAGetTestCase("SubstanceAdministration") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSubstanceAdministration(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + SectionOperations.addSubstanceAdministration( + (Section) objectToTest, (SubstanceAdministration) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return SectionOperations.getSubstanceAdministrations((Section) objectToTest); + } + }, + + // Supply + // ------------------------------------------------------------- + new CDAGetTestCase("Supply") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSupply(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + SectionOperations.addSupply((Section) objectToTest, (Supply) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return SectionOperations.getSupplies((Section) objectToTest); + } + }, + + // ClinicalDocument + // ------------------------------------------------------------- + new CDAGetTestCase("ClinicalDocument") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createClinicalDocument(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + // The Add is reversed, the objectToTest is added to the + // clinical document + final Section section = CDAFactory.eINSTANCE.createSection(); + section.addSection((Section) objectToTest); + ((ClinicalDocument) eObjectToAdd).addSection(section); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return SectionOperations.getClinicalDocument((Section) objectToTest); + } + + @Override + protected boolean isGetGood(final EObject eObjectToAdd, final Object value) { + return eObjectToAdd.equals(value); + } + }, + + // // Section + // // ------------------------------------------------------------- + // new CDAGetTestCase("Section") { + // + // @Override + // protected EObject getEObjectToAdd() { + // return CDAFactory.eINSTANCE.createSection(); + // } + // + // @Override + // protected void doAdd(final EObject objectToTest, + // final EObject eObjectToAdd) { + // // The Add is reversed, the objectToTest is added to the + // // clinical document + // ((Section) eObjectToAdd) + // .addSection((Section) objectToTest); + // } + // + // @Override + // protected Object doGet(final EObject objectToTest) { + // return SectionOperations + // .getSection((Section) objectToTest); + // } + // + // @Override + // protected boolean isGetGood(final EObject eObjectToAdd, + // final Object value) { + // return eObjectToAdd.equals(value); + // } + // }, + + // ************************************************************************* + // Act + // ------------------------------------------------------------- + new CDAHasTestCase("Act") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createAct(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + SectionOperations.addAct((Section) objectToTest, (Act) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return SectionOperations.hasActTemplate((Section) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Act) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Encounter + // ------------------------------------------------------------- + new CDAHasTestCase("Encounter") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createEncounter(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + SectionOperations.addEncounter((Section) objectToTest, (Encounter) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return SectionOperations.hasEncounterTemplate((Section) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Encounter) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Code + // ------------------------------------------------------------- + new CDAHasTestCase("Code") { + + @Override + protected void doTest(final EObject objectToTest, final BasicDiagnostic diagnostician, + final Map map) { + ((Section) objectToTest).setCode(THE_CE_CODE); + final boolean hasIsGood = doHas(objectToTest, TEMPLATE_ID); + assertTrue("Has \"" + getTestTargetDescription() + "\" failed for \"" + + objectToTest.eClass().getName() + "\"", hasIsGood); + } + + @Override + protected EObject getEObjectToAdd() { + return null; + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + SectionOperations.addEncounter((Section) objectToTest, (Encounter) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return SectionOperations.hasCode((Section) objectToTest, CODE, CODE_SYSTEM, CODE_SYSTEM_NAME); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Encounter) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Observation + // ------------------------------------------------------------- + new CDAHasTestCase("Observation") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservation(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + SectionOperations.addObservation((Section) objectToTest, (Observation) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return SectionOperations.hasObservationTemplate((Section) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Observation) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // ObservationMedia + // ------------------------------------------------------------- + new CDAHasTestCase("ObservationMedia") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservationMedia(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + SectionOperations.addObservationMedia((Section) objectToTest, (ObservationMedia) eObjectToAdd); + + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return SectionOperations.hasObservationMediaTemplate((Section) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((ObservationMedia) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Organizer + // ------------------------------------------------------------- + new CDAHasTestCase("Organizer") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createOrganizer(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + SectionOperations.addOrganizer((Section) objectToTest, (Organizer) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return SectionOperations.hasOrganizerTemplate((Section) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Organizer) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Procedure + // ------------------------------------------------------------- + new CDAHasTestCase("Procedure") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createProcedure(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + SectionOperations.addProcedure((Section) objectToTest, (Procedure) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return SectionOperations.hasProcedureTemplate((Section) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Procedure) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // RegionOfInterest + // ------------------------------------------------------------- + new CDAHasTestCase("RegionOfInterest") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createRegionOfInterest(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + SectionOperations.addRegionOfInterest((Section) objectToTest, (RegionOfInterest) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return SectionOperations.hasRegionOfInterestTemplate((Section) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((RegionOfInterest) eObjectToAdd).getTemplateIds().add(theIi); + } + + }, + + // SubstanceAdministration + // ------------------------------------------------------------- + new CDAHasTestCase("SubstanceAdministration") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSubstanceAdministration(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + SectionOperations.addSubstanceAdministration( + (Section) objectToTest, (SubstanceAdministration) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return SectionOperations.hasSubstanceAdministrationTemplate((Section) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((SubstanceAdministration) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Supply + // ------------------------------------------------------------- + new CDAHasTestCase("Supply") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSupply(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + SectionOperations.addSupply((Section) objectToTest, (Supply) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return SectionOperations.hasSupplyTemplate((Section) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Supply) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // TemplateID + // ------------------------------------------------------------- + new CDAHasTestCase("TemplateID") { + + @Override + protected void doTest(final EObject objectToTest, final BasicDiagnostic diagnostician, + final Map map) { + ((Section) objectToTest).getTemplateIds().add(THE_II); + final boolean hasIsGood = doHas(objectToTest, TEMPLATE_ID); + assertTrue("Has \"" + getTestTargetDescription() + "\" failed for \"" + + objectToTest.eClass().getName() + "\"", hasIsGood); + } + + @Override + protected EObject getEObjectToAdd() { + return null; + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + // Nothing + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return SectionOperations.hasTemplateId((Section) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + // Nothing + } + } }; + + @Override + protected List getTestCases() { + // Return a new List because the one returned by Arrays.asList is + // unmodifiable so a sub-class can't append their test cases. + final List retValue = super.getTestCases(); + retValue.addAll(Arrays.asList(TEST_CASE_ARRAY)); + return retValue; + } + + @Override + protected EObject getObjectToTest() { + return CDAFactory.eINSTANCE.createSection(); + } + +} // SectionOperationsTest diff --git a/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/StrucDocTextOperationsTest.java b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/StrucDocTextOperationsTest.java new file mode 100644 index 000000000..b6839d87a --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/StrucDocTextOperationsTest.java @@ -0,0 +1,72 @@ +/******************************************************************************* + * Copyright (c) 2010, 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.operations; + +import static org.junit.Assert.assertTrue; + +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.StrucDocText; + +/** + * This class is a JUnit4 test case. + */ +@SuppressWarnings("nls") +public class StrucDocTextOperationsTest { + + static final String TEST_TEXT = "Some text for testing"; + + /** + * Test method for + * {@link org.openhealthtools.mdht.uml.cda.operations.StrucDocTextOperations#addText(org.openhealthtools.mdht.uml.cda.StrucDocText, java.lang.String)} + * . + */ + @Test + public final void testAddText() { + final StrucDocText strcDocText = CDAFactory.eINSTANCE.createStrucDocText(); + assertTrue(StrucDocTextOperations.getText(strcDocText).equals("")); + StrucDocTextOperations.addText(strcDocText, TEST_TEXT); + assertTrue(StrucDocTextOperations.getText(strcDocText).equals(TEST_TEXT)); + } + + /** + * Test method for + * {@link org.openhealthtools.mdht.uml.cda.operations.StrucDocTextOperations#addText(org.openhealthtools.mdht.uml.cda.StrucDocText, java.lang.String)} + * . + */ + @Test(expected = IllegalArgumentException.class) + public final void testAddTextNull() { + final StrucDocText strcDocText = CDAFactory.eINSTANCE.createStrucDocText(); + assertTrue(StrucDocTextOperations.getText(strcDocText).equals("")); + StrucDocTextOperations.addText(strcDocText, null); + } + + /** + * Test method for + * {@link org.openhealthtools.mdht.uml.cda.operations.StrucDocTextOperations#getText(org.openhealthtools.mdht.uml.cda.StrucDocText)} + * . + */ + @Test + public final void testGetText() { + testAddText(); + } + + /** + * Test method for + * {@link org.openhealthtools.mdht.uml.cda.operations.StrucDocTextOperations#getText(org.openhealthtools.mdht.uml.cda.StrucDocText)} + * . + */ + @Test + public final void testGetText_StructDocText() { + final StrucDocText strcDocText = CDAFactory.eINSTANCE.createStrucDocText(); + assertTrue(StrucDocTextOperations.getText(strcDocText, "foo") == null); + } +} // StrucDocTextOperationsTest diff --git a/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/SubstanceAdministrationOperationsTest.java b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/SubstanceAdministrationOperationsTest.java new file mode 100644 index 000000000..43775a58a --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/SubstanceAdministrationOperationsTest.java @@ -0,0 +1,804 @@ +/******************************************************************************* + * Copyright (c) 2010, 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.operations; + +import static org.junit.Assert.assertTrue; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.openhealthtools.mdht.uml.cda.Act; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.CDAPackage; +import org.openhealthtools.mdht.uml.cda.ClinicalDocument; +import org.openhealthtools.mdht.uml.cda.Encounter; +import org.openhealthtools.mdht.uml.cda.Observation; +import org.openhealthtools.mdht.uml.cda.ObservationMedia; +import org.openhealthtools.mdht.uml.cda.Organizer; +import org.openhealthtools.mdht.uml.cda.Procedure; +import org.openhealthtools.mdht.uml.cda.RegionOfInterest; +import org.openhealthtools.mdht.uml.cda.Section; +import org.openhealthtools.mdht.uml.cda.SubstanceAdministration; +import org.openhealthtools.mdht.uml.cda.Supply; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; + +/** + * This class is a JUnit4 test case. + */ +public class SubstanceAdministrationOperationsTest extends ClinicalStatementOperationsTest { + + @SuppressWarnings("nls") + private static final CDATestCase TEST_CASE_ARRAY[] = { + // Act + // ------------------------------------------------------------- + new CDAAddTestCase("Act") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createAct(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addAct((SubstanceAdministration) objectToTest, (Act) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_Act(); + } + }, + + // Encounter + // ------------------------------------------------------------- + new CDAAddTestCase("Encounter") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createEncounter(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addEncounter( + (SubstanceAdministration) objectToTest, (Encounter) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_Encounter(); + } + }, + + // Observation + // ------------------------------------------------------------- + new CDAAddTestCase("Observation") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservation(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addObservation( + (SubstanceAdministration) objectToTest, (Observation) eObjectToAdd); + + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_Observation(); + } + }, + + // ObservationMedia + // ------------------------------------------------------------- + new CDAAddTestCase("ObservationMedia") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservationMedia(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addObservationMedia( + (SubstanceAdministration) objectToTest, (ObservationMedia) eObjectToAdd); + + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_ObservationMedia(); + } + }, + + // Organizer + // ------------------------------------------------------------- + new CDAAddTestCase("Organizer") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createOrganizer(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addOrganizer( + (SubstanceAdministration) objectToTest, (Organizer) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_Organizer(); + } + }, + + // Procedure + // ------------------------------------------------------------- + new CDAAddTestCase("Procedure") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createProcedure(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addProcedure( + (SubstanceAdministration) objectToTest, (Procedure) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_Procedure(); + } + }, + + // RegionOfInterest + // ------------------------------------------------------------- + new CDAAddTestCase("RegionOfInterest") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createRegionOfInterest(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addRegionOfInterest( + (SubstanceAdministration) objectToTest, (RegionOfInterest) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_RegionOfInterest(); + } + }, + + // SubstanceAdministration + // ------------------------------------------------------------- + new CDAAddTestCase("SubstanceAdministration") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSubstanceAdministration(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addSubstanceAdministration( + (SubstanceAdministration) objectToTest, (SubstanceAdministration) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_SubstanceAdministration(); + } + }, + + // Supply + // ------------------------------------------------------------- + new CDAAddTestCase("Supply") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSupply(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addSupply((SubstanceAdministration) objectToTest, (Supply) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_Supply(); + } + }, + // ************************************************************************* + // Act + // ------------------------------------------------------------- + new CDAGetTestCase("Act") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createAct(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addAct((SubstanceAdministration) objectToTest, (Act) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getActs((SubstanceAdministration) objectToTest); + } + }, + + // Encounter + // ------------------------------------------------------------- + new CDAGetTestCase("Encounter") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createEncounter(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addEncounter( + (SubstanceAdministration) objectToTest, (Encounter) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getEncounters((SubstanceAdministration) objectToTest); + } + + }, + + // Observation + // ------------------------------------------------------------- + new CDAGetTestCase("Observation") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservation(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addObservation( + (SubstanceAdministration) objectToTest, (Observation) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getObservations((SubstanceAdministration) objectToTest); + } + }, + + // ObservationMedia + // ------------------------------------------------------------- + new CDAGetTestCase("ObservationMedia") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservationMedia(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addObservationMedia( + (SubstanceAdministration) objectToTest, (ObservationMedia) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getObservationMedia((SubstanceAdministration) objectToTest); + } + }, + + // Organizer + // ------------------------------------------------------------- + new CDAGetTestCase("Organizer") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createOrganizer(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addOrganizer( + (SubstanceAdministration) objectToTest, (Organizer) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getOrganizers((SubstanceAdministration) objectToTest); + } + }, + + // Procedure + // ------------------------------------------------------------- + new CDAGetTestCase("Procedure") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createProcedure(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addProcedure( + (SubstanceAdministration) objectToTest, (Procedure) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getProcedures((SubstanceAdministration) objectToTest); + } + }, + + // RegionOfInterest + // ------------------------------------------------------------- + new CDAGetTestCase("RegionOfInterest") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createRegionOfInterest(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addRegionOfInterest( + (SubstanceAdministration) objectToTest, (RegionOfInterest) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getRegionsOfInterest((SubstanceAdministration) objectToTest); + } + }, + + // SubstanceAdministration + // ------------------------------------------------------------- + new CDAGetTestCase("SubstanceAdministration") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSubstanceAdministration(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addSubstanceAdministration( + (SubstanceAdministration) objectToTest, (SubstanceAdministration) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getSubstanceAdministrations((SubstanceAdministration) objectToTest); + } + }, + + // Supply + // ------------------------------------------------------------- + new CDAGetTestCase("Supply") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSupply(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addSupply((SubstanceAdministration) objectToTest, (Supply) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getSupplies((SubstanceAdministration) objectToTest); + } + }, + + // ClinicalDocument + // ------------------------------------------------------------- + new CDAGetTestCase("ClinicalDocument") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createClinicalDocument(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + // The Add is reversed, the objectToTest is added to the + // clinical document + final Section section = CDAFactory.eINSTANCE.createSection(); + section.addSubstanceAdministration((SubstanceAdministration) objectToTest); + ((ClinicalDocument) eObjectToAdd).addSection(section); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getClinicalDocument((SubstanceAdministration) objectToTest); + } + + @Override + protected boolean isGetGood(final EObject eObjectToAdd, final Object value) { + return eObjectToAdd.equals(value); + } + }, + + // Section + // ------------------------------------------------------------- + new CDAGetTestCase("Section") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSection(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + // The Add is reversed, the objectToTest is added to the + // clinical document + ((Section) eObjectToAdd).addSubstanceAdministration((SubstanceAdministration) objectToTest); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getSection((SubstanceAdministration) objectToTest); + } + + @Override + protected boolean isGetGood(final EObject eObjectToAdd, final Object value) { + return eObjectToAdd.equals(value); + } + }, + // ************************************************************************* + // Act + // ------------------------------------------------------------- + new CDAHasTestCase("Act") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createAct(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addAct((SubstanceAdministration) objectToTest, (Act) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasActTemplate( + (SubstanceAdministration) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Act) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Encounter + // ------------------------------------------------------------- + new CDAHasTestCase("Encounter") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createEncounter(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addEncounter( + (SubstanceAdministration) objectToTest, (Encounter) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasEncounterTemplate( + (SubstanceAdministration) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Encounter) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Code + // ------------------------------------------------------------- + new CDAHasTestCase("Code") { + + @Override + protected void doTest(final EObject objectToTest, final BasicDiagnostic diagnostician, + final Map map) { + ((SubstanceAdministration) objectToTest).setCode(THE_CODE); + final boolean hasIsGood = doHas(objectToTest, TEMPLATE_ID); + assertTrue("Has \"" + getTestTargetDescription() + "\" failed for \"" + + objectToTest.eClass().getName() + "\"", hasIsGood); + } + + @Override + protected EObject getEObjectToAdd() { + return null; + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addEncounter( + (SubstanceAdministration) objectToTest, (Encounter) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasCode( + (SubstanceAdministration) objectToTest, CODE, CODE_SYSTEM, CODE_SYSTEM_NAME); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Encounter) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Observation + // ------------------------------------------------------------- + new CDAHasTestCase("Observation") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservation(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addObservation( + (SubstanceAdministration) objectToTest, (Observation) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasObservationTemplate( + (SubstanceAdministration) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Observation) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // ObservationMedia + // ------------------------------------------------------------- + new CDAHasTestCase("ObservationMedia") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservationMedia(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addObservationMedia( + (SubstanceAdministration) objectToTest, (ObservationMedia) eObjectToAdd); + + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasObservationMediaTemplate( + (SubstanceAdministration) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((ObservationMedia) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Organizer + // ------------------------------------------------------------- + new CDAHasTestCase("Organizer") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createOrganizer(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addOrganizer( + (SubstanceAdministration) objectToTest, (Organizer) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasOrganizerTemplate( + (SubstanceAdministration) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Organizer) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Procedure + // ------------------------------------------------------------- + new CDAHasTestCase("Procedure") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createProcedure(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addProcedure( + (SubstanceAdministration) objectToTest, (Procedure) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasProcedureTemplate( + (SubstanceAdministration) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Procedure) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // RegionOfInterest + // ------------------------------------------------------------- + new CDAHasTestCase("RegionOfInterest") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createRegionOfInterest(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addRegionOfInterest( + (SubstanceAdministration) objectToTest, (RegionOfInterest) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasRegionOfInterestTemplate( + (SubstanceAdministration) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((RegionOfInterest) eObjectToAdd).getTemplateIds().add(theIi); + } + + }, + + // SubstanceAdministration + // ------------------------------------------------------------- + new CDAHasTestCase("SubstanceAdministration") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSubstanceAdministration(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addSubstanceAdministration( + (SubstanceAdministration) objectToTest, (SubstanceAdministration) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasSubstanceAdministrationTemplate( + (SubstanceAdministration) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((SubstanceAdministration) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Supply + // ------------------------------------------------------------- + new CDAHasTestCase("Supply") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSupply(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addSupply((SubstanceAdministration) objectToTest, (Supply) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasSupplyTemplate( + (SubstanceAdministration) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Supply) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // TemplateID + // ------------------------------------------------------------- + new CDAHasTestCase("TemplateID") { + + @Override + protected void doTest(final EObject objectToTest, final BasicDiagnostic diagnostician, + final Map map) { + ((SubstanceAdministration) objectToTest).getTemplateIds().add(THE_II); + final boolean hasIsGood = doHas(objectToTest, TEMPLATE_ID); + assertTrue("Has \"" + getTestTargetDescription() + "\" failed for \"" + + objectToTest.eClass().getName() + "\"", hasIsGood); + } + + @Override + protected EObject getEObjectToAdd() { + return null; + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + // Nothing + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasTemplateId((SubstanceAdministration) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + // Nothing + } + } }; + + @Override + protected List getTestCases() { + // Return a new List because the one returned by Arrays.asList is + // unmodifiable so a sub-class can't append their test cases. + final List retValue = super.getTestCases(); + retValue.addAll(Arrays.asList(TEST_CASE_ARRAY)); + return retValue; + } + + @Override + protected EObject getObjectToTest() { + return CDAFactory.eINSTANCE.createSubstanceAdministration(); + } + +} // SubstanceAdministrationOperationsTest diff --git a/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/SupplyOperationsTest.java b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/SupplyOperationsTest.java new file mode 100644 index 000000000..e67313408 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/operations/SupplyOperationsTest.java @@ -0,0 +1,783 @@ +/******************************************************************************* + * Copyright (c) 2010, 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.operations; + +import static org.junit.Assert.assertTrue; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.openhealthtools.mdht.uml.cda.Act; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.CDAPackage; +import org.openhealthtools.mdht.uml.cda.ClinicalDocument; +import org.openhealthtools.mdht.uml.cda.Encounter; +import org.openhealthtools.mdht.uml.cda.Observation; +import org.openhealthtools.mdht.uml.cda.ObservationMedia; +import org.openhealthtools.mdht.uml.cda.Organizer; +import org.openhealthtools.mdht.uml.cda.Procedure; +import org.openhealthtools.mdht.uml.cda.RegionOfInterest; +import org.openhealthtools.mdht.uml.cda.Section; +import org.openhealthtools.mdht.uml.cda.SubstanceAdministration; +import org.openhealthtools.mdht.uml.cda.Supply; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; + +/** + * This class is a JUnit4 test case. + */ +public class SupplyOperationsTest extends ClinicalStatementOperationsTest { + + @SuppressWarnings("nls") + private static final CDATestCase TEST_CASE_ARRAY[] = { + // Act + // ------------------------------------------------------------- + new CDAAddTestCase("Act") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createAct(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addAct((Supply) objectToTest, (Act) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_Act(); + } + }, + + // Encounter + // ------------------------------------------------------------- + new CDAAddTestCase("Encounter") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createEncounter(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addEncounter((Supply) objectToTest, (Encounter) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_Encounter(); + } + }, + + // Observation + // ------------------------------------------------------------- + new CDAAddTestCase("Observation") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservation(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addObservation((Supply) objectToTest, (Observation) eObjectToAdd); + + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_Observation(); + } + }, + + // ObservationMedia + // ------------------------------------------------------------- + new CDAAddTestCase("ObservationMedia") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservationMedia(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addObservationMedia( + (Supply) objectToTest, (ObservationMedia) eObjectToAdd); + + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_ObservationMedia(); + } + }, + + // Organizer + // ------------------------------------------------------------- + new CDAAddTestCase("Organizer") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createOrganizer(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addOrganizer((Supply) objectToTest, (Organizer) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_Organizer(); + } + }, + + // Procedure + // ------------------------------------------------------------- + new CDAAddTestCase("Procedure") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createProcedure(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addProcedure((Supply) objectToTest, (Procedure) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_Procedure(); + } + }, + + // RegionOfInterest + // ------------------------------------------------------------- + new CDAAddTestCase("RegionOfInterest") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createRegionOfInterest(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addRegionOfInterest( + (Supply) objectToTest, (RegionOfInterest) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_RegionOfInterest(); + } + }, + + // SubstanceAdministration + // ------------------------------------------------------------- + new CDAAddTestCase("SubstanceAdministration") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSubstanceAdministration(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addSubstanceAdministration( + (Supply) objectToTest, (SubstanceAdministration) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_SubstanceAdministration(); + } + }, + + // Supply + // ------------------------------------------------------------- + new CDAAddTestCase("Supply") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSupply(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addSupply((Supply) objectToTest, (Supply) eObjectToAdd); + } + + @Override + protected EStructuralFeature getFeature() { + return CDAPackage.eINSTANCE.getEntryRelationship_Supply(); + } + }, + // ************************************************************************* + // Act + // ------------------------------------------------------------- + new CDAGetTestCase("Act") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createAct(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addAct((Supply) objectToTest, (Act) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getActs((Supply) objectToTest); + } + }, + + // Encounter + // ------------------------------------------------------------- + new CDAGetTestCase("Encounter") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createEncounter(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addEncounter((Supply) objectToTest, (Encounter) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getEncounters((Supply) objectToTest); + } + + }, + + // Observation + // ------------------------------------------------------------- + new CDAGetTestCase("Observation") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservation(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addObservation((Supply) objectToTest, (Observation) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getObservations((Supply) objectToTest); + } + }, + + // ObservationMedia + // ------------------------------------------------------------- + new CDAGetTestCase("ObservationMedia") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservationMedia(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addObservationMedia( + (Supply) objectToTest, (ObservationMedia) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getObservationMedia((Supply) objectToTest); + } + }, + + // Organizer + // ------------------------------------------------------------- + new CDAGetTestCase("Organizer") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createOrganizer(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addOrganizer((Supply) objectToTest, (Organizer) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getOrganizers((Supply) objectToTest); + } + }, + + // Procedure + // ------------------------------------------------------------- + new CDAGetTestCase("Procedure") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createProcedure(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addProcedure((Supply) objectToTest, (Procedure) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getProcedures((Supply) objectToTest); + } + }, + + // RegionOfInterest + // ------------------------------------------------------------- + new CDAGetTestCase("RegionOfInterest") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createRegionOfInterest(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addRegionOfInterest( + (Supply) objectToTest, (RegionOfInterest) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getRegionsOfInterest((Supply) objectToTest); + } + }, + + // SubstanceAdministration + // ------------------------------------------------------------- + new CDAGetTestCase("SubstanceAdministration") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSubstanceAdministration(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addSubstanceAdministration( + (Supply) objectToTest, (SubstanceAdministration) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getSubstanceAdministrations((Supply) objectToTest); + } + }, + + // Supply + // ------------------------------------------------------------- + new CDAGetTestCase("Supply") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSupply(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addSupply((Supply) objectToTest, (Supply) eObjectToAdd); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getSupplies((Supply) objectToTest); + } + }, + + // ClinicalDocument + // ------------------------------------------------------------- + new CDAGetTestCase("ClinicalDocument") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createClinicalDocument(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + // The Add is reversed, the objectToTest is added to the + // clinical document + final Section section = CDAFactory.eINSTANCE.createSection(); + section.addSupply((Supply) objectToTest); + ((ClinicalDocument) eObjectToAdd).addSection(section); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getClinicalDocument((Supply) objectToTest); + } + + @Override + protected boolean isGetGood(final EObject eObjectToAdd, final Object value) { + return eObjectToAdd.equals(value); + } + }, + + // Section + // ------------------------------------------------------------- + new CDAGetTestCase("Section") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSection(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + // The Add is reversed, the objectToTest is added to the + // clinical document + ((Section) eObjectToAdd).addSupply((Supply) objectToTest); + } + + @Override + protected Object doGet(final EObject objectToTest) { + return ClinicalStatementOperations.getSection((Supply) objectToTest); + } + + @Override + protected boolean isGetGood(final EObject eObjectToAdd, final Object value) { + return eObjectToAdd.equals(value); + } + }, + // ************************************************************************* + // Act + // ------------------------------------------------------------- + new CDAHasTestCase("Act") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createAct(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addAct((Supply) objectToTest, (Act) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasActTemplate((Supply) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Act) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Encounter + // ------------------------------------------------------------- + new CDAHasTestCase("Encounter") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createEncounter(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addEncounter((Supply) objectToTest, (Encounter) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasEncounterTemplate((Supply) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Encounter) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Code + // ------------------------------------------------------------- + new CDAHasTestCase("Code") { + + @Override + protected void doTest(final EObject objectToTest, final BasicDiagnostic diagnostician, + final Map map) { + ((Supply) objectToTest).setCode(THE_CODE); + final boolean hasIsGood = doHas(objectToTest, TEMPLATE_ID); + assertTrue("Has \"" + getTestTargetDescription() + "\" failed for \"" + + objectToTest.eClass().getName() + "\"", hasIsGood); + } + + @Override + protected EObject getEObjectToAdd() { + return null; + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addEncounter((Supply) objectToTest, (Encounter) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasCode( + (Supply) objectToTest, CODE, CODE_SYSTEM, CODE_SYSTEM_NAME); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Encounter) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Observation + // ------------------------------------------------------------- + new CDAHasTestCase("Observation") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservation(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addObservation((Supply) objectToTest, (Observation) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasObservationTemplate((Supply) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Observation) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // ObservationMedia + // ------------------------------------------------------------- + new CDAHasTestCase("ObservationMedia") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createObservationMedia(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addObservationMedia( + (Supply) objectToTest, (ObservationMedia) eObjectToAdd); + + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasObservationMediaTemplate((Supply) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((ObservationMedia) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Organizer + // ------------------------------------------------------------- + new CDAHasTestCase("Organizer") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createOrganizer(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addOrganizer((Supply) objectToTest, (Organizer) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasOrganizerTemplate((Supply) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Organizer) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Procedure + // ------------------------------------------------------------- + new CDAHasTestCase("Procedure") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createProcedure(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addProcedure((Supply) objectToTest, (Procedure) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasProcedureTemplate((Supply) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Procedure) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // RegionOfInterest + // ------------------------------------------------------------- + new CDAHasTestCase("RegionOfInterest") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createRegionOfInterest(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addRegionOfInterest( + (Supply) objectToTest, (RegionOfInterest) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasRegionOfInterestTemplate((Supply) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((RegionOfInterest) eObjectToAdd).getTemplateIds().add(theIi); + } + + }, + + // SubstanceAdministration + // ------------------------------------------------------------- + new CDAHasTestCase("SubstanceAdministration") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSubstanceAdministration(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addSubstanceAdministration( + (Supply) objectToTest, (SubstanceAdministration) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasSubstanceAdministrationTemplate( + (Supply) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((SubstanceAdministration) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // Supply + // ------------------------------------------------------------- + new CDAHasTestCase("Supply") { + + @Override + protected EObject getEObjectToAdd() { + return CDAFactory.eINSTANCE.createSupply(); + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + ClinicalStatementOperations.addSupply((Supply) objectToTest, (Supply) eObjectToAdd); + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasSupplyTemplate((Supply) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + ((Supply) eObjectToAdd).getTemplateIds().add(theIi); + } + }, + + // TemplateID + // ------------------------------------------------------------- + new CDAHasTestCase("TemplateID") { + + @Override + protected void doTest(final EObject objectToTest, final BasicDiagnostic diagnostician, + final Map map) { + ((Supply) objectToTest).getTemplateIds().add(THE_II); + final boolean hasIsGood = doHas(objectToTest, TEMPLATE_ID); + assertTrue("Has \"" + getTestTargetDescription() + "\" failed for \"" + + objectToTest.eClass().getName() + "\"", hasIsGood); + } + + @Override + protected EObject getEObjectToAdd() { + return null; + } + + @Override + protected void doAdd(final EObject objectToTest, final EObject eObjectToAdd) { + // Nothing + } + + @Override + protected boolean doHas(final EObject objectToTest, final String templateId) { + return ClinicalStatementOperations.hasTemplateId((Supply) objectToTest, templateId); + } + + @Override + protected void doAddTemplateId(final EObject eObjectToAdd, final II theIi) { + // Nothing + } + } }; + + @Override + protected List getTestCases() { + // Return a new List because the one returned by Arrays.asList is + // unmodifiable so a sub-class can't append their test cases. + final List retValue = super.getTestCases(); + retValue.addAll(Arrays.asList(TEST_CASE_ARRAY)); + return retValue; + } + + @Override + protected EObject getObjectToTest() { + return CDAFactory.eINSTANCE.createSupply(); + } + +} // SupplyOperationsTest diff --git a/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/tests/ADTest.java b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/tests/ADTest.java new file mode 100644 index 000000000..b434f477f --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/tests/ADTest.java @@ -0,0 +1,278 @@ +/******************************************************************************* + * Copyright (c) 2010, 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.tests; + +import org.openhealthtools.mdht.uml.cda.AssignedAuthor; +import org.openhealthtools.mdht.uml.cda.Author; +import org.openhealthtools.mdht.uml.cda.Birthplace; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.ClinicalDocument; +import org.openhealthtools.mdht.uml.cda.Component2; +import org.openhealthtools.mdht.uml.cda.Component3; +import org.openhealthtools.mdht.uml.cda.Entry; +import org.openhealthtools.mdht.uml.cda.InfrastructureRootTypeId; +import org.openhealthtools.mdht.uml.cda.Organization; +import org.openhealthtools.mdht.uml.cda.Patient; +import org.openhealthtools.mdht.uml.cda.PatientRole; +import org.openhealthtools.mdht.uml.cda.Person; +import org.openhealthtools.mdht.uml.cda.Place; +import org.openhealthtools.mdht.uml.cda.RecordTarget; +import org.openhealthtools.mdht.uml.cda.Section; +import org.openhealthtools.mdht.uml.cda.StructuredBody; +import org.openhealthtools.mdht.uml.cda.Supply; +import org.openhealthtools.mdht.uml.cda.util.CDAUtil; +import org.openhealthtools.mdht.uml.hl7.datatypes.AD; +import org.openhealthtools.mdht.uml.hl7.datatypes.ADXP; +import org.openhealthtools.mdht.uml.hl7.datatypes.BL; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.CR; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.EN; +import org.openhealthtools.mdht.uml.hl7.datatypes.ENXP; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVXB_TS; +import org.openhealthtools.mdht.uml.hl7.datatypes.PN; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; +import org.openhealthtools.mdht.uml.hl7.datatypes.SXCM_TS; +import org.openhealthtools.mdht.uml.hl7.datatypes.TEL; +import org.openhealthtools.mdht.uml.hl7.datatypes.TS; +import org.openhealthtools.mdht.uml.hl7.vocab.ActClassSupply; +import org.openhealthtools.mdht.uml.hl7.vocab.AddressPartType; +import org.openhealthtools.mdht.uml.hl7.vocab.EntityNamePartQualifier; +import org.openhealthtools.mdht.uml.hl7.vocab.EntityNamePartType; +import org.openhealthtools.mdht.uml.hl7.vocab.EntityNameUse; +import org.openhealthtools.mdht.uml.hl7.vocab.PostalAddressUse; +import org.openhealthtools.mdht.uml.hl7.vocab.SetOperator; +import org.openhealthtools.mdht.uml.hl7.vocab.TelecommunicationAddressUse; +import org.openhealthtools.mdht.uml.hl7.vocab.x_DocumentSubstanceMood; + +public class ADTest { + public static void main(String[] args) throws Exception { + ClinicalDocument doc = CDAFactory.eINSTANCE.createClinicalDocument(); + + InfrastructureRootTypeId typeId = CDAFactory.eINSTANCE.createInfrastructureRootTypeId(); + typeId.setExtension("POCD_HD000040"); + doc.setTypeId(typeId); + + II id = DatatypesFactory.eINSTANCE.createII("2.16.840.1.113883.19.4", "c266"); + doc.setId(id); + + II templateId = DatatypesFactory.eINSTANCE.createII("2.16.840.1.113883.3.27.1776"); + doc.getTemplateIds().add(templateId); + + CE code = DatatypesFactory.eINSTANCE.createCE("11488-4", "2.16.840.1.113883.6.1", "LOINC", "Consultation note"); + doc.setCode(code); + + ST title = DatatypesFactory.eINSTANCE.createST("Good Health Clinic Consultation Note"); + doc.setTitle(title); + + TS effectiveTime = DatatypesFactory.eINSTANCE.createTS("20000407"); + doc.setEffectiveTime(effectiveTime); + + CE confidentialityCode = DatatypesFactory.eINSTANCE.createCE("N", "2.16.840.1.113883.5.25"); + doc.setConfidentialityCode(confidentialityCode); + + RecordTarget recordTarget = CDAFactory.eINSTANCE.createRecordTarget(); + doc.getRecordTargets().add(recordTarget); + + PatientRole patientRole = CDAFactory.eINSTANCE.createPatientRole(); + recordTarget.setPatientRole(patientRole); + + Patient patient = CDAFactory.eINSTANCE.createPatient(); + patientRole.setPatient(patient); + + PN name = DatatypesFactory.eINSTANCE.createPN(); + name.addGiven("Henry").addFamily("Levin").addSuffix("the 7th"); + patient.getNames().add(name); + + CE administrativeGenderCode = DatatypesFactory.eINSTANCE.createCE("M", "2.16.840.1.113883.5.1"); + patient.setAdministrativeGenderCode(administrativeGenderCode); + + TS birthTime = DatatypesFactory.eINSTANCE.createTS("19320924"); + patient.setBirthTime(birthTime); + + Birthplace birthPlace = CDAFactory.eINSTANCE.createBirthplace(); + patient.setBirthplace(birthPlace); + + Place place = CDAFactory.eINSTANCE.createPlace(); + birthPlace.setPlace(place); + + EN en = DatatypesFactory.eINSTANCE.createEN(); + place.setName(en); + + en.getUses().add(EntityNameUse.ABC); + en.getUses().add(EntityNameUse.IDE); + + ENXP enDelimiter = DatatypesFactory.eINSTANCE.createENXP(EntityNamePartType.DEL, "TheDelimiter"); + en.getDelimiters().add(enDelimiter); + + ENXP enFamily = DatatypesFactory.eINSTANCE.createENXP(EntityNamePartType.FAM, "TheFamilyName"); + en.getFamilies().add(enFamily); + + en.addText("This text should show up between Family and Given."); + + ENXP enGiven = DatatypesFactory.eINSTANCE.createENXP(EntityNamePartType.GIV, "TheGivenName"); + enGiven.getQualifiers().add(EntityNamePartQualifier.AC); + enGiven.getQualifiers().add(EntityNamePartQualifier.AD); + en.getGivens().add(enGiven); + + ENXP enPrefix = DatatypesFactory.eINSTANCE.createENXP(EntityNamePartType.PFX, "ThePrefixName"); + en.getPrefixes().add(enPrefix); + + ENXP enSuffix = DatatypesFactory.eINSTANCE.createENXP(EntityNamePartType.SFX, "TheSuffixName"); + en.getSuffixes().add(enSuffix); + + IVL_TS ivlTs = DatatypesFactory.eINSTANCE.createIVL_TS(); + en.setValidTime(ivlTs); + + IVXB_TS ivxbTs = DatatypesFactory.eINSTANCE.createIVXB_TS(); + ivlTs.setHigh(ivxbTs); + ivxbTs.setValue("201101011000"); + + Organization providerOrganization = CDAFactory.eINSTANCE.createOrganization(); + providerOrganization.getIds().add(DatatypesFactory.eINSTANCE.createII("2.16.840.1.113883.19.5")); + patientRole.setProviderOrganization(providerOrganization); + + Author author = CDAFactory.eINSTANCE.createAuthor(); + author.setTime(DatatypesFactory.eINSTANCE.createTS("2000040714")); + doc.getAuthors().add(author); + + AssignedAuthor assignedAuthor = CDAFactory.eINSTANCE.createAssignedAuthor(); + assignedAuthor.getIds().add(DatatypesFactory.eINSTANCE.createII("2.16.840.1.113883.19.5", "KP00017")); + author.setAssignedAuthor(assignedAuthor); + + AD address = DatatypesFactory.eINSTANCE.createAD(); + assignedAuthor.getAddrs().add(address); + address.getUses().add(PostalAddressUse.ABC); + address.getUses().add(PostalAddressUse.DIR); + address.setIsNotOrdered(false); + + ADXP delimeter = DatatypesFactory.eINSTANCE.createADXP(AddressPartType.DEL, "TheDelimeter"); + address.getDelimiters().add(delimeter); + ADXP country = DatatypesFactory.eINSTANCE.createADXP(AddressPartType.CNT, "USA"); + address.getCounties().add(country); + ADXP state = DatatypesFactory.eINSTANCE.createADXP(AddressPartType.STA, "VA"); + address.getStates().add(state); + ADXP county = DatatypesFactory.eINSTANCE.createADXP(AddressPartType.CPA, "Fairfax"); + address.getCounties().add(county); + ADXP city = DatatypesFactory.eINSTANCE.createADXP(AddressPartType.CTY, "Chantilly"); + address.getCities().add(city); + ADXP postalCode = DatatypesFactory.eINSTANCE.createADXP(AddressPartType.ZIP, "60111"); + address.getPostalCodes().add(postalCode); + ADXP streetAddressLine = DatatypesFactory.eINSTANCE.createADXP(AddressPartType.SAL, "100 Sully Road"); + address.getStreetAddressLines().add(streetAddressLine); + ADXP houseNumber = DatatypesFactory.eINSTANCE.createADXP(AddressPartType.BNR, "100"); + address.getHouseNumbers().add(houseNumber); + ADXP houseNumberNumeric = DatatypesFactory.eINSTANCE.createADXP(AddressPartType.BNN, "100"); + address.getHouseNumberNumerics().add(houseNumberNumeric); + ADXP direction = DatatypesFactory.eINSTANCE.createADXP(AddressPartType.DIR, "TheDirection"); + address.getDirections().add(direction); + ADXP streetName = DatatypesFactory.eINSTANCE.createADXP(AddressPartType.STR, "Sully Road"); + address.getStreetNames().add(streetName); + ADXP streetNameBase = DatatypesFactory.eINSTANCE.createADXP(AddressPartType.STB, "TheStreetNameBase"); + address.getStreetNameBases().add(streetNameBase); + ADXP streetNameType = DatatypesFactory.eINSTANCE.createADXP(AddressPartType.STTYP, "TheStreetNameType"); + address.getStreetNameTypes().add(streetNameType); + ADXP additionalLocator = DatatypesFactory.eINSTANCE.createADXP(AddressPartType.ADL, "TheAdditionalLocator"); + address.getAdditionalLocators().add(additionalLocator); + ADXP unitId = DatatypesFactory.eINSTANCE.createADXP(AddressPartType.UNID, "TheUnitId"); + address.getUnitIDs().add(unitId); + ADXP unitType = DatatypesFactory.eINSTANCE.createADXP(AddressPartType.UNIT, "TheUnitType"); + address.getUnitTypes().add(unitType); + ADXP careOf = DatatypesFactory.eINSTANCE.createADXP(AddressPartType.CAR, "TheCareOf"); + address.getCareOfs().add(careOf); + ADXP censusTract = DatatypesFactory.eINSTANCE.createADXP(AddressPartType.CEN, "TheCensusTract"); + address.getCensusTracts().add(censusTract); + + // Put some mixed content in to make sure it shows up in the correct place. + // ------------------------------------------------------------------------- + address.addText("Some text that should immediately precede deliveryAddressLine"); + + ADXP deliveryAddressLine = DatatypesFactory.eINSTANCE.createADXP(AddressPartType.DAL, "TheDeliveryAddressLine"); + address.getDeliveryAddressLines().add(deliveryAddressLine); + ADXP deliveryInstallationType = DatatypesFactory.eINSTANCE.createADXP( + AddressPartType.DINST, "TheDeliveryInstallationType"); + address.getDeliveryInstallationTypes().add(deliveryInstallationType); + ADXP deliveryInstallationArea = DatatypesFactory.eINSTANCE.createADXP( + AddressPartType.DINSTA, "TheDeliveryInstallationArea"); + address.getDeliveryInstallationAreas().add(deliveryInstallationArea); + ADXP deliveryInstallQual = DatatypesFactory.eINSTANCE.createADXP( + AddressPartType.DINSTQ, "TheDeliveryInstallationQualification"); + address.getDeliveryInstallationQualifiers().add(deliveryInstallQual); + ADXP deliveryMode = DatatypesFactory.eINSTANCE.createADXP(AddressPartType.DMOD, "TheDeliveryMode"); + address.getDeliveryModes().add(deliveryMode); + ADXP deliveryModeIdentifier = DatatypesFactory.eINSTANCE.createADXP( + AddressPartType.DMODID, "TheDeliveryModeIdentifier"); + address.getDeliveryModeIdentifiers().add(deliveryModeIdentifier); + ADXP buildingNumberSuffix = DatatypesFactory.eINSTANCE.createADXP( + AddressPartType.BNS, "TheBuildingNumberSuffix"); + address.getBuildingNumberSuffixes().add(buildingNumberSuffix); + ADXP postBox = DatatypesFactory.eINSTANCE.createADXP(AddressPartType.POB, "100"); + address.getPostBoxes().add(postBox); + ADXP precinct = DatatypesFactory.eINSTANCE.createADXP(AddressPartType.PRE, "ThePrecinct"); + address.getPrecincts().add(precinct); + + // in order for this to serialize properly, this must come after setting the ADXP values. If it + // is placed before or in the middle of those, then it will show up in the wrong place in the + // serialized XML. + // ------------------------------------------------------------------------------------------------ + SXCM_TS useablePeriod1 = DatatypesFactory.eINSTANCE.createSXCM_TS(); + address.getUseablePeriods().add(useablePeriod1); + useablePeriod1.setValue("200004071400"); + useablePeriod1.setOperator(SetOperator.A); + + TEL tel = DatatypesFactory.eINSTANCE.createTEL(); + assignedAuthor.getTelecoms().add(tel); + tel.getUses().add(TelecommunicationAddressUse.AS); + tel.getUses().add(TelecommunicationAddressUse.DIR); + + Person assignedPerson = CDAFactory.eINSTANCE.createPerson(); + assignedAuthor.setAssignedPerson(assignedPerson); + + name = DatatypesFactory.eINSTANCE.createPN(); + name.addGiven("Bob").addFamily("Dolin").addSuffix("MD"); + assignedPerson.getNames().add(name); + + Component2 component2 = CDAFactory.eINSTANCE.createComponent2(); + doc.setComponent(component2); + + StructuredBody structuredBody = CDAFactory.eINSTANCE.createStructuredBody(); + component2.setStructuredBody(structuredBody); + + Component3 component3 = CDAFactory.eINSTANCE.createComponent3(); + structuredBody.getComponents().add(component3); + + Section section = CDAFactory.eINSTANCE.createSection(); + component3.setSection(section); + + Entry entry = CDAFactory.eINSTANCE.createEntry(); + section.getEntries().add(entry); + + Supply supply = CDAFactory.eINSTANCE.createSupply(); + entry.setSupply(supply); + CD cd = DatatypesFactory.eINSTANCE.createCD(); + supply.setCode(cd); + CR qualifier = DatatypesFactory.eINSTANCE.createCR(); + cd.getQualifiers().add(qualifier); + + supply.setClassCode(ActClassSupply.SPLY); + supply.setMoodCode(x_DocumentSubstanceMood.EVN); + BL bl = DatatypesFactory.eINSTANCE.createBL(); + supply.setIndependentInd(bl); + bl.setValue(true); + + System.out.println("***** Constructed example *****"); + CDAUtil.save(doc, System.out); + System.out.println(); + } +} diff --git a/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/tests/AllCDATests.java b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/tests/AllCDATests.java new file mode 100644 index 000000000..b9b19263a --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/tests/AllCDATests.java @@ -0,0 +1,36 @@ +/******************************************************************************* + * Copyright (c) 2010, 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.tests; + +import junit.framework.JUnit4TestAdapter; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; +import org.openhealthtools.mdht.uml.cda.operations.AllCDAOperationsTests; + +/** + * This class represents a suite of JUnit 4 test cases for CDA document + * processing. + */ +@RunWith(Suite.class) +@Suite.SuiteClasses({ CDADeserliazationTest.class, CDASerializationTest.class, AllCDAOperationsTests.class }) +public class AllCDATests { + + /** + * Adapter + * @return a test for JUnit 3 + */ + public static junit.framework.Test suite() { + return new JUnit4TestAdapter(AllCDATests.class); + } + + // Nothing +} // AllCDATests diff --git a/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/tests/BNTest.java b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/tests/BNTest.java new file mode 100644 index 000000000..6c2454a3e --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/tests/BNTest.java @@ -0,0 +1,107 @@ +/******************************************************************************* + * Copyright (c) 2010, 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.tests; + +import org.eclipse.emf.common.util.Diagnostic; +import org.eclipse.emf.ecore.util.Diagnostician; +import org.openhealthtools.mdht.uml.hl7.datatypes.BN; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.vocab.NullFlavor; + +/** + * This tests the BN class against the validations to make sure that they + * are functioning correctly. + * + * @author Les Westberg + * + */ +public class BNTest { + /** + * This method returns true if there are no errors. + * + * @param oDiagnostic The diagnostic information. + * @return TRUE if there are errors. FALSE if there are none. + */ + private static boolean diagnosticsHaveErrors(Diagnostic oDiagnostic) { + return (oDiagnostic.getSeverity() != Diagnostic.OK); + } + + /** + * This method processes and outputs the diagnostic information if there + * were any errors. It returns true if no errors exist. + * + * @param oDiagnostic The diagnostic information. + * @return TRUE if there are no errors. + */ + private static boolean processDiagnostics(Diagnostic oDiagnostic) { + boolean bResult = true; // Assume no errors + + if (diagnosticsHaveErrors(oDiagnostic)) { + SystemOutValidationHandler oValHandler = new SystemOutValidationHandler(); + DiagnosticOutputHelper.processDiagnostic(oDiagnostic, oValHandler); + bResult = false; + } + + return bResult; + } + + /** + * This method tests BN when NullFlavor is not set. This should work. + * + * @return boolean True if the test was successful. + */ + public static boolean testWithNullFlavorNotSet() { + BN oBn = DatatypesFactory.eINSTANCE.createBN(); + oBn.setValue(true); + Diagnostic oDiagnostic = Diagnostician.INSTANCE.validate(oBn); + return processDiagnostics(oDiagnostic); + } + + /** + * This method tests BN when setting nullFlavor. This should not be set + * on a BN - An error should occur. We need to make sure it does. + * + * @return boolean True if the test was successful. + */ + public static boolean testBNWithNullFlavor_FailureCase() { + boolean bResult = true; // assume everything is OK... + + BN oBn = DatatypesFactory.eINSTANCE.createBN(); + oBn.setNullFlavor(NullFlavor.NA); + + Diagnostic oDiagnostic = Diagnostician.INSTANCE.validate(oBn); + if (!diagnosticsHaveErrors(oDiagnostic)) { + System.out.println("There should have been a validation error but was not one."); + bResult = false; + } + + return bResult; + } + + public static void main(String[] args) throws Exception { + boolean bFailure = false; + + if (!testWithNullFlavorNotSet()) { + bFailure = true; + System.out.println("testWithNullFlavorNotSet failed!"); + } + if (!testBNWithNullFlavor_FailureCase()) { + bFailure = true; + System.out.println("testBNWithNullFlavor_FailureCase failed!"); + } + + if (bFailure) { + System.out.println("One or more tests Failed!!!"); + } else { + System.out.println("All tests completed successfully..."); + } + } +} diff --git a/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/tests/BigDecimalTest.java b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/tests/BigDecimalTest.java new file mode 100644 index 000000000..c9d71058b --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/tests/BigDecimalTest.java @@ -0,0 +1,183 @@ +/******************************************************************************* + * Copyright (c) 2010, 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.tests; + +import java.math.BigDecimal; + +import org.eclipse.emf.common.util.Diagnostic; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.MO; +import org.openhealthtools.mdht.uml.hl7.datatypes.PQ; +import org.openhealthtools.mdht.uml.hl7.datatypes.PQR; +import org.openhealthtools.mdht.uml.hl7.datatypes.REAL; + +public class BigDecimalTest { + /** + * This method returns true if there are no errors. + * + * @param oDiagnostic The diagnostic information. + * @return TRUE if there are errors. FALSE if there are none. + */ + private static boolean diagnosticsHaveErrors(Diagnostic oDiagnostic) { + return (oDiagnostic.getSeverity() != Diagnostic.OK); + } + + /** + * This method processes and outputs the diagnostic information if there + * were any errors. It returns true if no errors exist. + * + * @param oDiagnostic The diagnostic information. + * @return TRUE if there are no errors. + */ + @SuppressWarnings("unused") + private static boolean processDiagnostics(Diagnostic oDiagnostic) { + boolean bResult = true; // Assume no errors + + if (diagnosticsHaveErrors(oDiagnostic)) { + SystemOutValidationHandler oValHandler = new SystemOutValidationHandler(); + DiagnosticOutputHelper.processDiagnostic(oDiagnostic, oValHandler); + bResult = false; + } + + return bResult; + } + + /** + * This method tests the MO::value to make sure it is now working correctly with + * BigDecimal with backward compatibility with Double. + * + * @return boolean True if the test was successful. + */ + public static boolean testMOValue() { + boolean bResult = true; // Assume we are working correctly. + + MO oMO = DatatypesFactory.eINSTANCE.createMO(); + oMO.setValue(new BigDecimal("100.12345678")); + if (!oMO.getValue().equals(new BigDecimal("100.12345678"))) { + System.out.println("Failed to set/retrieve MO::value using BigDecimal initializer."); + bResult = false; + } + + oMO = DatatypesFactory.eINSTANCE.createMO(); + oMO.setValue(new Double("123.23")); + if (!oMO.getValue().equals(new BigDecimal("123.23"))) { + System.out.println("Failed to set/retrieve MO::value using Double initializer."); + bResult = false; + } + + return bResult; + } + + /** + * This method tests the PQ::value to make sure it is now working correctly with + * BigDecimal with backward compatibility with Double. + * + * @return boolean True if the test was successful. + */ + public static boolean testPQValue() { + boolean bResult = true; // Assume we are working correctly. + + PQ oPQ = DatatypesFactory.eINSTANCE.createPQ(); + oPQ.setValue(new BigDecimal("100.12345678")); + if (!oPQ.getValue().equals(new BigDecimal("100.12345678"))) { + System.out.println("Failed to set/retrieve PQ::value using BigDecimal initializer."); + bResult = false; + } + + oPQ = DatatypesFactory.eINSTANCE.createPQ(); + oPQ.setValue(new Double("123.23")); + if (!oPQ.getValue().equals(new BigDecimal("123.23"))) { + System.out.println("Failed to set/retrieve PQ::value using Double initializer."); + bResult = false; + } + + return bResult; + } + + /** + * This method tests the PQR::value to make sure it is now working correctly with + * BigDecimal with backward compatibility with Double. + * + * @return boolean True if the test was successful. + */ + public static boolean testPQRValue() { + boolean bResult = true; // Assume we are working correctly. + + PQR oPQR = DatatypesFactory.eINSTANCE.createPQR(); + oPQR.setValue(new BigDecimal("100.12345678")); + if (!oPQR.getValue().equals(new BigDecimal("100.12345678"))) { + System.out.println("Failed to set/retrieve PQR::value using BigDecimal initializer."); + bResult = false; + } + + oPQR = DatatypesFactory.eINSTANCE.createPQR(); + oPQR.setValue(new Double("123.23")); + if (!oPQR.getValue().equals(new BigDecimal("123.23"))) { + System.out.println("Failed to set/retrieve PQR::value using Double initializer."); + bResult = false; + } + + return bResult; + } + + /** + * This method tests the REAL::value to make sure it is now working correctly with + * BigDecimal with backward compatibility with Double. + * + * @return boolean True if the test was successful. + */ + public static boolean testREALValue() { + boolean bResult = true; // Assume we are working correctly. + + REAL oREAL = DatatypesFactory.eINSTANCE.createREAL(); + oREAL.setValue(new BigDecimal("100.12345678")); + if (!oREAL.getValue().equals(new BigDecimal("100.12345678"))) { + System.out.println("Failed to set/retrieve REAL::value using BigDecimal initializer."); + bResult = false; + } + + oREAL = DatatypesFactory.eINSTANCE.createREAL(); + oREAL.setValue(new Double("123.23")); + if (!oREAL.getValue().equals(new BigDecimal("123.23"))) { + System.out.println("Failed to set/retrieve REAL::value using Double initializer."); + bResult = false; + } + + return bResult; + } + + public static void main(String[] args) throws Exception { + boolean bFailure = false; + + if (!testMOValue()) { + bFailure = true; + System.out.println("testMOValue failed!"); + } + if (!testPQValue()) { + bFailure = true; + System.out.println("testPQValue failed!"); + } + if (!testPQRValue()) { + bFailure = true; + System.out.println("testPQRValue failed!"); + } + if (!testREALValue()) { + bFailure = true; + System.out.println("testREALValue failed!"); + } + + if (bFailure) { + System.out.println("One or more tests Failed!!!"); + } else { + System.out.println("All tests completed successfully..."); + } + } +} diff --git a/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/tests/BigIntegerTest.java b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/tests/BigIntegerTest.java new file mode 100644 index 000000000..309ce3bd0 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/tests/BigIntegerTest.java @@ -0,0 +1,90 @@ +/******************************************************************************* + * Copyright (c) 2010, 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.tests; + +import java.math.BigInteger; + +import org.eclipse.emf.common.util.Diagnostic; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.INT; + +public class BigIntegerTest { + /** + * This method returns true if there are no errors. + * + * @param oDiagnostic The diagnostic information. + * @return TRUE if there are errors. FALSE if there are none. + */ + private static boolean diagnosticsHaveErrors(Diagnostic oDiagnostic) { + return (oDiagnostic.getSeverity() != Diagnostic.OK); + } + + /** + * This method processes and outputs the diagnostic information if there + * were any errors. It returns true if no errors exist. + * + * @param oDiagnostic The diagnostic information. + * @return TRUE if there are no errors. + */ + @SuppressWarnings("unused") + private static boolean processDiagnostics(Diagnostic oDiagnostic) { + boolean bResult = true; // Assume no errors + + if (diagnosticsHaveErrors(oDiagnostic)) { + SystemOutValidationHandler oValHandler = new SystemOutValidationHandler(); + DiagnosticOutputHelper.processDiagnostic(oDiagnostic, oValHandler); + bResult = false; + } + + return bResult; + } + + /** + * This method tests the INT::value to make sure it is now working correctly with + * BigInteger with backward compatibility with Integer. + * + * @return boolean True if the test was successful. + */ + public static boolean testINTValue() { + boolean bResult = true; // Assume we are working correctly. + + INT oINT = DatatypesFactory.eINSTANCE.createINT(); + oINT.setValue(new BigInteger("123456")); + if (!oINT.getValue().equals(new BigInteger("123456"))) { + System.out.println("Failed to set/retrieve INT::value using BigInteger initializer."); + bResult = false; + } + + oINT = DatatypesFactory.eINSTANCE.createINT(); + oINT.setValue(new Integer("4567")); + if (!oINT.getValue().equals(new BigInteger("4567"))) { + System.out.println("Failed to set/retrieve INT::value using Double initializer."); + bResult = false; + } + + return bResult; + } + + public static void main(String[] args) throws Exception { + boolean bFailure = false; + + if (!testINTValue()) { + bFailure = true; + System.out.println("testINTValue failed!"); + } + + if (bFailure) { + System.out.println("One or more tests Failed!!!"); + } else { + System.out.println("All tests completed successfully..."); + } + } +} diff --git a/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/tests/CDADeserliazationTest.java b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/tests/CDADeserliazationTest.java new file mode 100644 index 000000000..e5a049894 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/tests/CDADeserliazationTest.java @@ -0,0 +1,66 @@ +/******************************************************************************* + * Copyright (c) 2010, 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.tests; + +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.fail; + +import java.io.FileInputStream; +import java.io.FileNotFoundException; + +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.openhealthtools.mdht.uml.cda.ClinicalDocument; +import org.openhealthtools.mdht.uml.cda.util.CDAUtil; + +/** + * This class is a JUnit 4 test case for CDA document deserialization. + */ +@SuppressWarnings("nls") +public class CDADeserliazationTest { + + /** + * The sample CDA document. + */ + public final static String SAMPLE_DOCUMENT = "resources/SampleCDADocument.xml"; + + /** + * @throws Exception + */ + @BeforeClass + public static void setUpBeforeClass() throws Exception { + CDAUtil.loadPackages(); + } + + /** + * @throws Exception + */ + @AfterClass + public static void tearDownAfterClass() throws Exception { + // nothing + } + + /** + * Test that the sample document can be trivially deserialized. + */ + + public void deserializeSampleCDADocment() { + try { + final ClinicalDocument clinicalDocument = CDAUtil.load(new FileInputStream(SAMPLE_DOCUMENT)); + assertNotNull(clinicalDocument); + } catch (FileNotFoundException e) { + fail(e.getMessage()); + } catch (Exception e) { + fail(e.getMessage()); + } + } // deserializeSampleCDADocment + +} // CDADeserliazationTest diff --git a/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/tests/CDASerializationTest.java b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/tests/CDASerializationTest.java new file mode 100644 index 000000000..048410d05 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/tests/CDASerializationTest.java @@ -0,0 +1,166 @@ +/******************************************************************************* + * Copyright (c) 2010, 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.tests; + +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.io.OutputStream; + +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.junit.Before; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.AssignedAuthor; +import org.openhealthtools.mdht.uml.cda.Author; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.ClinicalDocument; +import org.openhealthtools.mdht.uml.cda.InfrastructureRootTypeId; +import org.openhealthtools.mdht.uml.cda.Organization; +import org.openhealthtools.mdht.uml.cda.Patient; +import org.openhealthtools.mdht.uml.cda.PatientRole; +import org.openhealthtools.mdht.uml.cda.Person; +import org.openhealthtools.mdht.uml.cda.RecordTarget; +import org.openhealthtools.mdht.uml.cda.util.CDAUtil; +import org.openhealthtools.mdht.uml.hl7.datatypes.CE; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.II; +import org.openhealthtools.mdht.uml.hl7.datatypes.PN; +import org.openhealthtools.mdht.uml.hl7.datatypes.ST; +import org.openhealthtools.mdht.uml.hl7.datatypes.TS; + +/** + * This class is a JUnit 4 test case for CDA document serialization. + */ +@SuppressWarnings("nls") +public class CDASerializationTest { + + private static final String TEMP_CDA_FILE_PREFIX = "CDADoc"; + + private static final String TEMP_CDA_FILE_SUFFIX = "xml"; + + ClinicalDocument doc = null; + + /** + * Create and initialize a CDA document for serialization. + */ + @Before + public void createCDADocument() { + doc = CDAFactory.eINSTANCE.createClinicalDocument(); + + InfrastructureRootTypeId typeId = CDAFactory.eINSTANCE.createInfrastructureRootTypeId(); + typeId.setExtension("POCD_HD000040"); + doc.setTypeId(typeId); + + II id = DatatypesFactory.eINSTANCE.createII("2.16.840.1.113883.19.4", "c266"); + doc.setId(id); + + II templateId = DatatypesFactory.eINSTANCE.createII("2.16.840.1.113883.3.27.1776"); + doc.getTemplateIds().add(templateId); + + CE code = DatatypesFactory.eINSTANCE.createCE("11488-4", "2.16.840.1.113883.6.1", "LOINC", "Consultation note"); + doc.setCode(code); + + ST title = DatatypesFactory.eINSTANCE.createST("Good Health Clinic Consultation Note"); + doc.setTitle(title); + + TS effectiveTime = DatatypesFactory.eINSTANCE.createTS("20000407"); + doc.setEffectiveTime(effectiveTime); + + CE confidentialityCode = DatatypesFactory.eINSTANCE.createCE("N", "2.16.840.1.113883.5.25"); + doc.setConfidentialityCode(confidentialityCode); + + RecordTarget recordTarget = CDAFactory.eINSTANCE.createRecordTarget(); + doc.getRecordTargets().add(recordTarget); + + PatientRole patientRole = CDAFactory.eINSTANCE.createPatientRole(); + recordTarget.setPatientRole(patientRole); + + Patient patient = CDAFactory.eINSTANCE.createPatient(); + patientRole.setPatient(patient); + + PN name = DatatypesFactory.eINSTANCE.createPN(); + name.addGiven("Henry").addFamily("Levin").addSuffix("the 7th"); + patient.getNames().add(name); + + CE administrativeGenderCode = DatatypesFactory.eINSTANCE.createCE("M", "2.16.840.1.113883.5.1"); + patient.setAdministrativeGenderCode(administrativeGenderCode); + + TS birthTime = DatatypesFactory.eINSTANCE.createTS("19320924"); + patient.setBirthTime(birthTime); + + Organization providerOrganization = CDAFactory.eINSTANCE.createOrganization(); + providerOrganization.getIds().add(DatatypesFactory.eINSTANCE.createII("2.16.840.1.113883.19.5")); + patientRole.setProviderOrganization(providerOrganization); + + Author author = CDAFactory.eINSTANCE.createAuthor(); + author.setTime(DatatypesFactory.eINSTANCE.createTS("2000040714")); + doc.getAuthors().add(author); + + AssignedAuthor assignedAuthor = CDAFactory.eINSTANCE.createAssignedAuthor(); + assignedAuthor.getIds().add(DatatypesFactory.eINSTANCE.createII("2.16.840.1.113883.19.5", "KP00017")); + author.setAssignedAuthor(assignedAuthor); + + Person assignedPerson = CDAFactory.eINSTANCE.createPerson(); + assignedAuthor.setAssignedPerson(assignedPerson); + + name = DatatypesFactory.eINSTANCE.createPN(); + name.addGiven("Bob").addFamily("Dolin").addSuffix("MD"); + assignedPerson.getNames().add(name); + + } // createCDADocument + + /** + * Test that the CDA Document can be serialized, and that when it is + * deserialized, we get the same thing we wrote. + */ + @Test + public void serializeCDADocument() { + try { + // If you want to know where the temporary files are going, + // un-comment the next statement. + // System.out.println(System.getProperty("java.io.tmpdir")); + + final File tempFile = File.createTempFile(TEMP_CDA_FILE_PREFIX, TEMP_CDA_FILE_SUFFIX); + + // If you want the temporary files to stick around, comment out the + // next statement. + tempFile.deleteOnExit(); + + final OutputStream out = new BufferedOutputStream((new FileOutputStream(tempFile))); + + // Write the document out to a temporary file. + CDAUtil.save(doc, out); + + out.flush(); + out.close(); + + // Now read it back in. + final InputStream in = new BufferedInputStream(new FileInputStream(tempFile)); + + final ClinicalDocument clinicalDocument = CDAUtil.load(in); + assertNotNull(clinicalDocument); + + // What we wrote should be what we read back in + assertTrue( + "The CDA that was serialized doesn't equal the CDA that was deserialized", + EcoreUtil.equals(doc, clinicalDocument)); + } catch (Exception e) { + fail(e.getMessage()); + } + } // serializeCDADocument +} // CDASerializationTest diff --git a/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/tests/DiagnosticOutputHelper.java b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/tests/DiagnosticOutputHelper.java new file mode 100644 index 000000000..ce69d3e6f --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/tests/DiagnosticOutputHelper.java @@ -0,0 +1,46 @@ +/******************************************************************************* + * Copyright (c) 2010, 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.tests; + +import java.util.LinkedList; +import java.util.Queue; + +import org.eclipse.emf.common.util.Diagnostic; +import org.openhealthtools.mdht.uml.cda.util.CDAUtil.ValidationHandler; + +public class DiagnosticOutputHelper { + // iterative breadth-first traversal of diagnostic tree using queue + public static void processDiagnostic(Diagnostic diagnostic, ValidationHandler handler) { + Queue queue = new LinkedList(); + queue.add(diagnostic); // root + while (!queue.isEmpty()) { + Diagnostic d = queue.remove(); + handleDiagnostic(d, handler); // visit + for (Diagnostic childDiagnostic : d.getChildren()) { // process successors + queue.add(childDiagnostic); + } + } + } + + public static void handleDiagnostic(Diagnostic diagnostic, ValidationHandler handler) { + switch (diagnostic.getSeverity()) { + case Diagnostic.ERROR: + handler.handleError(diagnostic); + break; + case Diagnostic.WARNING: + handler.handleWarning(diagnostic); + break; + case Diagnostic.INFO: + handler.handleInfo(diagnostic); + break; + } + } +} diff --git a/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/tests/EIVLEventTest.java b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/tests/EIVLEventTest.java new file mode 100644 index 000000000..1b0f678a6 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/tests/EIVLEventTest.java @@ -0,0 +1,314 @@ +/******************************************************************************* + * Copyright (c) 2010, 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.tests; + +import org.eclipse.emf.common.util.Diagnostic; +import org.eclipse.emf.ecore.util.Diagnostician; +import org.openhealthtools.mdht.uml.hl7.datatypes.CD; +import org.openhealthtools.mdht.uml.hl7.datatypes.CR; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.ED; +import org.openhealthtools.mdht.uml.hl7.datatypes.EIVL_event; + +public class EIVLEventTest { + /** + * This method returns true if there are no errors. + * + * @param oDiagnostic The diagnostic information. + * @return TRUE if there are errors. FALSE if there are none. + */ + private static boolean diagnosticsHaveErrors(Diagnostic oDiagnostic) { + return (oDiagnostic.getSeverity() != Diagnostic.OK); + } + + /** + * This method processes and outputs the diagnostic information if there + * were any errors. It returns true if no errors exist. + * + * @param oDiagnostic The diagnostic information. + * @return TRUE if there are no errors. + */ + private static boolean processDiagnostics(Diagnostic oDiagnostic) { + boolean bResult = true; // Assume no errors + + if (diagnosticsHaveErrors(oDiagnostic)) { + SystemOutValidationHandler oValHandler = new SystemOutValidationHandler(); + DiagnosticOutputHelper.processDiagnostic(oDiagnostic, oValHandler); + bResult = false; + } + + return bResult; + } + + /** + * This method tests code with a valid value. One that is part of the + * TimingEvent enumerated type. + * + * @return boolean True if the test was successful. + */ + public static boolean testCodeValidValue() { + EIVL_event oEivlEvent = DatatypesFactory.eINSTANCE.createEIVL_event(); + oEivlEvent.setCode("AC"); + Diagnostic oDiagnostic = Diagnostician.INSTANCE.validate(oEivlEvent); + return processDiagnostics(oDiagnostic); + } + + /** + * This method tests setting code with a value that is invalid. An invalid code + * is one that is not part of the TimingEvent enumerated type. + * + * @return boolean True if the test was successful. + */ + public static boolean testCodeInvalidValue_FailureCase() { + boolean bResult = true; // assume everything is OK... + + EIVL_event oEivlEvent = DatatypesFactory.eINSTANCE.createEIVL_event(); + oEivlEvent.setCode("ZZZ"); + + Diagnostic oDiagnostic = Diagnostician.INSTANCE.validate(oEivlEvent); + if (!diagnosticsHaveErrors(oDiagnostic)) { + System.out.println("There should have been a validation error but was not one."); + bResult = false; + } + // processDiagnostics(oDiagnostic); - Uncomment to see the error printed out... + + return bResult; + } + + /** + * This method tests code system with a valid value. The valid value is: + * 2.16.840.1.113883.5.139 + * + * @return boolean True if the test was successful. + */ + public static boolean testCodeSystemValidValue() { + EIVL_event oEivlEvent = DatatypesFactory.eINSTANCE.createEIVL_event(); + oEivlEvent.setCodeSystem("2.16.840.1.113883.5.139"); + Diagnostic oDiagnostic = Diagnostician.INSTANCE.validate(oEivlEvent); + return processDiagnostics(oDiagnostic); + } + + /** + * This method tests code system with an invalid value. The valid value is: + * 2.16.840.1.113883.5.139 - Everything else is invalid. + * + * @return boolean True if the test was successful. + */ + public static boolean testCodeSystemInvalidValue_FailureCase() { + boolean bResult = true; // assume everything is OK... + + EIVL_event oEivlEvent = DatatypesFactory.eINSTANCE.createEIVL_event(); + oEivlEvent.setCodeSystem("2.16.840.1.113883.4.139"); + + Diagnostic oDiagnostic = Diagnostician.INSTANCE.validate(oEivlEvent); + if (!diagnosticsHaveErrors(oDiagnostic)) { + System.out.println("There should have been a validation error but was not one."); + bResult = false; + } + // processDiagnostics(oDiagnostic); - Uncomment to see the error printed out... + + return bResult; + } + + /** + * This method tests code system name with a valid value. The valid value is: + * TimingEvent + * + * @return boolean True if the test was successful. + */ + public static boolean testCodeSystemNameValidValue() { + EIVL_event oEivlEvent = DatatypesFactory.eINSTANCE.createEIVL_event(); + oEivlEvent.setCodeSystemName("TimingEvent"); + Diagnostic oDiagnostic = Diagnostician.INSTANCE.validate(oEivlEvent); + return processDiagnostics(oDiagnostic); + } + + /** + * This method tests code system name with an invalid value. The valid value is: + * TimingEvent - Everything else is invalid. + * + * @return boolean True if the test was successful. + */ + public static boolean testCodeSystemNameInvalidValue_FailureCase() { + boolean bResult = true; // assume everything is OK... + + EIVL_event oEivlEvent = DatatypesFactory.eINSTANCE.createEIVL_event(); + oEivlEvent.setCodeSystemName("SomethingElse"); + + Diagnostic oDiagnostic = Diagnostician.INSTANCE.validate(oEivlEvent); + if (!diagnosticsHaveErrors(oDiagnostic)) { + System.out.println("There should have been a validation error but was not one."); + bResult = false; + } + // processDiagnostics(oDiagnostic); - Uncomment to see the error printed out... + + return bResult; + } + + /** + * This method tests display name with a valid value. A valid value is anything that + * has at least one character. + * + * @return boolean True if the test was successful. + */ + public static boolean testDisplayNameValidValue() { + EIVL_event oEivlEvent = DatatypesFactory.eINSTANCE.createEIVL_event(); + oEivlEvent.setDisplayName("AC"); + Diagnostic oDiagnostic = Diagnostician.INSTANCE.validate(oEivlEvent); + return processDiagnostics(oDiagnostic); + } + + /** + * This method tests display name with an invalid value. The only really invalid + * value is an empty string. + * + * @return boolean True if the test was successful. + */ + public static boolean testDisplayNameInvalidValue_FailureCase() { + boolean bResult = true; // assume everything is OK... + + EIVL_event oEivlEvent = DatatypesFactory.eINSTANCE.createEIVL_event(); + oEivlEvent.setDisplayName(""); + + Diagnostic oDiagnostic = Diagnostician.INSTANCE.validate(oEivlEvent); + if (!diagnosticsHaveErrors(oDiagnostic)) { + System.out.println("There should have been a validation error but was not one."); + bResult = false; + } + // processDiagnostics(oDiagnostic); - Uncomment to see the error printed out... + + return bResult; + } + + /** + * This method tests original text. Based on this type as a restriction of CE/CD, + * this value should not be present. So setting it should trigger an error. + * + * @return boolean True if the test was successful. + */ + public static boolean testOriginalTextInvalidValue_FailureCase() { + boolean bResult = true; // assume everything is OK... + + EIVL_event oEivlEvent = DatatypesFactory.eINSTANCE.createEIVL_event(); + ED originalText = DatatypesFactory.eINSTANCE.createED(); + oEivlEvent.setOriginalText(originalText); + + Diagnostic oDiagnostic = Diagnostician.INSTANCE.validate(oEivlEvent); + if (!diagnosticsHaveErrors(oDiagnostic)) { + System.out.println("There should have been a validation error but was not one."); + bResult = false; + } + // processDiagnostics(oDiagnostic); - Uncomment to see the error printed out... + + return bResult; + } + + /** + * This method tests qualifier text. Based on this type as a restriction of CE/CD, + * this value should not be present. So setting it should trigger an error. + * + * @return boolean True if the test was successful. + */ + public static boolean testQualifierInvalidValue_FailureCase() { + boolean bResult = true; // assume everything is OK... + + EIVL_event oEivlEvent = DatatypesFactory.eINSTANCE.createEIVL_event(); + CR qualifier = DatatypesFactory.eINSTANCE.createCR(); + oEivlEvent.getQualifiers().add(qualifier); + + Diagnostic oDiagnostic = Diagnostician.INSTANCE.validate(oEivlEvent); + if (!diagnosticsHaveErrors(oDiagnostic)) { + System.out.println("There should have been a validation error but was not one."); + bResult = false; + } + // processDiagnostics(oDiagnostic); - Uncomment to see the error printed out... + + return bResult; + } + + /** + * This method tests translation text. Based on this type as a restriction of CE/CD, + * this value should not be present. So setting it should trigger an error. + * + * @return boolean True if the test was successful. + */ + public static boolean testTranslationInvalidValue_FailureCase() { + boolean bResult = true; // assume everything is OK... + + EIVL_event oEivlEvent = DatatypesFactory.eINSTANCE.createEIVL_event(); + CD translation = DatatypesFactory.eINSTANCE.createCD(); + oEivlEvent.getTranslations().add(translation); + + Diagnostic oDiagnostic = Diagnostician.INSTANCE.validate(oEivlEvent); + if (!diagnosticsHaveErrors(oDiagnostic)) { + System.out.println("There should have been a validation error but was not one."); + bResult = false; + } + // processDiagnostics(oDiagnostic); - Uncomment to see the error printed out... + + return bResult; + } + + public static void main(String[] args) throws Exception { + boolean bFailure = false; + + if (!testCodeValidValue()) { + bFailure = true; + System.out.println("testCodeValidValue failed!"); + } + if (!testCodeInvalidValue_FailureCase()) { + bFailure = true; + System.out.println("testCodeInvalidValue failed!"); + } + if (!testCodeSystemValidValue()) { + bFailure = true; + System.out.println("testCodeSystemValidValue failed!"); + } + if (!testCodeSystemInvalidValue_FailureCase()) { + bFailure = true; + System.out.println("testCodeSystemInvalidValue failed!"); + } + if (!testCodeSystemNameValidValue()) { + bFailure = true; + System.out.println("testCodeSystemNameValidValue failed!"); + } + if (!testCodeSystemNameInvalidValue_FailureCase()) { + bFailure = true; + System.out.println("testCodeSystemNameInvalidValue failed!"); + } + if (!testDisplayNameValidValue()) { + bFailure = true; + System.out.println("testDisplayNameValidValue failed!"); + } + if (!testDisplayNameInvalidValue_FailureCase()) { + bFailure = true; + System.out.println("testDisplayNameInvalidValue failed!"); + } + if (!testOriginalTextInvalidValue_FailureCase()) { + bFailure = true; + System.out.println("testOriginalTextInvalidValue failed!"); + } + if (!testQualifierInvalidValue_FailureCase()) { + bFailure = true; + System.out.println("testQualifierInvalidValue failed!"); + } + if (!testTranslationInvalidValue_FailureCase()) { + bFailure = true; + System.out.println("testQualifierInvalidValue failed!"); + } + + if (bFailure) { + System.out.println("One or more tests Failed!!!"); + } else { + System.out.println("All tests completed successfully..."); + } + } +} diff --git a/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/tests/IVLINTTest.java b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/tests/IVLINTTest.java new file mode 100644 index 000000000..29b16c9ab --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/tests/IVLINTTest.java @@ -0,0 +1,319 @@ +/******************************************************************************* + * Copyright (c) 2010, 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.tests; + +import org.eclipse.emf.common.util.Diagnostic; +import org.eclipse.emf.ecore.util.Diagnostician; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.INT; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_INT; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVXB_INT; + +/** + * This tests the IVL_INT class against the validations to make sure that they + * are functioning correctly. + * + * @author Les Westberg + * + */ +public class IVLINTTest { + /** + * This method returns true if there are no errors. + * + * @param oDiagnostic The diagnostic information. + * @return TRUE if there are errors. FALSE if there are none. + */ + private static boolean diagnosticsHaveErrors(Diagnostic oDiagnostic) { + return (oDiagnostic.getSeverity() != Diagnostic.OK); + } + + /** + * This method processes and outputs the diagnostic information if there + * were any errors. It returns true if no errors exist. + * + * @param oDiagnostic The diagnostic information. + * @return TRUE if there are no errors. + */ + private static boolean processDiagnostics(Diagnostic oDiagnostic) { + boolean bResult = true; // Assume no errors + + if (diagnosticsHaveErrors(oDiagnostic)) { + SystemOutValidationHandler oValHandler = new SystemOutValidationHandler(); + DiagnosticOutputHelper.processDiagnostic(oDiagnostic, oValHandler); + bResult = false; + } + + return bResult; + } + + /** + * This method tests option one of the HL7 choice - specifically + * where "Low" exists and neither width or high are filled in. + * + * @return boolean True if the test was successful. + */ + public static boolean testOption1LowOnly() { + IVL_INT oIvlInt = DatatypesFactory.eINSTANCE.createIVL_INT(); + IVXB_INT oLow = DatatypesFactory.eINSTANCE.createIVXB_INT(); + oIvlInt.setLow(oLow); + Diagnostic oDiagnostic = Diagnostician.INSTANCE.validate(oIvlInt); + return processDiagnostics(oDiagnostic); + } + + /** + * This method tests option one of the HL7 choice - specifically + * where "Low" exists and width exists. + * + * @return boolean True if the test was successful. + */ + public static boolean testOption1LowWithWidth() { + IVL_INT oIvlInt = DatatypesFactory.eINSTANCE.createIVL_INT(); + IVXB_INT oLow = DatatypesFactory.eINSTANCE.createIVXB_INT(); + oIvlInt.setLow(oLow); + INT oWidth = DatatypesFactory.eINSTANCE.createINT(); + oIvlInt.setWidth(oWidth); + + Diagnostic oDiagnostic = Diagnostician.INSTANCE.validate(oIvlInt); + return processDiagnostics(oDiagnostic); + } + + /** + * This method tests option one of the HL7 choice - specifically + * where "Low" exists and high exists. + * + * @return boolean True if the test was successful. + */ + public static boolean testOption1LowWithHigh() { + IVL_INT oIvlInt = DatatypesFactory.eINSTANCE.createIVL_INT(); + IVXB_INT oLow = DatatypesFactory.eINSTANCE.createIVXB_INT(); + oIvlInt.setLow(oLow); + IVXB_INT oHigh = DatatypesFactory.eINSTANCE.createIVXB_INT(); + oIvlInt.setHigh(oHigh); + + Diagnostic oDiagnostic = Diagnostician.INSTANCE.validate(oIvlInt); + return processDiagnostics(oDiagnostic); + } + + /** + * This method tests option one of the HL7 choice - specifically + * where "Low" exists and both width and high exists. This should + * fail. + * + * @return boolean True if the test was successful. + */ + public static boolean testOption1LowWithWidthAndHigh_FailureCase() { + boolean bResult = true; // assume everything is OK... + + IVL_INT oIvlInt = DatatypesFactory.eINSTANCE.createIVL_INT(); + IVXB_INT oLow = DatatypesFactory.eINSTANCE.createIVXB_INT(); + oIvlInt.setLow(oLow); + + INT oWidth = DatatypesFactory.eINSTANCE.createINT(); + oIvlInt.setWidth(oWidth); + + IVXB_INT oHigh = DatatypesFactory.eINSTANCE.createIVXB_INT(); + oIvlInt.setHigh(oHigh); + + Diagnostic oDiagnostic = Diagnostician.INSTANCE.validate(oIvlInt); + if (!diagnosticsHaveErrors(oDiagnostic)) { + System.out.println("There should have been a validation error but was not one."); + bResult = false; + } + + return bResult; + } + + /** + * This method tests option two of the HL7 choice - specifically + * where "High" exists and nothing else. + * + * @return boolean True if the test was successful. + */ + public static boolean testOption2HighOnly() { + IVL_INT oIvlInt = DatatypesFactory.eINSTANCE.createIVL_INT(); + IVXB_INT oHigh = DatatypesFactory.eINSTANCE.createIVXB_INT(); + oIvlInt.setHigh(oHigh); + + Diagnostic oDiagnostic = Diagnostician.INSTANCE.validate(oIvlInt); + return processDiagnostics(oDiagnostic); + } + + /** + * This method tests option two of the HL7 choice - specifically + * where "High" exists and nothing else. + * + * @return boolean True if the test was successful. + */ + public static boolean testOption2HighWithCenter_FailureCase() { + boolean bResult = true; // assume everything is OK... + + IVL_INT oIvlInt = DatatypesFactory.eINSTANCE.createIVL_INT(); + IVXB_INT oHigh = DatatypesFactory.eINSTANCE.createIVXB_INT(); + oIvlInt.setHigh(oHigh); + + INT oCenter = DatatypesFactory.eINSTANCE.createINT(); + oIvlInt.setCenter(oCenter); + + Diagnostic oDiagnostic = Diagnostician.INSTANCE.validate(oIvlInt); + if (!diagnosticsHaveErrors(oDiagnostic)) { + System.out.println("There should have been a validation error but was not one."); + bResult = false; + } + + return bResult; + } + + /** + * This method tests option three of the HL7 choice - specifically + * where "Width" exists and nothing else. + * + * @return boolean True if the test was successful. + */ + public static boolean testOption3WidthOnly() { + IVL_INT oIvlInt = DatatypesFactory.eINSTANCE.createIVL_INT(); + INT oWidth = DatatypesFactory.eINSTANCE.createINT(); + oIvlInt.setWidth(oWidth); + + Diagnostic oDiagnostic = Diagnostician.INSTANCE.validate(oIvlInt); + return processDiagnostics(oDiagnostic); + } + + /** + * This method tests option three of the HL7 choice - specifically + * where "Width" exists and high exists. + * + * @return boolean True if the test was successful. + */ + public static boolean testOption3WidthAndHigh() { + IVL_INT oIvlInt = DatatypesFactory.eINSTANCE.createIVL_INT(); + INT oWidth = DatatypesFactory.eINSTANCE.createINT(); + oIvlInt.setWidth(oWidth); + + IVXB_INT oHigh = DatatypesFactory.eINSTANCE.createIVXB_INT(); + oIvlInt.setHigh(oHigh); + + Diagnostic oDiagnostic = Diagnostician.INSTANCE.validate(oIvlInt); + return processDiagnostics(oDiagnostic); + } + + /** + * This method tests option four of the HL7 choice - specifically + * where "Center" exists and nothing else. + * + * @return boolean True if the test was successful. + */ + public static boolean testOption4CenterOnly() { + IVL_INT oIvlInt = DatatypesFactory.eINSTANCE.createIVL_INT(); + INT oCenter = DatatypesFactory.eINSTANCE.createINT(); + oIvlInt.setCenter(oCenter); + + Diagnostic oDiagnostic = Diagnostician.INSTANCE.validate(oIvlInt); + return processDiagnostics(oDiagnostic); + } + + /** + * This method tests option four of the HL7 choice - specifically + * where "Center" exists and width exists. + * + * @return boolean True if the test was successful. + */ + public static boolean testOption4CenterAndWidth() { + IVL_INT oIvlInt = DatatypesFactory.eINSTANCE.createIVL_INT(); + INT oCenter = DatatypesFactory.eINSTANCE.createINT(); + oIvlInt.setCenter(oCenter); + + INT oWidth = DatatypesFactory.eINSTANCE.createINT(); + oIvlInt.setWidth(oWidth); + + Diagnostic oDiagnostic = Diagnostician.INSTANCE.validate(oIvlInt); + return processDiagnostics(oDiagnostic); + } + + /** + * This method tests option four of the HL7 choice - specifically + * where "Center" exists and low exists - This should be a failure. + * + * @return boolean True if the test was successful. + */ + public static boolean testOption4CenterAndLow_FailureCase() { + boolean bResult = true; // assume everything is OK... + + IVL_INT oIvlInt = DatatypesFactory.eINSTANCE.createIVL_INT(); + INT oCenter = DatatypesFactory.eINSTANCE.createINT(); + oIvlInt.setCenter(oCenter); + + IVXB_INT oLow = DatatypesFactory.eINSTANCE.createIVXB_INT(); + oIvlInt.setLow(oLow); + + Diagnostic oDiagnostic = Diagnostician.INSTANCE.validate(oIvlInt); + if (!diagnosticsHaveErrors(oDiagnostic)) { + System.out.println("There should have been a validation error but was not one."); + bResult = false; + } + + return bResult; + } + + public static void main(String[] args) throws Exception { + boolean bFailure = false; + + if (!testOption1LowOnly()) { + bFailure = true; + System.out.println("testOption1LowOnly failed!"); + } + if (!testOption1LowWithWidth()) { + bFailure = true; + System.out.println("testOption1LowWithWidth failed!"); + } + if (!testOption1LowWithHigh()) { + bFailure = true; + System.out.println("testOption1LowWithHigh failed!"); + } + if (!testOption1LowWithWidthAndHigh_FailureCase()) { + bFailure = true; + System.out.println("testOption1LowWithWidthAndHigh_FailureCase failed!"); + } + if (!testOption2HighOnly()) { + bFailure = true; + System.out.println("testOption2HighOnly failed!"); + } + if (!testOption2HighWithCenter_FailureCase()) { + bFailure = true; + System.out.println("testOption1LowWithWidthAndHigh_FailureCase failed!"); + } + if (!testOption3WidthOnly()) { + bFailure = true; + System.out.println("testOption3WidthOnly failed!"); + } + if (!testOption3WidthAndHigh()) { + bFailure = true; + System.out.println("testOption3WidthAndHigh failed!"); + } + if (!testOption4CenterOnly()) { + bFailure = true; + System.out.println("testOption4CenterOnly failed!"); + } + if (!testOption4CenterAndWidth()) { + bFailure = true; + System.out.println("testOption4CenterAndWidth failed!"); + } + if (!testOption4CenterAndLow_FailureCase()) { + bFailure = true; + System.out.println("testOption4CenterAndLow_FailureCase failed!"); + } + + if (bFailure) { + System.out.println("One or more tests Failed!!!"); + } else { + System.out.println("All tests completed successfully..."); + } + } +} diff --git a/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/tests/IVLPQTest.java b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/tests/IVLPQTest.java new file mode 100644 index 000000000..136a0881a --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/tests/IVLPQTest.java @@ -0,0 +1,319 @@ +/******************************************************************************* + * Copyright (c) 2010, 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.tests; + +import org.eclipse.emf.common.util.Diagnostic; +import org.eclipse.emf.ecore.util.Diagnostician; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_PQ; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVXB_PQ; +import org.openhealthtools.mdht.uml.hl7.datatypes.PQ; + +/** + * This tests the IVL_PQ class against the validations to make sure that they + * are functioning correctly. + * + * @author Les Westberg + * + */ +public class IVLPQTest { + /** + * This method returns true if there are no errors. + * + * @param oDiagnostic The diagnostic information. + * @return TRUE if there are errors. FALSE if there are none. + */ + private static boolean diagnosticsHaveErrors(Diagnostic oDiagnostic) { + return (oDiagnostic.getSeverity() != Diagnostic.OK); + } + + /** + * This method processes and outputs the diagnostic information if there + * were any errors. It returns true if no errors exist. + * + * @param oDiagnostic The diagnostic information. + * @return TRUE if there are no errors. + */ + private static boolean processDiagnostics(Diagnostic oDiagnostic) { + boolean bResult = true; // Assume no errors + + if (diagnosticsHaveErrors(oDiagnostic)) { + SystemOutValidationHandler oValHandler = new SystemOutValidationHandler(); + DiagnosticOutputHelper.processDiagnostic(oDiagnostic, oValHandler); + bResult = false; + } + + return bResult; + } + + /** + * This method tests option one of the HL7 choice - specifically + * where "Low" exists and neither width or high are filled in. + * + * @return boolean True if the test was successful. + */ + public static boolean testOption1LowOnly() { + IVL_PQ oIvlPq = DatatypesFactory.eINSTANCE.createIVL_PQ(); + IVXB_PQ oLow = DatatypesFactory.eINSTANCE.createIVXB_PQ(); + oIvlPq.setLow(oLow); + Diagnostic oDiagnostic = Diagnostician.INSTANCE.validate(oIvlPq); + return processDiagnostics(oDiagnostic); + } + + /** + * This method tests option one of the HL7 choice - specifically + * where "Low" exists and width exists. + * + * @return boolean True if the test was successful. + */ + public static boolean testOption1LowWithWidth() { + IVL_PQ oIvlPq = DatatypesFactory.eINSTANCE.createIVL_PQ(); + IVXB_PQ oLow = DatatypesFactory.eINSTANCE.createIVXB_PQ(); + oIvlPq.setLow(oLow); + PQ oWidth = DatatypesFactory.eINSTANCE.createPQ(); + oIvlPq.setWidth(oWidth); + + Diagnostic oDiagnostic = Diagnostician.INSTANCE.validate(oIvlPq); + return processDiagnostics(oDiagnostic); + } + + /** + * This method tests option one of the HL7 choice - specifically + * where "Low" exists and high exists. + * + * @return boolean True if the test was successful. + */ + public static boolean testOption1LowWithHigh() { + IVL_PQ oIvlPq = DatatypesFactory.eINSTANCE.createIVL_PQ(); + IVXB_PQ oLow = DatatypesFactory.eINSTANCE.createIVXB_PQ(); + oIvlPq.setLow(oLow); + IVXB_PQ oHigh = DatatypesFactory.eINSTANCE.createIVXB_PQ(); + oIvlPq.setHigh(oHigh); + + Diagnostic oDiagnostic = Diagnostician.INSTANCE.validate(oIvlPq); + return processDiagnostics(oDiagnostic); + } + + /** + * This method tests option one of the HL7 choice - specifically + * where "Low" exists and both width and high exists. This should + * fail. + * + * @return boolean True if the test was successful. + */ + public static boolean testOption1LowWithWidthAndHigh_FailureCase() { + boolean bResult = true; // assume everything is OK... + + IVL_PQ oIvlPq = DatatypesFactory.eINSTANCE.createIVL_PQ(); + IVXB_PQ oLow = DatatypesFactory.eINSTANCE.createIVXB_PQ(); + oIvlPq.setLow(oLow); + + PQ oWidth = DatatypesFactory.eINSTANCE.createPQ(); + oIvlPq.setWidth(oWidth); + + IVXB_PQ oHigh = DatatypesFactory.eINSTANCE.createIVXB_PQ(); + oIvlPq.setHigh(oHigh); + + Diagnostic oDiagnostic = Diagnostician.INSTANCE.validate(oIvlPq); + if (!diagnosticsHaveErrors(oDiagnostic)) { + System.out.println("There should have been a validation error but was not one."); + bResult = false; + } + + return bResult; + } + + /** + * This method tests option two of the HL7 choice - specifically + * where "High" exists and nothing else. + * + * @return boolean True if the test was successful. + */ + public static boolean testOption2HighOnly() { + IVL_PQ oIvlPq = DatatypesFactory.eINSTANCE.createIVL_PQ(); + IVXB_PQ oHigh = DatatypesFactory.eINSTANCE.createIVXB_PQ(); + oIvlPq.setHigh(oHigh); + + Diagnostic oDiagnostic = Diagnostician.INSTANCE.validate(oIvlPq); + return processDiagnostics(oDiagnostic); + } + + /** + * This method tests option two of the HL7 choice - specifically + * where "High" exists and nothing else. + * + * @return boolean True if the test was successful. + */ + public static boolean testOption2HighWithCenter_FailureCase() { + boolean bResult = true; // assume everything is OK... + + IVL_PQ oIvlPq = DatatypesFactory.eINSTANCE.createIVL_PQ(); + IVXB_PQ oHigh = DatatypesFactory.eINSTANCE.createIVXB_PQ(); + oIvlPq.setHigh(oHigh); + + PQ oCenter = DatatypesFactory.eINSTANCE.createPQ(); + oIvlPq.setCenter(oCenter); + + Diagnostic oDiagnostic = Diagnostician.INSTANCE.validate(oIvlPq); + if (!diagnosticsHaveErrors(oDiagnostic)) { + System.out.println("There should have been a validation error but was not one."); + bResult = false; + } + + return bResult; + } + + /** + * This method tests option three of the HL7 choice - specifically + * where "Width" exists and nothing else. + * + * @return boolean True if the test was successful. + */ + public static boolean testOption3WidthOnly() { + IVL_PQ oIvlPq = DatatypesFactory.eINSTANCE.createIVL_PQ(); + PQ oWidth = DatatypesFactory.eINSTANCE.createPQ(); + oIvlPq.setWidth(oWidth); + + Diagnostic oDiagnostic = Diagnostician.INSTANCE.validate(oIvlPq); + return processDiagnostics(oDiagnostic); + } + + /** + * This method tests option three of the HL7 choice - specifically + * where "Width" exists and high exists. + * + * @return boolean True if the test was successful. + */ + public static boolean testOption3WidthAndHigh() { + IVL_PQ oIvlPq = DatatypesFactory.eINSTANCE.createIVL_PQ(); + PQ oWidth = DatatypesFactory.eINSTANCE.createPQ(); + oIvlPq.setWidth(oWidth); + + IVXB_PQ oHigh = DatatypesFactory.eINSTANCE.createIVXB_PQ(); + oIvlPq.setHigh(oHigh); + + Diagnostic oDiagnostic = Diagnostician.INSTANCE.validate(oIvlPq); + return processDiagnostics(oDiagnostic); + } + + /** + * This method tests option four of the HL7 choice - specifically + * where "Center" exists and nothing else. + * + * @return boolean True if the test was successful. + */ + public static boolean testOption4CenterOnly() { + IVL_PQ oIvlPq = DatatypesFactory.eINSTANCE.createIVL_PQ(); + PQ oCenter = DatatypesFactory.eINSTANCE.createPQ(); + oIvlPq.setCenter(oCenter); + + Diagnostic oDiagnostic = Diagnostician.INSTANCE.validate(oIvlPq); + return processDiagnostics(oDiagnostic); + } + + /** + * This method tests option four of the HL7 choice - specifically + * where "Center" exists and width exists. + * + * @return boolean True if the test was successful. + */ + public static boolean testOption4CenterAndWidth() { + IVL_PQ oIvlPq = DatatypesFactory.eINSTANCE.createIVL_PQ(); + PQ oCenter = DatatypesFactory.eINSTANCE.createPQ(); + oIvlPq.setCenter(oCenter); + + PQ oWidth = DatatypesFactory.eINSTANCE.createPQ(); + oIvlPq.setWidth(oWidth); + + Diagnostic oDiagnostic = Diagnostician.INSTANCE.validate(oIvlPq); + return processDiagnostics(oDiagnostic); + } + + /** + * This method tests option four of the HL7 choice - specifically + * where "Center" exists and low exists - This should be a failure. + * + * @return boolean True if the test was successful. + */ + public static boolean testOption4CenterAndLow_FailureCase() { + boolean bResult = true; // assume everything is OK... + + IVL_PQ oIvlPq = DatatypesFactory.eINSTANCE.createIVL_PQ(); + PQ oCenter = DatatypesFactory.eINSTANCE.createPQ(); + oIvlPq.setCenter(oCenter); + + IVXB_PQ oLow = DatatypesFactory.eINSTANCE.createIVXB_PQ(); + oIvlPq.setLow(oLow); + + Diagnostic oDiagnostic = Diagnostician.INSTANCE.validate(oIvlPq); + if (!diagnosticsHaveErrors(oDiagnostic)) { + System.out.println("There should have been a validation error but was not one."); + bResult = false; + } + + return bResult; + } + + public static void main(String[] args) throws Exception { + boolean bFailure = false; + + if (!testOption1LowOnly()) { + bFailure = true; + System.out.println("testOption1LowOnly failed!"); + } + if (!testOption1LowWithWidth()) { + bFailure = true; + System.out.println("testOption1LowWithWidth failed!"); + } + if (!testOption1LowWithHigh()) { + bFailure = true; + System.out.println("testOption1LowWithHigh failed!"); + } + if (!testOption1LowWithWidthAndHigh_FailureCase()) { + bFailure = true; + System.out.println("testOption1LowWithWidthAndHigh_FailureCase failed!"); + } + if (!testOption2HighOnly()) { + bFailure = true; + System.out.println("testOption2HighOnly failed!"); + } + if (!testOption2HighWithCenter_FailureCase()) { + bFailure = true; + System.out.println("testOption1LowWithWidthAndHigh_FailureCase failed!"); + } + if (!testOption3WidthOnly()) { + bFailure = true; + System.out.println("testOption3WidthOnly failed!"); + } + if (!testOption3WidthAndHigh()) { + bFailure = true; + System.out.println("testOption3WidthAndHigh failed!"); + } + if (!testOption4CenterOnly()) { + bFailure = true; + System.out.println("testOption4CenterOnly failed!"); + } + if (!testOption4CenterAndWidth()) { + bFailure = true; + System.out.println("testOption4CenterAndWidth failed!"); + } + if (!testOption4CenterAndLow_FailureCase()) { + bFailure = true; + System.out.println("testOption4CenterAndLow_FailureCase failed!"); + } + + if (bFailure) { + System.out.println("One or more tests Failed!!!"); + } else { + System.out.println("All tests completed successfully..."); + } + } +} diff --git a/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/tests/IVLTSTest.java b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/tests/IVLTSTest.java new file mode 100644 index 000000000..8c58a4c27 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/tests/IVLTSTest.java @@ -0,0 +1,320 @@ +/******************************************************************************* + * Copyright (c) 2010, 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.tests; + +import org.eclipse.emf.common.util.Diagnostic; +import org.eclipse.emf.ecore.util.Diagnostician; +import org.openhealthtools.mdht.uml.hl7.datatypes.DatatypesFactory; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVL_TS; +import org.openhealthtools.mdht.uml.hl7.datatypes.IVXB_TS; +import org.openhealthtools.mdht.uml.hl7.datatypes.PQ; +import org.openhealthtools.mdht.uml.hl7.datatypes.TS; + +/** + * This tests the IVL_TS class against the validations to make sure that they + * are functioning correctly. + * + * @author Les Westberg + * + */ +public class IVLTSTest { + /** + * This method returns true if there are no errors. + * + * @param oDiagnostic The diagnostic information. + * @return TRUE if there are errors. FALSE if there are none. + */ + private static boolean diagnosticsHaveErrors(Diagnostic oDiagnostic) { + return (oDiagnostic.getSeverity() != Diagnostic.OK); + } + + /** + * This method processes and outputs the diagnostic information if there + * were any errors. It returns true if no errors exist. + * + * @param oDiagnostic The diagnostic information. + * @return TRUE if there are no errors. + */ + private static boolean processDiagnostics(Diagnostic oDiagnostic) { + boolean bResult = true; // Assume no errors + + if (diagnosticsHaveErrors(oDiagnostic)) { + SystemOutValidationHandler oValHandler = new SystemOutValidationHandler(); + DiagnosticOutputHelper.processDiagnostic(oDiagnostic, oValHandler); + bResult = false; + } + + return bResult; + } + + /** + * This method tests option one of the HL7 choice - specifically + * where "Low" exists and neither width or high are filled in. + * + * @return boolean True if the test was successful. + */ + public static boolean testOption1LowOnly() { + IVL_TS oIvlTs = DatatypesFactory.eINSTANCE.createIVL_TS(); + IVXB_TS oLow = DatatypesFactory.eINSTANCE.createIVXB_TS(); + oIvlTs.setLow(oLow); + Diagnostic oDiagnostic = Diagnostician.INSTANCE.validate(oIvlTs); + return processDiagnostics(oDiagnostic); + } + + /** + * This method tests option one of the HL7 choice - specifically + * where "Low" exists and width exists. + * + * @return boolean True if the test was successful. + */ + public static boolean testOption1LowWithWidth() { + IVL_TS oIvlTs = DatatypesFactory.eINSTANCE.createIVL_TS(); + IVXB_TS oLow = DatatypesFactory.eINSTANCE.createIVXB_TS(); + oIvlTs.setLow(oLow); + PQ oWidth = DatatypesFactory.eINSTANCE.createPQ(); + oIvlTs.setWidth(oWidth); + + Diagnostic oDiagnostic = Diagnostician.INSTANCE.validate(oIvlTs); + return processDiagnostics(oDiagnostic); + } + + /** + * This method tests option one of the HL7 choice - specifically + * where "Low" exists and high exists. + * + * @return boolean True if the test was successful. + */ + public static boolean testOption1LowWithHigh() { + IVL_TS oIvlTs = DatatypesFactory.eINSTANCE.createIVL_TS(); + IVXB_TS oLow = DatatypesFactory.eINSTANCE.createIVXB_TS(); + oIvlTs.setLow(oLow); + IVXB_TS oHigh = DatatypesFactory.eINSTANCE.createIVXB_TS(); + oIvlTs.setHigh(oHigh); + + Diagnostic oDiagnostic = Diagnostician.INSTANCE.validate(oIvlTs); + return processDiagnostics(oDiagnostic); + } + + /** + * This method tests option one of the HL7 choice - specifically + * where "Low" exists and both width and high exists. This should + * fail. + * + * @return boolean True if the test was successful. + */ + public static boolean testOption1LowWithWidthAndHigh_FailureCase() { + boolean bResult = true; // assume everything is OK... + + IVL_TS oIvlTs = DatatypesFactory.eINSTANCE.createIVL_TS(); + IVXB_TS oLow = DatatypesFactory.eINSTANCE.createIVXB_TS(); + oIvlTs.setLow(oLow); + + PQ oWidth = DatatypesFactory.eINSTANCE.createPQ(); + oIvlTs.setWidth(oWidth); + + IVXB_TS oHigh = DatatypesFactory.eINSTANCE.createIVXB_TS(); + oIvlTs.setHigh(oHigh); + + Diagnostic oDiagnostic = Diagnostician.INSTANCE.validate(oIvlTs); + if (!diagnosticsHaveErrors(oDiagnostic)) { + System.out.println("There should have been a validation error but was not one."); + bResult = false; + } + + return bResult; + } + + /** + * This method tests option two of the HL7 choice - specifically + * where "High" exists and nothing else. + * + * @return boolean True if the test was successful. + */ + public static boolean testOption2HighOnly() { + IVL_TS oIvlTs = DatatypesFactory.eINSTANCE.createIVL_TS(); + IVXB_TS oHigh = DatatypesFactory.eINSTANCE.createIVXB_TS(); + oIvlTs.setHigh(oHigh); + + Diagnostic oDiagnostic = Diagnostician.INSTANCE.validate(oIvlTs); + return processDiagnostics(oDiagnostic); + } + + /** + * This method tests option two of the HL7 choice - specifically + * where "High" exists and nothing else. + * + * @return boolean True if the test was successful. + */ + public static boolean testOption2HighWithCenter_FailureCase() { + boolean bResult = true; // assume everything is OK... + + IVL_TS oIvlTs = DatatypesFactory.eINSTANCE.createIVL_TS(); + IVXB_TS oHigh = DatatypesFactory.eINSTANCE.createIVXB_TS(); + oIvlTs.setHigh(oHigh); + + TS oCenter = DatatypesFactory.eINSTANCE.createTS(); + oIvlTs.setCenter(oCenter); + + Diagnostic oDiagnostic = Diagnostician.INSTANCE.validate(oIvlTs); + if (!diagnosticsHaveErrors(oDiagnostic)) { + System.out.println("There should have been a validation error but was not one."); + bResult = false; + } + + return bResult; + } + + /** + * This method tests option three of the HL7 choice - specifically + * where "Width" exists and nothing else. + * + * @return boolean True if the test was successful. + */ + public static boolean testOption3WidthOnly() { + IVL_TS oIvlTs = DatatypesFactory.eINSTANCE.createIVL_TS(); + PQ oWidth = DatatypesFactory.eINSTANCE.createPQ(); + oIvlTs.setWidth(oWidth); + + Diagnostic oDiagnostic = Diagnostician.INSTANCE.validate(oIvlTs); + return processDiagnostics(oDiagnostic); + } + + /** + * This method tests option three of the HL7 choice - specifically + * where "Width" exists and high exists. + * + * @return boolean True if the test was successful. + */ + public static boolean testOption3WidthAndHigh() { + IVL_TS oIvlTs = DatatypesFactory.eINSTANCE.createIVL_TS(); + PQ oWidth = DatatypesFactory.eINSTANCE.createPQ(); + oIvlTs.setWidth(oWidth); + + IVXB_TS oHigh = DatatypesFactory.eINSTANCE.createIVXB_TS(); + oIvlTs.setHigh(oHigh); + + Diagnostic oDiagnostic = Diagnostician.INSTANCE.validate(oIvlTs); + return processDiagnostics(oDiagnostic); + } + + /** + * This method tests option four of the HL7 choice - specifically + * where "Center" exists and nothing else. + * + * @return boolean True if the test was successful. + */ + public static boolean testOption4CenterOnly() { + IVL_TS oIvlTs = DatatypesFactory.eINSTANCE.createIVL_TS(); + TS oCenter = DatatypesFactory.eINSTANCE.createTS(); + oIvlTs.setCenter(oCenter); + + Diagnostic oDiagnostic = Diagnostician.INSTANCE.validate(oIvlTs); + return processDiagnostics(oDiagnostic); + } + + /** + * This method tests option four of the HL7 choice - specifically + * where "Center" exists and width exists. + * + * @return boolean True if the test was successful. + */ + public static boolean testOption4CenterAndWidth() { + IVL_TS oIvlTs = DatatypesFactory.eINSTANCE.createIVL_TS(); + TS oCenter = DatatypesFactory.eINSTANCE.createTS(); + oIvlTs.setCenter(oCenter); + + PQ oWidth = DatatypesFactory.eINSTANCE.createPQ(); + oIvlTs.setWidth(oWidth); + + Diagnostic oDiagnostic = Diagnostician.INSTANCE.validate(oIvlTs); + return processDiagnostics(oDiagnostic); + } + + /** + * This method tests option four of the HL7 choice - specifically + * where "Center" exists and low exists - This should be a failure. + * + * @return boolean True if the test was successful. + */ + public static boolean testOption4CenterAndLow_FailureCase() { + boolean bResult = true; // assume everything is OK... + + IVL_TS oIvlTs = DatatypesFactory.eINSTANCE.createIVL_TS(); + TS oCenter = DatatypesFactory.eINSTANCE.createTS(); + oIvlTs.setCenter(oCenter); + + IVXB_TS oLow = DatatypesFactory.eINSTANCE.createIVXB_TS(); + oIvlTs.setLow(oLow); + + Diagnostic oDiagnostic = Diagnostician.INSTANCE.validate(oIvlTs); + if (!diagnosticsHaveErrors(oDiagnostic)) { + System.out.println("There should have been a validation error but was not one."); + bResult = false; + } + + return bResult; + } + + public static void main(String[] args) throws Exception { + boolean bFailure = false; + + if (!testOption1LowOnly()) { + bFailure = true; + System.out.println("testOption1LowOnly failed!"); + } + if (!testOption1LowWithWidth()) { + bFailure = true; + System.out.println("testOption1LowWithWidth failed!"); + } + if (!testOption1LowWithHigh()) { + bFailure = true; + System.out.println("testOption1LowWithHigh failed!"); + } + if (!testOption1LowWithWidthAndHigh_FailureCase()) { + bFailure = true; + System.out.println("testOption1LowWithWidthAndHigh_FailureCase failed!"); + } + if (!testOption2HighOnly()) { + bFailure = true; + System.out.println("testOption2HighOnly failed!"); + } + if (!testOption2HighWithCenter_FailureCase()) { + bFailure = true; + System.out.println("testOption1LowWithWidthAndHigh_FailureCase failed!"); + } + if (!testOption3WidthOnly()) { + bFailure = true; + System.out.println("testOption3WidthOnly failed!"); + } + if (!testOption3WidthAndHigh()) { + bFailure = true; + System.out.println("testOption3WidthAndHigh failed!"); + } + if (!testOption4CenterOnly()) { + bFailure = true; + System.out.println("testOption4CenterOnly failed!"); + } + if (!testOption4CenterAndWidth()) { + bFailure = true; + System.out.println("testOption4CenterAndWidth failed!"); + } + if (!testOption4CenterAndLow_FailureCase()) { + bFailure = true; + System.out.println("testOption4CenterAndLow_FailureCase failed!"); + } + + if (bFailure) { + System.out.println("One or more tests Failed!!!"); + } else { + System.out.println("All tests completed successfully..."); + } + } +} diff --git a/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/tests/InfrastructureRootTest.java b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/tests/InfrastructureRootTest.java new file mode 100644 index 000000000..7053a66c3 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/tests/InfrastructureRootTest.java @@ -0,0 +1,198 @@ +/******************************************************************************* + * Copyright (c) 2010, 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.tests; + +import org.openhealthtools.mdht.uml.cda.AssignedEntity; +import org.openhealthtools.mdht.uml.cda.Authenticator; +import org.openhealthtools.mdht.uml.cda.Author; +import org.openhealthtools.mdht.uml.cda.AuthoringDevice; +import org.openhealthtools.mdht.uml.cda.CDAFactory; +import org.openhealthtools.mdht.uml.cda.ClinicalDocument; +import org.openhealthtools.mdht.uml.hl7.vocab.ActMood; +import org.openhealthtools.mdht.uml.hl7.vocab.ContextControl; +import org.openhealthtools.mdht.uml.hl7.vocab.EntityDeterminer; +import org.openhealthtools.mdht.uml.hl7.vocab.ParticipationType; +import org.openhealthtools.mdht.uml.hl7.vocab.RoleClassAssignedEntity; + +/** + * This tests the BN class against the validations to make sure that they + * are functioning correctly. + * + * @author Les Westberg + * + */ +public class InfrastructureRootTest { + /** + * This method tests the isDefined() method on the InfrastructureRoot class. + * + * @return boolean True if the test was successful. + */ + public static boolean testIsDefined() { + boolean bItWorked = true; + + AssignedEntity oAssignedEntity = CDAFactory.eINSTANCE.createAssignedEntity(); + if (oAssignedEntity.isDefined("classCode")) { + bItWorked = false; + } + + oAssignedEntity.setClassCode(RoleClassAssignedEntity.ASSIGNED); + if (!oAssignedEntity.isDefined("classCode")) { + bItWorked = false; + } + + return bItWorked; + } + + /** + * This method tests the isClassCodeDefined() method on the InfrastructureRoot class. + * + * @return boolean True if the test was successful. + */ + public static boolean testIsClassCodeDefined() { + boolean bItWorked = true; + + AssignedEntity oAssignedEntity = CDAFactory.eINSTANCE.createAssignedEntity(); + if (oAssignedEntity.isClassCodeDefined()) { + bItWorked = false; + } + + oAssignedEntity.setClassCode(RoleClassAssignedEntity.ASSIGNED); + if (!oAssignedEntity.isClassCodeDefined()) { + bItWorked = false; + } + + return bItWorked; + } + + /** + * This method tests the isTypeCodeDefined() method on the InfrastructureRoot class. + * + * @return boolean True if the test was successful. + */ + public static boolean testIsTypeCodeDefined() { + boolean bItWorked = true; + + Authenticator oAuthenticator = CDAFactory.eINSTANCE.createAuthenticator(); + if (oAuthenticator.isTypeCodeDefined()) { + bItWorked = false; + } + + oAuthenticator.setTypeCode(ParticipationType.ADM); + if (!oAuthenticator.isTypeCodeDefined()) { + bItWorked = false; + } + + return bItWorked; + } + + /** + * This method tests the isContextControlCodeDefined() method on the InfrastructureRoot class. + * + * @return boolean True if the test was successful. + */ + public static boolean testIsContextControlCodeDefined() { + boolean bItWorked = true; + + Author oAuthor = CDAFactory.eINSTANCE.createAuthor(); + if (oAuthor.isContextControlCodeDefined()) { + bItWorked = false; + } + + oAuthor.setContextControlCode(ContextControl.AN); + if (!oAuthor.isContextControlCodeDefined()) { + bItWorked = false; + } + + return bItWorked; + } + + /** + * This method tests the isDeterminerCodeDefined() method on the InfrastructureRoot class. + * + * @return boolean True if the test was successful. + */ + public static boolean testIsDeterminerCodeDefined() { + boolean bItWorked = true; + + AuthoringDevice oAuthoringDevice = CDAFactory.eINSTANCE.createAuthoringDevice(); + if (oAuthoringDevice.isDeterminerCodeDefined()) { + bItWorked = false; + } + + oAuthoringDevice.setDeterminerCode(EntityDeterminer.INSTANCE); + if (!oAuthoringDevice.isDeterminerCodeDefined()) { + bItWorked = false; + } + + return bItWorked; + } + + /** + * This method tests the isMoodCodeDefined() method on the InfrastructureRoot class. + * + * @return boolean True if the test was successful. + */ + public static boolean testIsMoodCodeDefined() { + boolean bItWorked = true; + + ClinicalDocument oClinicalDocument = CDAFactory.eINSTANCE.createClinicalDocument(); + if (oClinicalDocument.isMoodCodeDefined()) { + bItWorked = false; + } + + oClinicalDocument.setMoodCode(ActMood.APT); + if (!oClinicalDocument.isMoodCodeDefined()) { + bItWorked = false; + } + + return bItWorked; + } + + public static void main(String[] args) throws Exception { + boolean bFailure = false; + + if (!testIsDefined()) { + bFailure = true; + System.out.println("testIsDefined failed!"); + } + + if (!testIsClassCodeDefined()) { + bFailure = true; + System.out.println("testIsClassCodeDefined failed!"); + } + + if (!testIsTypeCodeDefined()) { + bFailure = true; + System.out.println("testIsTypeCodeDefined failed!"); + } + + if (!testIsContextControlCodeDefined()) { + bFailure = true; + System.out.println("testIsTypeCodeDefined failed!"); + } + + if (!testIsDeterminerCodeDefined()) { + bFailure = true; + System.out.println("testIsDeterminerCodeDefined failed!"); + } + + if (!testIsMoodCodeDefined()) { + bFailure = true; + System.out.println("testIsMoodCodeDefined failed!"); + } + + if (bFailure) { + System.out.println("One or more tests Failed!!!"); + } else { + System.out.println("All tests completed successfully..."); + } + } +} diff --git a/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/tests/SystemOutValidationHandler.java b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/tests/SystemOutValidationHandler.java new file mode 100644 index 000000000..778be76b6 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/src/org/openhealthtools/mdht/uml/cda/tests/SystemOutValidationHandler.java @@ -0,0 +1,28 @@ +/******************************************************************************* + * Copyright (c) 2010, 2011 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.tests; + +import org.eclipse.emf.common.util.Diagnostic; +import org.openhealthtools.mdht.uml.cda.util.CDAUtil.ValidationHandler; + +public class SystemOutValidationHandler implements ValidationHandler { + public void handleError(Diagnostic diagnostic) { + System.out.println("ERROR: " + diagnostic.getMessage()); + } + + public void handleWarning(Diagnostic diagnostic) { + System.out.println("Warning: " + diagnostic.getMessage()); + } + + public void handleInfo(Diagnostic diagnostic) { + System.out.println("Info: " + diagnostic.getMessage()); + } +} diff --git a/org.openhealthtools.mdht.uml.cda.test/start.tag b/org.openhealthtools.mdht.uml.cda.test/start.tag new file mode 100644 index 000000000..7b115499d --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.test/start.tag @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/org.openhealthtools.mdht.uml.cda.toc.tests/.classpath b/org.openhealthtools.mdht.uml.cda.toc.tests/.classpath new file mode 100644 index 000000000..121e527a9 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.toc.tests/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.openhealthtools.mdht.uml.cda.toc.tests/.project b/org.openhealthtools.mdht.uml.cda.toc.tests/.project new file mode 100644 index 000000000..4ae2da4d6 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.toc.tests/.project @@ -0,0 +1,28 @@ + + + org.openhealthtools.mdht.uml.cda.toc.tests + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.pde.PluginNature + + diff --git a/org.openhealthtools.mdht.uml.cda.toc.tests/.settings/org.eclipse.jdt.core.prefs b/org.openhealthtools.mdht.uml.cda.toc.tests/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..fd79a3e6c --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.toc.tests/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,355 @@ +#Mon May 16 10:24:25 EDT 2011 +eclipse.preferences.version=1 +org.eclipse.jdt.core.codeComplete.argumentPrefixes= +org.eclipse.jdt.core.codeComplete.argumentSuffixes= +org.eclipse.jdt.core.codeComplete.fieldPrefixes= +org.eclipse.jdt.core.codeComplete.fieldSuffixes= +org.eclipse.jdt.core.codeComplete.localPrefixes= +org.eclipse.jdt.core.codeComplete.localSuffixes= +org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.5 +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.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning +org.eclipse.jdt.core.compiler.problem.deadCode=warning +org.eclipse.jdt.core.compiler.problem.deprecation=warning +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore +org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=error +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore +org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning +org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +org.eclipse.jdt.core.compiler.problem.nullReference=warning +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore +org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=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 +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedImport=warning +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +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.5 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=36 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=36 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=36 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=36 +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_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=49 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=32 +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_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=0 +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 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=1 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=150 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@fmtOff +org.eclipse.jdt.core.formatter.enabling_tag=@fmtOn +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +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=true +org.eclipse.jdt.core.formatter.indentation.size=4 +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_parameter=do not 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=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +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_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_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 +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +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_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 +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +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_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not 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_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 +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +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_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 +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +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_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_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 +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=false +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=120 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +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=false +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/org.openhealthtools.mdht.uml.cda.toc.tests/.settings/org.eclipse.jdt.ui.prefs b/org.openhealthtools.mdht.uml.cda.toc.tests/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 000000000..6245d2099 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.toc.tests/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,120 @@ +#Tue Mar 29 22:38:51 EDT 2011 +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=false +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=false +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=false +cleanup.format_source_code=true +cleanup.format_source_code_changes_only=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=false +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=true +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=true +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=true +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_blocks=true +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_parentheses_in_expressions=false +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup_profile=_MDHT +cleanup_settings_version=2 +eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true +formatter_profile=_MDHT +formatter_settings_version=11 +org.eclipse.jdt.ui.exception.name=e +org.eclipse.jdt.ui.gettersetter.use.is=true +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com; +org.eclipse.jdt.ui.javadoc=true +org.eclipse.jdt.ui.keywordthis=false +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.overrideannotation=true +org.eclipse.jdt.ui.staticondemandthreshold=99 +org.eclipse.jdt.ui.text.custom_code_templates= +sp_cleanup.add_default_serial_version_id=true +sp_cleanup.add_generated_serial_version_id=false +sp_cleanup.add_missing_annotations=true +sp_cleanup.add_missing_deprecated_annotations=true +sp_cleanup.add_missing_methods=false +sp_cleanup.add_missing_nls_tags=false +sp_cleanup.add_missing_override_annotations=true +sp_cleanup.add_missing_override_annotations_interface_methods=false +sp_cleanup.add_serial_version_id=false +sp_cleanup.always_use_blocks=true +sp_cleanup.always_use_parentheses_in_expressions=false +sp_cleanup.always_use_this_for_non_static_field_access=false +sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.convert_to_enhanced_for_loop=false +sp_cleanup.correct_indentation=false +sp_cleanup.format_source_code=true +sp_cleanup.format_source_code_changes_only=false +sp_cleanup.make_local_variable_final=false +sp_cleanup.make_parameters_final=false +sp_cleanup.make_private_fields_final=true +sp_cleanup.make_type_abstract_if_missing_method=false +sp_cleanup.make_variable_declarations_final=false +sp_cleanup.never_use_blocks=false +sp_cleanup.never_use_parentheses_in_expressions=true +sp_cleanup.on_save_use_additional_actions=true +sp_cleanup.organize_imports=true +sp_cleanup.qualify_static_field_accesses_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_with_declaring_class=false +sp_cleanup.qualify_static_method_accesses_with_declaring_class=false +sp_cleanup.remove_private_constructors=true +sp_cleanup.remove_trailing_whitespaces=true +sp_cleanup.remove_trailing_whitespaces_all=true +sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +sp_cleanup.remove_unnecessary_casts=true +sp_cleanup.remove_unnecessary_nls_tags=false +sp_cleanup.remove_unused_imports=false +sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_private_fields=true +sp_cleanup.remove_unused_private_members=false +sp_cleanup.remove_unused_private_methods=true +sp_cleanup.remove_unused_private_types=true +sp_cleanup.sort_members=false +sp_cleanup.sort_members_all=false +sp_cleanup.use_blocks=false +sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_parentheses_in_expressions=false +sp_cleanup.use_this_for_non_static_field_access=false +sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true +sp_cleanup.use_this_for_non_static_method_access=false +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/org.openhealthtools.mdht.uml.cda.toc.tests/META-INF/MANIFEST.MF b/org.openhealthtools.mdht.uml.cda.toc.tests/META-INF/MANIFEST.MF new file mode 100644 index 000000000..a50f1f230 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.toc.tests/META-INF/MANIFEST.MF @@ -0,0 +1,28 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: org.openhealthtools.mdht.uml.cda.toc.tests;singleton:=true +Bundle-Version: 1.0.0.qualifier +Bundle-ClassPath: . +Bundle-Vendor: %providerName +Bundle-Localization: plugin +Bundle-RequiredExecutionEnvironment: J2SE-1.5 +Export-Package: org.openhealthtools.mdht.uml.cda.toc.tests +Require-Bundle: org.eclipse.core.runtime, + org.openhealthtools.mdht.uml.cda.toc;visibility:=reexport, + org.openhealthtools.mdht.uml.hl7.rim;visibility:=reexport, + org.openhealthtools.mdht.uml.hl7.datatypes;visibility:=reexport, + org.openhealthtools.mdht.uml.hl7.vocab;visibility:=reexport, + org.eclipse.emf.ecore;visibility:=reexport, + org.openhealthtools.mdht.uml.cda;visibility:=reexport, + org.openhealthtools.mdht.uml.cda.ccd;visibility:=reexport, + org.openhealthtools.mdht.uml.cda.ihe;visibility:=reexport, + org.openhealthtools.mdht.uml.cda.hitsp;visibility:=reexport, + org.openhealthtools.mdht.uml.cda.cdt;visibility:=reexport, + org.eclipse.emf.ecore.xmi;visibility:=reexport, + org.junit;visibility:=reexport, + org.openhealthtools.mdht.uml.cda.test;visibility:=reexport, + org.openhealthtools.mdht.uml.cda.hitsp.tests, + org.openhealthtools.mdht.uml.cda.ihe.tests, + org.openhealthtools.mdht.uml.cda.cdt.tests +Bundle-ActivationPolicy: lazy diff --git a/org.openhealthtools.mdht.uml.cda.toc.tests/build.properties b/org.openhealthtools.mdht.uml.cda.toc.tests/build.properties new file mode 100644 index 000000000..f86eda894 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.toc.tests/build.properties @@ -0,0 +1,16 @@ +############################################################################### +# Copyright (c) 2011, 2012 Sean Muir and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Sean Muir (JKM Software) - initial API and implementation +############################################################################### +bin.includes = .,\ + META-INF/,\ + plugin.properties +jars.compile.order = . +source.. = src/ +output.. = bin/ diff --git a/org.openhealthtools.mdht.uml.cda.toc.tests/plugin.properties b/org.openhealthtools.mdht.uml.cda.toc.tests/plugin.properties new file mode 100644 index 000000000..546cf8982 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.toc.tests/plugin.properties @@ -0,0 +1,12 @@ +############################################################################### +# Copyright (c) 2011, 2012 Sean Muir and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Sean Muir (JKM Software) - initial API and implementation +############################################################################### +pluginName = toc_Ecore Tests +providerName = www.example.org diff --git a/org.openhealthtools.mdht.uml.cda.toc.tests/src/org/openhealthtools/mdht/uml/cda/toc/tests/ConsultationRequestTest.java b/org.openhealthtools.mdht.uml.cda.toc.tests/src/org/openhealthtools/mdht/uml/cda/toc/tests/ConsultationRequestTest.java new file mode 100644 index 000000000..331b62138 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.toc.tests/src/org/openhealthtools/mdht/uml/cda/toc/tests/ConsultationRequestTest.java @@ -0,0 +1,1384 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.toc.tests; + +import static org.junit.Assert.assertTrue; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.junit.runner.JUnitCore; +import org.junit.runner.Result; +import org.openhealthtools.mdht.uml.cda.cdt.CDTFactory; +import org.openhealthtools.mdht.uml.cda.cdt.GeneralStatusSection; +import org.openhealthtools.mdht.uml.cda.hitsp.AdvanceDirectivesSection; +import org.openhealthtools.mdht.uml.cda.hitsp.AllergiesReactionsSection; +import org.openhealthtools.mdht.uml.cda.hitsp.AssessmentAndPlanSection; +import org.openhealthtools.mdht.uml.cda.hitsp.ChiefComplaintSection; +import org.openhealthtools.mdht.uml.cda.hitsp.DiagnosticResultsSection; +import org.openhealthtools.mdht.uml.cda.hitsp.EncountersSection; +import org.openhealthtools.mdht.uml.cda.hitsp.FamilyHistorySection; +import org.openhealthtools.mdht.uml.cda.hitsp.FunctionalStatusSection; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.HistoryOfPastIllnessSection; +import org.openhealthtools.mdht.uml.cda.hitsp.HistoryOfPresentIllness; +import org.openhealthtools.mdht.uml.cda.hitsp.ImmunizationsSection; +import org.openhealthtools.mdht.uml.cda.hitsp.MedicalEquipmentSection; +import org.openhealthtools.mdht.uml.cda.hitsp.MedicationsSection; +import org.openhealthtools.mdht.uml.cda.hitsp.PayersSection; +import org.openhealthtools.mdht.uml.cda.hitsp.PhysicalExamSection; +import org.openhealthtools.mdht.uml.cda.hitsp.PlanOfCareSection; +import org.openhealthtools.mdht.uml.cda.hitsp.ProblemListSection; +import org.openhealthtools.mdht.uml.cda.hitsp.ReasonForReferralSection; +import org.openhealthtools.mdht.uml.cda.hitsp.SocialHistorySection; +import org.openhealthtools.mdht.uml.cda.hitsp.SurgeriesSection; +import org.openhealthtools.mdht.uml.cda.hitsp.VitalSignsSection; +import org.openhealthtools.mdht.uml.cda.hitsp.tests.HistoryOfPastIllnessSectionTest; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.cda.toc.ConsultationRequest; +import org.openhealthtools.mdht.uml.cda.toc.ToCFactory; +import org.openhealthtools.mdht.uml.cda.toc.operations.ConsultationRequestOperations; + +/** + * + * A static utility class that provides operations related to 'Consultation Request' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationRequest#validateConsultationRequestAllergiesReactionsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Request Allergies Reactions Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationRequest#validateConsultationRequestMedicationsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Request Medications Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationRequest#validateConsultationRequestProblemListSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Request Problem List Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationRequest#validateConsultationRequestSurgeriesSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Request Surgeries Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationRequest#validateConsultationRequestDiagnosticResultsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Request Diagnostic Results Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationRequest#validateConsultationRequestAdvanceDirectivesSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Request Advance Directives Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationRequest#validateConsultationRequestAssessmentAndPlanSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Request Assessment And Plan Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationRequest#validateConsultationRequestHistoryOfPresentIllness(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Request History Of Present Illness}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationRequest#validateConsultationRequestPhysicalExamSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Request Physical Exam Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationRequest#validateConsultationRequestReasonForReferralSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Request Reason For Referral Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationRequest#validateConsultationRequestEncountersSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Request Encounters Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationRequest#validateConsultationRequestFamilyHistorySection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Request Family History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationRequest#validateConsultationRequestFunctionalStatusSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Request Functional Status Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationRequest#validateConsultationRequestImmunizationsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Request Immunizations Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationRequest#validateConsultationRequestMedicalEquipmentSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Request Medical Equipment Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationRequest#validateConsultationRequestPlanOfCareSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Request Plan Of Care Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationRequest#validateConsultationRequestSocialHistorySection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Request Social History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationRequest#validateConsultationRequestVitalSignsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Request Vital Signs Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationRequest#validateConsultationRequestChiefComplaintSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Request Chief Complaint Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationRequest#validateConsultationRequestGeneralStatusSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Request General Status Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationRequest#validateConsultationRequestHistoryOfPastIllnessSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Request History Of Past Illness Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationRequest#validateConsultationRequestPayersSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Request Payers Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationRequest#getAllergiesReactionsSection() Get Allergies Reactions Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationRequest#getMedicationsSection() Get Medications Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationRequest#getProblemListSection() Get Problem List Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationRequest#getSurgeriesSection() Get Surgeries Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationRequest#getDiagnosticResultsSection() Get Diagnostic Results Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationRequest#getAdvanceDirectivesSection() Get Advance Directives Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationRequest#getAssessmentAndPlanSection() Get Assessment And Plan Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationRequest#getHistoryOfPresentIllness() Get History Of Present Illness}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationRequest#getPhysicalExamSection() Get Physical Exam Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationRequest#getReasonForReferralSection() Get Reason For Referral Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationRequest#getEncountersSection() Get Encounters Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationRequest#getFamilyHistorySection() Get Family History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationRequest#getFunctionalStatusSection() Get Functional Status Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationRequest#getImmunizationsSection() Get Immunizations Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationRequest#getMedicalEquipmentSection() Get Medical Equipment Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationRequest#getPlanOfCareSection() Get Plan Of Care Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationRequest#getSocialHistorySection() Get Social History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationRequest#getVitalSignsSection() Get Vital Signs Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationRequest#getChiefComplaintSection() Get Chief Complaint Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationRequest#getGeneralStatusSection() Get General Status Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationRequest#getHistoryOfPastIllnessSection() Get History Of Past Illness Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationRequest#getPayersSection() Get Payers Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationRequest#validateGeneralHeaderConstraintsTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Template Id}
  • + *
+ *

+ * + * @generated NOT + */ + +public class ConsultationRequestTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationRequestAllergiesReactionsSection() { + OperationsTestCase validateConsultationRequestAllergiesReactionsSectionTestCase = new OperationsTestCase( + "validateConsultationRequestAllergiesReactionsSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_REQUEST_ALLERGIES_REACTIONS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationRequest target) { + + } + + @Override + protected void updateToPass(ConsultationRequest target) { + target.init(); + + /* AllergiesReactionsSection */ + AllergiesReactionsSection section = + + HITSPFactory.eINSTANCE.createAllergiesReactionsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationRequestOperations.validateConsultationRequestAllergiesReactionsSection( + (ConsultationRequest) objectToTest, diagnostician, map); + } + + }; + + validateConsultationRequestAllergiesReactionsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationRequestMedicationsSection() { + OperationsTestCase validateConsultationRequestMedicationsSectionTestCase = new OperationsTestCase( + "validateConsultationRequestMedicationsSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_REQUEST_MEDICATIONS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationRequest target) { + + } + + @Override + protected void updateToPass(ConsultationRequest target) { + target.init(); + + /* MedicationsSection */ + MedicationsSection section = + + HITSPFactory.eINSTANCE.createMedicationsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationRequestOperations.validateConsultationRequestMedicationsSection( + (ConsultationRequest) objectToTest, diagnostician, map); + } + + }; + + validateConsultationRequestMedicationsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationRequestProblemListSection() { + OperationsTestCase validateConsultationRequestProblemListSectionTestCase = new OperationsTestCase( + "validateConsultationRequestProblemListSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_REQUEST_PROBLEM_LIST_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationRequest target) { + + } + + @Override + protected void updateToPass(ConsultationRequest target) { + target.init(); + + /* ProblemListSection */ + ProblemListSection section = + + HITSPFactory.eINSTANCE.createProblemListSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationRequestOperations.validateConsultationRequestProblemListSection( + (ConsultationRequest) objectToTest, diagnostician, map); + } + + }; + + validateConsultationRequestProblemListSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationRequestSurgeriesSection() { + OperationsTestCase validateConsultationRequestSurgeriesSectionTestCase = new OperationsTestCase( + "validateConsultationRequestSurgeriesSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_REQUEST_SURGERIES_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationRequest target) { + + } + + @Override + protected void updateToPass(ConsultationRequest target) { + target.init(); + + /* SurgeriesSection */ + SurgeriesSection section = + + HITSPFactory.eINSTANCE.createSurgeriesSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationRequestOperations.validateConsultationRequestSurgeriesSection( + (ConsultationRequest) objectToTest, diagnostician, map); + } + + }; + + validateConsultationRequestSurgeriesSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationRequestDiagnosticResultsSection() { + OperationsTestCase validateConsultationRequestDiagnosticResultsSectionTestCase = new OperationsTestCase( + "validateConsultationRequestDiagnosticResultsSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_REQUEST_DIAGNOSTIC_RESULTS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationRequest target) { + + } + + @Override + protected void updateToPass(ConsultationRequest target) { + target.init(); + + /* DiagnosticResultsSection */ + DiagnosticResultsSection section = + + HITSPFactory.eINSTANCE.createDiagnosticResultsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationRequestOperations.validateConsultationRequestDiagnosticResultsSection( + (ConsultationRequest) objectToTest, diagnostician, map); + } + + }; + + validateConsultationRequestDiagnosticResultsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT NOT + */ + @Test + public void testValidateConsultationRequestAdvanceDirectivesSection() { + OperationsTestCase validateConsultationRequestAdvanceDirectivesSectionTestCase = new OperationsTestCase( + "validateConsultationRequestAdvanceDirectivesSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_REQUEST_ADVANCE_DIRECTIVES_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationRequest target) { + + } + + @Override + protected void updateToPass(ConsultationRequest target) { + target.init(); + + /* AdvanceDirectivesSection */ + AdvanceDirectivesSection section = + + HITSPFactory.eINSTANCE.createAdvanceDirectivesSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationRequestOperations.validateConsultationRequestAdvanceDirectivesSection( + (ConsultationRequest) objectToTest, diagnostician, map); + } + + }; + + validateConsultationRequestAdvanceDirectivesSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationRequestAssessmentAndPlanSection() { + OperationsTestCase validateConsultationRequestAssessmentAndPlanSectionTestCase = new OperationsTestCase( + "validateConsultationRequestAssessmentAndPlanSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_REQUEST_ASSESSMENT_AND_PLAN_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationRequest target) { + + } + + @Override + protected void updateToPass(ConsultationRequest target) { + target.init(); + + /* AssessmentAndPlanSection */ + AssessmentAndPlanSection section = + + HITSPFactory.eINSTANCE.createAssessmentAndPlanSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationRequestOperations.validateConsultationRequestAssessmentAndPlanSection( + (ConsultationRequest) objectToTest, diagnostician, map); + } + + }; + + validateConsultationRequestAssessmentAndPlanSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT NOT + */ + @Test + public void testValidateConsultationRequestHistoryOfPresentIllness() { + OperationsTestCase validateConsultationRequestHistoryOfPresentIllnessTestCase = new OperationsTestCase( + "validateConsultationRequestHistoryOfPresentIllness", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_REQUEST_HISTORY_OF_PRESENT_ILLNESS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationRequest target) { + + } + + @Override + protected void updateToPass(ConsultationRequest target) { + target.init(); + + HistoryOfPresentIllness historyOfPresentIllness = HITSPFactory.eINSTANCE.createHistoryOfPresentIllness().init(); + + target.addSection(historyOfPresentIllness); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationRequestOperations.validateConsultationRequestHistoryOfPresentIllness( + (ConsultationRequest) objectToTest, diagnostician, map); + } + + }; + + validateConsultationRequestHistoryOfPresentIllnessTestCase.doValidationTest(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationRequestPhysicalExamSection() { + OperationsTestCase validateConsultationRequestPhysicalExamSectionTestCase = new OperationsTestCase( + "validateConsultationRequestPhysicalExamSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_REQUEST_PHYSICAL_EXAM_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationRequest target) { + + } + + @Override + protected void updateToPass(ConsultationRequest target) { + target.init(); + + /* PhysicalExamSection */ + PhysicalExamSection section = + + HITSPFactory.eINSTANCE.createPhysicalExamSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationRequestOperations.validateConsultationRequestPhysicalExamSection( + (ConsultationRequest) objectToTest, diagnostician, map); + } + + }; + + validateConsultationRequestPhysicalExamSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationRequestReasonForReferralSection() { + OperationsTestCase validateConsultationRequestReasonForReferralSectionTestCase = new OperationsTestCase( + "validateConsultationRequestReasonForReferralSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_REQUEST_REASON_FOR_REFERRAL_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationRequest target) { + + } + + @Override + protected void updateToPass(ConsultationRequest target) { + target.init(); + + /* ReasonForReferralSection */ + ReasonForReferralSection section = + + HITSPFactory.eINSTANCE.createReasonForReferralSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationRequestOperations.validateConsultationRequestReasonForReferralSection( + (ConsultationRequest) objectToTest, diagnostician, map); + } + + }; + + validateConsultationRequestReasonForReferralSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationRequestEncountersSection() { + OperationsTestCase validateConsultationRequestEncountersSectionTestCase = new OperationsTestCase( + "validateConsultationRequestEncountersSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_REQUEST_ENCOUNTERS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationRequest target) { + + } + + @Override + protected void updateToPass(ConsultationRequest target) { + target.init(); + + /* EncountersSection */ + EncountersSection section = + + HITSPFactory.eINSTANCE.createEncountersSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationRequestOperations.validateConsultationRequestEncountersSection( + (ConsultationRequest) objectToTest, diagnostician, map); + } + + }; + + validateConsultationRequestEncountersSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationRequestFamilyHistorySection() { + OperationsTestCase validateConsultationRequestFamilyHistorySectionTestCase = new OperationsTestCase( + "validateConsultationRequestFamilyHistorySection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_REQUEST_FAMILY_HISTORY_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationRequest target) { + + } + + @Override + protected void updateToPass(ConsultationRequest target) { + target.init(); + + /* FamilyHistorySection */ + FamilyHistorySection section = + + HITSPFactory.eINSTANCE.createFamilyHistorySection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationRequestOperations.validateConsultationRequestFamilyHistorySection( + (ConsultationRequest) objectToTest, diagnostician, map); + } + + }; + + validateConsultationRequestFamilyHistorySectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationRequestFunctionalStatusSection() { + OperationsTestCase validateConsultationRequestFunctionalStatusSectionTestCase = new OperationsTestCase( + "validateConsultationRequestFunctionalStatusSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_REQUEST_FUNCTIONAL_STATUS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationRequest target) { + + } + + @Override + protected void updateToPass(ConsultationRequest target) { + target.init(); + + /* FunctionalStatusSection */ + FunctionalStatusSection section = + + HITSPFactory.eINSTANCE.createFunctionalStatusSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationRequestOperations.validateConsultationRequestFunctionalStatusSection( + (ConsultationRequest) objectToTest, diagnostician, map); + } + + }; + + validateConsultationRequestFunctionalStatusSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationRequestImmunizationsSection() { + OperationsTestCase validateConsultationRequestImmunizationsSectionTestCase = new OperationsTestCase( + "validateConsultationRequestImmunizationsSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_REQUEST_IMMUNIZATIONS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationRequest target) { + + } + + @Override + protected void updateToPass(ConsultationRequest target) { + target.init(); + + /* ImmunizationsSection */ + ImmunizationsSection section = + + HITSPFactory.eINSTANCE.createImmunizationsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationRequestOperations.validateConsultationRequestImmunizationsSection( + (ConsultationRequest) objectToTest, diagnostician, map); + } + + }; + + validateConsultationRequestImmunizationsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationRequestMedicalEquipmentSection() { + OperationsTestCase validateConsultationRequestMedicalEquipmentSectionTestCase = new OperationsTestCase( + "validateConsultationRequestMedicalEquipmentSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_REQUEST_MEDICAL_EQUIPMENT_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationRequest target) { + + } + + @Override + protected void updateToPass(ConsultationRequest target) { + target.init(); + + /* MedicalEquipmentSection */ + MedicalEquipmentSection section = + + HITSPFactory.eINSTANCE.createMedicalEquipmentSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationRequestOperations.validateConsultationRequestMedicalEquipmentSection( + (ConsultationRequest) objectToTest, diagnostician, map); + } + + }; + + validateConsultationRequestMedicalEquipmentSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationRequestPlanOfCareSection() { + OperationsTestCase validateConsultationRequestPlanOfCareSectionTestCase = new OperationsTestCase( + "validateConsultationRequestPlanOfCareSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_REQUEST_PLAN_OF_CARE_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationRequest target) { + + } + + @Override + protected void updateToPass(ConsultationRequest target) { + target.init(); + + /* PlanOfCareSection */ + PlanOfCareSection section = + + HITSPFactory.eINSTANCE.createPlanOfCareSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationRequestOperations.validateConsultationRequestPlanOfCareSection( + (ConsultationRequest) objectToTest, diagnostician, map); + } + + }; + + validateConsultationRequestPlanOfCareSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationRequestSocialHistorySection() { + OperationsTestCase validateConsultationRequestSocialHistorySectionTestCase = new OperationsTestCase( + "validateConsultationRequestSocialHistorySection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_REQUEST_SOCIAL_HISTORY_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationRequest target) { + + } + + @Override + protected void updateToPass(ConsultationRequest target) { + target.init(); + + /* SocialHistorySection */ + SocialHistorySection section = + + HITSPFactory.eINSTANCE.createSocialHistorySection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationRequestOperations.validateConsultationRequestSocialHistorySection( + (ConsultationRequest) objectToTest, diagnostician, map); + } + + }; + + validateConsultationRequestSocialHistorySectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationRequestVitalSignsSection() { + OperationsTestCase validateConsultationRequestVitalSignsSectionTestCase = new OperationsTestCase( + "validateConsultationRequestVitalSignsSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_REQUEST_VITAL_SIGNS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationRequest target) { + + } + + @Override + protected void updateToPass(ConsultationRequest target) { + target.init(); + + /* VitalSignsSection */ + VitalSignsSection section = + + HITSPFactory.eINSTANCE.createVitalSignsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationRequestOperations.validateConsultationRequestVitalSignsSection( + (ConsultationRequest) objectToTest, diagnostician, map); + } + + }; + + validateConsultationRequestVitalSignsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationRequestChiefComplaintSection() { + OperationsTestCase validateConsultationRequestChiefComplaintSectionTestCase = new OperationsTestCase( + "validateConsultationRequestChiefComplaintSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_REQUEST_CHIEF_COMPLAINT_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationRequest target) { + + } + + @Override + protected void updateToPass(ConsultationRequest target) { + target.init(); + + /* ChiefComplaintSection */ + ChiefComplaintSection section = + + HITSPFactory.eINSTANCE.createChiefComplaintSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationRequestOperations.validateConsultationRequestChiefComplaintSection( + (ConsultationRequest) objectToTest, diagnostician, map); + } + + }; + + validateConsultationRequestChiefComplaintSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationRequestGeneralStatusSection() { + OperationsTestCase validateConsultationRequestGeneralStatusSectionTestCase = new OperationsTestCase( + "validateConsultationRequestGeneralStatusSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_REQUEST_GENERAL_STATUS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationRequest target) { + + } + + @Override + protected void updateToPass(ConsultationRequest target) { + target.init(); + + /* GeneralStatusSection */ + GeneralStatusSection section = + + CDTFactory.eINSTANCE.createGeneralStatusSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationRequestOperations.validateConsultationRequestGeneralStatusSection( + (ConsultationRequest) objectToTest, diagnostician, map); + } + + }; + + validateConsultationRequestGeneralStatusSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT NOT + */ + @Test + public void testValidateConsultationRequestHistoryOfPastIllnessSection() { + OperationsTestCase validateConsultationRequestHistoryOfPastIllnessSectionTestCase = new OperationsTestCase( + "validateConsultationRequestHistoryOfPastIllnessSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_REQUEST_HISTORY_OF_PAST_ILLNESS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationRequest target) { + + } + + @Override + protected void updateToPass(ConsultationRequest target) { + target.init(); + + /* HistoryOfPastIllnessSection */ + HistoryOfPastIllnessSection section = + + HITSPFactory.eINSTANCE.createHistoryOfPastIllnessSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationRequestOperations.validateConsultationRequestHistoryOfPastIllnessSection( + (ConsultationRequest) objectToTest, diagnostician, map); + } + + }; + + validateConsultationRequestHistoryOfPastIllnessSectionTestCase.doValidationTest(); + + Result result = JUnitCore.runClasses(HistoryOfPastIllnessSectionTest.class); + + assertTrue(HistoryOfPastIllnessSectionTest.class.getName() + " Failed", result.getFailures().isEmpty()); + + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationRequestPayersSection() { + OperationsTestCase validateConsultationRequestPayersSectionTestCase = new OperationsTestCase( + "validateConsultationRequestPayersSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_REQUEST_PAYERS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationRequest target) { + + } + + @Override + protected void updateToPass(ConsultationRequest target) { + target.init(); + + /* PayersSection */ + PayersSection section = + + HITSPFactory.eINSTANCE.createPayersSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationRequestOperations.validateConsultationRequestPayersSection( + (ConsultationRequest) objectToTest, diagnostician, map); + } + + }; + + validateConsultationRequestPayersSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testGetAllergiesReactionsSection() { + + ConsultationRequest target = objectFactory.create(); + target.getAllergiesReactionsSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetMedicationsSection() { + + ConsultationRequest target = objectFactory.create(); + target.getMedicationsSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetProblemListSection() { + + ConsultationRequest target = objectFactory.create(); + target.getProblemListSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetSurgeriesSection() { + + ConsultationRequest target = objectFactory.create(); + target.getSurgeriesSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetDiagnosticResultsSection() { + + ConsultationRequest target = objectFactory.create(); + target.getDiagnosticResultsSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetAdvanceDirectivesSection() { + + ConsultationRequest target = objectFactory.create(); + target.getAdvanceDirectivesSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetAssessmentAndPlanSection() { + + ConsultationRequest target = objectFactory.create(); + target.getAssessmentAndPlanSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetHistoryOfPresentIllness() { + + ConsultationRequest target = objectFactory.create(); + target.getHistoryOfPresentIllness(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetPhysicalExamSection() { + + ConsultationRequest target = objectFactory.create(); + target.getPhysicalExamSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetReasonForReferralSection() { + + ConsultationRequest target = objectFactory.create(); + target.getReasonForReferralSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetEncountersSection() { + + ConsultationRequest target = objectFactory.create(); + target.getEncountersSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetFamilyHistorySection() { + + ConsultationRequest target = objectFactory.create(); + target.getFamilyHistorySection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetFunctionalStatusSection() { + + ConsultationRequest target = objectFactory.create(); + target.getFunctionalStatusSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetImmunizationsSection() { + + ConsultationRequest target = objectFactory.create(); + target.getImmunizationsSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetMedicalEquipmentSection() { + + ConsultationRequest target = objectFactory.create(); + target.getMedicalEquipmentSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetPlanOfCareSection() { + + ConsultationRequest target = objectFactory.create(); + target.getPlanOfCareSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetSocialHistorySection() { + + ConsultationRequest target = objectFactory.create(); + target.getSocialHistorySection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetVitalSignsSection() { + + ConsultationRequest target = objectFactory.create(); + target.getVitalSignsSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetChiefComplaintSection() { + + ConsultationRequest target = objectFactory.create(); + target.getChiefComplaintSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetGeneralStatusSection() { + + ConsultationRequest target = objectFactory.create(); + target.getGeneralStatusSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetHistoryOfPastIllnessSection() { + + ConsultationRequest target = objectFactory.create(); + target.getHistoryOfPastIllnessSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetPayersSection() { + + ConsultationRequest target = objectFactory.create(); + target.getPayersSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateGeneralHeaderConstraintsTemplateId() { + OperationsTestCase validateGeneralHeaderConstraintsTemplateIdTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsTemplateId", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationRequest target) { + + } + + @Override + protected void updateToPass(ConsultationRequest target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationRequestOperations.validateGeneralHeaderConstraintsTemplateId( + (ConsultationRequest) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + private static class OperationsForOCL extends ConsultationRequestOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated NOT + */ + private static class ObjectFactory implements TestObjectFactory { + + public ConsultationRequest create() { + return ToCFactory.eINSTANCE.createConsultationRequest(); + } + } + + /** + * + * @generated NOT + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated NOT + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated NOT + */ + private static class ConstructorTestClass extends ConsultationRequestOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated NOT + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated NOT + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ConsultationRequestOperations diff --git a/org.openhealthtools.mdht.uml.cda.toc.tests/src/org/openhealthtools/mdht/uml/cda/toc/tests/ConsultationSummaryTest.java b/org.openhealthtools.mdht.uml.cda.toc.tests/src/org/openhealthtools/mdht/uml/cda/toc/tests/ConsultationSummaryTest.java new file mode 100644 index 000000000..1bf8af395 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.toc.tests/src/org/openhealthtools/mdht/uml/cda/toc/tests/ConsultationSummaryTest.java @@ -0,0 +1,983 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.toc.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.hitsp.AdvanceDirectivesSection; +import org.openhealthtools.mdht.uml.cda.hitsp.AllergiesReactionsSection; +import org.openhealthtools.mdht.uml.cda.hitsp.DiagnosticResultsSection; +import org.openhealthtools.mdht.uml.cda.hitsp.EncountersSection; +import org.openhealthtools.mdht.uml.cda.hitsp.FamilyHistorySection; +import org.openhealthtools.mdht.uml.cda.hitsp.FunctionalStatusSection; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.ImmunizationsSection; +import org.openhealthtools.mdht.uml.cda.hitsp.MedicalEquipmentSection; +import org.openhealthtools.mdht.uml.cda.hitsp.MedicationsSection; +import org.openhealthtools.mdht.uml.cda.hitsp.PayersSection; +import org.openhealthtools.mdht.uml.cda.hitsp.PlanOfCareSection; +import org.openhealthtools.mdht.uml.cda.hitsp.ProblemListSection; +import org.openhealthtools.mdht.uml.cda.hitsp.SocialHistorySection; +import org.openhealthtools.mdht.uml.cda.hitsp.SurgeriesSection; +import org.openhealthtools.mdht.uml.cda.hitsp.VitalSignsSection; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.cda.toc.ConsultationSummary; +import org.openhealthtools.mdht.uml.cda.toc.ToCFactory; +import org.openhealthtools.mdht.uml.cda.toc.operations.ConsultationSummaryOperations; + +/** + * + * A static utility class that provides operations related to 'Consultation Summary' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationSummary#validateConsultationSummaryAllergiesReactionsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Summary Allergies Reactions Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationSummary#validateConsultationSummaryMedicationsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Summary Medications Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationSummary#validateConsultationSummaryProblemListSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Summary Problem List Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationSummary#validateConsultationSummarySurgeriesSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Summary Surgeries Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationSummary#validateConsultationSummaryDiagnosticResultsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Summary Diagnostic Results Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationSummary#validateConsultationSummaryAdvanceDirectivesSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Summary Advance Directives Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationSummary#validateConsultationSummaryEncountersSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Summary Encounters Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationSummary#validateConsultationSummaryFamilyHistorySection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Summary Family History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationSummary#validateConsultationSummaryFunctionalStatusSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Summary Functional Status Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationSummary#validateConsultationSummaryImmunizationsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Summary Immunizations Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationSummary#validateConsultationSummaryMedicalEquipmentSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Summary Medical Equipment Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationSummary#validateConsultationSummaryPayersSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Summary Payers Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationSummary#validateConsultationSummaryPlanOfCareSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Summary Plan Of Care Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationSummary#validateConsultationSummarySocialHistorySection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Summary Social History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationSummary#validateConsultationSummaryVitalSignsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Consultation Summary Vital Signs Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationSummary#getAllergiesReactionsSection() Get Allergies Reactions Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationSummary#getMedicationsSection() Get Medications Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationSummary#getProblemListSection() Get Problem List Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationSummary#getSurgeriesSection() Get Surgeries Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationSummary#getDiagnosticResultsSection() Get Diagnostic Results Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationSummary#getAdvanceDirectivesSection() Get Advance Directives Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationSummary#getEncountersSection() Get Encounters Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationSummary#getFamilyHistorySection() Get Family History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationSummary#getFunctionalStatusSection() Get Functional Status Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationSummary#getImmunizationsSection() Get Immunizations Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationSummary#getMedicalEquipmentSection() Get Medical Equipment Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationSummary#getPayersSection() Get Payers Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationSummary#getPlanOfCareSection() Get Plan Of Care Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationSummary#getSocialHistorySection() Get Social History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationSummary#getVitalSignsSection() Get Vital Signs Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.ConsultationSummary#validateGeneralHeaderConstraintsTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Template Id}
  • + *
+ *

+ * + * @generated NOT + */ + +public class ConsultationSummaryTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationSummaryAllergiesReactionsSection() { + OperationsTestCase validateConsultationSummaryAllergiesReactionsSectionTestCase = new OperationsTestCase( + "validateConsultationSummaryAllergiesReactionsSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_SUMMARY_ALLERGIES_REACTIONS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationSummary target) { + + } + + @Override + protected void updateToPass(ConsultationSummary target) { + target.init(); + + /* AllergiesReactionsSection */ + AllergiesReactionsSection section = + + HITSPFactory.eINSTANCE.createAllergiesReactionsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationSummaryOperations.validateConsultationSummaryAllergiesReactionsSection( + (ConsultationSummary) objectToTest, diagnostician, map); + } + + }; + + validateConsultationSummaryAllergiesReactionsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationSummaryMedicationsSection() { + OperationsTestCase validateConsultationSummaryMedicationsSectionTestCase = new OperationsTestCase( + "validateConsultationSummaryMedicationsSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_SUMMARY_MEDICATIONS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationSummary target) { + + } + + @Override + protected void updateToPass(ConsultationSummary target) { + target.init(); + + /* MedicationsSection */ + MedicationsSection section = + + HITSPFactory.eINSTANCE.createMedicationsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationSummaryOperations.validateConsultationSummaryMedicationsSection( + (ConsultationSummary) objectToTest, diagnostician, map); + } + + }; + + validateConsultationSummaryMedicationsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationSummaryProblemListSection() { + OperationsTestCase validateConsultationSummaryProblemListSectionTestCase = new OperationsTestCase( + "validateConsultationSummaryProblemListSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_SUMMARY_PROBLEM_LIST_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationSummary target) { + + } + + @Override + protected void updateToPass(ConsultationSummary target) { + target.init(); + + /* ProblemListSection */ + ProblemListSection section = + + HITSPFactory.eINSTANCE.createProblemListSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationSummaryOperations.validateConsultationSummaryProblemListSection( + (ConsultationSummary) objectToTest, diagnostician, map); + } + + }; + + validateConsultationSummaryProblemListSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationSummarySurgeriesSection() { + OperationsTestCase validateConsultationSummarySurgeriesSectionTestCase = new OperationsTestCase( + "validateConsultationSummarySurgeriesSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_SUMMARY_SURGERIES_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationSummary target) { + + } + + @Override + protected void updateToPass(ConsultationSummary target) { + target.init(); + + /* SurgeriesSection */ + SurgeriesSection section = + + HITSPFactory.eINSTANCE.createSurgeriesSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationSummaryOperations.validateConsultationSummarySurgeriesSection( + (ConsultationSummary) objectToTest, diagnostician, map); + } + + }; + + validateConsultationSummarySurgeriesSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationSummaryDiagnosticResultsSection() { + OperationsTestCase validateConsultationSummaryDiagnosticResultsSectionTestCase = new OperationsTestCase( + "validateConsultationSummaryDiagnosticResultsSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_SUMMARY_DIAGNOSTIC_RESULTS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationSummary target) { + + } + + @Override + protected void updateToPass(ConsultationSummary target) { + target.init(); + + /* DiagnosticResultsSection */ + DiagnosticResultsSection section = + + HITSPFactory.eINSTANCE.createDiagnosticResultsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationSummaryOperations.validateConsultationSummaryDiagnosticResultsSection( + (ConsultationSummary) objectToTest, diagnostician, map); + } + + }; + + validateConsultationSummaryDiagnosticResultsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationSummaryAdvanceDirectivesSection() { + OperationsTestCase validateConsultationSummaryAdvanceDirectivesSectionTestCase = new OperationsTestCase( + "validateConsultationSummaryAdvanceDirectivesSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_SUMMARY_ADVANCE_DIRECTIVES_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationSummary target) { + + } + + @Override + protected void updateToPass(ConsultationSummary target) { + target.init(); + + /* AdvanceDirectivesSection */ + AdvanceDirectivesSection section = + + HITSPFactory.eINSTANCE.createAdvanceDirectivesSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationSummaryOperations.validateConsultationSummaryAdvanceDirectivesSection( + (ConsultationSummary) objectToTest, diagnostician, map); + } + + }; + + validateConsultationSummaryAdvanceDirectivesSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationSummaryEncountersSection() { + OperationsTestCase validateConsultationSummaryEncountersSectionTestCase = new OperationsTestCase( + "validateConsultationSummaryEncountersSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_SUMMARY_ENCOUNTERS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationSummary target) { + + } + + @Override + protected void updateToPass(ConsultationSummary target) { + target.init(); + + /* EncountersSection */ + EncountersSection section = + + HITSPFactory.eINSTANCE.createEncountersSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationSummaryOperations.validateConsultationSummaryEncountersSection( + (ConsultationSummary) objectToTest, diagnostician, map); + } + + }; + + validateConsultationSummaryEncountersSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationSummaryFamilyHistorySection() { + OperationsTestCase validateConsultationSummaryFamilyHistorySectionTestCase = new OperationsTestCase( + "validateConsultationSummaryFamilyHistorySection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_SUMMARY_FAMILY_HISTORY_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationSummary target) { + + } + + @Override + protected void updateToPass(ConsultationSummary target) { + target.init(); + + /* FamilyHistorySection */ + FamilyHistorySection section = + + HITSPFactory.eINSTANCE.createFamilyHistorySection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationSummaryOperations.validateConsultationSummaryFamilyHistorySection( + (ConsultationSummary) objectToTest, diagnostician, map); + } + + }; + + validateConsultationSummaryFamilyHistorySectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationSummaryFunctionalStatusSection() { + OperationsTestCase validateConsultationSummaryFunctionalStatusSectionTestCase = new OperationsTestCase( + "validateConsultationSummaryFunctionalStatusSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_SUMMARY_FUNCTIONAL_STATUS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationSummary target) { + + } + + @Override + protected void updateToPass(ConsultationSummary target) { + target.init(); + + /* FunctionalStatusSection */ + FunctionalStatusSection section = + + HITSPFactory.eINSTANCE.createFunctionalStatusSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationSummaryOperations.validateConsultationSummaryFunctionalStatusSection( + (ConsultationSummary) objectToTest, diagnostician, map); + } + + }; + + validateConsultationSummaryFunctionalStatusSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationSummaryImmunizationsSection() { + OperationsTestCase validateConsultationSummaryImmunizationsSectionTestCase = new OperationsTestCase( + "validateConsultationSummaryImmunizationsSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_SUMMARY_IMMUNIZATIONS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationSummary target) { + + } + + @Override + protected void updateToPass(ConsultationSummary target) { + target.init(); + + /* ImmunizationsSection */ + ImmunizationsSection section = + + HITSPFactory.eINSTANCE.createImmunizationsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationSummaryOperations.validateConsultationSummaryImmunizationsSection( + (ConsultationSummary) objectToTest, diagnostician, map); + } + + }; + + validateConsultationSummaryImmunizationsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationSummaryMedicalEquipmentSection() { + OperationsTestCase validateConsultationSummaryMedicalEquipmentSectionTestCase = new OperationsTestCase( + "validateConsultationSummaryMedicalEquipmentSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_SUMMARY_MEDICAL_EQUIPMENT_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationSummary target) { + + } + + @Override + protected void updateToPass(ConsultationSummary target) { + target.init(); + + /* MedicalEquipmentSection */ + MedicalEquipmentSection section = + + HITSPFactory.eINSTANCE.createMedicalEquipmentSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationSummaryOperations.validateConsultationSummaryMedicalEquipmentSection( + (ConsultationSummary) objectToTest, diagnostician, map); + } + + }; + + validateConsultationSummaryMedicalEquipmentSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationSummaryPayersSection() { + OperationsTestCase validateConsultationSummaryPayersSectionTestCase = new OperationsTestCase( + "validateConsultationSummaryPayersSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_SUMMARY_PAYERS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationSummary target) { + + } + + @Override + protected void updateToPass(ConsultationSummary target) { + target.init(); + + /* PayersSection */ + PayersSection section = + + HITSPFactory.eINSTANCE.createPayersSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationSummaryOperations.validateConsultationSummaryPayersSection( + (ConsultationSummary) objectToTest, diagnostician, map); + } + + }; + + validateConsultationSummaryPayersSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationSummaryPlanOfCareSection() { + OperationsTestCase validateConsultationSummaryPlanOfCareSectionTestCase = new OperationsTestCase( + "validateConsultationSummaryPlanOfCareSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_SUMMARY_PLAN_OF_CARE_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationSummary target) { + + } + + @Override + protected void updateToPass(ConsultationSummary target) { + target.init(); + + /* PlanOfCareSection */ + PlanOfCareSection section = + + HITSPFactory.eINSTANCE.createPlanOfCareSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationSummaryOperations.validateConsultationSummaryPlanOfCareSection( + (ConsultationSummary) objectToTest, diagnostician, map); + } + + }; + + validateConsultationSummaryPlanOfCareSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationSummarySocialHistorySection() { + OperationsTestCase validateConsultationSummarySocialHistorySectionTestCase = new OperationsTestCase( + "validateConsultationSummarySocialHistorySection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_SUMMARY_SOCIAL_HISTORY_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationSummary target) { + + } + + @Override + protected void updateToPass(ConsultationSummary target) { + target.init(); + + /* SocialHistorySection */ + SocialHistorySection section = + + HITSPFactory.eINSTANCE.createSocialHistorySection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationSummaryOperations.validateConsultationSummarySocialHistorySection( + (ConsultationSummary) objectToTest, diagnostician, map); + } + + }; + + validateConsultationSummarySocialHistorySectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateConsultationSummaryVitalSignsSection() { + OperationsTestCase validateConsultationSummaryVitalSignsSectionTestCase = new OperationsTestCase( + "validateConsultationSummaryVitalSignsSection", + operationsForOCL.getOCLValue("VALIDATE_CONSULTATION_SUMMARY_VITAL_SIGNS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationSummary target) { + + } + + @Override + protected void updateToPass(ConsultationSummary target) { + target.init(); + + /* VitalSignsSection */ + VitalSignsSection section = + + HITSPFactory.eINSTANCE.createVitalSignsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationSummaryOperations.validateConsultationSummaryVitalSignsSection( + (ConsultationSummary) objectToTest, diagnostician, map); + } + + }; + + validateConsultationSummaryVitalSignsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testGetAllergiesReactionsSection() { + + ConsultationSummary target = objectFactory.create(); + target.getAllergiesReactionsSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetMedicationsSection() { + + ConsultationSummary target = objectFactory.create(); + target.getMedicationsSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetProblemListSection() { + + ConsultationSummary target = objectFactory.create(); + target.getProblemListSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetSurgeriesSection() { + + ConsultationSummary target = objectFactory.create(); + target.getSurgeriesSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetDiagnosticResultsSection() { + + ConsultationSummary target = objectFactory.create(); + target.getDiagnosticResultsSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetAdvanceDirectivesSection() { + + ConsultationSummary target = objectFactory.create(); + target.getAdvanceDirectivesSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetEncountersSection() { + + ConsultationSummary target = objectFactory.create(); + target.getEncountersSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetFamilyHistorySection() { + + ConsultationSummary target = objectFactory.create(); + target.getFamilyHistorySection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetFunctionalStatusSection() { + + ConsultationSummary target = objectFactory.create(); + target.getFunctionalStatusSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetImmunizationsSection() { + + ConsultationSummary target = objectFactory.create(); + target.getImmunizationsSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetMedicalEquipmentSection() { + + ConsultationSummary target = objectFactory.create(); + target.getMedicalEquipmentSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetPayersSection() { + + ConsultationSummary target = objectFactory.create(); + target.getPayersSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetPlanOfCareSection() { + + ConsultationSummary target = objectFactory.create(); + target.getPlanOfCareSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetSocialHistorySection() { + + ConsultationSummary target = objectFactory.create(); + target.getSocialHistorySection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetVitalSignsSection() { + + ConsultationSummary target = objectFactory.create(); + target.getVitalSignsSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateGeneralHeaderConstraintsTemplateId() { + OperationsTestCase validateGeneralHeaderConstraintsTemplateIdTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsTemplateId", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(ConsultationSummary target) { + + } + + @Override + protected void updateToPass(ConsultationSummary target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return ConsultationSummaryOperations.validateGeneralHeaderConstraintsTemplateId( + (ConsultationSummary) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + private static class OperationsForOCL extends ConsultationSummaryOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated NOT + */ + private static class ObjectFactory implements TestObjectFactory { + + public ConsultationSummary create() { + return ToCFactory.eINSTANCE.createConsultationSummary(); + } + } + + /** + * + * @generated NOT + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated NOT + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated NOT + */ + private static class ConstructorTestClass extends ConsultationSummaryOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated NOT + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated NOT + */ + + @Override + protected EObject getObjectToTest() { + return null; + } + +} // ConsultationSummaryOperations diff --git a/org.openhealthtools.mdht.uml.cda.toc.tests/src/org/openhealthtools/mdht/uml/cda/toc/tests/DischargeInstructionsTest.java b/org.openhealthtools.mdht.uml.cda.toc.tests/src/org/openhealthtools/mdht/uml/cda/toc/tests/DischargeInstructionsTest.java new file mode 100644 index 000000000..1914a4512 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.toc.tests/src/org/openhealthtools/mdht/uml/cda/toc/tests/DischargeInstructionsTest.java @@ -0,0 +1,534 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.toc.tests; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.hitsp.AdvanceDirectivesSection; +import org.openhealthtools.mdht.uml.cda.hitsp.AllergiesReactionsSection; +import org.openhealthtools.mdht.uml.cda.hitsp.DischargeDiagnosisSection; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.ImmunizationsSection; +import org.openhealthtools.mdht.uml.cda.hitsp.MedicalEquipmentSection; +import org.openhealthtools.mdht.uml.cda.hitsp.PlanOfCareSection; +import org.openhealthtools.mdht.uml.cda.hitsp.ProblemListSection; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.cda.toc.DischargeInstructions; +import org.openhealthtools.mdht.uml.cda.toc.ToCFactory; +import org.openhealthtools.mdht.uml.cda.toc.operations.DischargeInstructionsOperations; + +/** + * + * A static utility class that provides operations related to 'Discharge Instructions' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeInstructions#validateDischargeInstructionsPlanOfCareSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Instructions Plan Of Care Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeInstructions#validateDischargeInstructionsAllergiesReactionsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Instructions Allergies Reactions Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeInstructions#validateDischargeInstructionsProblemListSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Instructions Problem List Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeInstructions#validateDischargeInstructionsDischargeDiagnosisSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Instructions Discharge Diagnosis Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeInstructions#validateDischargeInstructionsAdvanceDirectivesSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Instructions Advance Directives Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeInstructions#validateDischargeInstructionsImmunizationsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Instructions Immunizations Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeInstructions#validateDischargeInstructionsMedicalEquipmentSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Instructions Medical Equipment Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeInstructions#getPlanOfCareSection() Get Plan Of Care Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeInstructions#getAllergiesReactionsSection() Get Allergies Reactions Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeInstructions#getProblemListSection() Get Problem List Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeInstructions#getDischargeDiagnosisSection() Get Discharge Diagnosis Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeInstructions#getAdvanceDirectivesSection() Get Advance Directives Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeInstructions#getImmunizationsSection() Get Immunizations Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeInstructions#getMedicalEquipmentSection() Get Medical Equipment Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeInstructions#validateGeneralHeaderConstraintsTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Template Id}
  • + *
+ *

+ * + * @generated NOT + */ + +public class DischargeInstructionsTest extends CDAValidationTest { + + /** + * + * @generated NOT + */ + @Test + public void testValidateDischargeInstructionsPlanOfCareSection() { + OperationsTestCase validateDischargeInstructionsPlanOfCareSectionTestCase = new OperationsTestCase( + "validateDischargeInstructionsPlanOfCareSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_INSTRUCTIONS_PLAN_OF_CARE_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeInstructions target) { + + } + + @Override + protected void updateToPass(DischargeInstructions target) { + target.init(); + + /* PlanOfCareSection */ + PlanOfCareSection section = + + HITSPFactory.eINSTANCE.createPlanOfCareSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeInstructionsOperations.validateDischargeInstructionsPlanOfCareSection( + (DischargeInstructions) objectToTest, diagnostician, map); + } + + }; + + validateDischargeInstructionsPlanOfCareSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateDischargeInstructionsAllergiesReactionsSection() { + OperationsTestCase validateDischargeInstructionsAllergiesReactionsSectionTestCase = new OperationsTestCase( + "validateDischargeInstructionsAllergiesReactionsSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_INSTRUCTIONS_ALLERGIES_REACTIONS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeInstructions target) { + + } + + @Override + protected void updateToPass(DischargeInstructions target) { + target.init(); + + /* AllergiesReactionsSection */ + AllergiesReactionsSection section = + + HITSPFactory.eINSTANCE.createAllergiesReactionsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeInstructionsOperations.validateDischargeInstructionsAllergiesReactionsSection( + (DischargeInstructions) objectToTest, diagnostician, map); + } + + }; + + validateDischargeInstructionsAllergiesReactionsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateDischargeInstructionsProblemListSection() { + OperationsTestCase validateDischargeInstructionsProblemListSectionTestCase = new OperationsTestCase( + "validateDischargeInstructionsProblemListSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_INSTRUCTIONS_PROBLEM_LIST_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeInstructions target) { + + } + + @Override + protected void updateToPass(DischargeInstructions target) { + target.init(); + + /* ProblemListSection */ + ProblemListSection section = + + HITSPFactory.eINSTANCE.createProblemListSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeInstructionsOperations.validateDischargeInstructionsProblemListSection( + (DischargeInstructions) objectToTest, diagnostician, map); + } + + }; + + validateDischargeInstructionsProblemListSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateDischargeInstructionsDischargeDiagnosisSection() { + OperationsTestCase validateDischargeInstructionsDischargeDiagnosisSectionTestCase = new OperationsTestCase( + "validateDischargeInstructionsDischargeDiagnosisSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_INSTRUCTIONS_DISCHARGE_DIAGNOSIS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeInstructions target) { + + } + + @Override + protected void updateToPass(DischargeInstructions target) { + target.init(); + + /* DischargeDiagnosisSection */ + DischargeDiagnosisSection section = + + HITSPFactory.eINSTANCE.createDischargeDiagnosisSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeInstructionsOperations.validateDischargeInstructionsDischargeDiagnosisSection( + (DischargeInstructions) objectToTest, diagnostician, map); + } + + }; + + validateDischargeInstructionsDischargeDiagnosisSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateDischargeInstructionsAdvanceDirectivesSection() { + OperationsTestCase validateDischargeInstructionsAdvanceDirectivesSectionTestCase = new OperationsTestCase( + "validateDischargeInstructionsAdvanceDirectivesSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_INSTRUCTIONS_ADVANCE_DIRECTIVES_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeInstructions target) { + + } + + @Override + protected void updateToPass(DischargeInstructions target) { + target.init(); + + /* AdvanceDirectivesSection */ + AdvanceDirectivesSection section = + + HITSPFactory.eINSTANCE.createAdvanceDirectivesSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeInstructionsOperations.validateDischargeInstructionsAdvanceDirectivesSection( + (DischargeInstructions) objectToTest, diagnostician, map); + } + + }; + + validateDischargeInstructionsAdvanceDirectivesSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateDischargeInstructionsImmunizationsSection() { + OperationsTestCase validateDischargeInstructionsImmunizationsSectionTestCase = new OperationsTestCase( + "validateDischargeInstructionsImmunizationsSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_INSTRUCTIONS_IMMUNIZATIONS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeInstructions target) { + + } + + @Override + protected void updateToPass(DischargeInstructions target) { + target.init(); + + /* ImmunizationsSection */ + ImmunizationsSection section = + + HITSPFactory.eINSTANCE.createImmunizationsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeInstructionsOperations.validateDischargeInstructionsImmunizationsSection( + (DischargeInstructions) objectToTest, diagnostician, map); + } + + }; + + validateDischargeInstructionsImmunizationsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateDischargeInstructionsMedicalEquipmentSection() { + OperationsTestCase validateDischargeInstructionsMedicalEquipmentSectionTestCase = new OperationsTestCase( + "validateDischargeInstructionsMedicalEquipmentSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_INSTRUCTIONS_MEDICAL_EQUIPMENT_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeInstructions target) { + + } + + @Override + protected void updateToPass(DischargeInstructions target) { + target.init(); + + /* MedicalEquipmentSection */ + MedicalEquipmentSection section = + + HITSPFactory.eINSTANCE.createMedicalEquipmentSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeInstructionsOperations.validateDischargeInstructionsMedicalEquipmentSection( + (DischargeInstructions) objectToTest, diagnostician, map); + } + + }; + + validateDischargeInstructionsMedicalEquipmentSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testGetPlanOfCareSection() { + + DischargeInstructions target = objectFactory.create(); + target.getPlanOfCareSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetAllergiesReactionsSection() { + + DischargeInstructions target = objectFactory.create(); + target.getAllergiesReactionsSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetProblemListSection() { + + DischargeInstructions target = objectFactory.create(); + target.getProblemListSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetDischargeDiagnosisSection() { + + DischargeInstructions target = objectFactory.create(); + target.getDischargeDiagnosisSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetAdvanceDirectivesSection() { + + DischargeInstructions target = objectFactory.create(); + target.getAdvanceDirectivesSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetImmunizationsSection() { + + DischargeInstructions target = objectFactory.create(); + target.getImmunizationsSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetMedicalEquipmentSection() { + + DischargeInstructions target = objectFactory.create(); + target.getMedicalEquipmentSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateGeneralHeaderConstraintsTemplateId() { + OperationsTestCase validateGeneralHeaderConstraintsTemplateIdTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsTemplateId", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeInstructions target) { + + } + + @Override + protected void updateToPass(DischargeInstructions target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeInstructionsOperations.validateGeneralHeaderConstraintsTemplateId( + (DischargeInstructions) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + private static class OperationsForOCL extends DischargeInstructionsOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated NOT + */ + private static class ObjectFactory implements TestObjectFactory { + public DischargeInstructions create() { + return ToCFactory.eINSTANCE.createDischargeInstructions(); + + } + } + + /** + * + * @generated NOT + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated NOT + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated NOT + */ + private static class ConstructorTestClass extends DischargeInstructionsOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated NOT + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated NOT + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // DischargeInstructionsOperations diff --git a/org.openhealthtools.mdht.uml.cda.toc.tests/src/org/openhealthtools/mdht/uml/cda/toc/tests/DischargeSummaryTest.java b/org.openhealthtools.mdht.uml.cda.toc.tests/src/org/openhealthtools/mdht/uml/cda/toc/tests/DischargeSummaryTest.java new file mode 100644 index 000000000..dc986918d --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.toc.tests/src/org/openhealthtools/mdht/uml/cda/toc/tests/DischargeSummaryTest.java @@ -0,0 +1,1145 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.toc.tests; + +import static org.junit.Assert.assertTrue; + +import java.util.Map; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.ecore.EObject; +import org.junit.Test; +import org.junit.runner.JUnitCore; +import org.junit.runner.Result; +import org.openhealthtools.mdht.uml.cda.cdt.CDTFactory; +import org.openhealthtools.mdht.uml.cda.cdt.HospitalDischargeStudiesSummarySection; +import org.openhealthtools.mdht.uml.cda.hitsp.AllergiesReactionsSection; +import org.openhealthtools.mdht.uml.cda.hitsp.ChiefComplaintSection; +import org.openhealthtools.mdht.uml.cda.hitsp.DischargeDiagnosisSection; +import org.openhealthtools.mdht.uml.cda.hitsp.FamilyHistorySection; +import org.openhealthtools.mdht.uml.cda.hitsp.FunctionalStatusSection; +import org.openhealthtools.mdht.uml.cda.hitsp.HITSPFactory; +import org.openhealthtools.mdht.uml.cda.hitsp.HospitalCourseSection; +import org.openhealthtools.mdht.uml.cda.hitsp.HospitalDischargeMedicationsSection; +import org.openhealthtools.mdht.uml.cda.hitsp.ImmunizationsSection; +import org.openhealthtools.mdht.uml.cda.hitsp.PlanOfCareSection; +import org.openhealthtools.mdht.uml.cda.hitsp.ProblemListSection; +import org.openhealthtools.mdht.uml.cda.hitsp.ReviewOfSystemsSection; +import org.openhealthtools.mdht.uml.cda.hitsp.SocialHistorySection; +import org.openhealthtools.mdht.uml.cda.hitsp.SurgeriesSection; +import org.openhealthtools.mdht.uml.cda.hitsp.VitalSignsSection; +import org.openhealthtools.mdht.uml.cda.hitsp.tests.AllergiesReactionsSectionTest; +import org.openhealthtools.mdht.uml.cda.ihe.DischargeDiet; +import org.openhealthtools.mdht.uml.cda.ihe.IHEFactory; +import org.openhealthtools.mdht.uml.cda.operations.CDAValidationTest; +import org.openhealthtools.mdht.uml.cda.toc.DischargeSummary; +import org.openhealthtools.mdht.uml.cda.toc.ToCFactory; +import org.openhealthtools.mdht.uml.cda.toc.operations.DischargeSummaryOperations; + +/** + * + * A static utility class that provides operations related to 'Discharge Summary' model objects. + * + * + *

+ * The following operations are supported: + *

    + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeSummary#validateDischargeSummaryAllergiesReactionsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Allergies Reactions Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeSummary#validateDischargeSummaryProblemListSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Problem List Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeSummary#validateDischargeSummaryHospitalCourseSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Hospital Course Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeSummary#validateDischargeSummaryHospitalDischargeMedicationsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Hospital Discharge Medications Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeSummary#validateDischargeSummaryDischargeDiagnosisSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Discharge Diagnosis Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeSummary#validateDischargeSummaryPlanOfCareSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Plan Of Care Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeSummary#validateDischargeSummaryChiefComplaintSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Chief Complaint Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeSummary#validateDischargeSummaryDischargeDiet(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Discharge Diet}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeSummary#validateDischargeSummaryFamilyHistorySection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Family History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeSummary#validateDischargeSummaryFunctionalStatusSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Functional Status Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeSummary#validateDischargeSummaryHistoryOfPresentIllness(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary History Of Present Illness}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeSummary#validateDischargeSummaryHospitalDischargePhysical(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Hospital Discharge Physical}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeSummary#validateDischargeSummaryHospitalDischargeStudiesSummarySection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Hospital Discharge Studies Summary Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeSummary#validateDischargeSummaryImmunizationsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Immunizations Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeSummary#validateDischargeSummarySurgeriesSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Surgeries Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeSummary#validateDischargeSummaryReviewOfSystemsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Review Of Systems Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeSummary#validateDischargeSummarySocialHistorySection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Social History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeSummary#validateDischargeSummaryVitalSignsSection(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate Discharge Summary Vital Signs Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeSummary#getAllergiesReactionsSection() Get Allergies Reactions Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeSummary#getProblemListSection() Get Problem List Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeSummary#getHospitalCourseSection() Get Hospital Course Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeSummary#getHospitalDischargeMedicationsSection() Get Hospital Discharge Medications Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeSummary#getDischargeDiagnosisSection() Get Discharge Diagnosis Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeSummary#getPlanOfCareSection() Get Plan Of Care Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeSummary#getChiefComplaintSection() Get Chief Complaint Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeSummary#getDischargeDiet() Get Discharge Diet}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeSummary#getFamilyHistorySection() Get Family History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeSummary#getFunctionalStatusSection() Get Functional Status Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeSummary#getHistoryOfPresentIllness() Get History Of Present Illness}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeSummary#getHospitalDischargePhysical() Get Hospital Discharge Physical}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeSummary#getHospitalDischargeStudiesSummarySection() Get Hospital Discharge Studies Summary Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeSummary#getImmunizationsSection() Get Immunizations Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeSummary#getSurgeriesSection() Get Surgeries Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeSummary#getReviewOfSystemsSection() Get Review Of Systems Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeSummary#getSocialHistorySection() Get Social History Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeSummary#getVitalSignsSection() Get Vital Signs Section}
  • + *
  • {@link org.openhealthtools.mdht.uml.cda.toc.DischargeSummary#validateGeneralHeaderConstraintsTemplateId(org.eclipse.emf.common.util.DiagnosticChain, java.util.Map) Validate General Header Constraints Template Id}
  • + *
+ *

+ * + * @generated NOT + */ + +public class DischargeSummaryTest extends CDAValidationTest { + + /** + * + * @generated NOT NOT + */ + @Test + public void testValidateDischargeSummaryAllergiesReactionsSection() { + OperationsTestCase validateDischargeSummaryAllergiesReactionsSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryAllergiesReactionsSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_ALLERGIES_REACTIONS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* AllergiesReactionsSection */ + AllergiesReactionsSection section = + + HITSPFactory.eINSTANCE.createAllergiesReactionsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryAllergiesReactionsSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryAllergiesReactionsSectionTestCase.doValidationTest(); + + Result result = JUnitCore.runClasses(AllergiesReactionsSectionTest.class); + + assertTrue(AllergiesReactionsSectionTest.class.getName() + " Failed", result.getFailures().isEmpty()); + + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateDischargeSummaryProblemListSection() { + OperationsTestCase validateDischargeSummaryProblemListSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryProblemListSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_PROBLEM_LIST_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* ProblemListSection */ + ProblemListSection section = + + HITSPFactory.eINSTANCE.createProblemListSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryProblemListSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryProblemListSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateDischargeSummaryHospitalCourseSection() { + OperationsTestCase validateDischargeSummaryHospitalCourseSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryHospitalCourseSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_HOSPITAL_COURSE_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* HospitalCourseSection */ + HospitalCourseSection section = + + HITSPFactory.eINSTANCE.createHospitalCourseSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryHospitalCourseSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryHospitalCourseSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateDischargeSummaryHospitalDischargeMedicationsSection() { + OperationsTestCase validateDischargeSummaryHospitalDischargeMedicationsSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryHospitalDischargeMedicationsSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_HOSPITAL_DISCHARGE_MEDICATIONS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* HospitalDischargeMedicationsSection */ + HospitalDischargeMedicationsSection section = + + HITSPFactory.eINSTANCE.createHospitalDischargeMedicationsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryHospitalDischargeMedicationsSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryHospitalDischargeMedicationsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateDischargeSummaryDischargeDiagnosisSection() { + OperationsTestCase validateDischargeSummaryDischargeDiagnosisSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryDischargeDiagnosisSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_DISCHARGE_DIAGNOSIS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* DischargeDiagnosisSection */ + DischargeDiagnosisSection section = + + HITSPFactory.eINSTANCE.createDischargeDiagnosisSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryDischargeDiagnosisSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryDischargeDiagnosisSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateDischargeSummaryPlanOfCareSection() { + OperationsTestCase validateDischargeSummaryPlanOfCareSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryPlanOfCareSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_PLAN_OF_CARE_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* PlanOfCareSection */ + PlanOfCareSection section = + + HITSPFactory.eINSTANCE.createPlanOfCareSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryPlanOfCareSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryPlanOfCareSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT NOT + */ + @Test + public void testValidateDischargeSummaryChiefComplaintSection() { + OperationsTestCase validateDischargeSummaryChiefComplaintSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryChiefComplaintSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_CHIEF_COMPLAINT_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* ChiefComplaintSection */ + ChiefComplaintSection section = + + HITSPFactory.eINSTANCE.createChiefComplaintSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryChiefComplaintSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryChiefComplaintSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT NOT + */ + @Test + public void testValidateDischargeSummaryDischargeDiet() { + OperationsTestCase validateDischargeSummaryDischargeDietTestCase = new OperationsTestCase( + "validateDischargeSummaryDischargeDiet", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_DISCHARGE_DIET__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + DischargeDiet dischargeDiet = IHEFactory.eINSTANCE.createDischargeDiet().init(); + + target.addSection(dischargeDiet); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryDischargeDiet( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryDischargeDietTestCase.doValidationTest(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateDischargeSummaryFamilyHistorySection() { + OperationsTestCase validateDischargeSummaryFamilyHistorySectionTestCase = new OperationsTestCase( + "validateDischargeSummaryFamilyHistorySection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_FAMILY_HISTORY_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* FamilyHistorySection */ + FamilyHistorySection section = + + HITSPFactory.eINSTANCE.createFamilyHistorySection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryFamilyHistorySection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryFamilyHistorySectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateDischargeSummaryFunctionalStatusSection() { + OperationsTestCase validateDischargeSummaryFunctionalStatusSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryFunctionalStatusSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_FUNCTIONAL_STATUS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* FunctionalStatusSection */ + FunctionalStatusSection section = + + HITSPFactory.eINSTANCE.createFunctionalStatusSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryFunctionalStatusSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryFunctionalStatusSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateDischargeSummaryHistoryOfPresentIllness() { + OperationsTestCase validateDischargeSummaryHistoryOfPresentIllnessTestCase = new OperationsTestCase( + "validateDischargeSummaryHistoryOfPresentIllness", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_HISTORY_OF_PRESENT_ILLNESS__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + target.addSection(HITSPFactory.eINSTANCE.createHistoryOfPastIllnessSection().init()); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryHistoryOfPresentIllness( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryHistoryOfPresentIllnessTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateDischargeSummaryHospitalDischargePhysical() { + OperationsTestCase validateDischargeSummaryHospitalDischargePhysicalTestCase = new OperationsTestCase( + "validateDischargeSummaryHospitalDischargePhysical", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_HOSPITAL_DISCHARGE_PHYSICAL__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryHospitalDischargePhysical( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryHospitalDischargePhysicalTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateDischargeSummaryHospitalDischargeStudiesSummarySection() { + OperationsTestCase validateDischargeSummaryHospitalDischargeStudiesSummarySectionTestCase = new OperationsTestCase( + "validateDischargeSummaryHospitalDischargeStudiesSummarySection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_HOSPITAL_DISCHARGE_STUDIES_SUMMARY_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* HospitalDischargeStudiesSummarySection */ + HospitalDischargeStudiesSummarySection section = + + CDTFactory.eINSTANCE.createHospitalDischargeStudiesSummarySection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryHospitalDischargeStudiesSummarySection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryHospitalDischargeStudiesSummarySectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateDischargeSummaryImmunizationsSection() { + OperationsTestCase validateDischargeSummaryImmunizationsSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryImmunizationsSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_IMMUNIZATIONS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* ImmunizationsSection */ + ImmunizationsSection section = + + HITSPFactory.eINSTANCE.createImmunizationsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryImmunizationsSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryImmunizationsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateDischargeSummarySurgeriesSection() { + OperationsTestCase validateDischargeSummarySurgeriesSectionTestCase = new OperationsTestCase( + "validateDischargeSummarySurgeriesSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_SURGERIES_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* SurgeriesSection */ + SurgeriesSection section = + + HITSPFactory.eINSTANCE.createSurgeriesSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummarySurgeriesSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummarySurgeriesSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateDischargeSummaryReviewOfSystemsSection() { + OperationsTestCase validateDischargeSummaryReviewOfSystemsSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryReviewOfSystemsSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_REVIEW_OF_SYSTEMS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* ReviewOfSystemsSection */ + ReviewOfSystemsSection section = + + HITSPFactory.eINSTANCE.createReviewOfSystemsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryReviewOfSystemsSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryReviewOfSystemsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateDischargeSummarySocialHistorySection() { + OperationsTestCase validateDischargeSummarySocialHistorySectionTestCase = new OperationsTestCase( + "validateDischargeSummarySocialHistorySection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_SOCIAL_HISTORY_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* SocialHistorySection */ + SocialHistorySection section = + + HITSPFactory.eINSTANCE.createSocialHistorySection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummarySocialHistorySection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummarySocialHistorySectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateDischargeSummaryVitalSignsSection() { + OperationsTestCase validateDischargeSummaryVitalSignsSectionTestCase = new OperationsTestCase( + "validateDischargeSummaryVitalSignsSection", + operationsForOCL.getOCLValue("VALIDATE_DISCHARGE_SUMMARY_VITAL_SIGNS_SECTION__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + /* VitalSignsSection */ + VitalSignsSection section = + + HITSPFactory.eINSTANCE.createVitalSignsSection().init(); + + target.addSection(section); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateDischargeSummaryVitalSignsSection( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateDischargeSummaryVitalSignsSectionTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + @Test + public void testGetAllergiesReactionsSection() { + + DischargeSummary target = objectFactory.create(); + target.getAllergiesReactionsSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetProblemListSection() { + + DischargeSummary target = objectFactory.create(); + target.getProblemListSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetHospitalCourseSection() { + + DischargeSummary target = objectFactory.create(); + target.getHospitalCourseSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetHospitalDischargeMedicationsSection() { + + DischargeSummary target = objectFactory.create(); + target.getHospitalDischargeMedicationsSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetDischargeDiagnosisSection() { + + DischargeSummary target = objectFactory.create(); + target.getDischargeDiagnosisSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetPlanOfCareSection() { + + DischargeSummary target = objectFactory.create(); + target.getPlanOfCareSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetChiefComplaintSection() { + + DischargeSummary target = objectFactory.create(); + target.getChiefComplaintSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetDischargeDiet() { + + DischargeSummary target = objectFactory.create(); + target.getDischargeDiet(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetFamilyHistorySection() { + + DischargeSummary target = objectFactory.create(); + target.getFamilyHistorySection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetFunctionalStatusSection() { + + DischargeSummary target = objectFactory.create(); + target.getFunctionalStatusSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetHistoryOfPresentIllness() { + + DischargeSummary target = objectFactory.create(); + target.getHistoryOfPresentIllness(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetHospitalDischargePhysical() { + + DischargeSummary target = objectFactory.create(); + target.getHospitalDischargePhysical(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetHospitalDischargeStudiesSummarySection() { + + DischargeSummary target = objectFactory.create(); + target.getHospitalDischargeStudiesSummarySection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetImmunizationsSection() { + + DischargeSummary target = objectFactory.create(); + target.getImmunizationsSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetSurgeriesSection() { + + DischargeSummary target = objectFactory.create(); + target.getSurgeriesSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetReviewOfSystemsSection() { + + DischargeSummary target = objectFactory.create(); + target.getReviewOfSystemsSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetSocialHistorySection() { + + DischargeSummary target = objectFactory.create(); + target.getSocialHistorySection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testGetVitalSignsSection() { + + DischargeSummary target = objectFactory.create(); + target.getVitalSignsSection(); + + } + + /** + * + * @generated NOT + */ + @Test + public void testValidateGeneralHeaderConstraintsTemplateId() { + OperationsTestCase validateGeneralHeaderConstraintsTemplateIdTestCase = new OperationsTestCase( + "validateGeneralHeaderConstraintsTemplateId", + operationsForOCL.getOCLValue("VALIDATE_GENERAL_HEADER_CONSTRAINTS_TEMPLATE_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_EXP"), + objectFactory) { + + @Override + protected void updateToFail(DischargeSummary target) { + + } + + @Override + protected void updateToPass(DischargeSummary target) { + target.init(); + + } + + @Override + protected boolean validate(EObject objectToTest, BasicDiagnostic diagnostician, Map map) { + + return DischargeSummaryOperations.validateGeneralHeaderConstraintsTemplateId( + (DischargeSummary) objectToTest, diagnostician, map); + } + + }; + + validateGeneralHeaderConstraintsTemplateIdTestCase.doValidationTest(); + } + + /** + * + * @generated NOT + */ + private static class OperationsForOCL extends DischargeSummaryOperations { + public String getOCLValue(String fieldName) { + + String oclValue = null; + + try { + oclValue = (String) this.getClass().getSuperclass().getDeclaredField(fieldName).get(this); + } catch (Exception e) { + oclValue = "NO OCL FOUND FOR PROPERTY " + fieldName; + } + return oclValue; + } + } + + /** + * + * @generated NOT + */ + private static class ObjectFactory implements TestObjectFactory { + + public DischargeSummary create() { + return ToCFactory.eINSTANCE.createDischargeSummary(); + } + } + + /** + * + * @generated NOT + */ + private static OperationsForOCL operationsForOCL = new OperationsForOCL(); + + /** + * + * @generated NOT + */ + private static ObjectFactory objectFactory = new ObjectFactory(); + + /** + * Tests Operations Constructor for 100% coverage + * @generated NOT + */ + private static class ConstructorTestClass extends DischargeSummaryOperations { + }; + + /** + * Tests Operations Constructor for 100% coverage + * @generated NOT + */ + @Test + public void testConstructor() { + @SuppressWarnings("unused") + ConstructorTestClass constructorTestClass = new ConstructorTestClass(); + } // testConstructor + + /** + * + * @generated NOT + */ + @Override + protected EObject getObjectToTest() { + return null; + } + +} // DischargeSummaryOperations diff --git a/org.openhealthtools.mdht.uml.cda.toc.tests/src/org/openhealthtools/mdht/uml/cda/toc/tests/ToCExample.java b/org.openhealthtools.mdht.uml.cda.toc.tests/src/org/openhealthtools/mdht/uml/cda/toc/tests/ToCExample.java new file mode 100644 index 000000000..b9966752a --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.toc.tests/src/org/openhealthtools/mdht/uml/cda/toc/tests/ToCExample.java @@ -0,0 +1,119 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.toc.tests; + +import java.io.File; +import java.io.IOException; + +import org.eclipse.emf.common.util.Diagnostic; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; +import org.eclipse.emf.ecore.util.Diagnostician; +import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl; +import org.openhealthtools.mdht.uml.cda.toc.DischargeSummary; +import org.openhealthtools.mdht.uml.cda.toc.ToCFactory; +import org.openhealthtools.mdht.uml.cda.toc.ToCPackage; + +/** + * + * A sample utility for the 'toc' package. + * + * @generated + */ +public class ToCExample { + /** + * + * Load all the argument file paths or URIs as instances of the model. + * + * @param args the file paths or URIs. + * @generated + */ + public static void main(String[] args) { + // Create a resource set to hold the resources. + // + ResourceSet resourceSet = new ResourceSetImpl(); + + // Register the appropriate resource factory to handle all file extensions. + // + resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put( + Resource.Factory.Registry.DEFAULT_EXTENSION, new XMIResourceFactoryImpl()); + + // Register the package to ensure it is available during loading. + // + resourceSet.getPackageRegistry().put(ToCPackage.eNS_URI, ToCPackage.eINSTANCE); + + // If there are no arguments, emit an appropriate usage message. + // + if (args.length == 0) { + System.out.println("Enter a list of file paths or URIs that have content like this:"); + try { + Resource resource = resourceSet.createResource(URI.createURI("http:///My.toc")); + DischargeSummary root = ToCFactory.eINSTANCE.createDischargeSummary(); + resource.getContents().add(root); + resource.save(System.out, null); + } catch (IOException exception) { + exception.printStackTrace(); + } + } else { + // Iterate over all the arguments. + // + for (int i = 0; i < args.length; ++i) { + // Construct the URI for the instance file. + // The argument is treated as a file path only if it denotes an existing file. + // Otherwise, it's directly treated as a URL. + // + File file = new File(args[i]); + URI uri = file.isFile() + ? URI.createFileURI(file.getAbsolutePath()) + : URI.createURI(args[i]); + + try { + // Demand load resource for this file. + // + Resource resource = resourceSet.getResource(uri, true); + System.out.println("Loaded " + uri); + + // Validate the contents of the loaded resource. + // + for (EObject eObject : resource.getContents()) { + Diagnostic diagnostic = Diagnostician.INSTANCE.validate(eObject); + if (diagnostic.getSeverity() != Diagnostic.OK) { + printDiagnostic(diagnostic, ""); + } + } + } catch (RuntimeException exception) { + System.out.println("Problem loading " + uri); + exception.printStackTrace(); + } + } + } + } + + /** + * + * Prints diagnostics with indentation. + * + * @param diagnostic the diagnostic to print. + * @param indent the indentation for printing. + * @generated + */ + protected static void printDiagnostic(Diagnostic diagnostic, String indent) { + System.out.print(indent); + System.out.println(diagnostic.getMessage()); + for (Diagnostic child : diagnostic.getChildren()) { + printDiagnostic(child, indent + " "); + } + } + +} // ToCExample diff --git a/org.openhealthtools.mdht.uml.cda.toc.tests/src/org/openhealthtools/mdht/uml/cda/toc/tests/ToCTests.java b/org.openhealthtools.mdht.uml.cda.toc.tests/src/org/openhealthtools/mdht/uml/cda/toc/tests/ToCTests.java new file mode 100644 index 000000000..24ede5417 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.toc.tests/src/org/openhealthtools/mdht/uml/cda/toc/tests/ToCTests.java @@ -0,0 +1,41 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.toc.tests; + +import junit.framework.JUnit4TestAdapter; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +/** + * + * A test suite for the 'toc' package. + * + * + + * @generated + */ +@RunWith(Suite.class) +@Suite.SuiteClasses({ + DischargeSummaryTest.class, DischargeInstructionsTest.class, ConsultationSummaryTest.class, + ConsultationRequestTest.class }) +public class ToCTests { + + /** + * + * + * @generated + */ + public static junit.framework.Test suite() { + return new JUnit4TestAdapter(ToCTests.class); + } + +} // ToCTests diff --git a/org.openhealthtools.mdht.uml.cda.toc.tests/src/org/openhealthtools/mdht/uml/cda/toc/tests/toc_EcoreAllTests.java b/org.openhealthtools.mdht.uml.cda.toc.tests/src/org/openhealthtools/mdht/uml/cda/toc/tests/toc_EcoreAllTests.java new file mode 100644 index 000000000..2682b7011 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.toc.tests/src/org/openhealthtools/mdht/uml/cda/toc/tests/toc_EcoreAllTests.java @@ -0,0 +1,54 @@ +/******************************************************************************* + * Copyright (c) 2011, 2012 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealthtools.mdht.uml.cda.toc.tests; + +import junit.framework.Test; +import junit.framework.TestSuite; +import junit.textui.TestRunner; + +/** + * + * A test suite for the 'toc_Ecore' model. + * + * @generated + */ +public class toc_EcoreAllTests extends TestSuite { + + /** + * + * + * @generated + */ + public static void main(String[] args) { + TestRunner.run(suite()); + } + + /** + * + * + * @generated + */ + public static Test suite() { + TestSuite suite = new toc_EcoreAllTests("toc_Ecore Tests"); + suite.addTest(ToCTests.suite()); + return suite; + } + + /** + * + * + * @generated + */ + public toc_EcoreAllTests(String name) { + super(name); + } + +} // toc_EcoreAllTests diff --git a/org.openhealthtools.mdht.uml.cda.toc.tests/test.xml b/org.openhealthtools.mdht.uml.cda.toc.tests/test.xml new file mode 100644 index 000000000..147b37ef3 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.toc.tests/test.xml @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/org.openhealthtools.mdht.uml.cda.util.test/.classpath b/org.openhealthtools.mdht.uml.cda.util.test/.classpath new file mode 100644 index 000000000..2d1a4302f --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.util.test/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.openhealthtools.mdht.uml.cda.util.test/.project b/org.openhealthtools.mdht.uml.cda.util.test/.project new file mode 100644 index 000000000..866269f0d --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.util.test/.project @@ -0,0 +1,28 @@ + + + org.openhealthtools.mdht.uml.cda.util.test + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/org.openhealthtools.mdht.uml.cda.util.test/.settings/org.eclipse.jdt.core.prefs b/org.openhealthtools.mdht.uml.cda.util.test/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..fd79a3e6c --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.util.test/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,355 @@ +#Mon May 16 10:24:25 EDT 2011 +eclipse.preferences.version=1 +org.eclipse.jdt.core.codeComplete.argumentPrefixes= +org.eclipse.jdt.core.codeComplete.argumentSuffixes= +org.eclipse.jdt.core.codeComplete.fieldPrefixes= +org.eclipse.jdt.core.codeComplete.fieldSuffixes= +org.eclipse.jdt.core.codeComplete.localPrefixes= +org.eclipse.jdt.core.codeComplete.localSuffixes= +org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.5 +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.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning +org.eclipse.jdt.core.compiler.problem.deadCode=warning +org.eclipse.jdt.core.compiler.problem.deprecation=warning +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore +org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=error +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore +org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning +org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +org.eclipse.jdt.core.compiler.problem.nullReference=warning +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore +org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=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 +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedImport=warning +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +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.5 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=36 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=36 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=36 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=36 +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_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=49 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=32 +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_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=0 +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 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=1 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=150 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@fmtOff +org.eclipse.jdt.core.formatter.enabling_tag=@fmtOn +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +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=true +org.eclipse.jdt.core.formatter.indentation.size=4 +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_parameter=do not 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=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +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_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_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 +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +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_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 +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +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_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not 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_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 +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +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_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 +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +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_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_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 +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=false +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=120 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +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=false +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/org.openhealthtools.mdht.uml.cda.util.test/.settings/org.eclipse.jdt.ui.prefs b/org.openhealthtools.mdht.uml.cda.util.test/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 000000000..6245d2099 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.util.test/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,120 @@ +#Tue Mar 29 22:38:51 EDT 2011 +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=false +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=false +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=false +cleanup.format_source_code=true +cleanup.format_source_code_changes_only=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=false +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=true +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=true +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=true +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_blocks=true +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_parentheses_in_expressions=false +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup_profile=_MDHT +cleanup_settings_version=2 +eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true +formatter_profile=_MDHT +formatter_settings_version=11 +org.eclipse.jdt.ui.exception.name=e +org.eclipse.jdt.ui.gettersetter.use.is=true +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com; +org.eclipse.jdt.ui.javadoc=true +org.eclipse.jdt.ui.keywordthis=false +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.overrideannotation=true +org.eclipse.jdt.ui.staticondemandthreshold=99 +org.eclipse.jdt.ui.text.custom_code_templates= +sp_cleanup.add_default_serial_version_id=true +sp_cleanup.add_generated_serial_version_id=false +sp_cleanup.add_missing_annotations=true +sp_cleanup.add_missing_deprecated_annotations=true +sp_cleanup.add_missing_methods=false +sp_cleanup.add_missing_nls_tags=false +sp_cleanup.add_missing_override_annotations=true +sp_cleanup.add_missing_override_annotations_interface_methods=false +sp_cleanup.add_serial_version_id=false +sp_cleanup.always_use_blocks=true +sp_cleanup.always_use_parentheses_in_expressions=false +sp_cleanup.always_use_this_for_non_static_field_access=false +sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.convert_to_enhanced_for_loop=false +sp_cleanup.correct_indentation=false +sp_cleanup.format_source_code=true +sp_cleanup.format_source_code_changes_only=false +sp_cleanup.make_local_variable_final=false +sp_cleanup.make_parameters_final=false +sp_cleanup.make_private_fields_final=true +sp_cleanup.make_type_abstract_if_missing_method=false +sp_cleanup.make_variable_declarations_final=false +sp_cleanup.never_use_blocks=false +sp_cleanup.never_use_parentheses_in_expressions=true +sp_cleanup.on_save_use_additional_actions=true +sp_cleanup.organize_imports=true +sp_cleanup.qualify_static_field_accesses_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_with_declaring_class=false +sp_cleanup.qualify_static_method_accesses_with_declaring_class=false +sp_cleanup.remove_private_constructors=true +sp_cleanup.remove_trailing_whitespaces=true +sp_cleanup.remove_trailing_whitespaces_all=true +sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +sp_cleanup.remove_unnecessary_casts=true +sp_cleanup.remove_unnecessary_nls_tags=false +sp_cleanup.remove_unused_imports=false +sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_private_fields=true +sp_cleanup.remove_unused_private_members=false +sp_cleanup.remove_unused_private_methods=true +sp_cleanup.remove_unused_private_types=true +sp_cleanup.sort_members=false +sp_cleanup.sort_members_all=false +sp_cleanup.use_blocks=false +sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_parentheses_in_expressions=false +sp_cleanup.use_this_for_non_static_field_access=false +sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true +sp_cleanup.use_this_for_non_static_method_access=false +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/org.openhealthtools.mdht.uml.cda.util.test/META-INF/MANIFEST.MF b/org.openhealthtools.mdht.uml.cda.util.test/META-INF/MANIFEST.MF new file mode 100644 index 000000000..e9148780e --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.util.test/META-INF/MANIFEST.MF @@ -0,0 +1,9 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: org.openhealthtools.mdht.uml.cda.util.test +Bundle-SymbolicName: org.openhealthtools.mdht.uml.cda.util.test;singleton:=true +Bundle-Version: 1.1.0.qualifier +Bundle-Vendor: Open Health Tools +Fragment-Host: org.openhealthtools.mdht.uml.cda;bundle-version="0.7.0" +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 +Require-Bundle: org.junit4 diff --git a/org.openhealthtools.mdht.uml.cda.util.test/build.properties b/org.openhealthtools.mdht.uml.cda.util.test/build.properties new file mode 100644 index 000000000..53fe9370a --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.util.test/build.properties @@ -0,0 +1,17 @@ +############################################################################### +# Copyright (c) 2010 Sean Muir and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Sean Muir (JKM Software) - initial API and implementation +############################################################################### +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + resource/ +src.includes = resource/ +jre.compilation.profile = J2SE-1.5 diff --git a/org.openhealthtools.mdht.uml.cda.util.test/resource/SampleCCDDocument.xml b/org.openhealthtools.mdht.uml.cda.util.test/resource/SampleCCDDocument.xml new file mode 100644 index 000000000..364ef0716 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.util.test/resource/SampleCCDDocument.xml @@ -0,0 +1,1606 @@ + + + + + + + + + + Good Health Clinic Continuity of Care Document + + + + + + + + + Henry + Levin + the 7th + + + + + + + Good Health Clinic + + + + + + + + + + + Good Health Clinic + + + + + + + + Good Health Clinic + + + + + + + + + + 17 Daws Rd. + Blue Bell + MA + 02368 + + + + + Kenneth + Ross + + + + + + + + + + + + Henrietta + Levin + + + + + + + + + + + + + + Dr.RobertDolin + + + + Good Health Clinic + + + + + + + + + + +
+ + + Summary Purpose + Transfer of care + + + + + + + + + + + + + +
+
+ + +
+ + + Payers + + + + + + + + + + + + + +
Payer namePolicy type / Coverage typeCovered party ID Authorization(s)
Good Health InsuranceExtended healthcare / Self14d4a520-7aae-11db-9fe1-0800200c9a66Colonoscopy
+
+ + + + + + + + + + + + + + + + + Good Health Insurance + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + Advance Directives + + + + + + + + + + + + + +
DirectiveDescriptionVerificationSupporting Document(s)
Resuscitation statusDo not resuscitateDr. Robert Dolin, Nov 07, 1999Advance directive
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + Functional Status + + + + + + + + + +
Functional Condition Effective Dates Condition Status
Dependence on cane1998Active
Memory impairment1999Active
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + Problems + + + + + + + + + + + +
ConditionEffective DatesCondition Status
Asthma1950Active
PneumoniaJan 1997Resolved
"Mar 1999Resolved
Myocardial InfarctionJan 1997Resolved
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + Family history + + Father (deceased) + + + + + + + + +
DiagnosisAge At Onset
Myocardial Infarction (cause of death)57
Hypertension40
+ Mother (alive) + + + + + + + +
DiagnosisAge At Onset
Asthma30
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + Social History + + + + + + + + + + +
Social History ElementDescriptionEffective Dates
Cigarette smoking1 pack per day1947 - 1972
"None1973 -
Alcohol consumptionNone1973 -
+
+ + + + + + + + 1 pack per day + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + None + + +
+
+ + +
+ + + Allergies, Adverse Reactions, Alerts + + + + + + + + + + +
SubstanceReactionStatus
PenicillinHivesActive
AspirinWheezingActive
CodeineNauseaActive
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + Medications + + + + + + + + + + + + +
MedicationInstructionsStart DateStatus
Albuterol inhalant2 puffs QID PRN wheezing Active
Clopidogrel (Plavix)75mg PO daily Active
Metoprolol25mg PO BID Active
Prednisone20mg PO dailyMar 28, 2000Active
Cephalexin (Keflex)500mg PO QID x 7 days (for bronchitis)Mar 28, 2000No longer active
+
+ + + + + + Good Health Clinic + + + + + + + + + + + + + + + + + + + + Albuterol inhalant + + + + + + + + + + + + + + + + + + + + + + + + + + + + Clopidogrel + + Plavix + + + + + + + + + + + + + + + + + + + + + Metoprolol + + + + + + + + + + + + + + + + + + + + + + + + + Prednisone + + + + + + + + + + + + + + + + + + + + + + + + + + Cephalexin + + Keflex + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + Medical Equipment + + + + + + + + + + +
Supply/DeviceDate Supplied
Automatic implantable cardioverter/defibrillatorNov 1999
Total hip replacement prosthesis1998
Wheelchair1999
+
+ + + + + +
+ + + + + + + + + + + + + + + +
+ + + + + + + + + + Good Health Prostheses Company + + + + + + + + + + +
+ + + + + + + + + + +
+
+ + +
+ + + Immunizations + + + + + + + + + + + +
VaccineDateStatus
Influenza virus vaccine, IMNov 1999Completed
Influenza virus vaccine, IMDec 1998Completed
Pneumococcal polysaccharide vaccine, IMDec 1998Completed
Tetanus and diphtheria toxoids, IM1997Completed
+
+ + + + + +
+ + + + + + + Influenza virus vaccine + + + + + + + + + + + +
+ + + + + + + Influenza virus vaccine + + + + + + + + + + + +
+ + + + + + + Pneumococcal polysaccharide vaccine + + + + + + + + + + + +
+ + + + + + + Tetanus and diphtheria toxoids + + + + + + +
+
+ + +
+ + + Vital Signs + + + + + + + + + + +
Date / Time: Nov 14, 1999April 7, 2000
Height177 cm177 cm
Weight86 kg88 kg
Blood Pressure132/86 mmHg145/88 mmHg
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + Results + + + + + + + + + + + + + + + + +
 March 23, 2000April 06, 2000
Hematology
HGB (M 13-18 g/dl; F 12-16 g/dl)13.2 
WBC (4.3-10.8 10+3/ul)6.7 
PLT (135-145 meq/l)123* 
Chemistry
NA (135-145meq/l) 140
K (3.5-5.0 meq/l) 4.0
CL (98-106 meq/l) 102
HCO3 (18-23 meq/l) 35*
+
+ + + + + + + + + + + + + + + + + + + M 13-18 g/dl; F 12-16 g/dl + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + Procedures + + + + + + + + +
ProcedureDate
Total hip replacement, left1998
+
+ + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ + + Encounters + + + + + + + + +
EncounterLocationDate
Checkup ExaminationGood Health ClinicApr 07, 2000
+
+ + + + + + Checkup Examination + + + + + + + + Good Health Clinic + + + + + +
+
+ + +
+ + + Plan + + + + + + + + +
Planned ActivityPlanned Date
Pulmonary function testApril 21, 2000
+
+ + + + + + +
+ + +
+
+
+
+
diff --git a/org.openhealthtools.mdht.uml.cda.util.test/resource/TemplateToolingPilot1.xml b/org.openhealthtools.mdht.uml.cda.util.test/resource/TemplateToolingPilot1.xml new file mode 100644 index 000000000..194513841 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.util.test/resource/TemplateToolingPilot1.xml @@ -0,0 +1,473 @@ + + + + + + + + + + + + + Public Health Case Report - Tuberculosis + + + + + + + + 2222 Home Street + Ann Arbor + MI + 99999 + USA + + + + + Eve + E + Everywoman + + + + + + + + USA + + + + + + + Good Health Hospital + + + + + + + + + + Good Health Hospital + + + + + + + + + + +
+ + + Clinical Information + + + Condition (Problem): Tuberculosis + Body site of Tuberculosis: Lung structure + Date of Diagnosis: December 30, 2008 + Problem Status: Active + Diagnosing Clinician: Dr. Patricia Primary, tel:+1-888-888-8888;ext=9999 + Age at Diagnosis: 25 + Pregnant during condition: Yes + Estimated delivery date: February 15, 2009 + Asymptomatic: No + Fever: Yes, onset December 26, 2008 + Chills: Yes, onset December 26, 2008 + Non-productive cough: Yes, onset December 20, 2008 + Productive cough: Yes, onset December 24, 2008 + Hemoptysis: No + Night sweats: Yes, onset December 29, 2008 + Weight loss: No + Chest pain: No + Patient general condition: Alive + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + Relevant diagnostic tests and/or laboratory data + + + Result observations: + Tuberculosis reaction wheal^3D post 1 TU ID: 10mmSputum culture: + Sputum collected Dec 15, 2008 at GHH Outpatient ClinicCollection procedure: Bronchoalveolar lavageMycobacterium tuberculosis + Pyrazinamide MIC: 0.05 ug/mL (S)Rifampin MIC: 0.04 ug/mL (S)Mycobacterium sp DNA: January 7, 2009: Detected + Imaging observations: + Radiologic infiltrate (Standard chest X-ray, Jan 07, 2009) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GHH Outpatient Clinic + + + + + + + + + + + + + + + + + + +
+
+
+
+
\ No newline at end of file diff --git a/org.openhealthtools.mdht.uml.cda.util.test/resource/TemplateToolingPilot2.xml b/org.openhealthtools.mdht.uml.cda.util.test/resource/TemplateToolingPilot2.xml new file mode 100644 index 000000000..bd58c3d74 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.util.test/resource/TemplateToolingPilot2.xml @@ -0,0 +1,469 @@ + + + + + + + + + + + + + Public Health Case Report - Tuberculosis + + + + + + + + 2222 Home Street + Ann Arbor + MI + 99999 + USA + + + + Eve Everywoman + + + + + + + USA + + + + + + + Good Health Hospital + + + + + + + + + + Good Health Hospital + + + + + + + + + + +
+ + + Clinical Information + + + Condition (Problem): Tuberculosis + Body site of Tuberculosis: Lung structure + Date of Diagnosis: December 30, 2008 + Problem Status: Active + Diagnosing Clinician: Dr. Patricia Primary, tel:+1-888-888-8888;ext=9999 + Age at Diagnosis: 25 + Pregnant during condition: Yes + Estimated delivery date: February 15, 2009 + Asymptomatic: No + Fever: Yes, onset December 26, 2008 + Chills: Yes, onset December 26, 2008 + Non-productive cough: Yes, onset December 20, 2008 + Productive cough: Yes, onset December 24, 2008 + Hemoptysis: No + Night sweats: Yes, onset December 29, 2008 + Weight loss: No + Chest pain: No + Patient general condition: Alive + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + Relevant diagnostic tests and/or laboratory data + + + Result observations: + Tuberculosis reaction wheal^3D post 1 TU ID: 10mmSputum culture: + Sputum collected Dec 15, 2008 at GHH Outpatient ClinicCollection procedure: Bronchoalveolar lavageMycobacterium tuberculosis + Pyrazinamide MIC: 0.05 ug/mL (S)Rifampin MIC: 0.04 ug/mL (S)Mycobacterium sp DNA: January 7, 2009: Detected + Imaging observations: + Radiologic infiltrate (Standard chest X-ray, Jan 07, 2009) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GHH Outpatient Clinic + + + + + + + + + + + + + + + + + + +
+
+
+
+
\ No newline at end of file diff --git a/org.openhealthtools.mdht.uml.cda.util.test/resource/TemplateToolingPilot3.xml b/org.openhealthtools.mdht.uml.cda.util.test/resource/TemplateToolingPilot3.xml new file mode 100644 index 000000000..944d14925 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.util.test/resource/TemplateToolingPilot3.xml @@ -0,0 +1,157 @@ + + + + + + + + + + + + + Public Health Case Report - Tuberculosis + + + + + + + + 2222 Home Street + Ann Arbor + MI + 99999 + USA + + + + + Eve + E + Everywoman + + + + + + + + USA + + + + + + + Good Health Hospital + + + + + + + + + + Good Health Hospital + + + + + + + + + + +
+ + + Relevant diagnostic tests and/or laboratory data + + + Result observations: + Tuberculosis reaction wheal^3D post 1 TU ID: 10mmSputum culture: + Sputum collected Dec 15, 2008 at GHH Outpatient ClinicCollection procedure: Bronchoalveolar lavageMycobacterium tuberculosis + Pyrazinamide MIC: 0.05 ug/mL (S)Rifampin MIC: 0.04 ug/mL (S)Mycobacterium sp DNA: January 7, 2009: Detected + Imaging observations: + Radiologic infiltrate (Standard chest X-ray, Jan 07, 2009) + + + + + + + + + + + + + + +
+
+
+
+
\ No newline at end of file diff --git a/org.openhealthtools.mdht.uml.cda.util.test/resource/TemplateToolingPilot4.xml b/org.openhealthtools.mdht.uml.cda.util.test/resource/TemplateToolingPilot4.xml new file mode 100644 index 000000000..80c7b0a8d --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.util.test/resource/TemplateToolingPilot4.xml @@ -0,0 +1,271 @@ + + + + + + + + + + + + + Public Health Case Report - Tuberculosis + + + + + + + + 2222 Home Street + Ann Arbor + MI + 99999 + USA + + + + + Eve + E + Everywoman + + + + + + + + USA + + + + + + + Good Health Hospital + + + + + + + + + + Good Health Hospital + + + + + + + + + + +
+ + + Relevant diagnostic tests and/or laboratory data + + + Result observations: + Tuberculosis reaction wheal^3D post 1 TU ID: 10mmSputum culture: + Sputum collected Dec 15, 2008 at GHH Outpatient ClinicCollection procedure: Bronchoalveolar lavageMycobacterium tuberculosis + Pyrazinamide MIC: 0.05 ug/mL (S)Rifampin MIC: 0.04 ug/mL (S)Mycobacterium sp DNA: January 7, 2009: Detected + Imaging observations: + Radiologic infiltrate (Standard chest X-ray, Jan 07, 2009) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GHH Outpatient Clinic + + + + + + + + + + + + + + + + + + +
+
+
+
+
\ No newline at end of file diff --git a/org.openhealthtools.mdht.uml.cda.util.test/resource/TemplateToolingPilot5.xml b/org.openhealthtools.mdht.uml.cda.util.test/resource/TemplateToolingPilot5.xml new file mode 100644 index 000000000..b8a884eb3 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.util.test/resource/TemplateToolingPilot5.xml @@ -0,0 +1,271 @@ + + + + + + + + + + + + + Public Health Case Report - Tuberculosis + + + + + + + + 2222 Home Street + Ann Arbor + MI + 99999 + USA + + + + + Eve + E + Everywoman + + + + + + + + USA + + + + + + + Good Health Hospital + + + + + + + + + + Good Health Hospital + + + + + + + + + + +
+ + + Results + + + Result observations: + Tuberculosis reaction wheal^3D post 1 TU ID: 10mmSputum culture: + Sputum collected Dec 15, 2008 at GHH Outpatient ClinicCollection procedure: Bronchoalveolar lavageMycobacterium tuberculosis + Pyrazinamide MIC: 0.05 ug/mL (S)Rifampin MIC: 0.04 ug/mL (S)Mycobacterium sp DNA: January 7, 2009: Detected + Imaging observations: + Radiologic infiltrate (Standard chest X-ray, Jan 07, 2009) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GHH Outpatient Clinic + + + + + + + + + + + + + + + + + + +
+
+
+
+
\ No newline at end of file diff --git a/org.openhealthtools.mdht.uml.cda.util.test/resource/TemplateToolingPilot6.xml b/org.openhealthtools.mdht.uml.cda.util.test/resource/TemplateToolingPilot6.xml new file mode 100644 index 000000000..004106556 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.util.test/resource/TemplateToolingPilot6.xml @@ -0,0 +1,157 @@ + + + + + + + + + + + + + Public Health Case Report - Tuberculosis + + + + + + + + 2222 Home Street + Ann Arbor + MI + 99999 + USA + + + + + Eve + E + Everywoman + + + + + + + + USA + + + + + + + Good Health Hospital + + + + + + + + + + Good Health Hospital + + + + + + + + + + +
+ + + Relevant diagnostic tests and/or laboratory data + + + Result observations: + Tuberculosis reaction wheal^3D post 1 TU ID: 10mmSputum culture: + Sputum collected Dec 15, 2008 at GHH Outpatient ClinicCollection procedure: Bronchoalveolar lavageMycobacterium tuberculosis + Pyrazinamide MIC: 0.05 ug/mL (S)Rifampin MIC: 0.04 ug/mL (S)Mycobacterium sp DNA: January 7, 2009: Detected + Imaging observations: + Radiologic infiltrate (Standard chest X-ray, Jan 07, 2009) + + + + + + + + + + + + + + +
+
+
+
+
\ No newline at end of file diff --git a/org.openhealthtools.mdht.uml.cda.util.test/resource/TemplateToolingPilot7.xml b/org.openhealthtools.mdht.uml.cda.util.test/resource/TemplateToolingPilot7.xml new file mode 100644 index 000000000..7b99a22c5 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.util.test/resource/TemplateToolingPilot7.xml @@ -0,0 +1,259 @@ + + + + + + + + + + + + + Public Health Case Report - Tuberculosis + + + + + + + + 2222 Home Street + Ann Arbor + MI + 99999 + USA + + + + + Eve + E + Everywoman + + + + + + + + USA + + + + + + + Good Health Hospital + + + + + + + + + + Good Health Hospital + + + + + + + + + + +
+ + + Relevant diagnostic tests and/or laboratory data + + + Result observations: + Tuberculosis reaction wheal^3D post 1 TU ID: 10mmSputum culture: + Sputum collected Dec 15, 2008 at GHH Outpatient ClinicCollection procedure: Bronchoalveolar lavageMycobacterium tuberculosis + Pyrazinamide MIC: 0.05 ug/mL (S)Rifampin MIC: 0.04 ug/mL (S)Mycobacterium sp DNA: January 7, 2009: Detected + Imaging observations: + Radiologic infiltrate (Standard chest X-ray, Jan 07, 2009) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GHH Outpatient Clinic + + + + + + + + + + + + + + + + + + +
+
+
+
+
\ No newline at end of file diff --git a/org.openhealthtools.mdht.uml.cda.util.test/src/org/openhealttools/mdht/uml/cda/util/test/TestCDAPackageLoad.java b/org.openhealthtools.mdht.uml.cda.util.test/src/org/openhealttools/mdht/uml/cda/util/test/TestCDAPackageLoad.java new file mode 100644 index 000000000..c6bfa50e9 --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.util.test/src/org/openhealttools/mdht/uml/cda/util/test/TestCDAPackageLoad.java @@ -0,0 +1,23 @@ +/******************************************************************************* + * Copyright (c) 2010 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealttools.mdht.uml.cda.util.test; + +import org.junit.Test; +import org.openhealthtools.mdht.uml.cda.util.CDAUtil; + +public class TestCDAPackageLoad { + + @Test + public void testLoadPackages() { + CDAUtil.loadPackages(); + } + +} diff --git a/org.openhealthtools.mdht.uml.cda.util.test/src/org/openhealttools/mdht/uml/cda/util/test/TestCDAUtil.java b/org.openhealthtools.mdht.uml.cda.util.test/src/org/openhealttools/mdht/uml/cda/util/test/TestCDAUtil.java new file mode 100644 index 000000000..ccc26f88e --- /dev/null +++ b/org.openhealthtools.mdht.uml.cda.util.test/src/org/openhealttools/mdht/uml/cda/util/test/TestCDAUtil.java @@ -0,0 +1,61 @@ +/******************************************************************************* + * Copyright (c) 2010 Sean Muir and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Sean Muir (JKM Software) - initial API and implementation + *******************************************************************************/ +package org.openhealttools.mdht.uml.cda.util.test; + +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.InputStream; + +import junit.framework.TestCase; + +import org.eclipse.emf.common.CommonPlugin; +import org.eclipse.emf.common.util.URI; +import org.openhealthtools.mdht.uml.cda.ClinicalDocument; +import org.openhealthtools.mdht.uml.cda.impl.ClinicalDocumentImpl; +import org.openhealthtools.mdht.uml.cda.util.CDAUtil; + +public class TestCDAUtil extends TestCase { + final static String SAMPLECCDDOCUMENT = "platform:/fragment/org.openhealthtools.mdht.uml.cda.util.test/resource/SampleCCDDocument.xml"; + + public TestCDAUtil(String name) { + super(name); + } + + @Override + protected void setUp() throws Exception { + } + + @Override + protected void tearDown() throws Exception { + } + + public void testLoadInputStream() { + URI sampleCCDURI = URI.createURI(SAMPLECCDDOCUMENT, false); + sampleCCDURI = CommonPlugin.resolve(sampleCCDURI); + ClinicalDocument testDocument = null; + InputStream input; + if (sampleCCDURI.isFile()) { + try { + input = new FileInputStream(sampleCCDURI.path()); + testDocument = CDAUtil.load(input); + } catch (FileNotFoundException e) { + e.printStackTrace(); + } catch (Exception e) { + e.printStackTrace(); + } + } + assertNotNull(testDocument); + assertFalse( + "CDAUtil.load did not create CCD document, instead created document of type " + + testDocument.getClass().getName(), + testDocument.getClass().getName().equals(ClinicalDocumentImpl.class.getName())); + } +}