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

5# 2021, SMART Health IT. 

6 

7 

8from . import domainresource 

9 

10class Questionnaire(domainresource.DomainResource): 

11 """ A structured set of questions. 

12  

13 A structured set of questions intended to guide the collection of answers 

14 from end-users. Questionnaires provide detailed control over order, 

15 presentation, phraseology and grouping to allow coherent, consistent data 

16 collection. 

17 """ 

18 

19 resource_type = "Questionnaire" 

20 

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

22 """ Initialize all valid properties. 

23  

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

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

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

27 """ 

28 

29 self.approvalDate = None 

30 """ When the questionnaire was approved by publisher. 

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

32 

33 self.code = None 

34 """ Concept that represents the overall questionnaire. 

35 List of `Coding` items (represented as `dict` in JSON). """ 

36 

37 self.contact = None 

38 """ Contact details for the publisher. 

39 List of `ContactDetail` items (represented as `dict` in JSON). """ 

40 

41 self.copyright = None 

42 """ Use and/or publishing restrictions. 

43 Type `str`. """ 

44 

45 self.date = None 

46 """ Date last changed. 

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

48 

49 self.derivedFrom = None 

50 """ Instantiates protocol or definition. 

51 List of `str` items. """ 

52 

53 self.description = None 

54 """ Natural language description of the questionnaire. 

55 Type `str`. """ 

56 

57 self.effectivePeriod = None 

58 """ When the questionnaire is expected to be used. 

59 Type `Period` (represented as `dict` in JSON). """ 

60 

61 self.experimental = None 

62 """ For testing purposes, not real usage. 

63 Type `bool`. """ 

64 

65 self.identifier = None 

66 """ Additional identifier for the questionnaire. 

67 List of `Identifier` items (represented as `dict` in JSON). """ 

68 

69 self.item = None 

70 """ Questions and sections within the Questionnaire. 

71 List of `QuestionnaireItem` items (represented as `dict` in JSON). """ 

72 

73 self.jurisdiction = None 

74 """ Intended jurisdiction for questionnaire (if applicable). 

75 List of `CodeableConcept` items (represented as `dict` in JSON). """ 

76 

77 self.lastReviewDate = None 

78 """ When the questionnaire was last reviewed. 

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

80 

81 self.name = None 

82 """ Name for this questionnaire (computer friendly). 

83 Type `str`. """ 

84 

85 self.publisher = None 

86 """ Name of the publisher (organization or individual). 

87 Type `str`. """ 

88 

89 self.purpose = None 

90 """ Why this questionnaire is defined. 

91 Type `str`. """ 

92 

93 self.status = None 

94 """ draft | active | retired | unknown. 

95 Type `str`. """ 

96 

97 self.subjectType = None 

98 """ Resource that can be subject of QuestionnaireResponse. 

99 List of `str` items. """ 

100 

101 self.title = None 

102 """ Name for this questionnaire (human friendly). 

103 Type `str`. """ 

104 

105 self.url = None 

106 """ Canonical identifier for this questionnaire, represented as a URI 

107 (globally unique). 

108 Type `str`. """ 

109 

110 self.useContext = None 

111 """ The context that the content is intended to support. 

112 List of `UsageContext` items (represented as `dict` in JSON). """ 

113 

114 self.version = None 

115 """ Business version of the questionnaire. 

116 Type `str`. """ 

117 

118 super(Questionnaire, self).__init__(jsondict=jsondict, strict=strict) 

119 

120 def elementProperties(self): 

121 js = super(Questionnaire, self).elementProperties() 

122 js.extend([ 

123 ("approvalDate", "approvalDate", fhirdate.FHIRDate, False, None, False), 

124 ("code", "code", coding.Coding, True, None, False), 

125 ("contact", "contact", contactdetail.ContactDetail, True, None, False), 

126 ("copyright", "copyright", str, False, None, False), 

127 ("date", "date", fhirdate.FHIRDate, False, None, False), 

128 ("derivedFrom", "derivedFrom", str, True, None, False), 

129 ("description", "description", str, False, None, False), 

130 ("effectivePeriod", "effectivePeriod", period.Period, False, None, False), 

131 ("experimental", "experimental", bool, False, None, False), 

132 ("identifier", "identifier", identifier.Identifier, True, None, False), 

133 ("item", "item", QuestionnaireItem, True, None, False), 

134 ("jurisdiction", "jurisdiction", codeableconcept.CodeableConcept, True, None, False), 

135 ("lastReviewDate", "lastReviewDate", fhirdate.FHIRDate, False, None, False), 

136 ("name", "name", str, False, None, False), 

137 ("publisher", "publisher", str, False, None, False), 

138 ("purpose", "purpose", str, False, None, False), 

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

140 ("subjectType", "subjectType", str, True, None, False), 

141 ("title", "title", str, False, None, False), 

142 ("url", "url", str, False, None, False), 

143 ("useContext", "useContext", usagecontext.UsageContext, True, None, False), 

144 ("version", "version", str, False, None, False), 

145 ]) 

146 return js 

147 

148 

149from . import backboneelement 

150 

151class QuestionnaireItem(backboneelement.BackboneElement): 

152 """ Questions and sections within the Questionnaire. 

