Hide keyboard shortcuts

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/Bundle) on 2021-05-18. 

5# 2021, SMART Health IT. 

6 

7 

8from . import resource 

9 

10class Bundle(resource.Resource): 

11 """ Contains a collection of resources. 

12  

13 A container for a collection of resources. 

14 """ 

15 

16 resource_type = "Bundle" 

17 

18 def __init__(self, jsondict=None, strict=True): 

19 """ Initialize all valid properties. 

20  

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 """ 

25 

26 self.entry = None 

27 """ Entry in the bundle - will have a resource or information. 

28 List of `BundleEntry` items (represented as `dict` in JSON). """ 

29 

30 self.identifier = None 

31 """ Persistent identifier for the bundle. 

32 Type `Identifier` (represented as `dict` in JSON). """ 

33 

34 self.link = None 

35 """ Links related to this Bundle. 

36 List of `BundleLink` items (represented as `dict` in JSON). """ 

37 

38 self.signature = None 

39 """ Digital Signature. 

40 Type `Signature` (represented as `dict` in JSON). """ 

41 

42 self.timestamp = None 

43 """ When the bundle was assembled. 

44 Type `FHIRDate` (represented as `str` in JSON). """ 

45 

46 self.total = None 

47 """ If search, the total number of matches. 

48 Type `int`. """ 

49 

50 self.type = None 

51 """ document | message | transaction | transaction-response | batch | 

52 batch-response | history | searchset | collection. 

53 Type `str`. """ 

54 

55 super(Bundle, self).__init__(jsondict=jsondict, strict=strict) 

56 

57 def elementProperties(self): 

58 js = super(Bundle, self).elementProperties() 

59 js.extend([ 

60 ("entry", "entry", BundleEntry, True, None, False), 

61 ("identifier", "identifier", identifier.Identifier, False, None, False), 

62 ("link", "link", BundleLink, True, None, False), 

63 ("signature", "signature", signature.Signature, False, None, False), 

64 ("timestamp", "timestamp", fhirdate.FHIRDate, False, None, False), 

65 ("total", "total", int, False, None, False), 

66 ("type", "type", str, False, None, True), 

67 ]) 

68 return js 

69 

70 

71from . import backboneelement 

72 

73class BundleEntry(backboneelement.BackboneElement): 

74 """ Entry in the bundle - will have a resource or information. 

75  

76 An entry in a bundle resource - will either contain a resource or 

77 information about a resource (transactions and history only). 

78 """ 

79 

80 resource_type = "BundleEntry" 

81 

82 def __init__(self, jsondict=None, strict=True): 

83 """ Initialize all valid properties. 

84  

85 :raises: FHIRValidationError on validation errors, unless strict is False 

86 :param dict jsondict: A JSON dictionary to use for initialization 

87 :param bool strict: If True (the default), invalid variables will raise a TypeError 

88 """ 

89 

90 self.fullUrl = None 

91 """ URI for resource (Absolute URL server address or URI for UUID/OID). 

92 Type `str`. """ 

93 

94 self.link = None 

95 """ Links related to this entry. 

96 List of `BundleLink` items (represented as `dict` in JSON). """ 

97 

98 self.request = None 

99 """ Additional execution information (transaction/batch/history). 

100 Type `BundleEntryRequest` (represented as `dict` in JSON). """ 

101 

102 self.resource = None 

103 """ A resource in the bundle. 

104 Type `Resource` (represented as `dict` in JSON). """ 

105 

106 self.response = None 

107 """ Results of execution (transaction/batch/history). 

108 Type `BundleEntryResponse` (represented as `dict` in JSON). """ 

109 

110 self.search = None 

111 """ Search related information. 

112 Type `BundleEntrySearch` (represented as `dict` in JSON). """ 

113 

114 super(BundleEntry, self).__init__(jsondict=jsondict, strict=strict) 

115 

116 def elementProperties(self): 

117 js = super(BundleEntry, self).elementProperties() 

118 js.extend([ 

119 ("fullUrl", "fullUrl", str, False, None, False), 

120 ("link", "link", BundleLink, True, None, False), 

121 ("request", "request", BundleEntryRequest, False, None, False), 

122 ("resource", "resource", resource.Resource, False, None, False), 

123 ("response", "response", BundleEntryResponse, False, None, False), 

124 ("search", "search", BundleEntrySearch, False, None, False), 

125 ]) 

126 return js 

127 

128 

129class BundleEntryRequest(backboneelement.BackboneElement): 

130 """ Additional execution information (transaction/batch/history). 

131  

132 Additional information about how this entry should be processed as part of 

133 a transaction or batch. For history, it shows how the entry was processed 

134 to create the version contained in the entry. 

135 """ 

136 

137 resource_type = "BundleEntryRequest" 

138 

139 def __init__(self, jsondict=None, strict=True): 

140 """ Initialize all valid properties. 

141  

142 :raises: FHIRValidationError on validation errors, unless strict is False 

143 :param dict jsondict: A JSON dictionary to use for initialization 

144 :param bool strict: If True (the default), invalid variables will raise a TypeError 

145 """ 

146 

147 self.ifMatch = None 

148 """ For managing update contention. 

149 Type `str`. """ 

150 

151 self.ifModifiedSince = None 

152 """ For managing cache currency. 

153 Type `FHIRDate` (represented as `str` in JSON). """ 

154 

155 self.ifNoneExist = None 

156 """ For conditional creates. 

157 Type `str`. """ 

158 

159 self.ifNoneMatch = None 

160 """ For managing cache currency. 

161 Type `str`. """ 

162 

163 self.method = None 

