Class: FHIR::Tag
- Inherits:
-
Object
- Object
- FHIR::Tag
- Defined in:
- lib/fhir_client/model/tag.rb
Instance Attribute Summary collapse
-
#label ⇒ Object
Label is an OPTIONAL human-readable label for the tag for use when displaying in end-user applications.
-
#scheme ⇒ Object
Scheme is a URI: “hl7.org/fhir/tag” A general tag “hl7.org/fhir/tag/profile” A profile tag - a claim that the Resource conforms to the profile identified in the term “hl7.org/fhir/tag/security” A security label.
-
#term ⇒ Object
Term is a URI: General tags: Bundle / FHIR Documents: “hl7.org/fhir/tag/document” Bundle / FHIR Messages: “hl7.org/fhir/tag/message” Profile tags: URL that references a profile resource.
Class Method Summary collapse
-
.parse_tag(header) ⇒ Object
Parses a string named “header” and returns a Tag object.
-
.parse_tags(header) ⇒ Object
Parses a string named “header” and returns an Array of Tag objects.
Instance Method Summary collapse
Instance Attribute Details
#label ⇒ Object
Label is an OPTIONAL human-readable label for the tag for use when displaying in end-user applications
21 22 23 |
# File 'lib/fhir_client/model/tag.rb', line 21 def label @label end |
#scheme ⇒ Object
Scheme is a URI:
"http://hl7.org/fhir/tag" A general tag
"http://hl7.org/fhir/tag/profile" A profile tag - a claim that the Resource conforms to the profile identified in the term
"http://hl7.org/fhir/tag/security" A security label
18 19 20 |
# File 'lib/fhir_client/model/tag.rb', line 18 def scheme @scheme end |
#term ⇒ Object
Term is a URI:
General tags:
Bundle / FHIR Documents: "http://hl7.org/fhir/tag/document"
Bundle / FHIR Messages: "http://hl7.org/fhir/tag/message"
Profile tags: URL that references a profile resource.
12 13 14 |
# File 'lib/fhir_client/model/tag.rb', line 12 def term @term end |
Class Method Details
.parse_tag(header) ⇒ Object
Parses a string named “header” and returns a Tag object.
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/fhir_client/model/tag.rb', line 30 def self.parse_tag(header) h = FHIR::Tag.new regex = /\s*;\s*/ tokens = header.strip.split(regex) h.term = tokens.shift tokens.each do |token| if !token.strip.index('scheme').nil? token.strip =~ %r{(?<=scheme)(\s*)=(\s*)([\".:_\-\/\w]+)} h.scheme = Regexp.last_match(3) elsif !token.strip.index('label').nil? token.strip =~ %r{(?<=label)(\s*)=(\s*)([\".:_\-\/\w\s]+)} h.label = Regexp.last_match(3) end end h end |
Instance Method Details
#to_header ⇒ Object
23 24 25 26 27 |
# File 'lib/fhir_client/model/tag.rb', line 23 def to_header s = "#{term}; scheme=#{scheme}" s += "; label=#{label}" unless label.nil? s end |