153  

154 A particular question, question grouping or display text that is part of 

155 the questionnaire. 

156 """ 

157 

158 resource_type = "QuestionnaireItem" 

159 

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

161 """ Initialize all valid properties. 

162  

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

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

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

166 """ 

167 

168 self.answerOption = None 

169 """ Permitted answer. 

170 List of `QuestionnaireItemAnswerOption` items (represented as `dict` in JSON). """ 

171 

172 self.answerValueSet = None 

173 """ Valueset containing permitted answers. 

174 Type `str`. """ 

175 

176 self.code = None 

177 """ Corresponding concept for this item in a terminology. 

178 List of `Coding` items (represented as `dict` in JSON). """ 

179 

180 self.definition = None 

181 """ ElementDefinition - details for the item. 

182 Type `str`. """ 

183 

184 self.enableBehavior = None 

185 """ all | any. 

186 Type `str`. """ 

187 

188 self.enableWhen = None 

189 """ Only allow data when. 

190 List of `QuestionnaireItemEnableWhen` items (represented as `dict` in JSON). """ 

191 

192 self.initial = None 

193 """ Initial value(s) when item is first rendered. 

194 List of `QuestionnaireItemInitial` items (represented as `dict` in JSON). """ 

195 

196 self.item = None 

197 """ Nested questionnaire items. 

198 List of `QuestionnaireItem` items (represented as `dict` in JSON). """ 

199 

200 self.linkId = None 

201 """ Unique id for item in questionnaire. 

202 Type `str`. """ 

203 

204 self.maxLength = None 

205 """ No more than this many characters. 

206 Type `int`. """ 

207 

208 self.prefix = None 

209 """ E.g. "1(a)", "2.5.3". 

210 Type `str`. """ 

211 

212 self.readOnly = None 

213 """ Don't allow human editing. 

214 Type `bool`. """ 

215 

216 self.repeats = None 

217 """ Whether the item may repeat. 

218 Type `bool`. """ 

219 

220 self.required = None 

221 """ Whether the item must be included in data results. 

222 Type `bool`. """ 

223 

224 self.text = None 

225 """ Primary text for the item. 

226 Type `str`. """ 

227 

228 self.type = None 

229 """ group | display | boolean | decimal | integer | date | dateTime +. 

230 Type `str`. """ 

231 

232 super(QuestionnaireItem, self).__init__(jsondict=jsondict, strict=strict) 

233 

234 def elementProperties(self): 

235 js = super(QuestionnaireItem, self).elementProperties() 

236 js.extend([ 

237 ("answerOption", "answerOption", QuestionnaireItemAnswerOption, True, None, False), 

238 ("answerValueSet", "answerValueSet", str, False, None, False), 

239 ("code", "code", coding.Coding, True, None, False), 

240 ("definition", "definition", str, False, None, False), 

241 ("enableBehavior", "enableBehavior", str, False, None, False), 

242 ("enableWhen", "enableWhen", QuestionnaireItemEnableWhen, True, None, False), 

243 ("initial", "initial", QuestionnaireItemInitial, True, None, False), 

244 ("item", "item", QuestionnaireItem, True, None, False), 

245 ("linkId", "linkId", str, False, None, True), 

246 ("maxLength", "maxLength", int, False, None, False), 

247 ("prefix", "prefix", str, False, None, False), 

248 ("readOnly", "readOnly", bool, False, None, False), 

249 ("repeats", "repeats", bool, False, None, False), 

250 ("required", "required", bool, False, None, False), 

251 ("text", "text", str, False, None, False), 

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

253 ]) 

254 return js 

255 

256 

257class QuestionnaireItemAnswerOption(backboneelement.BackboneElement): 

258 """ Permitted answer. 

259  

260 One of the permitted answers for a "choice" or "open-choice" question. 

261 """ 

262 

263 resource_type = "QuestionnaireItemAnswerOption" 

264 

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

266 """ Initialize all valid properties. 

