-
Notifications
You must be signed in to change notification settings - Fork 49
/
deviceusestatement.schema.js
202 lines (201 loc) · 8.1 KB
/
deviceusestatement.schema.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
const {
GraphQLNonNull,
GraphQLEnumType,
GraphQLList,
GraphQLUnionType,
GraphQLObjectType,
} = require('graphql');
const IdScalar = require('../scalars/id.scalar.js');
const UriScalar = require('../scalars/uri.scalar.js');
const CodeScalar = require('../scalars/code.scalar.js');
const DateTimeScalar = require('../scalars/datetime.scalar.js');
/**
* @name exports
* @summary DeviceUseStatement Schema
*/
module.exports = new GraphQLObjectType({
name: 'DeviceUseStatement',
description: 'Base StructureDefinition for DeviceUseStatement Resource',
fields: () => ({
resourceType: {
type: new GraphQLNonNull(
new GraphQLEnumType({
name: 'DeviceUseStatement_Enum_schema',
values: { DeviceUseStatement: { value: 'DeviceUseStatement' } },
}),
),
description: 'Type of resource',
},
_id: {
type: require('./element.schema.js'),
description:
'The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.',
},
id: {
type: IdScalar,
description:
'The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.',
},
meta: {
type: require('./meta.schema.js'),
description:
'The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource.',
},
_implicitRules: {
type: require('./element.schema.js'),
description:
'A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content.',
},
implicitRules: {
type: UriScalar,
description:
'A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content.',
},
_language: {
type: require('./element.schema.js'),
description: 'The base language in which the resource is written.',
},
// valueSetReference: http://hl7.org/fhir/ValueSet/languages
language: {
type: CodeScalar,
description: 'The base language in which the resource is written.',
},
text: {
type: require('./narrative.schema.js'),
description:
"A human-readable narrative that contains a summary of the resource, and may be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it 'clinically safe' for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.",
},
contained: {
type: new GraphQLList(require('./resourcelist.schema')),
description:
'These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.',
},
extension: {
type: new GraphQLList(require('./extension.schema.js')),
description:
'May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.',
},
modifierExtension: {
type: new GraphQLList(require('./extension.schema.js')),
description:
'May be used to represent additional information that is not part of the basic definition of the resource, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.',
},
identifier: {
type: new GraphQLList(require('./identifier.schema.js')),
description: 'An external identifier for this statement such as an IRI.',
},
_status: {
type: require('./element.schema.js'),
description:
"A code representing the patient or other source's judgment about the state of the device used that this statement is about. Generally this will be active or completed.",
},
// valueSetReference: http://hl7.org/fhir/ValueSet/device-statement-status
status: {
type: new GraphQLNonNull(CodeScalar),
description:
"A code representing the patient or other source's judgment about the state of the device used that this statement is about. Generally this will be active or completed.",
},
subject: {
type: new GraphQLNonNull(
new GraphQLUnionType({
name: 'DeviceUseStatementsubject_subject_Union',
description: 'The patient who used the device.',
types: () => [
require('./patient.schema.js'),
require('./group.schema.js'),
],
resolveType(data) {
if (data && data.resourceType === 'Patient') {
return require('./patient.schema.js');
}
if (data && data.resourceType === 'Group') {
return require('./group.schema.js');
}
},
}),
),
description: 'The patient who used the device.',
},
whenUsed: {
type: require('./period.schema.js'),
description: 'The time period over which the device was used.',
},
timingTiming: {
type: require('./timing.schema.js'),
description: 'How often the device was used.',
},
timingPeriod: {
type: require('./period.schema.js'),
description: 'How often the device was used.',
},
_timingDateTime: {
type: require('./element.schema.js'),
description: 'How often the device was used.',
},
timingDateTime: {
type: DateTimeScalar,
description: 'How often the device was used.',
},
_recordedOn: {
type: require('./element.schema.js'),
description: 'The time at which the statement was made/recorded.',
},
recordedOn: {
type: DateTimeScalar,
description: 'The time at which the statement was made/recorded.',
},
source: {
type: new GraphQLUnionType({
name: 'DeviceUseStatementsource_source_Union',
description: 'Who reported the device was being used by the patient.',
types: () => [
require('./patient.schema.js'),
require('./practitioner.schema.js'),
require('./relatedperson.schema.js'),
],
resolveType(data) {
if (data && data.resourceType === 'Patient') {
return require('./patient.schema.js');
}
if (data && data.resourceType === 'Practitioner') {
return require('./practitioner.schema.js');
}
if (data && data.resourceType === 'RelatedPerson') {
return require('./relatedperson.schema.js');
}
},
}),
description: 'Who reported the device was being used by the patient.',
},
device: {
type: new GraphQLNonNull(
new GraphQLUnionType({
name: 'DeviceUseStatementdevice_device_Union',
description: 'The details of the device used.',
types: () => [require('./device.schema.js')],
resolveType(data) {
if (data && data.resourceType === 'Device') {
return require('./device.schema.js');
}
},
}),
),
description: 'The details of the device used.',
},
indication: {
type: new GraphQLList(require('./codeableconcept.schema.js')),
description: 'Reason or justification for the use of the device.',
},
// valueSetReference: http://hl7.org/fhir/ValueSet/body-site
bodySite: {
type: require('./codeableconcept.schema.js'),
description:
"Indicates the site on the subject's body where the device was used ( i.e. the target site).",
},
note: {
type: new GraphQLList(require('./annotation.schema.js')),
description:
'Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.',
},
}),
});