Coverage for /home/martinb/workspace/client-py/fhirclient/models/attachment.py : 36%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3#
4# Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Attachment) on 2021-05-18.
5# 2021, SMART Health IT.
8from . import element
10class Attachment(element.Element):
11 """ Content in a format defined elsewhere.
13 For referring to data content defined in other formats.
14 """
16 resource_type = "Attachment"
18 def __init__(self, jsondict=None, strict=True):
19 """ Initialize all valid properties.
21 :raises: FHIRValidationError on validation errors, unless strict is False
22 :param dict jsondict: A JSON dictionary to use for initialization
23 :param bool strict: If True (the default), invalid variables will raise a TypeError
24 """
26 self.contentType = None
27 """ Mime type of the content, with charset etc..
28 Type `str`. """
30 self.creation = None
31 """ Date attachment was first created.
32 Type `FHIRDate` (represented as `str` in JSON). """
34 self.data = None
35 """ Data inline, base64ed.
36 Type `str`. """
38 self.hash = None
39 """ Hash of the data (sha-1, base64ed).
40 Type `str`. """
42 self.language = None
43 """ Human language of the content (BCP-47).
44 Type `str`. """
46 self.size = None
47 """ Number of bytes of content (if url provided).
48 Type `int`. """
50 self.title = None
51 """ Label to display in place of the data.
52 Type `str`. """
54 self.url = None
55 """ Uri where the data can be found.
56 Type `str`. """
58 super(Attachment, self).__init__(jsondict=jsondict, strict=strict)
60 def elementProperties(self):
61 js = super(Attachment, self).elementProperties()
62 js.extend([
63 ("contentType", "contentType", str, False, None, False),
64 ("creation", "creation", fhirdate.FHIRDate, False, None, False),
65 ("data", "data", str, False, None, False),
66 ("hash", "hash", str, False, None, False),
67 ("language", "language", str, False, None, False),
68 ("size", "size", int, False, None, False),
69 ("title", "title", str, False, None, False),
70 ("url", "url", str, False, None, False),
71 ])
72 return js
75import sys
76try:
77 from . import fhirdate
78except ImportError:
79 fhirdate = sys.modules[__package__ + '.fhirdate']