openehr 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.rspec +2 -0
- data/.travis.yml +3 -0
- data/Gemfile +23 -0
- data/Guardfile +12 -0
- data/History.txt +36 -0
- data/PostInstall.txt +9 -0
- data/README.rdoc +82 -0
- data/Rakefile +44 -0
- data/VERSION +1 -0
- data/doc/openehr_terminology.xml +2700 -0
- data/lib/openehr.rb +11 -0
- data/lib/openehr/am.rb +8 -0
- data/lib/openehr/am/archetype.rb +133 -0
- data/lib/openehr/am/archetype/assertion.rb +190 -0
- data/lib/openehr/am/archetype/constraint_model.rb +328 -0
- data/lib/openehr/am/archetype/constraint_model/primitive.rb +327 -0
- data/lib/openehr/am/archetype/ontology.rb +126 -0
- data/lib/openehr/am/openehr_profile.rb +9 -0
- data/lib/openehr/am/openehr_profile/data_types.rb +13 -0
- data/lib/openehr/am/openehr_profile/data_types/basic.rb +114 -0
- data/lib/openehr/am/openehr_profile/data_types/quantity.rb +67 -0
- data/lib/openehr/am/openehr_profile/data_types/text.rb +22 -0
- data/lib/openehr/assumed_library_types.rb +691 -0
- data/lib/openehr/parser.rb +23 -0
- data/lib/openehr/parser/adl.rb +57 -0
- data/lib/openehr/parser/adl_grammar.tt +245 -0
- data/lib/openehr/parser/adl_parser.rb +52 -0
- data/lib/openehr/parser/cadl_grammar.tt +1527 -0
- data/lib/openehr/parser/cadl_node.rb +44 -0
- data/lib/openehr/parser/dadl.rb +13 -0
- data/lib/openehr/parser/dadl_grammar.tt +358 -0
- data/lib/openehr/parser/exception.rb +68 -0
- data/lib/openehr/parser/shared_token_grammar.tt +1229 -0
- data/lib/openehr/parser/validator.rb +19 -0
- data/lib/openehr/parser/xml_perser.rb +13 -0
- data/lib/openehr/rm.rb +15 -0
- data/lib/openehr/rm/common.rb +14 -0
- data/lib/openehr/rm/common/archetyped.rb +182 -0
- data/lib/openehr/rm/common/change_control.rb +332 -0
- data/lib/openehr/rm/common/directory.rb +29 -0
- data/lib/openehr/rm/common/generic.rb +216 -0
- data/lib/openehr/rm/common/resource.rb +154 -0
- data/lib/openehr/rm/composition.rb +103 -0
- data/lib/openehr/rm/composition/content.rb +22 -0
- data/lib/openehr/rm/composition/content/entry.rb +253 -0
- data/lib/openehr/rm/composition/content/navigation.rb +31 -0
- data/lib/openehr/rm/data_structures.rb +25 -0
- data/lib/openehr/rm/data_structures/history.rb +117 -0
- data/lib/openehr/rm/data_structures/item_structure.rb +218 -0
- data/lib/openehr/rm/data_structures/item_structure/representation.rb +63 -0
- data/lib/openehr/rm/data_types.rb +14 -0
- data/lib/openehr/rm/data_types/basic.rb +108 -0
- data/lib/openehr/rm/data_types/charset.lst +818 -0
- data/lib/openehr/rm/data_types/charset_extract.rb +24 -0
- data/lib/openehr/rm/data_types/encapsulated.rb +98 -0
- data/lib/openehr/rm/data_types/quantity.rb +402 -0
- data/lib/openehr/rm/data_types/quantity/date_time.rb +256 -0
- data/lib/openehr/rm/data_types/text.rb +169 -0
- data/lib/openehr/rm/data_types/time_specification.rb +75 -0
- data/lib/openehr/rm/data_types/uri.rb +83 -0
- data/lib/openehr/rm/demographic.rb +269 -0
- data/lib/openehr/rm/ehr.rb +162 -0
- data/lib/openehr/rm/integration.rb +27 -0
- data/lib/openehr/rm/security.rb +12 -0
- data/lib/openehr/rm/support.rb +14 -0
- data/lib/openehr/rm/support/definition.rb +15 -0
- data/lib/openehr/rm/support/identification.rb +412 -0
- data/lib/openehr/rm/support/measurement.rb +17 -0
- data/lib/openehr/rm/support/terminology.rb +135 -0
- data/lib/openehr/serializer.rb +272 -0
- data/lib/openehr/terminology.rb +7 -0
- data/lib/openehr/terminology/open_ehr_terminology.rb +41 -0
- data/lib/openehr/writer.rb +12 -0
- data/openehr.gemspec +472 -0
- data/spec/lib/openehr/am/archetype/archetype_spec.rb +103 -0
- data/spec/lib/openehr/am/archetype/assertion/assertion_spec.rb +60 -0
- data/spec/lib/openehr/am/archetype/assertion/assertion_variable_spec.rb +30 -0
- data/spec/lib/openehr/am/archetype/assertion/expr_binary_operator.rb +40 -0
- data/spec/lib/openehr/am/archetype/assertion/expr_item_spec.rb +28 -0
- data/spec/lib/openehr/am/archetype/assertion/expr_leaf_spec.rb +34 -0
- data/spec/lib/openehr/am/archetype/assertion/expr_operator_spec.rb +25 -0
- data/spec/lib/openehr/am/archetype/assertion/expr_unary_operator_spec.rb +26 -0
- data/spec/lib/openehr/am/archetype/assertion/operator_kind_spec.rb +114 -0
- data/spec/lib/openehr/am/archetype/constraint_model/archetype_constraint_spec.rb +56 -0
- data/spec/lib/openehr/am/archetype/constraint_model/archetype_internal_ref_spec.rb +36 -0
- data/spec/lib/openehr/am/archetype/constraint_model/archetype_slot_spec.rb +61 -0
- data/spec/lib/openehr/am/archetype/constraint_model/c_attribute_spec.rb +59 -0
- data/spec/lib/openehr/am/archetype/constraint_model/c_complex_object_spec.rb +39 -0
- data/spec/lib/openehr/am/archetype/constraint_model/c_defined_object_spec.rb +53 -0
- data/spec/lib/openehr/am/archetype/constraint_model/c_domain_type_spec.rb +25 -0
- data/spec/lib/openehr/am/archetype/constraint_model/c_multiple_attribute_spec.rb +23 -0
- data/spec/lib/openehr/am/archetype/constraint_model/c_object_spec.rb +61 -0
- data/spec/lib/openehr/am/archetype/constraint_model/c_primitive_object_spec.rb +33 -0
- data/spec/lib/openehr/am/archetype/constraint_model/c_reference_object_spec.rb +17 -0
- data/spec/lib/openehr/am/archetype/constraint_model/c_single_attribute_spec.rb +22 -0
- data/spec/lib/openehr/am/archetype/constraint_model/cardinality_spec.rb +68 -0
- data/spec/lib/openehr/am/archetype/constraint_model/constraint_ref_spec.rb +29 -0
- data/spec/lib/openehr/am/archetype/constraint_model/primitive/c_boolean_spec.rb +57 -0
- data/spec/lib/openehr/am/archetype/constraint_model/primitive/c_date_spec.rb +52 -0
- data/spec/lib/openehr/am/archetype/constraint_model/primitive/c_date_time_spec.rb +136 -0
- data/spec/lib/openehr/am/archetype/constraint_model/primitive/c_duration_spec.rb +41 -0
- data/spec/lib/openehr/am/archetype/constraint_model/primitive/c_integer_spec.rb +67 -0
- data/spec/lib/openehr/am/archetype/constraint_model/primitive/c_primitive_spec.rb +41 -0
- data/spec/lib/openehr/am/archetype/constraint_model/primitive/c_real_spec.rb +19 -0
- data/spec/lib/openehr/am/archetype/constraint_model/primitive/c_string_spec.rb +73 -0
- data/spec/lib/openehr/am/archetype/constraint_model/primitive/c_time_spec.rb +104 -0
- data/spec/lib/openehr/am/archetype/ontology/archetype_ontology_spec.rb +97 -0
- data/spec/lib/openehr/am/archetype/ontology/archetype_term_spec.rb +43 -0
- data/spec/lib/openehr/am/archetype/validity_kind_spec.rb +42 -0
- data/spec/lib/openehr/am/openehr_profile/data_types/basic/c_dv_state_spec.rb +34 -0
- data/spec/lib/openehr/am/openehr_profile/data_types/basic/non_terminal_state_spec.rb +36 -0
- data/spec/lib/openehr/am/openehr_profile/data_types/basic/state_machine_spec.rb +34 -0
- data/spec/lib/openehr/am/openehr_profile/data_types/basic/state_spec.rb +26 -0
- data/spec/lib/openehr/am/openehr_profile/data_types/basic/terminal_state_spec.rb +18 -0
- data/spec/lib/openehr/am/openehr_profile/data_types/basic/transition_spec.rb +62 -0
- data/spec/lib/openehr/am/openehr_profile/data_types/quantity/c_dv_ordinal_spec.rb +41 -0
- data/spec/lib/openehr/am/openehr_profile/data_types/quantity/c_dv_quantity_spec.rb +50 -0
- data/spec/lib/openehr/am/openehr_profile/data_types/quantity/c_quantity_item_spec.rb +46 -0
- data/spec/lib/openehr/am/openehr_profile/data_types/text/c_code_phrase_spec.rb +34 -0
- data/spec/lib/openehr/assumed_library_types/interval_spec.rb +145 -0
- data/spec/lib/openehr/assumed_library_types/iso8601_date_spec.rb +236 -0
- data/spec/lib/openehr/assumed_library_types/iso8601_date_time_spec.rb +47 -0
- data/spec/lib/openehr/assumed_library_types/iso8601_duration_spec.rb +150 -0
- data/spec/lib/openehr/assumed_library_types/iso8601_time_spec.rb +234 -0
- data/spec/lib/openehr/assumed_library_types/iso8601_timezone_spec.rb +57 -0
- data/spec/lib/openehr/assumed_library_types/time_definitions_spec.rb +136 -0
- data/spec/lib/openehr/assumed_library_types/timezone_spec.rb +42 -0
- data/spec/lib/openehr/parser/adl14/adl-test-ENTRY.assumed_types.v1.adl +88 -0
- data/spec/lib/openehr/parser/adl14/adl-test-ENTRY.basic_types.v1.adl +143 -0
- data/spec/lib/openehr/parser/adl14/adl-test-ENTRY.basic_types_fail.v1.adl +50 -0
- data/spec/lib/openehr/parser/adl14/adl-test-ENTRY.most_minimal.v1.adl +27 -0
- data/spec/lib/openehr/parser/adl14/adl-test-ENTRY.structure_test1.v1.adl +46 -0
- data/spec/lib/openehr/parser/adl14/adl-test-SOME_TYPE.generic_type_basic.draft.adl +56 -0
- data/spec/lib/openehr/parser/adl14/adl-test-SOME_TYPE.generic_type_use_node.draft.adl +63 -0
- data/spec/lib/openehr/parser/adl14/adl-test-car.paths.test.adl +80 -0
- data/spec/lib/openehr/parser/adl14/adl-test-car.use_node.test.adl +87 -0
- data/spec/lib/openehr/parser/adl14/adl-test-composition.dv_coded_text.test.adl +29 -0
- data/spec/lib/openehr/parser/adl14/adl-test-entry.archetype_bindings.test.adl +47 -0
- data/spec/lib/openehr/parser/adl14/adl-test-entry.archetype_desc_missing_purpose.test.adl +45 -0
- data/spec/lib/openehr/parser/adl14/adl-test-entry.archetype_description.test.adl +61 -0
- data/spec/lib/openehr/parser/adl14/adl-test-entry.archetype_description2.test.adl +45 -0
- data/spec/lib/openehr/parser/adl14/adl-test-entry.archetype_identification.test.adl +26 -0
- data/spec/lib/openehr/parser/adl14/adl-test-entry.archetype_internal_ref.test.adl +36 -0
- data/spec/lib/openehr/parser/adl14/adl-test-entry.archetype_internal_ref2.test.adl +36 -0
- data/spec/lib/openehr/parser/adl14/adl-test-entry.archetype_language.test.adl +47 -0
- data/spec/lib/openehr/parser/adl14/adl-test-entry.archetype_language_no_accreditation.test.adl +38 -0
- data/spec/lib/openehr/parser/adl14/adl-test-entry.archetype_language_order_of_translation_details.test.adl +40 -0
- data/spec/lib/openehr/parser/adl14/adl-test-entry.archetype_ontology.test.adl +25 -0
- data/spec/lib/openehr/parser/adl14/adl-test-entry.archetype_slot.test.adl +40 -0
- data/spec/lib/openehr/parser/adl14/adl-test-entry.archetype_slot.test2.adl +37 -0
- data/spec/lib/openehr/parser/adl14/adl-test-entry.archetype_uncommonkeys.test.adl +29 -0
- data/spec/lib/openehr/parser/adl14/adl-test-entry.basic_types.test.adl +272 -0
- data/spec/lib/openehr/parser/adl14/adl-test-entry.c_code_phrase.test.adl +77 -0
- data/spec/lib/openehr/parser/adl14/adl-test-entry.c_dv_ordinal.test.adl +66 -0
- data/spec/lib/openehr/parser/adl14/adl-test-entry.c_dv_quantity_empty.test.adl +46 -0
- data/spec/lib/openehr/parser/adl14/adl-test-entry.c_dv_quantity_full.test.adl +64 -0
- data/spec/lib/openehr/parser/adl14/adl-test-entry.c_dv_quantity_full2.test.adl +64 -0
- data/spec/lib/openehr/parser/adl14/adl-test-entry.c_dv_quantity_full3.test.adl +64 -0
- data/spec/lib/openehr/parser/adl14/adl-test-entry.c_dv_quantity_item_units_only.test.adl +55 -0
- data/spec/lib/openehr/parser/adl14/adl-test-entry.c_dv_quantity_list.test.adl +58 -0
- data/spec/lib/openehr/parser/adl14/adl-test-entry.c_dv_quantity_property.test.adl +47 -0
- data/spec/lib/openehr/parser/adl14/adl-test-entry.c_dv_quantity_reversed.test.adl +59 -0
- data/spec/lib/openehr/parser/adl14/adl-test-entry.constraint_binding.test.adl +37 -0
- data/spec/lib/openehr/parser/adl14/adl-test-entry.constraint_ref.test.adl +43 -0
- data/spec/lib/openehr/parser/adl14/adl-test-entry.datetime.test.adl +183 -0
- data/spec/lib/openehr/parser/adl14/adl-test-entry.domain_types.test.adl +97 -0
- data/spec/lib/openehr/parser/adl14/adl-test-entry.durations.test.adl +109 -0
- data/spec/lib/openehr/parser/adl14/adl-test-entry.empty_other_contributors.test.adl +42 -0
- data/spec/lib/openehr/parser/adl14/adl-test-entry.missing_language.test.adl +23 -0
- data/spec/lib/openehr/parser/adl14/adl-test-entry.mixed_node_types.draft.adl +61 -0
- data/spec/lib/openehr/parser/adl14/adl-test-entry.most_minimal.test.adl +23 -0
- data/spec/lib/openehr/parser/adl14/adl-test-entry.multi_language.test.adl +52 -0
- data/spec/lib/openehr/parser/adl14/adl-test-entry.special_string.test.adl +88 -0
- data/spec/lib/openehr/parser/adl14/adl-test-entry.structure_test1.test.adl +45 -0
- data/spec/lib/openehr/parser/adl14/adl-test-entry.structure_test2.test.adl +45 -0
- data/spec/lib/openehr/parser/adl14/adl-test-entry.term_binding.test.adl +37 -0
- data/spec/lib/openehr/parser/adl14/adl-test-entry.term_binding2.test.adl +32 -0
- data/spec/lib/openehr/parser/adl14/adl-test-entry.testtranslations.test.adl +83 -0
- data/spec/lib/openehr/parser/adl14/adl-test-entry.translations_author_language.test.adl +34 -0
- data/spec/lib/openehr/parser/adl14/adl-test-entry.translations_language_author.test.adl +34 -0
- data/spec/lib/openehr/parser/adl14/adl-test-entry.unicode_BOM_support.test.adl +41 -0
- data/spec/lib/openehr/parser/adl14/adl-test-entry.unicode_support.test.adl +41 -0
- data/spec/lib/openehr/parser/adl14/openEHR-EHR-ACTION.imaging.v1.adl +275 -0
- data/spec/lib/openehr/parser/adl14/openEHR-EHR-ACTION.referral.v1.adl +351 -0
- data/spec/lib/openehr/parser/adl14/openEHR-EHR-CLUSTER.auscultation-chest.v1.adl +765 -0
- data/spec/lib/openehr/parser/adl14/openEHR-EHR-CLUSTER.auscultation.v1.adl +48 -0
- data/spec/lib/openehr/parser/adl14/openEHR-EHR-CLUSTER.dimensions-circumference.v1.adl +134 -0
- data/spec/lib/openehr/parser/adl14/openEHR-EHR-CLUSTER.dimensions.v1.adl +241 -0
- data/spec/lib/openehr/parser/adl14/openEHR-EHR-CLUSTER.exam-abdomen.v1.adl +321 -0
- data/spec/lib/openehr/parser/adl14/openEHR-EHR-CLUSTER.exam-chest.v1.adl +379 -0
- data/spec/lib/openehr/parser/adl14/openEHR-EHR-CLUSTER.exam-fetus.v1.adl +577 -0
- data/spec/lib/openehr/parser/adl14/openEHR-EHR-CLUSTER.exam-generic-joint.v1.adl +146 -0
- data/spec/lib/openehr/parser/adl14/openEHR-EHR-CLUSTER.exam-generic-lymphnode.v1.adl +176 -0
- data/spec/lib/openehr/parser/adl14/openEHR-EHR-CLUSTER.exam-generic-mass.v1.adl +221 -0
- data/spec/lib/openehr/parser/adl14/openEHR-EHR-CLUSTER.exam-generic.v1.adl +139 -0
- data/spec/lib/openehr/parser/adl14/openEHR-EHR-CLUSTER.exam-nervous_system.v1.adl +116 -0
- data/spec/lib/openehr/parser/adl14/openEHR-EHR-CLUSTER.exam-uterine_cervix.v1.adl +420 -0
- data/spec/lib/openehr/parser/adl14/openEHR-EHR-CLUSTER.exam-uterus.v1.adl +293 -0
- data/spec/lib/openehr/parser/adl14/openEHR-EHR-COMPOSITION.discharge.v1draft.adl +53 -0
- data/spec/lib/openehr/parser/adl14/openEHR-EHR-COMPOSITION.encounter.v1draft.adl +45 -0
- data/spec/lib/openehr/parser/adl14/openEHR-EHR-EVALUATION.adverse.v1.adl +411 -0
- data/spec/lib/openehr/parser/adl14/openEHR-EHR-EVALUATION.columna_vertebral.v1.adl +85 -0
- data/spec/lib/openehr/parser/adl14/openEHR-EHR-INSTRUCTION.medication.v1.adl +88 -0
- data/spec/lib/openehr/parser/adl14/openEHR-EHR-INSTRUCTION.referral.v1.adl +84 -0
- data/spec/lib/openehr/parser/adl14/openEHR-EHR-ITEM_TREE.Laboratory_request.v1.adl +492 -0
- data/spec/lib/openehr/parser/adl14/openEHR-EHR-ITEM_TREE.follow_up.v1draft.adl +94 -0
- data/spec/lib/openehr/parser/adl14/openEHR-EHR-ITEM_TREE.imaging.v1.adl +127 -0
- data/spec/lib/openehr/parser/adl14/openEHR-EHR-ITEM_TREE.medication-formulation.v1.adl +457 -0
- data/spec/lib/openehr/parser/adl14/openEHR-EHR-ITEM_TREE.medication.v1.adl +869 -0
- data/spec/lib/openehr/parser/adl14/openEHR-EHR-ITEM_TREE.referral.v1.adl +494 -0
- data/spec/lib/openehr/parser/adl14/openEHR-EHR-OBSERVATION.apgar.v1.adl +545 -0
- data/spec/lib/openehr/parser/adl14/openEHR-EHR-OBSERVATION.blood_pressure.v1.adl +673 -0
- data/spec/lib/openehr/parser/adl14/openEHR-EHR-OBSERVATION.body_mass_index.v1.adl +166 -0
- data/spec/lib/openehr/parser/adl14/openEHR-EHR-OBSERVATION.lab_test.v1.adl +376 -0
- data/spec/lib/openehr/parser/adl14/openEHR-EHR-OBSERVATION.testassumedvalue.v1.adl +99 -0
- data/spec/lib/openehr/parser/adl14/openEHR-EHR-SECTION.findings.v1.adl +47 -0
- data/spec/lib/openehr/parser/adl14/openEHR-EHR-SECTION.reason_for_encounter.v1.adl +51 -0
- data/spec/lib/openehr/parser/adl14/openEHR-EHR-SECTION.summary.v1.adl +52 -0
- data/spec/lib/openehr/parser/adl14/openEHR-EHR-SECTION.vital_signs.v1.adl +54 -0
- data/spec/lib/openehr/parser/adl_archetype_internal_ref2_spec.rb +42 -0
- data/spec/lib/openehr/parser/adl_archetype_internal_ref_spec.rb +125 -0
- data/spec/lib/openehr/parser/adl_archetype_internal_ref_with_generics_spec.rb +258 -0
- data/spec/lib/openehr/parser/adl_archetype_ontology_binding_spec.rb +98 -0
- data/spec/lib/openehr/parser/adl_archetype_ontology_spec.rb +42 -0
- data/spec/lib/openehr/parser/adl_archetype_slot_cluster_spec.rb +101 -0
- data/spec/lib/openehr/parser/adl_archetype_slot_spec.rb +193 -0
- data/spec/lib/openehr/parser/adl_archetype_uncommon_term_keys_spec.rb +25 -0
- data/spec/lib/openehr/parser/adl_description_spec.rb +164 -0
- data/spec/lib/openehr/parser/adl_identification_spec.rb +18 -0
- data/spec/lib/openehr/parser/adl_language_no_accreditation_spec.rb +66 -0
- data/spec/lib/openehr/parser/adl_language_order_spec.rb +68 -0
- data/spec/lib/openehr/parser/adl_language_spec.rb +119 -0
- data/spec/lib/openehr/parser/adl_language_translation_author_language_spec.rb +50 -0
- data/spec/lib/openehr/parser/adl_language_translation_language_author_spec.rb +46 -0
- data/spec/lib/openehr/parser/adl_parser_spec.rb +347 -0
- data/spec/lib/openehr/parser/adl_path_spec.rb +176 -0
- data/spec/lib/openehr/parser/base_spec.rb +19 -0
- data/spec/lib/openehr/parser/basic_generic_type_spec.rb +18 -0
- data/spec/lib/openehr/parser/basic_type_spec.rb +2922 -0
- data/spec/lib/openehr/parser/c_dv_quantity_any_allowed_spec.rb +34 -0
- data/spec/lib/openehr/parser/c_dv_quantity_shared_example_for_lacked_items_spec.rb +36 -0
- data/spec/lib/openehr/parser/c_dv_quantity_shared_example_spec.rb +146 -0
- data/spec/lib/openehr/parser/cdv_ordinal_parse_spec.rb +231 -0
- data/spec/lib/openehr/parser/code_phrase_spec.rb +96 -0
- data/spec/lib/openehr/parser/constraint_binding_spec.rb +26 -0
- data/spec/lib/openehr/parser/constraint_ref_spec.rb +32 -0
- data/spec/lib/openehr/parser/date_time_spec.rb +1953 -0
- data/spec/lib/openehr/parser/duration_spec.rb +475 -0
- data/spec/lib/openehr/parser/dv_coded_text_parse_spec.rb +27 -0
- data/spec/lib/openehr/parser/empty_other_contributors_spec.rb +19 -0
- data/spec/lib/openehr/parser/lab_test_parser_spec.rb +14 -0
- data/spec/lib/openehr/parser/missing_language_spec.rb +20 -0
- data/spec/lib/openehr/parser/missing_purpose_spec.rb +23 -0
- data/spec/lib/openehr/parser/mixed_node_types_spec.rb +16 -0
- data/spec/lib/openehr/parser/most_minimal_adl_spec.rb +19 -0
- data/spec/lib/openehr/parser/multi_language_spec.rb +58 -0
- data/spec/lib/openehr/parser/parser_spec_helper.rb +7 -0
- data/spec/lib/openehr/parser/path_based_terminology_binding_spec.rb +30 -0
- data/spec/lib/openehr/parser/special_string_spec.rb +20 -0
- data/spec/lib/openehr/parser/structure_comment_spec.rb +21 -0
- data/spec/lib/openehr/parser/structure_nested_comments_spec.rb +22 -0
- data/spec/lib/openehr/parser/structure_spec.rb +202 -0
- data/spec/lib/openehr/parser/term_binding_spec.rb +54 -0
- data/spec/lib/openehr/parser/unicode_bom_spec.rb +17 -0
- data/spec/lib/openehr/parser/unicode_support_spec.rb +46 -0
- data/spec/lib/openehr/rm/common/archetyped/archetyped_spec.rb +50 -0
- data/spec/lib/openehr/rm/common/archetyped/feeder_audit_details_spec.rb +60 -0
- data/spec/lib/openehr/rm/common/archetyped/feeder_audit_spec.rb +51 -0
- data/spec/lib/openehr/rm/common/archetyped/link_spec.rb +42 -0
- data/spec/lib/openehr/rm/common/archetyped/locatable_spec.rb +89 -0
- data/spec/lib/openehr/rm/common/archetyped/pathable_spec.rb +42 -0
- data/spec/lib/openehr/rm/common/change_control/contribution_spec.rb +56 -0
- data/spec/lib/openehr/rm/common/change_control/imported_version_spec.rb +62 -0
- data/spec/lib/openehr/rm/common/change_control/original_version_spec.rb +71 -0
- data/spec/lib/openehr/rm/common/change_control/version_spec.rb +91 -0
- data/spec/lib/openehr/rm/common/change_control/versioned_object_spec.rb +284 -0
- data/spec/lib/openehr/rm/common/directory/folder_spec.rb +26 -0
- data/spec/lib/openehr/rm/common/generic/attestation_spec.rb +62 -0
- data/spec/lib/openehr/rm/common/generic/audit_details_spec.rb +51 -0
- data/spec/lib/openehr/rm/common/generic/participation_spec.rb +36 -0
- data/spec/lib/openehr/rm/common/generic/party_identified_spec.rb +64 -0
- data/spec/lib/openehr/rm/common/generic/party_proxy_spec.rb +18 -0
- data/spec/lib/openehr/rm/common/generic/party_related_spec.rb +24 -0
- data/spec/lib/openehr/rm/common/generic/revision_history_item_spec.rb +43 -0
- data/spec/lib/openehr/rm/common/generic/revision_history_spec.rb +45 -0
- data/spec/lib/openehr/rm/common/resource/authored_resource_spec.rb +68 -0
- data/spec/lib/openehr/rm/common/resource/resource_description_item_spec.rb +105 -0
- data/spec/lib/openehr/rm/common/resource/resource_description_spec.rb +74 -0
- data/spec/lib/openehr/rm/common/resource/translation_details_spec.rb +35 -0
- data/spec/lib/openehr/rm/composition/composition_spec.rb +92 -0
- data/spec/lib/openehr/rm/composition/content/content_item_spec.rb +14 -0
- data/spec/lib/openehr/rm/composition/content/entry/action_spec.rb +69 -0
- data/spec/lib/openehr/rm/composition/content/entry/activity_spec.rb +61 -0
- data/spec/lib/openehr/rm/composition/content/entry/admin_entry_spec.rb +38 -0
- data/spec/lib/openehr/rm/composition/content/entry/care_entry_spec.rb +37 -0
- data/spec/lib/openehr/rm/composition/content/entry/entry_spec.rb +98 -0
- data/spec/lib/openehr/rm/composition/content/entry/evaluation_spec.rb +37 -0
- data/spec/lib/openehr/rm/composition/content/entry/instruction_details_spec.rb +51 -0
- data/spec/lib/openehr/rm/composition/content/entry/instruction_spec.rb +62 -0
- data/spec/lib/openehr/rm/composition/content/entry/ism_transition_spec.rb +46 -0
- data/spec/lib/openehr/rm/composition/content/entry/observation_spec.rb +45 -0
- data/spec/lib/openehr/rm/composition/content/navigation/section_spec.rb +32 -0
- data/spec/lib/openehr/rm/composition/event_context_spec.rb +88 -0
- data/spec/lib/openehr/rm/data_structures/data_structure_spec.rb +21 -0
- data/spec/lib/openehr/rm/data_structures/history/event_spec.rb +44 -0
- data/spec/lib/openehr/rm/data_structures/history/history_spec.rb +67 -0
- data/spec/lib/openehr/rm/data_structures/history/interval_event_spec.rb +43 -0
- data/spec/lib/openehr/rm/data_structures/item_structure/item_list_spec.rb +53 -0
- data/spec/lib/openehr/rm/data_structures/item_structure/item_single_spec.rb +29 -0
- data/spec/lib/openehr/rm/data_structures/item_structure/item_table_spec.rb +147 -0
- data/spec/lib/openehr/rm/data_structures/item_structure/item_tree_spec.rb +48 -0
- data/spec/lib/openehr/rm/data_structures/item_structure/representation/cluster_spec.rb +26 -0
- data/spec/lib/openehr/rm/data_structures/item_structure/representation/element_spec.rb +22 -0
- data/spec/lib/openehr/rm/data_types/basic/data_value_spec.rb +17 -0
- data/spec/lib/openehr/rm/data_types/basic/dv_boolean_spec.rb +29 -0
- data/spec/lib/openehr/rm/data_types/basic/dv_identifier_spec.rb +108 -0
- data/spec/lib/openehr/rm/data_types/basic/dv_state_spec.rb +44 -0
- data/spec/lib/openehr/rm/data_types/encapsulated/dv_encapsulated_spec.rb +42 -0
- data/spec/lib/openehr/rm/data_types/encapsulated/dv_multimedia_spec.rb +79 -0
- data/spec/lib/openehr/rm/data_types/encapsulated/dv_parsable_spec.rb +34 -0
- data/spec/lib/openehr/rm/data_types/quantity/date_time/dv_date_spec.rb +64 -0
- data/spec/lib/openehr/rm/data_types/quantity/date_time/dv_date_time_spec.rb +26 -0
- data/spec/lib/openehr/rm/data_types/quantity/date_time/dv_duration_spec.rb +44 -0
- data/spec/lib/openehr/rm/data_types/quantity/date_time/dv_temporal_spec.rb +25 -0
- data/spec/lib/openehr/rm/data_types/quantity/date_time/dv_time_spec.rb +41 -0
- data/spec/lib/openehr/rm/data_types/quantity/dv_absolute_quantity_spec.rb +35 -0
- data/spec/lib/openehr/rm/data_types/quantity/dv_amount_spec.rb +105 -0
- data/spec/lib/openehr/rm/data_types/quantity/dv_count_spec.rb +12 -0
- data/spec/lib/openehr/rm/data_types/quantity/dv_interval_spec.rb +17 -0
- data/spec/lib/openehr/rm/data_types/quantity/dv_ordered_spec.rb +60 -0
- data/spec/lib/openehr/rm/data_types/quantity/dv_ordinal_spec.rb +74 -0
- data/spec/lib/openehr/rm/data_types/quantity/dv_proportion_spec.rb +162 -0
- data/spec/lib/openehr/rm/data_types/quantity/dv_quantified_spec.rb +36 -0
- data/spec/lib/openehr/rm/data_types/quantity/dv_quantity_spec.rb +78 -0
- data/spec/lib/openehr/rm/data_types/quantity/proportion_kind_spec.rb +24 -0
- data/spec/lib/openehr/rm/data_types/quantity/reference_range_spec.rb +43 -0
- data/spec/lib/openehr/rm/data_types/text/code_phrase_spec.rb +23 -0
- data/spec/lib/openehr/rm/data_types/text/dv_paragraph_spec.rb +13 -0
- data/spec/lib/openehr/rm/data_types/text/dv_text_spec.rb +79 -0
- data/spec/lib/openehr/rm/data_types/text/term_mapping_spec.rb +59 -0
- data/spec/lib/openehr/rm/data_types/uri/dv_ehr_uri_spec.rb +21 -0
- data/spec/lib/openehr/rm/data_types/uri/dv_uri_spec.rb +36 -0
- data/spec/lib/openehr/rm/demographic/actor_spec.rb +79 -0
- data/spec/lib/openehr/rm/demographic/address_spec.rb +33 -0
- data/spec/lib/openehr/rm/demographic/capability_spec.rb +37 -0
- data/spec/lib/openehr/rm/demographic/contact_spec.rb +45 -0
- data/spec/lib/openehr/rm/demographic/party_identity_spec.rb +32 -0
- data/spec/lib/openehr/rm/demographic/party_relationship_spec.rb +84 -0
- data/spec/lib/openehr/rm/demographic/party_spec.rb +131 -0
- data/spec/lib/openehr/rm/demographic/role_spec.rb +58 -0
- data/spec/lib/openehr/rm/ehr/ehr_access_spec.rb +33 -0
- data/spec/lib/openehr/rm/ehr/ehr_spec.rb +139 -0
- data/spec/lib/openehr/rm/ehr/ehr_status_spec.rb +52 -0
- data/spec/lib/openehr/rm/ehr/versioned_composition_spec.rb +33 -0
- data/spec/lib/openehr/rm/integration/generic_entry_spec.rb +31 -0
- data/spec/lib/openehr/rm/support/identification/access_group_ref_spec.rb +19 -0
- data/spec/lib/openehr/rm/support/identification/archetype_id_spec.rb +152 -0
- data/spec/lib/openehr/rm/support/identification/generic_id_spec.rb +33 -0
- data/spec/lib/openehr/rm/support/identification/hier_object_id_spec.rb +12 -0
- data/spec/lib/openehr/rm/support/identification/internet_id_spec.rb +12 -0
- data/spec/lib/openehr/rm/support/identification/iso_oid_spec.rb +12 -0
- data/spec/lib/openehr/rm/support/identification/locatable_ref_spec.rb +34 -0
- data/spec/lib/openehr/rm/support/identification/object_id_spec.rb +24 -0
- data/spec/lib/openehr/rm/support/identification/object_ref_spec.rb +33 -0
- data/spec/lib/openehr/rm/support/identification/object_version_id_spec.rb +59 -0
- data/spec/lib/openehr/rm/support/identification/party_ref_spec.rb +29 -0
- data/spec/lib/openehr/rm/support/identification/template_id_spec.rb +12 -0
- data/spec/lib/openehr/rm/support/identification/terminology_id_spec.rb +33 -0
- data/spec/lib/openehr/rm/support/identification/uid_based_id_spec.rb +50 -0
- data/spec/lib/openehr/rm/support/identification/uid_spec.rb +29 -0
- data/spec/lib/openehr/rm/support/identification/version_tree_id_spec.rb +104 -0
- data/spec/lib/openehr/rm/support/measurement_service_spec.rb +7 -0
- data/spec/lib/openehr/rm/support/terminology_service_spec.rb +24 -0
- data/spec/lib/openehr/serializer/adl-test-entry.most_minimal.test.adl +20 -0
- data/spec/lib/openehr/serializer/adl_serializer_spec.rb +47 -0
- data/spec/lib/openehr/serializer/openEHR-EHR-SECTION.test.v1.adl +38 -0
- data/spec/lib/openehr/serializer/openEHR-EHR-SECTION.test.v1.xml +58 -0
- data/spec/lib/openehr/serializer/sample_archetype_spec.rb +44 -0
- data/spec/lib/openehr/serializer/xml_serializer_spec.rb +49 -0
- data/spec/lib/openehr/terminology/open_ehr_terminology_spec.rb +40 -0
- data/spec/spec.opts +6 -0
- data/spec/spec_helper.rb +58 -0
- metadata +631 -0
@@ -0,0 +1,27 @@
|
|
1
|
+
# rm::integration
|
2
|
+
# integration module
|
3
|
+
# http://www.openehr.org/uml/release-1.0.1/Browsable/_9_5_1_76d0249_1140530578205_529440_4046Report.html
|
4
|
+
# refs #42
|
5
|
+
include OpenEHR::RM::Composition::Content
|
6
|
+
|
7
|
+
module OpenEHR
|
8
|
+
module RM
|
9
|
+
module Integration
|
10
|
+
class GenericEntry < ContentItem
|
11
|
+
attr_reader :data
|
12
|
+
|
13
|
+
def initialize(args = { })
|
14
|
+
super(args)
|
15
|
+
self.data = args[:data]
|
16
|
+
end
|
17
|
+
|
18
|
+
def data=(data)
|
19
|
+
if data.nil?
|
20
|
+
raise ArgumentError, 'data are mandatory'
|
21
|
+
end
|
22
|
+
@data = data
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end # of Integration
|
26
|
+
end # of RM
|
27
|
+
end # of OpenEHR
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# This module is based on the UML,
|
2
|
+
# http://www.openehr.org/uml/release-1.0.1/Browsable/_9_5_1_76d0249_1155650882301_836618_5314Report.html
|
3
|
+
# Ticket refs #41
|
4
|
+
module OpenEHR
|
5
|
+
module RM
|
6
|
+
module Security
|
7
|
+
class AccessControlSettings
|
8
|
+
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
$:.unshift(File.dirname(__FILE__)) unless
|
2
|
+
$:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
|
3
|
+
|
4
|
+
module OpenEHR
|
5
|
+
module RM
|
6
|
+
module Support
|
7
|
+
autoload :AssumedTypes, 'support/assumed_types'
|
8
|
+
autoload :Definition, 'support/definition'
|
9
|
+
autoload :Identification, 'support/identification'
|
10
|
+
autoload :Measurement, 'support/measurement'
|
11
|
+
autoload :Terminology, 'support/terminology'
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,412 @@
|
|
1
|
+
$:.unshift(File.dirname(__FILE__))
|
2
|
+
# This module is an implementation of this UML:
|
3
|
+
# http://www.openehr.org/uml/release-1.0.1/Browsable/_9_0_76d0249_1109331021343_528780_2066Report.html
|
4
|
+
# Ticket refs #39
|
5
|
+
module OpenEHR
|
6
|
+
module RM
|
7
|
+
module Support
|
8
|
+
module Identification
|
9
|
+
class ObjectID
|
10
|
+
attr_reader :value
|
11
|
+
|
12
|
+
def initialize(args = {})
|
13
|
+
self.value=args[:value]
|
14
|
+
end
|
15
|
+
|
16
|
+
def value=(value)
|
17
|
+
raise ArgumentError, "empty value" if value.nil? or value.empty?
|
18
|
+
@value = value
|
19
|
+
end
|
20
|
+
|
21
|
+
def ==(oid)
|
22
|
+
self.value == oid.value
|
23
|
+
end
|
24
|
+
end # of ObjectID
|
25
|
+
|
26
|
+
class ObjectRef
|
27
|
+
attr_reader :namespace, :type, :id
|
28
|
+
|
29
|
+
def initialize(args = {})
|
30
|
+
self.namespace = args[:namespace]
|
31
|
+
self.type = args[:type]
|
32
|
+
self.id = args[:id]
|
33
|
+
end
|
34
|
+
|
35
|
+
def namespace=(namespace)
|
36
|
+
if namespace.nil? or namespace.empty? or
|
37
|
+
!(/^[a-zA-Z][a-zA-Z0-9_\-\:\/\&\+\?]*$/ =~ namespace)
|
38
|
+
raise ArgumentError
|
39
|
+
end
|
40
|
+
@namespace = namespace
|
41
|
+
end
|
42
|
+
|
43
|
+
def type=(type)
|
44
|
+
raise ArgumentError if type.nil? or type.empty?
|
45
|
+
@type = type
|
46
|
+
end
|
47
|
+
|
48
|
+
def id=(id)
|
49
|
+
raise ArgumentError if id.nil?
|
50
|
+
@id = id
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
class ArchetypeID < ObjectID
|
55
|
+
attr_reader :rm_originator, :rm_name, :rm_entity,
|
56
|
+
:concept_name, :specialisation, :version_id
|
57
|
+
|
58
|
+
def initialize(args = {})
|
59
|
+
if args[:value].nil?
|
60
|
+
self.rm_originator = args[:rm_originator]
|
61
|
+
self.rm_name = args[:rm_name]
|
62
|
+
self.rm_entity = args[:rm_entity]
|
63
|
+
self.concept_name = args[:concept_name]
|
64
|
+
self.version_id = args[:version_id]
|
65
|
+
self.specialisation = args[:specialisation]
|
66
|
+
else
|
67
|
+
super(args)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
def value=(value)
|
72
|
+
if /([a-zA-Z]\w+)-([a-zA-Z]\w+)-([a-zA-Z]\w+)\.([a-zA-Z]\w+)(-([a-zA-Z]\w+))?\.(v[1-9]\d*)/ =~ value
|
73
|
+
self.rm_originator = $1
|
74
|
+
self.rm_name = $2
|
75
|
+
self.rm_entity = $3
|
76
|
+
self.concept_name = $4
|
77
|
+
self.specialisation = $6
|
78
|
+
self.version_id = $7
|
79
|
+
else
|
80
|
+
raise ArgumentError, 'invalid archetype id form'
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
def qualified_rm_entity
|
85
|
+
return @rm_originator + '-' + @rm_name + '-' + @rm_entity
|
86
|
+
end
|
87
|
+
|
88
|
+
def domain_concept
|
89
|
+
if @specialisation.nil?
|
90
|
+
return @concept_name
|
91
|
+
else
|
92
|
+
return @concept_name + '-' + @specialisation
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
def value
|
97
|
+
return self.qualified_rm_entity + '.' +
|
98
|
+
self.domain_concept + '.' + @version_id
|
99
|
+
end
|
100
|
+
|
101
|
+
def concept_name=(concept_name)
|
102
|
+
if concept_name.nil? or concept_name.empty?
|
103
|
+
raise ArgumentError, 'concept_name is mandatory'
|
104
|
+
end
|
105
|
+
@concept_name = concept_name
|
106
|
+
end
|
107
|
+
|
108
|
+
def domain_concept=(domain_concept)
|
109
|
+
if domain_concept.nil? or domain_concept.empty?
|
110
|
+
raise ArgumentError, "domain concept not valid"
|
111
|
+
end
|
112
|
+
if /([a-zA-Z]\w+)(-([a-zA-Z]\w))?/ =~ domain_concept
|
113
|
+
self.concept_name = $1
|
114
|
+
self.specialisation = $3
|
115
|
+
else
|
116
|
+
raise ArgumentError, 'invalid domain concept form'
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
def rm_name=(rm_name)
|
121
|
+
raise ArgumentError, "rm_name not valid" if rm_name.nil? or rm_name.empty?
|
122
|
+
@rm_name = rm_name
|
123
|
+
end
|
124
|
+
|
125
|
+
def rm_entity=(rm_entity)
|
126
|
+
if rm_entity.nil? or rm_entity.empty?
|
127
|
+
raise ArgumentError, "rm_entity is mandatory"
|
128
|
+
end
|
129
|
+
@rm_entity = rm_entity
|
130
|
+
end
|
131
|
+
|
132
|
+
def rm_originator=(rm_originator)
|
133
|
+
if rm_originator.nil? or rm_originator.empty?
|
134
|
+
raise ArgumentError, "rm_originator not valid"
|
135
|
+
end
|
136
|
+
@rm_originator = rm_originator
|
137
|
+
end
|
138
|
+
|
139
|
+
def specialisation=(specialisation)
|
140
|
+
if !specialisation.nil? and specialisation.empty?
|
141
|
+
raise ArgumentError, "rm_specialisation not valid"
|
142
|
+
end
|
143
|
+
@specialisation = specialisation
|
144
|
+
end
|
145
|
+
|
146
|
+
def version_id=(version_id)
|
147
|
+
raise ArgumentError, "version_id not valid" if version_id.nil? or version_id.empty?
|
148
|
+
@version_id = version_id
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
class TerminologyID < ObjectID
|
153
|
+
attr_reader :name, :version_id
|
154
|
+
|
155
|
+
def initialize(args = {})
|
156
|
+
if args[:value].nil?
|
157
|
+
self.name = args[:name]
|
158
|
+
self.version_id = args[:version_id]
|
159
|
+
else
|
160
|
+
super(args)
|
161
|
+
end
|
162
|
+
end
|
163
|
+
|
164
|
+
def value
|
165
|
+
if @version_id.empty?
|
166
|
+
@name
|
167
|
+
else
|
168
|
+
@name + '(' + @version_id + ')'
|
169
|
+
end
|
170
|
+
end
|
171
|
+
|
172
|
+
|
173
|
+
def value=(value)
|
174
|
+
raise ArgumentError, "value not valid" if value.nil? or value.empty?
|
175
|
+
if /(.*)\((.*)\)/ =~ value
|
176
|
+
self.name = $1
|
177
|
+
self.version_id = $2
|
178
|
+
else
|
179
|
+
self.name = value
|
180
|
+
self.version_id = ''
|
181
|
+
end
|
182
|
+
end
|
183
|
+
|
184
|
+
def name=(name)
|
185
|
+
raise ArgumentError, "name not valid" if name.nil? or name.empty?
|
186
|
+
@name = name
|
187
|
+
end
|
188
|
+
|
189
|
+
def version_id=(version_id)
|
190
|
+
if version_id.nil?
|
191
|
+
@version_id = ''
|
192
|
+
else
|
193
|
+
@version_id = version_id
|
194
|
+
end
|
195
|
+
end
|
196
|
+
end # of Terminology_ID
|
197
|
+
|
198
|
+
class GenericID < ObjectID
|
199
|
+
attr_reader :scheme
|
200
|
+
|
201
|
+
def initialize(args)
|
202
|
+
super(args)
|
203
|
+
self.scheme = args[:scheme]
|
204
|
+
end
|
205
|
+
|
206
|
+
def scheme=(scheme)
|
207
|
+
if scheme.nil? or scheme.empty?
|
208
|
+
raise ArgumentError, "scheme not valid"
|
209
|
+
end
|
210
|
+
@scheme = scheme
|
211
|
+
end
|
212
|
+
end # of Generic_ID
|
213
|
+
|
214
|
+
class TemplateID < ObjectID
|
215
|
+
|
216
|
+
end
|
217
|
+
|
218
|
+
class UIDBasedID < ObjectID
|
219
|
+
attr_reader :root, :extension
|
220
|
+
|
221
|
+
def initialize(args = {})
|
222
|
+
super(args)
|
223
|
+
end
|
224
|
+
|
225
|
+
def value=(value)
|
226
|
+
super(value)
|
227
|
+
if /(\S+)::(\S+)/ =~ value
|
228
|
+
@root = UID.new(:value => $1)
|
229
|
+
@extension = $2
|
230
|
+
else
|
231
|
+
@root = UID.new(:value => value)
|
232
|
+
@extension = ''
|
233
|
+
end
|
234
|
+
end
|
235
|
+
|
236
|
+
def has_extension?
|
237
|
+
return !@extension.empty?
|
238
|
+
end
|
239
|
+
end
|
240
|
+
|
241
|
+
class ObjectVersionID < UIDBasedID
|
242
|
+
attr_reader :creating_system_id, :version_tree_id
|
243
|
+
|
244
|
+
def initialize(args= {})
|
245
|
+
super
|
246
|
+
end
|
247
|
+
|
248
|
+
def value=(value)
|
249
|
+
if /^(\S+)::(\S+)::((\d|\.)+)$/ =~ value
|
250
|
+
self.objectid = UID.new(:value => $1)
|
251
|
+
self.creating_system_id = UID.new(:value => $2)
|
252
|
+
self.version_tree_id = VersionTreeID.new(:value => $3)
|
253
|
+
else
|
254
|
+
raise ArgumentError, 'invalid format'
|
255
|
+
end
|
256
|
+
end
|
257
|
+
|
258
|
+
def value
|
259
|
+
return @oid.value + '::' +
|
260
|
+
@creating_system_id.value + '::' +
|
261
|
+
@version_tree_id.value
|
262
|
+
end
|
263
|
+
|
264
|
+
def objectid
|
265
|
+
return @oid
|
266
|
+
end
|
267
|
+
|
268
|
+
def objectid=(oid)
|
269
|
+
raise ArgumentError, 'objectid is mandatory' if oid.nil?
|
270
|
+
@oid = oid
|
271
|
+
end
|
272
|
+
|
273
|
+
def creating_system_id=(creating_system_id)
|
274
|
+
if creating_system_id.nil?
|
275
|
+
raise ArgumentError, 'creating_system_id is mandatory'
|
276
|
+
end
|
277
|
+
@creating_system_id = creating_system_id
|
278
|
+
end
|
279
|
+
|
280
|
+
def version_tree_id=(version_tree_id)
|
281
|
+
if version_tree_id.nil?
|
282
|
+
raise ArgumentError, 'version_tree_id is mandatory'
|
283
|
+
end
|
284
|
+
@version_tree_id = version_tree_id
|
285
|
+
end
|
286
|
+
|
287
|
+
def is_branch?
|
288
|
+
return @version_tree_id.is_branch?
|
289
|
+
end
|
290
|
+
end
|
291
|
+
|
292
|
+
class LocatableRef < ObjectRef
|
293
|
+
attr_reader :path
|
294
|
+
|
295
|
+
def initialize(args = {})
|
296
|
+
super(args)
|
297
|
+
self.path = args[:path]
|
298
|
+
end
|
299
|
+
|
300
|
+
def path=(path)
|
301
|
+
raise ArgumentError if path.nil? or path.empty?
|
302
|
+
@path = path
|
303
|
+
end
|
304
|
+
|
305
|
+
def as_uri
|
306
|
+
'ehr://' + @id.value + '/' + @path
|
307
|
+
end
|
308
|
+
end
|
309
|
+
|
310
|
+
class PartyRef < ObjectRef
|
311
|
+
def type=(type)
|
312
|
+
parties = %w[PERSON ORGANISATION GROUP AGENT ROLE PARTY ACTOR]
|
313
|
+
raise ArgumentError, 'type invalid' unless parties.include? type
|
314
|
+
@type = type
|
315
|
+
end
|
316
|
+
end
|
317
|
+
|
318
|
+
class AccessGroupRef < ObjectRef
|
319
|
+
def initialize(args = {})
|
320
|
+
super(args)
|
321
|
+
@type = 'ACCESS_GROUP'
|
322
|
+
end
|
323
|
+
|
324
|
+
def type=(type)
|
325
|
+
end
|
326
|
+
end
|
327
|
+
|
328
|
+
class HierObjectID < UIDBasedID
|
329
|
+
|
330
|
+
end
|
331
|
+
|
332
|
+
class VersionTreeID
|
333
|
+
attr_reader :trunk_version, :branch_number, :branch_version
|
334
|
+
|
335
|
+
def initialize(args = {})
|
336
|
+
self.value = args[:value]
|
337
|
+
end
|
338
|
+
|
339
|
+
def value=(value)
|
340
|
+
raise ArgumentError, 'value invalid' if value.nil? or value.empty?
|
341
|
+
(trunk_version, branch_number, branch_version) = value.split '.'
|
342
|
+
self.trunk_version = trunk_version
|
343
|
+
self.branch_number = branch_number
|
344
|
+
self.branch_version = branch_version
|
345
|
+
end
|
346
|
+
|
347
|
+
def value
|
348
|
+
@value = trunk_version
|
349
|
+
@value = @value + '.' + @branch_number unless @branch_number.nil?
|
350
|
+
@value = @value + '.' + @branch_version unless @branch_version.nil?
|
351
|
+
return @value
|
352
|
+
end
|
353
|
+
|
354
|
+
def trunk_version=(trunk_version)
|
355
|
+
if trunk_version.nil? || (trunk_version.to_i < 1)
|
356
|
+
raise ArgumentError, 'trunk_version invalid'
|
357
|
+
end
|
358
|
+
@trunk_version = trunk_version
|
359
|
+
end
|
360
|
+
|
361
|
+
def branch_number=(branch_number)
|
362
|
+
unless branch_number.nil? or branch_number.to_i >= 1
|
363
|
+
raise ArgumentError, 'branch number invalid'
|
364
|
+
end
|
365
|
+
@branch_number = branch_number
|
366
|
+
end
|
367
|
+
|
368
|
+
def branch_version=(branch_version)
|
369
|
+
if (!branch_version.nil? and !(branch_version.to_i >= 1)) or
|
370
|
+
(!branch_version.nil? and @branch_number.nil?)
|
371
|
+
raise ArgumentError, 'branch version invalid'
|
372
|
+
end
|
373
|
+
@branch_version = branch_version
|
374
|
+
end
|
375
|
+
|
376
|
+
def is_branch?
|
377
|
+
!@branch_version.nil? and !@branch_number.nil?
|
378
|
+
end
|
379
|
+
|
380
|
+
def is_first?
|
381
|
+
trunk_version == '1'
|
382
|
+
end
|
383
|
+
end
|
384
|
+
|
385
|
+
class UID
|
386
|
+
attr_reader :value
|
387
|
+
|
388
|
+
def initialize(args = {})
|
389
|
+
self.value = args[:value]
|
390
|
+
end
|
391
|
+
|
392
|
+
def value=(value)
|
393
|
+
raise ArgumentError if value.nil? or value.empty?
|
394
|
+
@value = value
|
395
|
+
end
|
396
|
+
end
|
397
|
+
|
398
|
+
class UUID < UID
|
399
|
+
|
400
|
+
end
|
401
|
+
|
402
|
+
class InternetID <UID
|
403
|
+
|
404
|
+
end
|
405
|
+
|
406
|
+
class IsoOID <UID
|
407
|
+
|
408
|
+
end
|
409
|
+
end # of Identification
|
410
|
+
end # of Support
|
411
|
+
end # of RM
|
412
|
+
end # of OpenEHR
|