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

5# 2021, SMART Health IT. 

6 

7 

8from . import domainresource 

9 

10class QuestionnaireResponse(domainresource.DomainResource): 

11 """ A structured set of questions and their answers. 

12  

13 A structured set of questions and their answers. The questions are ordered 

14 and grouped into coherent subsets, corresponding to the structure of the 

15 grouping of the questionnaire being responded to. 

16 """ 

17 

18 resource_type = "QuestionnaireResponse" 

19 

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

21 """ Initialize all valid properties. 

22  

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

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

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

26 """ 

27 

28 self.author = None 

29 """ Person who received and recorded the answers. 

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

31 

32 self.authored = None 

33 """ Date the answers were gathered. 

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

35 

36 self.basedOn = None 

37 """ Request fulfilled by this QuestionnaireResponse. 

38 List of `FHIRReference` items (represented as `dict` in JSON). """ 

39 

40 self.encounter = None 

41 """ Encounter created as part of. 

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

43 

44 self.identifier = None 

45 """ Unique id for this set of answers. 

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

47 

48 self.item = None 

49 """ Groups and questions. 

50 List of `QuestionnaireResponseItem` items (represented as `dict` in JSON). """ 

51 

52 self.partOf = None 

53 """ Part of this action. 

54 List of `FHIRReference` items (represented as `dict` in JSON). """ 

55 

56 self.questionnaire = None 

57 """ Form being answered. 

58 Type `str`. """ 

59 

60 self.source = None 

61 """ The person who answered the questions. 

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

63 

64 self.status = None 

65 """ in-progress | completed | amended | entered-in-error | stopped. 

66 Type `str`. """ 

67 

68 self.subject = None 

69 """ The subject of the questions. 

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

71 

72 super(QuestionnaireResponse, self).__init__(jsondict=jsondict, strict=strict) 

73 

74 def elementProperties(self): 

75 js = super(QuestionnaireResponse, self).elementProperties() 

76 js.extend([ 

77 ("author", "author", fhirreference.FHIRReference, False, None, False), 

78 ("authored", "authored", fhirdate.FHIRDate, False, None, False), 

79 ("basedOn", "basedOn", fhirreference.FHIRReference, True, None, False), 

80 ("encounter", "encounter", fhirreference.FHIRReference, False, None, False), 

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

82 ("item", "item", QuestionnaireResponseItem, True, None, False), 

83 ("partOf", "partOf", fhirreference.FHIRReference, True, None, False), 

84 ("questionnaire", "questionnaire", str, False, None, False), 

85 ("source", "source", fhirreference.FHIRReference, False, None, False), 

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

87 ("subject", "subject", fhirreference.FHIRReference, False, None, False), 

88 ]) 

89 return js 

90 

91 

92from . import backboneelement 

93 

94class QuestionnaireResponseItem(backboneelement.BackboneElement): 

95 """ Groups and questions. 

96  

97 A group or question item from the original questionnaire for which answers 

98 are provided. 

99 """ 

100 

101 resource_type = "QuestionnaireResponseItem" 

102 

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

104 """ Initialize all valid properties. 

105  

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

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

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

109 """ 

110 

111 self.answer = None 

112 """ The response(s) to the question. 

113 List of `QuestionnaireResponseItemAnswer` items (represented as `dict` in JSON). """ 

114 

115 self.definition = None 

116 """ ElementDefinition - details for the item. 

117 Type `str`. """ 

118 

119 self.item = None 

120 """ Nested questionnaire response items. 

121 List of `QuestionnaireResponseItem` items (represented as `dict` in JSON). """ 

122 

123 self.linkId = None 

124 """ Pointer to specific item from Questionnaire. 

125 Type `str`. """ 

126 

127 self.text = None 

128 """ Name for group or question text. 

129 Type `str`. """ 

130 

131 super(QuestionnaireResponseItem, self).__init__(jsondict=jsondict, strict=strict) 

