forked from tracefirst/usaha_committee
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ecvi.xsd
637 lines (634 loc) · 32.7 KB
/
ecvi.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
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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
targetNamespace="http://www.usaha.org/xmlns/ecvi" version="6.0"
xmlns="http://www.usaha.org/xmlns/ecvi"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" ecore:package="org.usaha.ecvi" ecore:nsPrefix="ecvi">
<xs:annotation>
<xs:documentation>
(c) Copyright 2012-2013 Trace First Limited.
All rights reserved.
http://www.tracefirst.com/
</xs:documentation>
<xs:documentation>This XML Schema is Copyright © Trace First Limited and is made available under their XML Schema Public License v1. This license is accessible at http://www.statevet.com/xml/public-license-v1.pdf</xs:documentation>
</xs:annotation>
<xs:element name="eCVI">
<xs:complexType ecore:name="Ecvi">
<xs:sequence minOccurs="1" maxOccurs="1">
<xs:element name="Veterinarian" minOccurs="1" maxOccurs="1">
<xs:complexType ecore:name="Veterinarian">
<xs:sequence>
<xs:element name="Person" type="PersonType" minOccurs="1" maxOccurs="1"/>
<xs:element name="Address" type="Address" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
<xs:attribute name="LicenseIssueState" type="UsState" use="optional"/>
<xs:attribute name="LicenseNumber" type="xs:string" use="optional"/>
<xs:attribute name="NationalAccreditationNumber" type="xs:string" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="MovementPurposes" type="MovementPurposeListType" minOccurs="1" maxOccurs="1"/>
<xs:element name="Origin" type="PremType" minOccurs="1" maxOccurs="1"/>
<xs:element name="Destination" type="PremType" minOccurs="1" maxOccurs="1"/>
<xs:element name="Consignor" type="ContactType" minOccurs="0" maxOccurs="1"/>
<xs:element name="Consignee" type="ContactType" minOccurs="0" maxOccurs="1"/>
<xs:element name="Accessions" minOccurs="0" maxOccurs="1">
<xs:complexType ecore:name="Accessions">
<xs:sequence>
<xs:element name="Accession" type="AccessionType" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:sequence maxOccurs="unbounded" minOccurs="0">
<xs:element name="Animal" minOccurs="1" maxOccurs="1">
<xs:complexType ecore:name="Animal">
<xs:sequence minOccurs="1" maxOccurs="1">
<xs:element name="AnimalTag" minOccurs="1" maxOccurs="6">
<xs:complexType ecore:name="AnimalTag">
<xs:attribute name="Type" type="TagType" use="optional"/>
<xs:attribute name="Number" type="xs:string" use="required"/>
<xs:attribute name="BrandImage" type="xs:base64Binary" use="optional">
<xs:annotation>
<xs:documentation>This should be PNG/JPEG/GIF/PDF format and must be provided if the TagType is BRAND-IMAGE</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="Test" type="TestType" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="Age" type="AgeType" use="optional"/>
<xs:attribute name="Breed" type="BreedType" use="optional"/>
<xs:attribute name="Sex" type="SexType" use="optional"/>
<xs:attribute name="SexDetail" use="optional">
<xs:simpleType ecore:name="AnimalSexDetail">
<xs:restriction base="xs:string">
<xs:maxLength value="100"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="InspectionDate" type="xs:date" use="required">
<xs:annotation>
<xs:documentation>This is the date on which the animals were inspected by the accrediting veterinarian. If the inspection took place over multiple days, the first day of the inspection should be used.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="GroupLot" minOccurs="1" maxOccurs="1">
<xs:complexType ecore:name="GroupLot">
<xs:attribute name="Quantity" type="xs:float" use="required">
<xs:annotation>
<xs:documentation>This is the quantity of animals or other commodity included in this GroupLot element.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute default="Number" name="Unit" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>This is the type of Units that the Quantity refers to. For example, it could be pounds or gallons.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="Species" type="SpeciesCodeType" use="optional"/>
<xs:attribute name="Age" type="AgeType" use="optional"/>
<xs:attribute name="Breed" type="BreedType" use="optional"/>
<xs:attribute name="Sex" type="SexType" use="optional"/>
<xs:attribute name="SexDetail" use="optional">
<xs:simpleType ecore:name="GroupLotSexDetail">
<xs:restriction base="xs:string">
<xs:maxLength value="100"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="Description" use="required">
<xs:simpleType ecore:name="GroupLotDescription">
<xs:restriction base="xs:string">
<xs:maxLength value="200"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:element name="Attachment" type="AttachmentType" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="CviNumber" use="required">
<xs:annotation>
<xs:documentation>This is the CVI number for this CVI</xs:documentation>
</xs:annotation>
<xs:simpleType ecore:name="CviNumber">
<xs:restriction base="xs:string">
<xs:maxLength value="100"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="SpeciesCode" type="SpeciesCodeType" use="required">
<xs:annotation>
<xs:documentation>This is the Species for all the animals contained in this CVI.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="IssueDate" type="xs:date" use="required">
<xs:annotation>
<xs:documentation>This is the date on which the CVI was issued.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="ExpirationDate" type="xs:date" use="required">
<xs:annotation>
<xs:documentation>This is the last date on which this CVI remains valid.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="ShipmentDate" type="xs:date" use="optional">
<xs:annotation>
<xs:documentation>This is the date on which the animals will leave the origin premises to commence their interstate movement.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="EntryPermitNumber" use="optional">
<xs:simpleType ecore:name="EntryPermitNumber">
<xs:restriction base="xs:string">
<xs:maxLength value="100"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:simpleType name="SpeciesCodeType" ecore:name="SpeciesCode">
<xs:annotation>
<xs:documentation>This enforces the list of allowed species codes that are supported.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="UNK"/>
<xs:enumeration value="BOV"/>
<xs:enumeration value="CAP"/>
<xs:enumeration value="CER"/>
<xs:enumeration value="EQU"/>
<xs:enumeration value="OVI"/>
<xs:enumeration value="POR"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="AgeType" ecore:name="Age">
<xs:annotation>
<xs:documentation>This can be an age specified as a number of days, weeks, months or years (suffixed with d, wk, mo or a to designate which) or a date of birth specified as "YYYY-MM-DD"
The age definitions adhere to UCUM - http://unitsofmeasure.org/ucum.html</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:pattern value="[0-9]{1,2}(d|wk|mo|a)"/>
<xs:pattern value="(19|20)\d\d-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="TagType">
<xs:annotation>
<xs:documentation>This enforces the list of allowed tag types that are supported.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="UN"/>
<xs:enumeration value="AIN"/>
<xs:enumeration value="AMID"/>
<xs:enumeration value="BRAND"/>
<xs:enumeration value="BRAND-IMAGE"/>
<xs:enumeration value="BT"/>
<xs:enumeration value="IMP"/>
<xs:enumeration value="MGT"/>
<xs:enumeration value="N840RFID"/>
<xs:enumeration value="NUES8"/>
<xs:enumeration value="NUES9"/>
<xs:enumeration value="OFORID"/>
<xs:enumeration value="OTH"/>
<xs:enumeration value="NAME"/>
<xs:enumeration value="SGFLID"/>
<xs:enumeration value="NPIN"/>
<xs:enumeration value="TAT"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="BreedType" ecore:name="Breed">
<xs:annotation>
<xs:documentation>The breed code must be 2 or 3 uppercase characters</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:minLength value="2"/>
<xs:maxLength value="3"/>
<xs:pattern value="[A-Z]{2,3}"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="SexType" ecore:name="Sex">
<xs:annotation>
<xs:documentation>This enforces the list of allowed codes for animal sex types that are supported.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="Female"/>
<xs:enumeration value="Male"/>
<xs:enumeration value="Gender Unknown"/>
<xs:enumeration value="Spayed Female"/>
<xs:enumeration value="Neutered Male"/>
<xs:enumeration value="True Hermaphrodite"/>
<xs:enumeration value="Other"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="Address">
<xs:sequence>
<xs:element name="Line1" minOccurs="1" maxOccurs="1">
<xs:annotation>
<xs:documentation>First line of the premises address</xs:documentation>
</xs:annotation>
<xs:simpleType ecore:name="AddressLine1">
<xs:restriction base="xs:string">
<xs:maxLength value="200"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Line2" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation>Second line of the premises address</xs:documentation>
</xs:annotation>
<xs:simpleType ecore:name="AddressLine2">
<xs:restriction base="xs:string">
<xs:maxLength value="200"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Town" minOccurs="1" maxOccurs="1">
<xs:annotation>
<xs:documentation>Town/City of the premises address</xs:documentation>
</xs:annotation>
<xs:simpleType ecore:name="Town">
<xs:restriction base="xs:string">
<xs:maxLength value="200"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="County" type="CountyType" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation>County of the premises address</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="State" type="UsState" minOccurs="1" maxOccurs="1">
<xs:annotation>
<xs:documentation>State of the premises address</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="ZIP" type="ZipCode" minOccurs="1" maxOccurs="1">
<xs:annotation>
<xs:documentation>ZipCode of the premises address</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="Country" type="ISO3166CountryType" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation>Country of the premises address</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="GeoPoint" type="GeoPointType" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation>The co-ordinates of this premises</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="PremType" ecore:name="Premises">
<xs:sequence>
<xs:element name="PremId" type="PremIdType" minOccurs="0" maxOccurs="1"/>
<xs:element name="PremName" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="Address" type="Address" minOccurs="1" maxOccurs="1"/>
<xs:element name="ProgramStatus" type="ProgramStatusType" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="Person" type="PersonType" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ContactType" ecore:name="Contact">
<xs:sequence>
<xs:element name="PremId" type="PremIdType" minOccurs="0" maxOccurs="1"/>
<xs:element name="PremName" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="Address" type="Address" minOccurs="0" maxOccurs="1"/>
<xs:element name="Person" type="PersonType" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="PremIdType" ecore:name="PremId">
<xs:annotation>
<xs:documentation>NAIS Premises ID or State LID (6-8 uppercase letters and digits)</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:pattern value="[A-Z0-9]{6,8}"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="ProgramStatusType" ecore:name="ProgramStatus">
<xs:attribute name="Name" use="required">
<xs:simpleType ecore:name="ProgramStatusName">
<xs:restriction base="xs:string">
<xs:enumeration value="Bovine Tuberculosis"/>
<xs:enumeration value="Brucellosis (state)"/>
<xs:enumeration value="Brucellosis (herd)"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="Value" use="required">
<xs:annotation>
<xs:documentation>If this is 'Other' you should elaborate using the ValueOther attribute</xs:documentation>
</xs:annotation>
<xs:simpleType ecore:name="ProgramStatusValue">
<xs:restriction base="xs:string">
<xs:enumeration value="Free"/>
<xs:enumeration value="Modified Accredited"/>
<xs:enumeration value="Modified Advanced Accredited"/>
<xs:enumeration value="Other"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="ValueOther" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>You should only provide this attribute if the Value is 'Other'</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:simpleType name="CountyType" ecore:name="County">
<xs:annotation>
<xs:documentation>From "Lee" to "Aleutians West Census Area" and beyond!</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:minLength value="3"/>
<xs:maxLength value="40"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="UsState" ecore:name="UsState">
<xs:annotation>
<xs:documentation>2-character abbreviation for a state as per USPS National ZIP Code Directory</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:length value="2"/>
<xs:enumeration value="AA"/>
<xs:enumeration value="AE"/>
<xs:enumeration value="AK"/>
<xs:enumeration value="AL"/>
<xs:enumeration value="AP"/>
<xs:enumeration value="AR"/>
<xs:enumeration value="AS"/>
<xs:enumeration value="AZ"/>
<xs:enumeration value="CA"/>
<xs:enumeration value="CO"/>
<xs:enumeration value="CT"/>
<xs:enumeration value="DC"/>
<xs:enumeration value="DE"/>
<xs:enumeration value="FL"/>
<xs:enumeration value="FM"/>
<xs:enumeration value="GA"/>
<xs:enumeration value="GU"/>
<xs:enumeration value="HI"/>
<xs:enumeration value="IA"/>
<xs:enumeration value="ID"/>
<xs:enumeration value="IL"/>
<xs:enumeration value="IN"/>
<xs:enumeration value="KS"/>
<xs:enumeration value="KY"/>
<xs:enumeration value="LA"/>
<xs:enumeration value="MA"/>
<xs:enumeration value="MD"/>
<xs:enumeration value="ME"/>
<xs:enumeration value="MH"/>
<xs:enumeration value="MI"/>
<xs:enumeration value="MN"/>
<xs:enumeration value="MO"/>
<xs:enumeration value="MP"/>
<xs:enumeration value="MS"/>
<xs:enumeration value="MT"/>
<xs:enumeration value="NC"/>
<xs:enumeration value="ND"/>
<xs:enumeration value="NE"/>
<xs:enumeration value="NH"/>
<xs:enumeration value="NJ"/>
<xs:enumeration value="NM"/>
<xs:enumeration value="NV"/>
<xs:enumeration value="NY"/>
<xs:enumeration value="OH"/>
<xs:enumeration value="OK"/>
<xs:enumeration value="OR"/>
<xs:enumeration value="PA"/>
<xs:enumeration value="PR"/>
<xs:enumeration value="PW"/>
<xs:enumeration value="RI"/>
<xs:enumeration value="SC"/>
<xs:enumeration value="SD"/>
<xs:enumeration value="TN"/>
<xs:enumeration value="TX"/>
<xs:enumeration value="UT"/>
<xs:enumeration value="VA"/>
<xs:enumeration value="VI"/>
<xs:enumeration value="VT"/>
<xs:enumeration value="WA"/>
<xs:enumeration value="WI"/>
<xs:enumeration value="WV"/>
<xs:enumeration value="WY"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ISO3166CountryType" ecore:name="ISO3166Country">
<xs:annotation>
<xs:documentation>ISO3166 Alpha-3 codes</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="USA"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ZipCode" ecore:name="ZipCode">
<xs:annotation>
<xs:documentation>Must be ZIP or ZIP+4 format</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:pattern value="[0-9]{5}"/>
<xs:pattern value="[0-9]{5}-[0-9]{4}"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="LatitudeType" ecore:name="Latitude">
<xs:annotation>
<xs:documentation>A positive number indicates North; negative indicates South</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:decimal">
<xs:minInclusive value="-90.0"/>
<xs:maxInclusive value="90.0"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="LongitudeType" ecore:name="Longitude">
<xs:annotation>
<xs:documentation>A negative number indicates West; a positive number indicates East</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:decimal">
<xs:minInclusive value="-180.0"/>
<xs:maxInclusive value="180.0"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="GeoPointType" ecore:name="GeoPoint">
<xs:attribute name="lat" type="LatitudeType" use="required"/>
<xs:attribute name="lng" type="LongitudeType" use="required"/>
</xs:complexType>
<xs:complexType name="PersonType" ecore:name="Person">
<xs:sequence>
<xs:element name="Name" type="xs:string" minOccurs="1" maxOccurs="1"/>
<xs:element name="Phone" type="PhoneNumType" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="PhoneNumType" ecore:name="PhoneNum">
<xs:attribute name="Type" type="PhoneDeviceType" use="required"/>
<xs:attribute name="Number" use="required">
<xs:simpleType ecore:name="PhoneNumNumber">
<xs:restriction base="PhoneNumber">
<xs:pattern value="[0-9]{10}"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="Comment" use="optional">
<xs:annotation>
<xs:documentation>This is meant for comments about this phone number. Examples might be an extension number or a comment such as "daytime only."</xs:documentation>
</xs:annotation>
<xs:simpleType ecore:name="PhoneNumComment">
<xs:restriction base="xs:string">
<xs:maxLength value="100"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
<xs:simpleType name="PhoneDeviceType" ecore:name="PhoneDevice">
<xs:annotation>
<xs:documentation>What type of device is this phone number for?</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="Unknown"/>
<xs:enumeration value="Landline"/>
<xs:enumeration value="Cellphone"/>
<xs:enumeration value="Fax"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="PhoneNumber" ecore:name="PhoneNumber">
<xs:annotation>
<xs:documentation>Must be a 10-digit number without spaces, dashes etc.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:length value="10"/>
<xs:pattern value="[0-9]{10}"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="AttachmentType" ecore:name="Attachement">
<xs:sequence>
<xs:element name="Payload" type="xs:base64Binary" minOccurs="1" maxOccurs="1"/>
</xs:sequence>
<xs:attribute name="DocType" use="required" >
<xs:annotation>
<xs:documentation>This specifies what type of document this attachment is</xs:documentation>
</xs:annotation>
<xs:simpleType ecore:name="DocType">
<xs:restriction base="xs:string">
<xs:enumeration value="Scanned Paper CVI"/>
<xs:enumeration value="Scanned Test Chart"/>
<xs:enumeration value="PDF CVI"/>
<xs:enumeration value="PDF Test Chart"/>
<xs:enumeration value="Other"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="MimeType" type="MimeTypeType" use="optional"/>
<xs:attribute name="Filename" use="required">
<xs:simpleType ecore:name="FileName">
<xs:restriction base="xs:string">
<xs:maxLength value="250"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="Comment" use="optional">
<xs:simpleType ecore:name="AttachementComment">
<xs:restriction base="xs:string">
<xs:maxLength value="250"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
<xs:simpleType name="MimeTypeType" ecore:name="MimeType">
<xs:annotation>
<xs:documentation>See http://tools.ietf.org/html/rfc4288#section-4.2</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:pattern value="^.{1,127}/.{1,127}$"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="AccessionType" ecore:name="Accession">
<xs:sequence>
<xs:element name="Laboratory" minOccurs="1" maxOccurs="1">
<xs:complexType ecore:name="Laboratory">
<xs:sequence>
<xs:element name="LabName" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="PremId" type="PremIdType" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation>This is the Premises ID for the Laboratory. If it is an in-field test, then the premises ID of the farm on which the tests were performed should be used.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="Address" type="Address" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:documentation>This is the address for the Laboratory. If it is an in-field test, then the address of the farm on which the tests were performed should be used.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
<xs:attribute name="AccessionDate" type="xs:date" use="required">
<xs:annotation>
<xs:documentation>This is the date on which the samples were received by the laboratory.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="AccessionNumber" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>This is the Accession Number of this accession/test chart.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="id" type="xs:ID" use="required">
<xs:annotation>
<xs:documentation>This is the reference number that we will use to associate an animal's test details derived from this Accession.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="InfieldTest" type="xs:boolean" use="required">
<xs:annotation>
<xs:documentation>This flag should be 'true' if this Accession is the result of an infield test; it should be 'false' if the Accession was sent to a laboratory</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="TestType" ecore:name="Test">
<xs:sequence>
<xs:element name="Result" type="ResultValueType" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="idref" type="xs:IDREF" use="required">
<xs:annotation>
<xs:documentation>This *must* be one of the ID values in the Accessions included with this document. If any Animal Test references an Accession ID that doesn't exist, the document will not be valid.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="TestCode" type="xs:string" use="required"/>
</xs:complexType>
<xs:simpleType name="ResultNameType" ecore:name="ResultName">
<xs:annotation>
<xs:documentation>This is the result type which can either be RESULT or COMMENT</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="RESULT"/>
<xs:enumeration value="COMMENT"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="ResultValueType" ecore:name="ResultValue">
<xs:annotation>
<xs:documentation>You should choose the correct type for the result based on your source data type. We support Integer, Float and String.</xs:documentation>
</xs:annotation>
<xs:choice>
<xs:element name="ResultInteger" type="xs:integer" minOccurs="0" maxOccurs="1"/>
<xs:element name="ResultString" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="ResultFloat" type="xs:float" minOccurs="0" maxOccurs="1"/>
</xs:choice>
<xs:attribute name="ResultName" type="ResultNameType" use="required"/>
</xs:complexType>
<xs:complexType name="MovementPurposeListType" ecore:name="MovementPurposes">
<xs:sequence>
<xs:element name="MovementPurpose" type="MovementPurposeType" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="MovementPurposeType" ecore:name="MovementPurpose">
<xs:restriction base="xs:string">
<xs:enumeration value="show"/>
<xs:enumeration value="race"/>
<xs:enumeration value="rodeo"/>
<xs:enumeration value="sale"/>
<xs:enumeration value="pet"/>
<xs:enumeration value="breeding"/>
<xs:enumeration value="feeding"/>
<xs:enumeration value="grazing"/>
<xs:enumeration value="training"/>
<xs:enumeration value="slaughter"/>
<xs:enumeration value="medicalTreatment"/>
<xs:enumeration value="other"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>