164 """ GET | HEAD | POST | PUT | DELETE | PATCH. 

165 Type `str`. """ 

166 

167 self.url = None 

168 """ URL for HTTP equivalent of this entry. 

169 Type `str`. """ 

170 

171 super(BundleEntryRequest, self).__init__(jsondict=jsondict, strict=strict) 

172 

173 def elementProperties(self): 

174 js = super(BundleEntryRequest, self).elementProperties() 

175 js.extend([ 

176 ("ifMatch", "ifMatch", str, False, None, False), 

177 ("ifModifiedSince", "ifModifiedSince", fhirdate.FHIRDate, False, None, False), 

178 ("ifNoneExist", "ifNoneExist", str, False, None, False), 

179 ("ifNoneMatch", "ifNoneMatch", str, False, None, False), 

180 ("method", "method", str, False, None, True), 

181 ("url", "url", str, False, None, True), 

182 ]) 

183 return js 

184 

185 

186class BundleEntryResponse(backboneelement.BackboneElement): 

187 """ Results of execution (transaction/batch/history). 

188  

189 Indicates the results of processing the corresponding 'request' entry in 

190 the batch or transaction being responded to or what the results of an 

191 operation where when returning history. 

192 """ 

193 

194 resource_type = "BundleEntryResponse" 

195 

196 def __init__(self, jsondict=None, strict=True): 

197 """ Initialize all valid properties. 

198  

199 :raises: FHIRValidationError on validation errors, unless strict is False 

200 :param dict jsondict: A JSON dictionary to use for initialization 

201 :param bool strict: If True (the default), invalid variables will raise a TypeError 

202 """ 

203 

204 self.etag = None 

205 """ The Etag for the resource (if relevant). 

206 Type `str`. """ 

207 

208 self.lastModified = None 

209 """ Server's date time modified. 

210 Type `FHIRDate` (represented as `str` in JSON). """ 

211 

212 self.location = None 

213 """ The location (if the operation returns a location). 

214 Type `str`. """ 

215 

216 self.outcome = None 

217 """ OperationOutcome with hints and warnings (for batch/transaction). 

218 Type `Resource` (represented as `dict` in JSON). """ 

219 

220 self.status = None 

221 """ Status response code (text optional). 

222 Type `str`. """ 

223 

224 super(BundleEntryResponse, self).__init__(jsondict=jsondict, strict=strict) 

225 

226 def elementProperties(self): 

227 js = super(BundleEntryResponse, self).elementProperties() 

228 js.extend([ 

229 ("etag", "etag", str, False, None, False), 

230 ("lastModified", "lastModified", fhirdate.FHIRDate, False, None, False), 

231 ("location", "location", str, False, None, False), 

232 ("outcome", "outcome", resource.Resource, False, None, False), 

233 ("status", "status", str, False, None, True), 

234 ]) 

235 return js 

236 

237 

238class BundleEntrySearch(backboneelement.BackboneElement): 

239 """ Search related information. 

240  

241 Information about the search process that lead to the creation of this 

242 entry. 

243 """ 

244 

245 resource_type = "BundleEntrySearch" 

246 

247 def __init__(self, jsondict=None, strict=True): 

248 """ Initialize all valid properties. 

249  

250 :raises: FHIRValidationError on validation errors, unless strict is False 

251 :param dict jsondict: A JSON dictionary to use for initialization 

252 :param bool strict: If True (the default), invalid variables will raise a TypeError 

253 """ 

254 

255 self.mode = None 

256 """ match | include | outcome - why this is in the result set. 

257 Type `str`. """ 

258 

259 self.score = None 

260 """ Search ranking (between 0 and 1). 

261 Type `float`. """ 

262 

263 super(BundleEntrySearch, self).__init__(jsondict=jsondict, strict=strict) 

264 

265 def elementProperties(self): 

266 js = super(BundleEntrySearch, self).elementProperties() 

267 js.extend([ 

268 ("mode", "mode", str, False, None, False), 

269 ("score", "score", float, False, None, False), 

270 ]) 

271 return js 

272 

273 

274class BundleLink(backboneelement.BackboneElement): 

275 """ Links related to this Bundle. 

276  

277 A series of links that provide context to this bundle. 

278 """ 

279 

280 resource_type = "BundleLink" 

281 

282 def __init__(self, jsondict=None, strict=True): 

283 """ Initialize all valid properties. 

284  

285 :raises: FHIRValidationError on validation errors, unless strict is False 

286 :param dict jsondict: A JSON dictionary to use for initialization 

287 :param bool strict: If True (the default), invalid variables will raise a TypeError 

288 """ 

289 

290 self.relation = None 

291 """ See http://www.iana.org/assignments/link-relations/link- 

292 relations.xhtml#link-relations-1. 

293 Type `str`. """ 

294 

295 self.url = None 

296 """ Reference details for the link. 

297 Type `str`. """ 

298 

299 super(BundleLink, self).__init__(jsondict=jsondict, strict=strict) 

300 

301 def elementProperties(self): 

302 js = super(BundleLink, self).elementProperties() 

303 js.extend([ 

304 ("relation", "relation", str, False, None, True), 

305 ("url", "url", str, False, None, True), 

306 ]) 

307 return js 

308 

309 

310import sys 

311try: 

312 from . import fhirdate 

313except ImportError: 

314 fhirdate = sys.modules[__package__ + '.fhirdate'] 

315try: 

316 from . import identifier 

317except ImportError: 

318 identifier = sys.modules[__package__ + '.identifier'] 

319try: 

320 from . import signature 

321except ImportError: 

322 signature = sys.modules[__package__ + '.signature']