267  

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

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

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

271 """ 

272 

273 self.initialSelected = None 

274 """ Whether option is selected by default. 

275 Type `bool`. """ 

276 

277 self.valueCoding = None 

278 """ Answer value. 

279 Type `Coding` (represented as `dict` in JSON). """ 

280 

281 self.valueDate = None 

282 """ Answer value. 

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

284 

285 self.valueInteger = None 

286 """ Answer value. 

287 Type `int`. """ 

288 

289 self.valueReference = None 

290 """ Answer value. 

291 Type `FHIRReference` (represented as `dict` in JSON). """ 

292 

293 self.valueString = None 

294 """ Answer value. 

295 Type `str`. """ 

296 

297 self.valueTime = None 

298 """ Answer value. 

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

300 

301 super(QuestionnaireItemAnswerOption, self).__init__(jsondict=jsondict, strict=strict) 

302 

303 def elementProperties(self): 

304 js = super(QuestionnaireItemAnswerOption, self).elementProperties() 

305 js.extend([ 

306 ("initialSelected", "initialSelected", bool, False, None, False), 

307 ("valueCoding", "valueCoding", coding.Coding, False, "value", True), 

308 ("valueDate", "valueDate", fhirdate.FHIRDate, False, "value", True), 

309 ("valueInteger", "valueInteger", int, False, "value", True), 

310 ("valueReference", "valueReference", fhirreference.FHIRReference, False, "value", True), 

311 ("valueString", "valueString", str, False, "value", True), 

312 ("valueTime", "valueTime", fhirdate.FHIRDate, False, "value", True), 

313 ]) 

314 return js 

315 

316 

317class QuestionnaireItemEnableWhen(backboneelement.BackboneElement): 

318 """ Only allow data when. 

319  

320 A constraint indicating that this item should only be enabled 

321 (displayed/allow answers to be captured) when the specified condition is 

322 true. 

323 """ 

324 

325 resource_type = "QuestionnaireItemEnableWhen" 

326 

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

328 """ Initialize all valid properties. 

329  

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

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

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

333 """ 

334 

335 self.answerBoolean = None 

336 """ Value for question comparison based on operator. 

337 Type `bool`. """ 

338 

339 self.answerCoding = None 

340 """ Value for question comparison based on operator. 

341 Type `Coding` (represented as `dict` in JSON). """ 

342 

343 self.answerDate = None 

344 """ Value for question comparison based on operator. 

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

346 

347 self.answerDateTime = None 

348 """ Value for question comparison based on operator. 

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

350 

351 self.answerDecimal = None 

352 """ Value for question comparison based on operator. 

353 Type `float`. """ 

354 

355 self.answerInteger = None 

356 """ Value for question comparison based on operator. 

357 Type `int`. """ 

358 

359 self.answerQuantity = None 

360 """ Value for question comparison based on operator. 

361 Type `Quantity` (represented as `dict` in JSON). """ 

362 

363 self.answerReference = None 

364 """ Value for question comparison based on operator. 

365 Type `FHIRReference` (represented as `dict` in JSON). """ 

366 

367 self.answerString = None 

368 """ Value for question comparison based on operator. 

369 Type `str`. """ 

370 

371 self.answerTime = None 

372 """ Value for question comparison based on operator. 

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

374 

375 self.operator = None 

376 """ exists | = | != | > | < | >= | <=. 

377 Type `str`. """ 

378 

379 self.question = None 

380 """ Question that determines whether item is enabled. 

381 Type `str`. """ 

382 

383 super(QuestionnaireItemEnableWhen, self).__init__(jsondict=jsondict, strict=strict) 

384 

385 def elementProperties(self): 

386 js = super(QuestionnaireItemEnableWhen, self).elementProperties() 

387 js.extend([ 

388 ("answerBoolean", "answerBoolean", bool, False, "answer", True), 

389 ("answerCoding", "answerCoding", coding.Coding, False, "answer", True), 

390 ("answerDate", "answerDate", fhirdate.FHIRDate, False, "answer", True), 

391 ("answerDateTime", "answerDateTime", fhirdate.FHIRDate, False, "answer", True), 

392 ("answerDecimal", "answerDecimal", float, False, "answer", True), 

393 ("answerInteger", "answerInteger", int, False, "answer", True), 

394 ("answerQuantity", "answerQuantity", quantity.Quantity, False, "answer", True), 

395 ("answerReference", "answerReference", fhirreference.FHIRReference, False, "answer", True), 

396 ("answerString", "answerString", str, False, "answer", True), 

397 ("answerTime", "answerTime", fhirdate.FHIRDate, False, "answer", True), 

398 ("operator", "operator", str, False, None, True), 

399 ("question", "question", str, False, None, True), 

400 ]) 

