forked from chb/indivo_schemas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lab.xsd
144 lines (110 loc) · 5.48 KB
/
lab.xsd
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
<?xml version="1.0" encoding="ISO-8859-1" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://indivo.org/vocab/xml/documents#"
xmlns:indivo="http://indivo.org/vocab/xml/documents#"
elementFormDefault="qualified">
<xs:include schemaLocation="codes.xsd" />
<xs:include schemaLocation="provider.xsd" />
<xs:include schemaLocation="values.xsd" />
<!-- the base type for a lab test -->
<xs:complexType name="LabTest">
<xs:sequence>
<xs:element name="dateMeasured" type="xs:dateTime" minOccurs="1" maxOccurs="1" />
<!-- e.g. "hematocrit" -->
<xs:element name="name" type="indivo:CodedValue" minOccurs="1" maxOccurs="1" />
<!-- either preliminary, or final -->
<xs:element name="final" type="xs:boolean" minOccurs="1" maxOccurs="1" />
</xs:sequence>
</xs:complexType>
<!-- a type to represent a single-value lab test -->
<xs:complexType name="SingleResultLabTest">
<xs:complexContent>
<xs:extension base="indivo:LabTest">
<xs:sequence>
<!-- an abstract type, which will be subtyped in instance documents -->
<xs:element name="result" type="indivo:Result" minOccurs="1" maxOccurs="1" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!-- a type to represent a single MIC lab test -->
<xs:complexType name="MicroWithCultureLabTest">
<xs:complexContent>
<xs:extension base="indivo:LabTest">
<xs:sequence>
<xs:element name="source" type="indivo:CodedValue" minOccurs="1" maxOccurs="1" />
<!-- a bunch of observations -->
<xs:element name="observation" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="time" type="xs:dateTime" minOccurs="1" maxOccurs="1" />
<xs:element name="microbialDensity" type="indivo:Concentration" minOccurs="0" maxOccurs="1" />
<xs:element name="organism" type="indivo:CodedValue" minOccurs="0" maxOccurs="1" />
<xs:element name="extendedDescription" type="xs:string" minOccurs="0" maxOccurs="1" />
<!-- aerobic, anaerobic, not specified, or not cultured altogether -->
<xs:element name="cultureCondition" type="xs:string" minOccurs="0" maxOccurs="1" />
<xs:element name="gram" type="xs:boolean" minOccurs="0" maxOccurs="1" />
<xs:element name="morphology" type="xs:string" minOccurs="0" maxOccurs="1" />
<xs:element name="organization" type="xs:string" minOccurs="0" maxOccurs="1" />
<xs:element name="comments" type="xs:string" minOccurs="0" maxOccurs="1" />
</xs:sequence>
<!-- an isolate is a group of organisms that look similar, while an identity is a clear identified microorg -->
<xs:attribute name="isolate" type="xs:string" use="required" />
<xs:attribute name="identity" type="xs:string" use="optional" />
</xs:complexType>
</xs:element>
<!-- a bunch of results (could be more than one if more than one bug -->
<xs:element name="result" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="organism" type="indivo:CodedValue" minOccurs="1" maxOccurs="1" />
<xs:element name="sensitivity" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="antibiotic" type="indivo:CodedValue" minOccurs="1" maxOccurs="1" />
<xs:element name="MIC" type="indivo:Concentration" minOccurs="0" maxOccurs="1" />
<!-- coded value for resistant/intermediate/not resistant -->
<xs:element name="interpretation" type="indivo:CodedValue" minOccurs="1" maxOccurs="1" />
<!-- more info -->
<xs:element name="comments" type="xs:string" minOccurs="0" maxOccurs="1" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="interpretation" type="xs:string" minOccurs="0" maxOccurs="1" />
<!-- additional comments that are not directly interpretation -->
<xs:element name="comments" type="xs:string" minOccurs="0" maxOccurs="1" />
</xs:sequence>
<xs:attribute name="isolate" type="xs:string" use="required" />
<xs:attribute name="identity" type="xs:string" use="optional" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!-- a type to represent a panel of tests -->
<xs:complexType name="LabPanel">
<xs:sequence>
<!-- e.g. CBC -->
<xs:element name="name" type="indivo:CodedValue" minOccurs="1" maxOccurs="1" />
<!-- for now, no subpanels, but we could do it if we wanted to with a self-reference -->
<!-- a bunch of lab tests -->
<xs:element name="labTest" type="indivo:LabTest" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
<xs:element name="Lab">
<xs:complexType>
<xs:sequence>
<xs:element name="dateMeasured" type="xs:dateTime" minOccurs="1" maxOccurs="1" />
<!-- e.g. "hematology" -->
<xs:element name="labType" type="xs:string" minOccurs="1" maxOccurs="1" />
<!-- the lab provider -->
<xs:element name="laboratory" type="indivo:LabProvider" minOccurs="0" maxOccurs="1" />
<!-- a bunch of panels -->
<xs:element name="labPanel" type="indivo:LabPanel" minOccurs="0" maxOccurs="unbounded" />
<!-- a bunch of additional tests not in any panel -->
<xs:element name="labTest" type="indivo:LabTest" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="comments" type="xs:string" minOccurs="0" maxOccurs="1" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>