132 

133 def elementProperties(self): 

134 js = super(QuestionnaireResponseItem, self).elementProperties() 

135 js.extend([ 

136 ("answer", "answer", QuestionnaireResponseItemAnswer, True, None, False), 

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

138 ("item", "item", QuestionnaireResponseItem, True, None, False), 

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

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

141 ]) 

142 return js 

143 

144 

145class QuestionnaireResponseItemAnswer(backboneelement.BackboneElement): 

146 """ The response(s) to the question. 

147  

148 The respondent's answer(s) to the question. 

149 """ 

150 

151 resource_type = "QuestionnaireResponseItemAnswer" 

152 

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

154 """ Initialize all valid properties. 

155  

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

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

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

159 """ 

160 

161 self.item = None 

162 """ Nested groups and questions. 

163 List of `QuestionnaireResponseItem` items (represented as `dict` in JSON). """ 

164 

165 self.valueAttachment = None 

166 """ Single-valued answer to the question. 

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

168 

169 self.valueBoolean = None 

170 """ Single-valued answer to the question. 

171 Type `bool`. """ 

172 

173 self.valueCoding = None 

174 """ Single-valued answer to the question. 

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

176 

177 self.valueDate = None 

178 """ Single-valued answer to the question. 

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

180 

181 self.valueDateTime = None 

182 """ Single-valued answer to the question. 

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

184 

185 self.valueDecimal = None 

186 """ Single-valued answer to the question. 

187 Type `float`. """ 

188 

189 self.valueInteger = None 

190 """ Single-valued answer to the question. 

191 Type `int`. """ 

192 

193 self.valueQuantity = None 

194 """ Single-valued answer to the question. 

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

196 

197 self.valueReference = None 

198 """ Single-valued answer to the question. 

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

200 

201 self.valueString = None 

202 """ Single-valued answer to the question. 

203 Type `str`. """ 

204 

205 self.valueTime = None 

206 """ Single-valued answer to the question. 

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

208 

209 self.valueUri = None 

210 """ Single-valued answer to the question. 

211 Type `str`. """ 

212 

213 super(QuestionnaireResponseItemAnswer, self).__init__(jsondict=jsondict, strict=strict) 

214 

215 def elementProperties(self): 

216 js = super(QuestionnaireResponseItemAnswer, self).elementProperties() 

217 js.extend([ 

218 ("item", "item", QuestionnaireResponseItem, True, None, False), 

219 ("valueAttachment", "valueAttachment", attachment.Attachment, False, "value", False), 

220 ("valueBoolean", "valueBoolean", bool, False, "value", False), 

221 ("valueCoding", "valueCoding", coding.Coding, False, "value", False), 

222 ("valueDate", "valueDate", fhirdate.FHIRDate, False, "value", False), 

223 ("valueDateTime", "valueDateTime", fhirdate.FHIRDate, False, "value", False), 

224 ("valueDecimal", "valueDecimal", float, False, "value", False), 

225 ("valueInteger", "valueInteger", int, False, "value", False), 

226 ("valueQuantity", "valueQuantity", quantity.Quantity, False, "value", False), 

227 ("valueReference", "valueReference", fhirreference.FHIRReference, False, "value", False), 

228 ("valueString", "valueString", str, False, "value", False), 

229 ("valueTime", "valueTime", fhirdate.FHIRDate, False, "value", False), 

230 ("valueUri", "valueUri", str, False, "value", False), 

231 ]) 

232 return js 

233 

234 

235import sys 

236try: 

237 from . import attachment 

238except ImportError: 

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

240try: 

241 from . import coding 

242except ImportError: 

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

244try: 

245 from . import fhirdate 

246except ImportError: 

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

248try: 

249 from . import fhirreference 

250except ImportError: 

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

252try: 

253 from . import identifier 

254except ImportError: 

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

256try: 

257 from . import quantity 

258except ImportError: 

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