401 return js 

402 

403 

404class QuestionnaireItemInitial(backboneelement.BackboneElement): 

405 """ Initial value(s) when item is first rendered. 

406  

407 One or more values that should be pre-populated in the answer when 

408 initially rendering the questionnaire for user input. 

409 """ 

410 

411 resource_type = "QuestionnaireItemInitial" 

412 

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

414 """ Initialize all valid properties. 

415  

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

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

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

419 """ 

420 

421 self.valueAttachment = None 

422 """ Actual value for initializing the question. 

423 Type `Attachment` (represented as `dict` in JSON). """ 

424 

425 self.valueBoolean = None 

426 """ Actual value for initializing the question. 

427 Type `bool`. """ 

428 

429 self.valueCoding = None 

430 """ Actual value for initializing the question. 

431 Type `Coding` (represented as `dict` in JSON). """ 

432 

433 self.valueDate = None 

434 """ Actual value for initializing the question. 

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

436 

437 self.valueDateTime = None 

438 """ Actual value for initializing the question. 

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

440 

441 self.valueDecimal = None 

442 """ Actual value for initializing the question. 

443 Type `float`. """ 

444 

445 self.valueInteger = None 

446 """ Actual value for initializing the question. 

447 Type `int`. """ 

448 

449 self.valueQuantity = None 

450 """ Actual value for initializing the question. 

451 Type `Quantity` (represented as `dict` in JSON). """ 

452 

453 self.valueReference = None 

454 """ Actual value for initializing the question. 

455 Type `FHIRReference` (represented as `dict` in JSON). """ 

456 

457 self.valueString = None 

458 """ Actual value for initializing the question. 

459 Type `str`. """ 

460 

461 self.valueTime = None 

462 """ Actual value for initializing the question. 

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

464 

465 self.valueUri = None 

466 """ Actual value for initializing the question. 

467 Type `str`. """ 

468 

469 super(QuestionnaireItemInitial, self).__init__(jsondict=jsondict, strict=strict) 

470 

471 def elementProperties(self): 

472 js = super(QuestionnaireItemInitial, self).elementProperties() 

473 js.extend([ 

474 ("valueAttachment", "valueAttachment", attachment.Attachment, False, "value", True), 

475 ("valueBoolean", "valueBoolean", bool, False, "value", True), 

476 ("valueCoding", "valueCoding", coding.Coding, False, "value", True), 

477 ("valueDate", "valueDate", fhirdate.FHIRDate, False, "value", True), 

478 ("valueDateTime", "valueDateTime", fhirdate.FHIRDate, False, "value", True), 

479 ("valueDecimal", "valueDecimal", float, False, "value", True), 

480 ("valueInteger", "valueInteger", int, False, "value", True), 

481 ("valueQuantity", "valueQuantity", quantity.Quantity, False, "value", True), 

482 ("valueReference", "valueReference", fhirreference.FHIRReference, False, "value", True), 

483 ("valueString", "valueString", str, False, "value", True), 

484 ("valueTime", "valueTime", fhirdate.FHIRDate, False, "value", True), 

485 ("valueUri", "valueUri", str, False, "value", True), 

486 ]) 

487 return js 

488 

489 

490import sys 

491try: 

492 from . import attachment 

493except ImportError: 

494 attachment = sys.modules[__package__ + '.attachment'] 

495try: 

496 from . import codeableconcept 

497except ImportError: 

498 codeableconcept = sys.modules[__package__ + '.codeableconcept'] 

499try: 

500 from . import coding 

501except ImportError: 

502 coding = sys.modules[__package__ + '.coding'] 

503try: 

504 from . import contactdetail 

505except ImportError: 

506 contactdetail = sys.modules[__package__ + '.contactdetail'] 

507try: 

508 from . import fhirdate 

509except ImportError: 

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

511try: 

512 from . import fhirreference 

513except ImportError: 

514 fhirreference = sys.modules[__package__ + '.fhirreference'] 

515try: 

516 from . import identifier 

517except ImportError: 

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

519try: 

520 from . import period 

521except ImportError: 

522 period = sys.modules[__package__ + '.period'] 

523try: 

524 from . import quantity 

525except ImportError: 

526 quantity = sys.modules[__package__ + '.quantity'] 

527try: 

528 from . import usagecontext 

529except ImportError: 

530 usagecontext = sys.modules[__package__ + '.usagecontext']