forked from chb/indivo_server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
indivo_wadl.xml
4759 lines (4728 loc) · 169 KB
/
indivo_wadl.xml
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
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<application xmlns="http://wadl.dev.java.net/2009/02" xmlns:iwe="http://org.indivo.server/indivoServerWadlExtension" xmlns:ns0="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="placeholder_for__http://www.w3.org/2001/XMLSchema-instance"
ns0:schemaLocation="http://wadl.dev.java.net/2009/02 file:///home/nate/NetBeansProjects/src/sh/wadl.xsd http://org.indivo.server/indivoServerWadlExtension file:///home/nate/NetBeansProjects/artifacts_from_wadl/src/main/xml/indivoServerWadlExtension.xsd">
<!-- replace "placeholder_for__http://www.w3.org/2001/XMLSchema-instance" with "http://www.w3.org/2001/XMLSchema-instance"
to validate against indivo_wadl_restriction.xsd -->
<doc title="indivo_server_Alaph-3" xml:lang="en">This wadl describes the Indivo REST API, version:alpha-3</doc>
<grammars>
<include href="NewsSearchResponse.xsd"/>
<include href="Error.xsd"/>
</grammars>
<resources base="http://x-staging.indivo.org:8000">
<wadl:doc xmlns:wadl="http://wadl.dev.java.net/2009/02">
{
grantsOauthLegged : {
"None" : { "machineapp":"2L" ,"account":"3L" },
"accessrule_carenet_account" : "3L",
"accessrule_carenet_document" : "3L",
"account_ruleset.account_rule" : "3L",
"account_ruleset.is_owner" : "3L",
"account_ruleset.reqtoken_carenet" : "3L",
"account_ruleset.reqtoken_exists" : "3L",
"account_ruleset.reqtoken_record" : "3L",
"ar_carenet_account" : "3L",
"ar_share_record_or_pha" : "3L",
"full_control" : "3L",
"machapp_ruleset.appspecific_rule" : "2L",
"machapp_ruleset.machineapp_record_created_rule" : "2L",
"machapp_ruleset.no_external_id" : "2L",
"machapp_ruleset.principal_email_matches_principal" : "2L",
"userapp_ruleset.userapp_documents" : "2L"
},
grantsText : {
"None" : { "machineapp":"(2L) All admin apps", "account":"(3L) All accounts" },
"accessrule_carenet_account" : "(3L) An account which controls the record or is in the carenet",
"accessrule_carenet_document" : "(3L) An account which controls the record or has been granted a complete share of the record",
"account_ruleset.account_rule" : "(3L) An account which matches the account on which the action is being performed",
"account_ruleset.is_owner" : "(3L) An account which is the owner of the record on which the action is being performed",
"account_ruleset.reqtoken_carenet" : "(3L) An account which is in the given carenet, and the given PHA is also in the given carenet",
"account_ruleset.reqtoken_exists" : "(3L) An account using an existing request token",
"account_ruleset.reqtoken_record" : "(3L) An account which can administer the given record for reqtoken approval",
"ar_carenet_account" : "The currently-used access token's bound record matches the requested record OR The current account bound to this access token is in the requested carenet",
"ar_share_record_or_pha" :
"(3L) A PHA which has proper record-or-carenet access, when using a token which corresponds to a share in the appropriate carenet if the carenet is specified",
"full_control" : "(3L) An account which has full control over the given record",
"machapp_ruleset.appspecific_rule" : "(2L) An admin app",
"machapp_ruleset.machineapp_record_created_rule" : "(2L) An admin app which created the given record",
"machapp_ruleset.no_external_id" : "(2L) An admin app",
"machapp_ruleset.principal_email_matches_principal" :
"(2L) An admin app with and ID which matches the supplied app-id",
"userapp_ruleset.userapp_documents" : "(2L) A PHA with an ID which matchres the supplied app-id"
}
}
</wadl:doc>
<resource xsi:type="IndivoNonURLResource" id="Overview">
<doc>
<span xmlns="http://www.w3.org/1999/xhtml">
<h2> <span class="mw-headline"> Overview </span>
</h2>
<p>Personal Health Applications (PHAs) make HTTP calls to the Indivo API endpoint using the REST convention. <a class="external text" href="http://oauth.net/" rel="nofollow" title="http://oauth.net">oAuth</a>
is used to authenticate all calls, either in 2-legged mode for simple
authentication, or in 3-legged mode when the PHA is making a call with
delegated authentication, i.e. on behalf of the user.
</p>
</span>
</doc>
<resource xsi:type="IndivoNonURLResource" id="Application_Types">
<doc>
<span xmlns="http://www.w3.org/1999/xhtml">
<h3> <span class="mw-headline"> Application Types </span>
</h3>
<p>We consider three types of applications:
</p>
<ul>
<li> <b>User Applications</b>, which individual Indivo users can add to their record.
</li>
<li> <b>Administrative Applications</b>, which are used to perform account and record manipulations.
</li>
<li> <b>Indivo Chrome</b>, which provides the public user interface to Indivo features.
</li>
</ul>
<p>Per Indivo installation, there is one Indivo Chrome, a small handful
of administrative applications, and quite a number of user applications.
</p>
</span>
</doc>
</resource>
<resource xsi:type="IndivoNonURLResource" id="Terminology">
<doc>
<span xmlns="http://www.w3.org/1999/xhtml">
<h3> <span class="mw-headline"> Terminology </span>
</h3>
<p>A <b>record</b> is the single set of medical information that pertains to an individual. It is composed of <b>documents</b>, including a <b>demographics document</b> which details the individual's contact information and name. A record can be accessed by one or more <b>accounts</b>.
</p>
<p>
<b>oAuth</b> is the authentication protocol used by Indivo. In 2-legged oAuth, the PHA (the oAuth <b>consumer</b>) makes calls to Indivo (the oAuth <b>service provider</b>) using a <b>consumer key</b> to identify itself, and a <b>consumer secret</b>
to sign the request. In 3-legged oAuth, the PHA makes calls to Indivo
to access medical information as delegated by the user, using an
additional <b>token</b> and <b>token secret</b> that pertain to the specific Indivo record being accessed.
</p>
</span>
</doc>
</resource>
</resource>
<resource xsi:type="IndivoNonURLResource" id="Authentication">
<doc>
<span xmlns="http://www.w3.org/1999/xhtml">
<h2> <span class="mw-headline"> Authentication </span>
</h2>
<p>All calls to Indivo are authenticated using <a class="external text" href="http://oauth.net/" rel="nofollow" title="http://oauth.net">oAuth</a>.
</p>
<p>We detail the authentication process at <a href="http://wiki.chip.org/indivo/index.php/Indivo_Authentication" title="Indivo Authentication">Indivo Authentication</a>.
</p>
</span>
</doc>
</resource>
<resource xsi:type="IndivoNonURLResource" id="Design_Patterns">
<doc>
<span xmlns="http://www.w3.org/1999/xhtml">
<h2> <span class="mw-headline"> Design Patterns </span>
</h2>
<p>Some common design patterns are repeated throughout the API. Not all
of these patterns are necessarily 100% supported by all Indivo API
implementations, though when they are they are consistent.
</p>
</span>
</doc>
<resource xsi:type="IndivoNonURLResource" id="Email_Addresses_as_Identifiers">
<doc>
<span xmlns="http://www.w3.org/1999/xhtml">
<h3> <span class="mw-headline"> Email Addresses as Identifiers </span>
</h3>
<p>Core accounts in Indivo X are identified by email addresses, because
email addresses provide mechanisms for distributed identification and
messaging. When an email address is included in a URL, it must be URL
encoded, where the <tt>@</tt> sign turns into <tt>%40</tt>.
</p>
</span>
</doc>
</resource>
<resource xsi:type="IndivoNonURLResource" id="Paging.2FFiltering_Results">
<doc>
<span xmlns="http://www.w3.org/1999/xhtml">
<h3> <span class="mw-headline"> Paging/Filtering Results </span>
</h3>
<p>When a list of results are returned, the URL ends in a <tt>/</tt> and the HTTP method is a <tt>GET</tt>,
as is typical of REST design. In that case, Indivo X supports a generic
query string that determines paging and ordering of the results:
</p>
<pre>?offset={offset}&limit={limit}&order_by={order_by}&status={document_status}&modified_since={modified_since}
</pre>
<p>
<tt>offset</tt> indicates which item number to start with, e.g. when getting a second batch of items.
</p>
<p>
<tt>limit</tt> indicates the maximum number of items to return. This is used in combination with <tt>offset</tt> to accomplish paging.
</p>
<p>
<tt>order_by</tt> is dependent on the fields returned in the list
of items, and each call must thus define which fields are valid. Using
an invalid field in <tt>order_by</tt> results in no effect on the output, as if <tt>order_by</tt> were absent.
</p>
<p>
<tt>status</tt> can be used where applicable. It pertains to the
status of documents and can currently be set to one of three options:
'void', 'archived' or 'active'
</p>
<p>
<tt>modified_since</tt> allows an application to look at items
that have been modified since a given timestamp, so that incremental
downloads may be possible.
</p>
</span>
</doc>
</resource>
<resource xsi:type="IndivoNonURLResource" id="External_IDs">
<doc>
<span xmlns="http://www.w3.org/1999/xhtml">
<h3> <span class="mw-headline"> External IDs </span>
</h3>
<p>When a resource is created, the Indivo API offers the ability to create this resource using a <tt>PUT</tt> with an <tt>external_id</tt>
in the URL, so that the call is idempotent: if a failure occurs, the
call can be repeated safely and only the resource will not be created on
the second call if it was already created successfully during the first
call.
</p>
<p>An <tt>external_id</tt> is only valid within a particular PHA
scope. Other PHAs cannot see the external_id of a given document if they
didn't create the document, and certainly cannot access the document by
external_id.
</p>
</span>
</doc>
</resource>
</resource>
<resource xsi:type="IndivoNonURLResource" id="Managing_Records_and_Documents">
<doc>
<span xmlns="http://www.w3.org/1999/xhtml">
<h2> <span class="mw-headline"> Managing Records and Documents </span>
</h2>
<p>Data stored in Indivo cannot by permanently deleted by default: the
API enforces only appending data, not fully replacing it or removing it.
One exception is made to this rule to prevent storing typos forever:
for 5 minutes following the creation of a new Indivo document by a human
user (as opposed to a batch loading process), the creator of this
document can remove this document entirely.
</p>
</span>
</doc>
<resource xsi:type="IndivoURLResource" id="Available_Records" path="/accounts/{account_id}/records/" type="#list_of_results_returned">
<doc>
<span xmlns="http://www.w3.org/1999/xhtml">
<h3> <span class="mw-headline"> Available Records </span>
</h3>
<pre>GET /accounts/{account_id}/records/
</pre>
<pre><Records account="joe@smith.org">
<Record id="b43810b8-1ff0-11de-b090-001b63948875" label="Joe Smith" />
<Record id="c002aa8e-1ff0-11de-b090-001b63948875" label="Jill Smith" />
</Records>
</pre>
<p>supports paging, order by: label.
</p>
</span>
</doc>
<method name="GET">
<response>
<doc>
<span xmlns="http://www.w3.org/1999/xhtml">
<pre><Records account="joe@smith.org">
<Record id="b43810b8-1ff0-11de-b090-001b63948875" label="Joe Smith" />
<Record id="c002aa8e-1ff0-11de-b090-001b63948875" label="Jill Smith" />
</Records>
</pre>
</span>
</doc>
</response>
<iwe:method_extension iwe:server_method_name="record_list" iwe:shortname="read_records" xmlns="http://org.indivo.server/indivoServerWadlExtension">
<iwe:grants iwe:principal="account">
<iwe:grant>account_ruleset.account_rule</iwe:grant>
</iwe:grants>
</iwe:method_extension>
</method>
</resource>
<resource xsi:type="IndivoURLResource" id="Record" path="/records/{record_id}">
<doc>
<span xmlns="http://www.w3.org/1999/xhtml">
<h3> <span class="mw-headline"> Record </span>
</h3>
<pre>GET /records/{record_id}
</pre>
<pre><Record id="c002aa8e-1ff0-11de-b090-001b63948875" label="Jill Smith">
<contact document_id="83nvb-038xcc-98xcv-234234325235" />
<demographics document_id="646937a0-1ff1-11de-b090-001b63948875" />
</Record>
</pre>
</span>
</doc>
<method name="GET">
<response>
<doc>
<span xmlns="http://www.w3.org/1999/xhtml">
<pre><Record id="c002aa8e-1ff0-11de-b090-001b63948875" label="Jill Smith">
<contact document_id="83nvb-038xcc-98xcv-234234325235" />
<demographics document_id="646937a0-1ff1-11de-b090-001b63948875" />
</Record>
</pre>
</span>
</doc>
</response>
<iwe:method_extension iwe:server_method_name="record" iwe:shortname="read_record" xmlns="http://org.indivo.server/indivoServerWadlExtension">
<iwe:grants iwe:principal="accesstoken">
<iwe:grant>ar_share_record_or_pha</iwe:grant>
</iwe:grants>
<iwe:grants iwe:principal="account">
<iwe:grant>full_control</iwe:grant>
</iwe:grants>
</iwe:method_extension>
</method>
</resource>
<resource xsi:type="IndivoURLResource" id="Applications_attached_to_a_Record" path="/records/{record_id}/apps/" type="#list_of_results_returned">
<doc>
<span xmlns="http://www.w3.org/1999/xhtml">
<h3> <span class="mw-headline"> Applications attached to a Record </span>
</h3>
<pre>GET /records/{record_id}/apps/
</pre>
<pre><Apps>
<App id="f6fb1c56-1ff0-11de-b090-001b63948875">
<startURL><a class="external free" href="http://example.org/app/start" rel="nofollow" title="http://example.org/app/start">http://example.org/app/start</a></startURL>
<name>Medical Surveys</name>
<frameable>false</frameable>
</App>
<App id="3c726d0c-1ff1-11de-b090-001b63948875">
<startURL><a class="external free" href="http://example2.org/app/start" rel="nofollow" title="http://example2.org/app/start">http://example2.org/app/start</a></startURL>
<name>Flu Tracker</name>
<frameable>true</frameable>
</App>
</Apps>
</pre>
<p>supports paging, order by: name.
</p>
</span>
</doc>
<method name="GET">
<response>
<doc>
<span xmlns="http://www.w3.org/1999/xhtml">
<pre><Apps>
<App id="f6fb1c56-1ff0-11de-b090-001b63948875">
<startURL><a class="external free" href="http://example.org/app/start" rel="nofollow" title="http://example.org/app/start">http://example.org/app/start</a></startURL>
<name>Medical Surveys</name>
<frameable>false</frameable>
</App>
<App id="3c726d0c-1ff1-11de-b090-001b63948875">
<startURL><a class="external free" href="http://example2.org/app/start" rel="nofollow" title="http://example2.org/app/start">http://example2.org/app/start</a></startURL>
<name>Flu Tracker</name>
<frameable>true</frameable>
</App>
</Apps>
</pre>
</span>
</doc>
</response>
<iwe:method_extension iwe:server_method_name="record_phas" iwe:shortname="get_record_apps" xmlns="http://org.indivo.server/indivoServerWadlExtension">
<iwe:grants iwe:principal="account">
<iwe:grant>full_control</iwe:grant>
</iwe:grants>
</iwe:method_extension>
</method>
</resource>
<resource xsi:type="IndivoNonURLResource" id="Documents_within_a_Record">
<doc>
<span xmlns="http://www.w3.org/1999/xhtml">
<h3> <span class="mw-headline"> Documents within a Record </span>
</h3>
</span>
</doc>
<resource xsi:type="IndivoURLResource" path="/{records_OR_carenets}/{record_OR_carenet_id}/documents/" type="#list_of_results_returned">
<doc>
<span xmlns="http://www.w3.org/1999/xhtml">
<pre>GET /records/{record_id}/documents/
</pre>
<pre>GET /carenets/{carenet_id}/documents/
</pre>
<pre><Documents record_id="646937a0-1ff1-11de-b090-001b63948875"
xmlns:indivo="<a class="external free" href="http://indivohealth.org/xml/doctypes/" rel="nofollow" title="http://indivohealth.org/xml/doctypes/">http://indivohealth.org/xml/doctypes/</a>" type="indivo:Medication">
<Document id="ac21fe42-1ff1-11de-b090-001b63948875">
<.. document metadata fields ..>
</Document>
</Documents>
</pre>
<p>supports paging, order by document metadata fields (see <a href="http://wiki.chip.org/indivo/index.php/Indivo_Document_Metadata_Schema" title="Indivo Document Metadata Schema">Indivo Document Metadata Schema</a>).
</p>
</span>
</doc>
<param name="records_OR_carenets" style="template">
<option value="records"/>
<option value="carenets"/>
</param>
<param name="record_OR_carenet_id" style="template"/>
<method name="GET">
<response>
<doc>
<span xmlns="http://www.w3.org/1999/xhtml">
<pre><Documents record_id="646937a0-1ff1-11de-b090-001b63948875"
xmlns:indivo="<a class="external free" href="http://indivohealth.org/xml/doctypes/" rel="nofollow" title="http://indivohealth.org/xml/doctypes/">http://indivohealth.org/xml/doctypes/</a>" type="indivo:Medication">
<Document id="ac21fe42-1ff1-11de-b090-001b63948875">
<.. document metadata fields ..>
</Document>
</Documents>
</pre>
</span>
</doc>
</response>
<iwe:method_extension iwe:records_or_carenets="records" iwe:server_method_name="document_list" iwe:shortname="read_documents" xmlns="http://org.indivo.server/indivoServerWadlExtension">
<iwe:grants iwe:principal="accesstoken">
<iwe:grant>ar_share_record_or_pha</iwe:grant>
</iwe:grants>
<iwe:grants iwe:principal="account">
<iwe:grant>full_control</iwe:grant>
</iwe:grants>
</iwe:method_extension>
<iwe:method_extension iwe:records_or_carenets="carenets" iwe:server_method_name="carenet_document_list" iwe:shortname="get_carenet_documents" xmlns="http://org.indivo.server/indivoServerWadlExtension">
<iwe:grants iwe:principal="accesstoken">
<iwe:grant>ar_share_record_or_pha</iwe:grant>
</iwe:grants>
<iwe:grants iwe:principal="account">
<iwe:grant>accessrule_carenet_account</iwe:grant>
</iwe:grants>
</iwe:method_extension>
</method>
</resource>
<resource xsi:type="IndivoNonURLResource" id="by_Type">
<doc>
<span xmlns="http://www.w3.org/1999/xhtml">
<h5> <span class="mw-headline"> by Type </span>
</h5>
</span>
</doc>
<resource xsi:type="IndivoURLResource" path="/{records_OR_carenets}/{record_OR_carenet_id}/documents/types/{type}/" type="#list_of_results_returned">
<doc>
<span xmlns="http://www.w3.org/1999/xhtml">
<pre>GET /records/{record_id}/documents/types/{type}/
</pre>
<pre>GET /carenets/{carenet_id}/documents/types/{type}/
</pre>
<p>
<tt>type</tt> is the suffix of a URL that corresponds to the XML schema datatype, where the prefix is <tt>
<a class="external free" href="http://indivo.org/vocab/xml/documents#" rel="nofollow" title="http://indivo.org/vocab/xml/documents#">http://indivo.org/vocab/xml/documents#</a>
</tt>. Thus, <tt>type</tt> can be <tt>Medication</tt>, <tt>Encounter</tt>, etc.
</p>
<p>Indivo X supports storing XML documents whose datatype is not
among the default Indivo X recommended types. In those cases, if the XML
schema namespace doesn't end in a <tt>/</tt> or <tt>#</tt>, then as is typical in the XML/RDF community, a <tt>#</tt> is used as delimiter in the URI. Examples of document types include:
</p>
<ul>
<li> <tt>
<a class="external free" href="http://indivo.org/xml/phr/medication#Medication" rel="nofollow" title="http://indivo.org/xml/phr/medication#Medication">http://indivo.org/xml/phr/medication#Medication</a>
</tt> (Indivo 3.1 data type)
</li>
<li> <tt>urn:astm-org:CCR#ContinuityOfCareRecord</tt>, as per <a class="external free" href="http://code.google.com/apis/health/ccrg_reference.html" rel="nofollow" title="http://code.google.com/apis/health/ccrg_reference.html">http://code.google.com/apis/health/ccrg_reference.html</a>
</li>
</ul>
</span>
</doc>
<param name="records_OR_carenets" style="template">
<option value="records"/>
<option value="carenets"/>
</param>
<param name="record_OR_carenet_id" style="template"/>
<method name="GET">
<iwe:method_extension iwe:not_implemented="indivo_server-v0.8.3.7" iwe:records_or_carenets="records" iwe:shortname="read_document_types" xmlns="http://org.indivo.server/indivoServerWadlExtension"/>
<iwe:method_extension iwe:not_implemented="indivo_server-v0.8.3.7" iwe:records_or_carenets="carenets" xmlns="http://org.indivo.server/indivoServerWadlExtension"/>
</method>
</resource>
<resource xsi:type="IndivoURLResource" path="/{records_OR_carenets}/{record_OR_carenet_id}/documents/" type="#list_of_results_returned">
<doc>
<span xmlns="http://www.w3.org/1999/xhtml">
<p>Because it is confusing to embed a full URL inside another URL's path, Indivo X supports a second call:
</p>
<pre>GET /records/{record_id}/documents/?type={type_url}
</pre>
<pre>GET /carenets/{carenet_id}/documents/?type={type_url}
</pre>
<p>where <tt>type_url</tt> is now in the URL's query string.
</p>
<p>This call supports paging, order by document metadata fields (see <a href="http://wiki.chip.org/indivo/index.php/Indivo_Document_Metadata_Schema" title="Indivo Document Metadata Schema">Indivo Document Metadata Schema</a>).
</p>
</span>
</doc>
<param name="records_OR_carenets" style="template">
<option value="records"/>
<option value="carenets"/>
</param>
<param name="record_OR_carenet_id" style="template"/>
<method name="GET">
<request>
<param name="type" style="query" type="xsd:string">
<doc>{type_url}</doc>
</param>
</request>
<iwe:method_extension iwe:records_or_carenets="records" iwe:server_method_name="document_list" iwe:shortname="read_documents" xmlns="http://org.indivo.server/indivoServerWadlExtension">
<iwe:grants iwe:principal="accesstoken">
<iwe:grant>ar_share_record_or_pha</iwe:grant>
</iwe:grants>
<iwe:grants iwe:principal="account">
<iwe:grant>full_control</iwe:grant>
</iwe:grants>
</iwe:method_extension>
<iwe:method_extension iwe:records_or_carenets="carenets" iwe:server_method_name="carenet_document_list" iwe:shortname="get_carenet_documents" xmlns="http://org.indivo.server/indivoServerWadlExtension">
<iwe:grants iwe:principal="accesstoken">
<iwe:grant>ar_share_record_or_pha</iwe:grant>
</iwe:grants>
<iwe:grants iwe:principal="account">
<iwe:grant>accessrule_carenet_account</iwe:grant>
</iwe:grants>
</iwe:method_extension>
</method>
</resource>
</resource>
</resource>
<resource xsi:type="IndivoURLResource" id="Single_Document" path="/{records_OR_carenets}/{record_OR_carenet_id}/documents/{document_id}">
<doc>
<span xmlns="http://www.w3.org/1999/xhtml">
<h3> <span class="mw-headline"> Single Document </span>
</h3>
<pre>GET /records/{record_id}/documents/{document_id}
</pre>
<pre>GET /carenets/{carenet_id}/documents/{document_id}
</pre>
<pre>{ Indivo Document Content }
</pre>
</span>
</doc>
<param name="records_OR_carenets" style="template">
<option value="records"/>
<option value="carenets"/>
</param>
<param name="record_OR_carenet_id" style="template"/>
<method name="GET">
<response>
<doc>
<span xmlns="http://www.w3.org/1999/xhtml">
<pre>{ Indivo Document Content }
</pre>
</span>
</doc>
</response>
<iwe:method_extension iwe:records_or_carenets="records" iwe:server_method_name="document" iwe:shortname="read_document" xmlns="http://org.indivo.server/indivoServerWadlExtension">
<iwe:grants iwe:principal="accesstoken">
<iwe:grant>ar_share_record_or_pha</iwe:grant>
</iwe:grants>
<iwe:grants iwe:principal="account">
<iwe:grant>full_control</iwe:grant>
</iwe:grants>
</iwe:method_extension>
<iwe:method_extension iwe:records_or_carenets="carenets" iwe:server_method_name="carenet_document" iwe:shortname="get_carenet_document" xmlns="http://org.indivo.server/indivoServerWadlExtension">
<iwe:grants iwe:principal="accesstoken">
<iwe:grant>ar_share_record_or_pha</iwe:grant>
</iwe:grants>
<iwe:grants iwe:principal="account">
<iwe:grant>accessrule_carenet_document</iwe:grant>
</iwe:grants>
</iwe:method_extension>
</method>
</resource>
<resource xsi:type="IndivoNonURLResource" id="Special_Documents">
<doc>
<span xmlns="http://www.w3.org/1999/xhtml">
<h3> <span class="mw-headline"> Special Documents </span>
</h3>
<p>The Demographics and Contact documents are special in that there
should only be one of each per record, and they should be easy to find.
</p>
<p>See also:
</p>
<ul>
<li> <a href="http://wiki.chip.org/indivo/index.php/Indivo_Document_Demographics_Schema" title="Indivo Document Demographics Schema">Indivo Document Demographics Schema</a>
</li>
<li> <a href="http://wiki.chip.org/indivo/index.php/Indivo_Document_Contact_Schema" title="Indivo Document Contact Schema">Indivo Document Contact Schema</a>
</li>
</ul>
</span>
</doc>
<resource xsi:type="IndivoURLResource" id="Demographics" path="/{records_OR_carenets}/{record_OR_carenet_id}/documents/special/demographics">
<doc>
<span xmlns="http://www.w3.org/1999/xhtml">
<h4> <span class="mw-headline"> Demographics </span>
</h4>
<pre>GET /records/{record_id}/documents/special/demographics
</pre>
<pre>GET /carenets/{carenet_id}/documents/special/demographics
</pre>
<pre>{ Demographics Document }
</pre>
</span>
</doc>
<param name="records_OR_carenets" style="template">
<option value="records"/>
<option value="carenets"/>
</param>
<param name="record_OR_carenet_id" style="template"/>
<method name="GET">
<response>
<doc>
<span xmlns="http://www.w3.org/1999/xhtml">
<pre>{ Demographics Document }
</pre>
</span>
</doc>
</response>
<iwe:method_extension iwe:records_or_carenets="records" iwe:server_method_name="read_special_document" iwe:shortname="read_special_document" xmlns="http://org.indivo.server/indivoServerWadlExtension">
<iwe:grants iwe:principal="accesstoken">
<iwe:grant>ar_share_record_or_pha</iwe:grant>
</iwe:grants>
<iwe:grants iwe:principal="machineapp">
<iwe:grant>machapp_ruleset.machineapp_record_created_rule</iwe:grant>
</iwe:grants>
<iwe:grants iwe:principal="account">
<iwe:grant>accessrule_carenet_account</iwe:grant>
</iwe:grants>
</iwe:method_extension>
<iwe:method_extension iwe:records_or_carenets="carenets" iwe:server_method_name="read_special_document" xmlns="http://org.indivo.server/indivoServerWadlExtension">
<iwe:grants iwe:principal="accesstoken">
<iwe:grant>ar_share_record_or_pha</iwe:grant>
</iwe:grants>
<iwe:grants iwe:principal="machineapp">
<iwe:grant>machapp_ruleset.machineapp_record_created_rule</iwe:grant>
</iwe:grants>
<iwe:grants iwe:principal="account">
<iwe:grant>accessrule_carenet_account</iwe:grant>
</iwe:grants>
</iwe:method_extension>
</method>
</resource>
<resource xsi:type="IndivoURLResource" id="Updating_Demographics" path="/records/{record_id}/documents/special/demographics">
<doc>
<span xmlns="http://www.w3.org/1999/xhtml">
<h4> <span class="mw-headline"> Updating Demographics </span>
</h4>
<pre>PUT /records/{record_id}/documents/special/demographics
{ New Demographics Document }
</pre>
<pre>{ Indivo Document Metadata for the new Demographics document }
</pre>
</span>
</doc>
<method name="PUT">
<request>
<doc>{ New Demographics Document }</doc>
</request>
<response>
<doc>
<span xmlns="http://www.w3.org/1999/xhtml">
<pre>{ Indivo Document Metadata for the new Demographics document }
</pre>
</span>
</doc>
</response>
<iwe:method_extension iwe:server_method_name="save_special_document" iwe:shortname="put_special_document" xmlns="http://org.indivo.server/indivoServerWadlExtension">
<iwe:grants iwe:principal="machineapp">
<iwe:grant>machapp_ruleset.machineapp_record_created_rule</iwe:grant>
</iwe:grants>
<iwe:grants iwe:principal="account">
<iwe:grant>full_control</iwe:grant>
</iwe:grants>
</iwe:method_extension>
</method>
</resource>
<resource xsi:type="IndivoURLResource" id="Contact" path="/{records_OR_carenets}/{record_OR_carenet_id}/documents/special/contact">
<doc>
<span xmlns="http://www.w3.org/1999/xhtml">
<h4> <span class="mw-headline"> Contact </span>
</h4>
<pre>GET /records/{record_id}/documents/special/contact
</pre>
<pre>GET /carenets/{carenet_id}/documents/special/contact
</pre>
<pre>{ Contact Document }
</pre>
</span>
</doc>
<param name="records_OR_carenets" style="template">
<option value="records"/>
<option value="carenets"/>
</param>
<param name="record_OR_carenet_id" style="template"/>
<method name="GET">
<response>
<doc>
<span xmlns="http://www.w3.org/1999/xhtml">
<pre>{ Contact Document }
</pre>
</span>
</doc>
</response>
<iwe:method_extension iwe:records_or_carenets="records" iwe:server_method_name="read_special_document" iwe:shortname="read_special_document" xmlns="http://org.indivo.server/indivoServerWadlExtension">
<iwe:grants iwe:principal="accesstoken">
<iwe:grant>ar_share_record_or_pha</iwe:grant>
</iwe:grants>
<iwe:grants iwe:principal="machineapp">
<iwe:grant>machapp_ruleset.machineapp_record_created_rule</iwe:grant>
</iwe:grants>
<iwe:grants iwe:principal="account">
<iwe:grant>accessrule_carenet_account</iwe:grant>
</iwe:grants>
</iwe:method_extension>
<iwe:method_extension iwe:records_or_carenets="carenets" iwe:server_method_name="read_special_document" xmlns="http://org.indivo.server/indivoServerWadlExtension">
<iwe:grants iwe:principal="accesstoken">
<iwe:grant>ar_share_record_or_pha</iwe:grant>
</iwe:grants>
<iwe:grants iwe:principal="machineapp">
<iwe:grant>machapp_ruleset.machineapp_record_created_rule</iwe:grant>
</iwe:grants>
<iwe:grants iwe:principal="account">
<iwe:grant>accessrule_carenet_account</iwe:grant>
</iwe:grants>
</iwe:method_extension>
</method>
</resource>
<resource xsi:type="IndivoURLResource" id="Updating_Contact" path="/records/{record_id}/documents/special/contact">
<doc>
<span xmlns="http://www.w3.org/1999/xhtml">
<h4> <span class="mw-headline"> Updating Contact </span>
</h4>
<pre>PUT /records/{record_id}/documents/special/contact
{ New Contact Document }
</pre>
<pre>{ Indivo Document Metadata for the new Contact document }
</pre>
</span>
</doc>
<method name="PUT">
<request>
<doc>{ New Contact Document }</doc>
</request>
<response>
<doc>
<span xmlns="http://www.w3.org/1999/xhtml">
<pre>{ Indivo Document Metadata for the new Contact document }
</pre>
</span>
</doc>
</response>
<iwe:method_extension iwe:server_method_name="save_special_document" iwe:shortname="put_special_document" xmlns="http://org.indivo.server/indivoServerWadlExtension">
<iwe:grants iwe:principal="machineapp">
<iwe:grant>machapp_ruleset.machineapp_record_created_rule</iwe:grant>
</iwe:grants>
<iwe:grants iwe:principal="account">
<iwe:grant>full_control</iwe:grant>
</iwe:grants>
</iwe:method_extension>
</method>
</resource>
</resource>
<resource xsi:type="IndivoURLResource" id="Document_Metadata" path="/{records_OR_carenets}/{record_OR_carenet_id}/documents/{document_id}/meta">
<doc>
<span xmlns="http://www.w3.org/1999/xhtml">
<h3> <span class="mw-headline"> Document Metadata </span>
</h3>
<pre>GET /records/{record_id}/documents/{document_id}/meta
</pre>
<pre>GET /carenets/{carenet_id}/documents/{document_id}/meta
</pre>
<pre><Document id="ac21fe42-1ff1-11de-b090-001b63948875">
<disabledAt />
<lastModifiedAt>2009-04-06 13:34:23</lastModifiedAt>
</Document>
</pre>
</span>
</doc>
<param name="records_OR_carenets" style="template">
<option value="records"/>
<option value="carenets"/>
</param>
<param name="record_OR_carenet_id" style="template"/>
<method name="GET">
<response>
<doc>
<span xmlns="http://www.w3.org/1999/xhtml">
<pre><Document id="ac21fe42-1ff1-11de-b090-001b63948875">
<disabledAt />
<lastModifiedAt>2009-04-06 13:34:23</lastModifiedAt>
</Document>
</pre>
</span>
</doc>
</response>
<iwe:method_extension iwe:records_or_carenets="records" iwe:server_method_name="document_meta" iwe:shortname="read_document_meta" xmlns="http://org.indivo.server/indivoServerWadlExtension">
<iwe:grants iwe:principal="accesstoken">
<iwe:grant>ar_share_record_or_pha</iwe:grant>
</iwe:grants>
<iwe:grants iwe:principal="account">
<iwe:grant>full_control</iwe:grant>
</iwe:grants>
</iwe:method_extension>
<iwe:method_extension iwe:records_or_carenets="carenets" iwe:server_method_name="document_meta" iwe:shortname="read_carenet_document_meta" xmlns="http://org.indivo.server/indivoServerWadlExtension">
<iwe:grants iwe:principal="accesstoken">
<iwe:grant>ar_share_record_or_pha</iwe:grant>
</iwe:grants>
<iwe:grants iwe:principal="account">
<iwe:grant>full_control</iwe:grant>
</iwe:grants>
</iwe:method_extension>
</method>
</resource>
<resource xsi:type="IndivoNonURLResource" id="Document_Versions">
<doc>
<span xmlns="http://www.w3.org/1999/xhtml">
<h3> <span class="mw-headline"> Document Versions </span>
</h3>
</span>
</doc>
<resource xsi:type="IndivoURLResource" path="/{records_OR_carenets}/{record_OR_carenet_id}/documents/{document_id}/versions/" type="#list_of_results_returned">
<doc>
<span xmlns="http://www.w3.org/1999/xhtml">
<pre>GET /records/{record_id}/documents/{document_id}/versions/
</pre>
<pre>GET /carenets/{carenet_id}/documents/{document_id}/versions/
</pre>
<pre><Documents original_id="ac21fe42-1ff1-11de-b090-001b63948875">
<Document id="cb31fe32-1ee1-21de-c190-041b66935866">
<.. DOC METADATA ..>
</Document>
<Document id="b321ee42-1fc5-12ee-b530-051b43948378">
<.. DOC METADATA ..>
</Document>
</Documents>
</pre>
</span>
</doc>
<param name="records_OR_carenets" style="template">
<option value="records"/>
<option value="carenets"/>
</param>
<param name="record_OR_carenet_id" style="template"/>
<method name="GET">
<response>
<doc>
<span xmlns="http://www.w3.org/1999/xhtml">
<pre><Documents original_id="ac21fe42-1ff1-11de-b090-001b63948875">
<Document id="cb31fe32-1ee1-21de-c190-041b66935866">
<.. DOC METADATA ..>
</Document>
<Document id="b321ee42-1fc5-12ee-b530-051b43948378">
<.. DOC METADATA ..>
</Document>
</Documents>
</pre>
</span>
</doc>
</response>
<iwe:method_extension iwe:records_or_carenets="records" iwe:server_method_name="document_versions" iwe:shortname="read_document_versions" xmlns="http://org.indivo.server/indivoServerWadlExtension">
<iwe:grants iwe:principal="accesstoken">
<iwe:grant>ar_share_record_or_pha</iwe:grant>
</iwe:grants>
<iwe:grants iwe:principal="account">
<iwe:grant>full_control</iwe:grant>
</iwe:grants>
</iwe:method_extension>
<iwe:method_extension iwe:not_implemented="indivo_server-v0.8.3.7" iwe:records_or_carenets="carenets" xmlns="http://org.indivo.server/indivoServerWadlExtension"/>
</method>
</resource>
<resource xsi:type="IndivoURLResource" id="by_External_ID" path="/{records_OR_carenets}/{record_OR_carenet_id}/documents/external/{app_id}/{external_id}/meta">
<doc>
<span xmlns="http://www.w3.org/1999/xhtml">
<h5> <span class="mw-headline"> by External ID </span>
</h5>
<pre>GET /records/{record_id}/documents/external/{app_id}/{external_id}/meta
</pre>
<pre>GET /carenets/{carenet_id}/documents/external/{app_id}/{external_id}/meta
</pre>
</span>
</doc>
<param name="records_OR_carenets" style="template">
<option value="records"/>
<option value="carenets"/>
</param>
<param name="record_OR_carenet_id" style="template"/>
<method name="GET">
<iwe:method_extension iwe:records_or_carenets="records" iwe:server_method_name="document_meta" iwe:shortname="read_document_ext_meta" xmlns="http://org.indivo.server/indivoServerWadlExtension">
<iwe:grants iwe:principal="accesstoken">
<iwe:grant>ar_share_record_or_pha</iwe:grant>
</iwe:grants>
<iwe:grants iwe:principal="account">
<iwe:grant>full_control</iwe:grant>
</iwe:grants>
</iwe:method_extension>
<iwe:method_extension iwe:not_implemented="indivo_server-v0.8.3.7" iwe:records_or_carenets="carenets" xmlns="http://org.indivo.server/indivoServerWadlExtension"/>
</method>
</resource>
</resource>
<resource xsi:type="IndivoNonURLResource" id="Document_Creation">
<doc>
<span xmlns="http://www.w3.org/1999/xhtml">
<h3> <span class="mw-headline"> Document Creation </span>
</h3>
</span>
</doc>
<resource xsi:type="IndivoURLResource" path="/records/{record_id}/documents/">
<doc>
<span xmlns="http://www.w3.org/1999/xhtml">
<pre>POST /records/{record_id}/documents/
{INDIVO_DOCUMENT_CONTENT}
</pre>
<pre><Document id="ac21fe42-1ff1-11de-b090-001b63948875" />
</pre>
</span>
</doc>
<method name="POST">
<request>
<doc>{INDIVO_DOCUMENT_CONTENT}</doc>
</request>
<response>
<doc>
<span xmlns="http://www.w3.org/1999/xhtml">
<pre><Document id="ac21fe42-1ff1-11de-b090-001b63948875" />
</pre>
</span>
</doc>
</response>
<iwe:method_extension iwe:server_method_name="document_create" iwe:shortname="post_document" xmlns="http://org.indivo.server/indivoServerWadlExtension">
<iwe:grants iwe:principal="accesstoken">
<iwe:grant>ar_share_record_or_pha</iwe:grant>
</iwe:grants>
<iwe:grants iwe:principal="machineapp">
<iwe:grant>machapp_ruleset.no_external_id</iwe:grant>
</iwe:grants>
<iwe:grants iwe:principal="account">
<iwe:grant>full_control</iwe:grant>
</iwe:grants>
</iwe:method_extension>
</method>
</resource>
<resource xsi:type="IndivoURLResource" id="by_External_ID_2" path="/records/{record_id}/documents/external/{app_id}/{external_id}">
<doc>
<span xmlns="http://www.w3.org/1999/xhtml">
<h5> <span class="mw-headline"> by External ID </span>
</h5>
<pre>PUT /records/{record_id}/documents/external/{app_id}/{external_id}
{INDIVO_DOCUMENT_CONTENT}
</pre>
<p>Medical data cannot be replaced wholesale, only versioned. Thus, this
call will fail (with a 409 conflict error code) if a document already
exists in the given record with given external ID and app ID.
</p>
</span>
</doc>
<method name="PUT">
<request>
<doc>{INDIVO_DOCUMENT_CONTENT}</doc>
</request>
<iwe:method_extension iwe:server_method_name="document_create" iwe:shortname="post_document_ext" xmlns="http://org.indivo.server/indivoServerWadlExtension">
<iwe:grants iwe:principal="accesstoken">
<iwe:grant>ar_share_record_or_pha</iwe:grant>
</iwe:grants>
<iwe:grants iwe:principal="account">
<iwe:grant>full_control</iwe:grant>
</iwe:grants>
</iwe:method_extension>
</method>
</resource>
</resource>
<resource xsi:type="IndivoNonURLResource" id="Document_Metadata_Update">
<doc>
<span xmlns="http://www.w3.org/1999/xhtml">
<h3> <span class="mw-headline"> Document Metadata Update </span>
</h3>
</span>
</doc>
<resource xsi:type="IndivoURLResource" path="/records/{record_id}/documents/{document_id}/label">
<doc>
<span xmlns="http://www.w3.org/1999/xhtml">
<p>Only the label on a document can be updated.
</p>
<pre>PUT /records/{record_id}/documents/{document_id}/label
{new_document_label}
</pre>
<pre><OK />
</pre>
</span>
</doc>
<method name="PUT">
<request>
<doc>{new_document_label}</doc>
</request>
<response>
<doc>
<span xmlns="http://www.w3.org/1999/xhtml">
<pre><OK />
</pre>
</span>
</doc>
</response>
<iwe:method_extension iwe:server_method_name="document_label" iwe:shortname="post_document_label" xmlns="http://org.indivo.server/indivoServerWadlExtension">
<iwe:grants iwe:principal="accesstoken">
<iwe:grant>ar_share_record_or_pha</iwe:grant>
</iwe:grants>
<iwe:grants iwe:principal="account">
<iwe:grant>full_control</iwe:grant>
</iwe:grants>
</iwe:method_extension>
</method>
</resource>
<resource xsi:type="IndivoURLResource" id="by_External_ID_3" path="/records/{record_id}/documents/external/{app_id}/{external_id}/label">
<doc>
<span xmlns="http://www.w3.org/1999/xhtml">
<h5> <span class="mw-headline"> by External ID </span>
</h5>
<pre>PUT /records/{record_id}/documents/external/{app_id}/{external_id}/label
{new_document_label}
</pre>
<pre><OK />
</pre>
</span>
</doc>
<method name="PUT">
<request>
<doc>{new_document_label}</doc>
</request>
<response>
<doc>
<span xmlns="http://www.w3.org/1999/xhtml">
<pre><OK />
</pre>
</span>
</doc>
</response>
<iwe:method_extension iwe:server_method_name="document_label" iwe:shortname="put_document_ext_label" xmlns="http://org.indivo.server/indivoServerWadlExtension">
<iwe:grants iwe:principal="accesstoken">