CTS2-LE REST API: Resolve Value Set: Unterschied zwischen den Versionen

Aus CTS2-LE
Zur Navigation springen Zur Suche springen
(Die Seite wurde neu angelegt: „xxx ---- <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height: normal'><b><span style='font-size:9.0pt;font-family:"Segoe UI","sans-…“)
 
 
(16 dazwischenliegende Versionen von 2 Benutzern werden nicht angezeigt)
Zeile 1: Zeile 1:
xxx
+
This REST call fetches the full content of a defined value set or codesystem. In case a value set is requested, this call responds with the '''expanded''' content of the value set, which means that all code references are resolved from their underlying codesystems.
  
----
+
This rest call is a variant of [[CTS2-LE REST API: Resolve Value Set MM|Resolve Value Set (multi-modal)]] with the minimal required parameter set <b>_query</b>=expandResource, <b>identifier</b>.
  
<p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
+
== Example ==
normal'><b><span style='font-size:9.0pt;font-family:"Segoe UI","sans-serif";
 
color:black'>Response
 
webCts2Le.rest.FhirValueSets.resolveValueSet(</span></b><span
 
style='font-size:9.0pt;font-family:"Segoe UI","sans-serif";color:black'>@Context
 
<b>HttpServletRequest
 
request, </b>@QueryParam(value=&quot;_query&quot;)
 
<b>String
 
query, </b>@QueryParam(value=&quot;identifier&quot;)
 
<b>String
 
identifier, </b>@QueryParam(value=&quot;codeSystemUri&quot;)
 
<b>String
 
codeSystemUri, </b>@QueryParam(value=&quot;code&quot;)
 
<b>String
 
code, </b>@QueryParam(value=&quot;stylesheet&quot;)
 
<b>String
 
stylesheet)</b></span></p>
 
  
<p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
+
The main purpose of the method is to resolve value sets in order to allow for
normal'><span style='font-size:9.0pt;font-family:"Segoe UI","sans-serif";
+
# display value set items to the user
color:black'>&nbsp;</span></p>
+
# validation of code system/value set references of an electronic health record
  
<p class=MsoNormal style='margin-bottom:3.75pt;line-height:normal'><span
+
In order to reference the value set properly, one has to use its identifier, e.g.
style='font-size:9.0pt;font-family:"Segoe UI","sans-serif";color:black'>@GET<br>
+
<code>http://hl7.org/fhir/vs/administrative-gender</code>
@Produces(value={&quot;application/xml&quot;})</span></p>
 
  
<p class=MsoNormal style='margin-top:12.0pt;margin-right:0cm;margin-bottom:
+
This identifier has to be part of the http-call
12.0pt;margin-left:0cm;line-height:normal'><span style='font-size:9.0pt;
+
<pre>
font-family:"Segoe UI","sans-serif";color:black'>Value set resolution. This
+
http://<host>/WebCts2LE/rest/fhir/ValueSet?_query=expandResource&identifier=http://hl7.org/fhir/vs/administrative-gender
REST function is a multi-modal function to retrieve value set resolutions.<br>
+
</pre>
(A) If </span><span style='font-size:10.0pt;font-family:"Courier New";
+
that will return the following value set expansion
color:black'>_query == 'expand'</span><span style='font-size:9.0pt;font-family:
 
"Segoe UI","sans-serif";color:black'> then </span><span style='font-size:10.0pt;
 
font-family:"Courier New";color:black'>identifier</span><span style='font-size:
 
9.0pt;font-family:"Segoe UI","sans-serif";color:black'> must be an URI of a
 
value set and the response is the corresponding FHIR expansion. To restrict the
 
expansion to code systems or codes, </span><span style='font-size:10.0pt;
 
font-family:"Courier New";color:black'>codeSystemUri</span><span
 
style='font-size:9.0pt;font-family:"Segoe UI","sans-serif";color:black'> and </span><span
 
style='font-size:10.0pt;font-family:"Courier New";color:black'>code</span><span
 
style='font-size:9.0pt;font-family:"Segoe UI","sans-serif";color:black'> have
 
to be set accordingly.<br>
 
(B) If </span><span style='font-size:10.0pt;font-family:"Courier New";
 
color:black'>_query == 'expandDefinedCodeSystem'</span><span style='font-size:
 
9.0pt;font-family:"Segoe UI","sans-serif";color:black'> then </span><span
 
style='font-size:10.0pt;font-family:"Courier New";color:black'>identifier</span><span
 
style='font-size:9.0pt;font-family:"Segoe UI","sans-serif";color:black'> has no
 
meaning and </span><span style='font-size:10.0pt;font-family:"Courier New";
 
color:black'>codeSystemUri</span><span style='font-size:9.0pt;font-family:"Segoe UI","sans-serif";
 
color:black'> must be set. To restrict the expansion to a code, </span><span
 
style='font-size:10.0pt;font-family:"Courier New";color:black'>code</span><span
 
style='font-size:9.0pt;font-family:"Segoe UI","sans-serif";color:black'> has to
 
be set accordingly.<br>
 
(C) If </span><span style='font-size:10.0pt;font-family:"Courier New";
 
color:black'>_query == 'expandResource'</span><span style='font-size:9.0pt;
 
font-family:"Segoe UI","sans-serif";color:black'> then </span><span
 
style='font-size:10.0pt;font-family:"Courier New";color:black'>identifier</span><span
 
style='font-size:9.0pt;font-family:"Segoe UI","sans-serif";color:black'> must
 
be an URI of a (1) CTS2 value set OR a (2) code system. In case of (1)
 
processing (A) will be performed. In case of (2) processing (B) will be
 
performed where </span><span style='font-size:10.0pt;font-family:"Courier New";
 
color:black'>codeSystemUri=identifier</span><span style='font-size:9.0pt;
 
font-family:"Segoe UI","sans-serif";color:black'>.</span></p>
 
  
<p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
+
<syntaxhighlight lang="xml">
normal'><b><span style='font-size:9.0pt;font-family:"Segoe UI","sans-serif";
+
<atom:feed xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://hl7.org/fhir"
color:black'>Parameters:</span></b></p>
+
  xmlns:at="http://purl.org/atompub/tombstones/1.0" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
 +
  xmlns:os="http://a9.com/-/spec/opensearch/1.1/" xmlns:xhtml="http://www.w3.org/1999/xhtml"
 +
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 +
  <atom:title>Value Set Expansion</atom:title>
 +
  <atom:id>urn:uuid:dc9f2f7e-6a1b-4389-9b88-7048787227c2</atom:id>
 +
  <atom:updated>2015-04-05T13:46:55</atom:updated>
 +
  <atom:entry>
 +
      <atom:title>Value Set Resolution</atom:title>
 +
      <atom:id>http://hl7.org/fhir/vs/administrative-gender</atom:id>
 +
      <atom:updated>2015-04-05T13:46:55</atom:updated>
 +
      <atom:content>
 +
        <ValueSet xmlns="http://hl7.org/fhir">
 +
            <name value="..." />
 +
            <description value="..." />
 +
            <status value="draft" />
 +
            <expansion>
 +
              <timestamp />
 +
              <contains xmlns="http://hl7.org/fhir">
 +
                  <system value="urn:oid:2.16.840.1.113883.5.1" />
 +
                  <code value="F" />
 +
                  <display value="Female" />
 +
              </contains>
 +
              <contains xmlns="http://hl7.org/fhir">
 +
                  <system value="urn:oid:2.16.840.1.113883.5.1" />
 +
                  <code value="M" />
 +
                  <display value="Male" />
 +
              </contains>
 +
              <contains xmlns="http://hl7.org/fhir">
 +
                  <system value="urn:oid:2.16.840.1.113883.5.1" />
 +
                  <code value="UN" />
 +
                  <display value="Undifferentiated" />
 +
              </contains>
 +
              <contains xmlns="http://hl7.org/fhir">
 +
                  <system value="urn:oid:2.16.840.1.113883.5.1008" />
 +
                  <code value="UNK" />
 +
                  <display value="unknown" />
 +
              </contains>
 +
            </expansion>
 +
        </ValueSet>
 +
      </atom:content>
 +
  </atom:entry>
 +
</atom:feed>
 +
</syntaxhighlight>
  
<p class=MsoNormal style='margin-top:0cm;margin-right:0cm;margin-bottom:0cm;
+
Appropriate XPATH expressions should select the code list. E.g., the XPATH expression
margin-left:42.0pt;margin-bottom:.0001pt;line-height:normal'><b><span
+
<pre>
style='font-size:9.0pt;font-family:"Segoe UI","sans-serif";color:black'>request</span></b><span
+
/atom:feed/atom:entry/atom:content/ValueSet/expansion/contains
style='font-size:9.0pt;font-family:"Segoe UI","sans-serif";color:black'> HTTP
+
</pre>
request.</span></p>
+
retrieves all (code, code system)-pairs with their display name.
 
 
<p class=MsoNormal style='margin-top:0cm;margin-right:0cm;margin-bottom:0cm;
 
margin-left:42.0pt;margin-bottom:.0001pt;line-height:normal'><b><span
 
style='font-size:9.0pt;font-family:"Segoe UI","sans-serif";color:black'>query</span></b><span
 
style='font-size:9.0pt;font-family:"Segoe UI","sans-serif";color:black'> Query
 
refinement. </span><span style='font-size:10.0pt;font-family:"Courier New";
 
color:black'>_query</span><span style='font-size:9.0pt;font-family:"Segoe UI","sans-serif";
 
color:black'> must match </span><span style='font-size:10.0pt;font-family:"Courier New";
 
color:black'>'(expand|expandDefinedCodeSystem|expandResource)'</span><span
 
style='font-size:9.0pt;font-family:"Segoe UI","sans-serif";color:black'>.</span></p>
 
 
 
<p class=MsoNormal style='margin-top:0cm;margin-right:0cm;margin-bottom:0cm;
 
margin-left:42.0pt;margin-bottom:.0001pt;line-height:normal'><b><span
 
style='font-size:9.0pt;font-family:"Segoe UI","sans-serif";color:black'>identifier</span></b><span
 
style='font-size:9.0pt;font-family:"Segoe UI","sans-serif";color:black'>
 
Identifier of a resource.</span></p>
 
 
 
<p class=MsoNormal style='margin-top:0cm;margin-right:0cm;margin-bottom:0cm;
 
margin-left:42.0pt;margin-bottom:.0001pt;line-height:normal'><b><span
 
style='font-size:9.0pt;font-family:"Segoe UI","sans-serif";color:black'>codeSystemUri</span></b><span
 
style='font-size:9.0pt;font-family:"Segoe UI","sans-serif";color:black'> Code
 
system URI.</span></p>
 
 
 
<p class=MsoNormal style='margin-top:0cm;margin-right:0cm;margin-bottom:0cm;
 
margin-left:42.0pt;margin-bottom:.0001pt;line-height:normal'><b><span
 
style='font-size:9.0pt;font-family:"Segoe UI","sans-serif";color:black'>code</span></b><span
 
style='font-size:9.0pt;font-family:"Segoe UI","sans-serif";color:black'> Code.</span></p>
 
 
 
<p class=MsoNormal style='margin-top:0cm;margin-right:0cm;margin-bottom:0cm;
 
margin-left:42.0pt;margin-bottom:.0001pt;line-height:normal'><b><span
 
style='font-size:9.0pt;font-family:"Segoe UI","sans-serif";color:black'>stylesheet</span></b><span
 
style='font-size:9.0pt;font-family:"Segoe UI","sans-serif";color:black'> the
 
stylesheet that will be referenced within the XML response.</span></p>
 
 
 
<p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
 
normal'><b><span style='font-size:9.0pt;font-family:"Segoe UI","sans-serif";
 
color:black'>Returns:</span></b></p>
 
 
 
<p class=MsoNormal style='margin-top:0cm;margin-right:0cm;margin-bottom:3.0pt;
 
margin-left:42.0pt;line-height:normal'><span style='font-size:9.0pt;font-family:
 
"Segoe UI","sans-serif";color:black'>FHIR expansion according to <a
 
href="http://hl7.org/fhir/2015Jan/valueset.html">FHIR</a>, or an error XML</span></p>
 
----
 
 
 
xxx
 

Aktuelle Version vom 25. Oktober 2016, 19:37 Uhr

This REST call fetches the full content of a defined value set or codesystem. In case a value set is requested, this call responds with the expanded content of the value set, which means that all code references are resolved from their underlying codesystems.

This rest call is a variant of Resolve Value Set (multi-modal) with the minimal required parameter set _query=expandResource, identifier.

Example

The main purpose of the method is to resolve value sets in order to allow for

  1. display value set items to the user
  2. validation of code system/value set references of an electronic health record

In order to reference the value set properly, one has to use its identifier, e.g. http://hl7.org/fhir/vs/administrative-gender

This identifier has to be part of the http-call

http://<host>/WebCts2LE/rest/fhir/ValueSet?_query=expandResource&identifier=http://hl7.org/fhir/vs/administrative-gender

that will return the following value set expansion

<atom:feed xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://hl7.org/fhir"
   xmlns:at="http://purl.org/atompub/tombstones/1.0" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
   xmlns:os="http://a9.com/-/spec/opensearch/1.1/" xmlns:xhtml="http://www.w3.org/1999/xhtml"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <atom:title>Value Set Expansion</atom:title>
   <atom:id>urn:uuid:dc9f2f7e-6a1b-4389-9b88-7048787227c2</atom:id>
   <atom:updated>2015-04-05T13:46:55</atom:updated>
   <atom:entry>
      <atom:title>Value Set Resolution</atom:title>
      <atom:id>http://hl7.org/fhir/vs/administrative-gender</atom:id>
      <atom:updated>2015-04-05T13:46:55</atom:updated>
      <atom:content>
         <ValueSet xmlns="http://hl7.org/fhir">
            <name value="..." />
            <description value="..." />
            <status value="draft" />
            <expansion>
               <timestamp />
               <contains xmlns="http://hl7.org/fhir">
                  <system value="urn:oid:2.16.840.1.113883.5.1" />
                  <code value="F" />
                  <display value="Female" />
               </contains>
               <contains xmlns="http://hl7.org/fhir">
                  <system value="urn:oid:2.16.840.1.113883.5.1" />
                  <code value="M" />
                  <display value="Male" />
               </contains>
               <contains xmlns="http://hl7.org/fhir">
                  <system value="urn:oid:2.16.840.1.113883.5.1" />
                  <code value="UN" />
                  <display value="Undifferentiated" />
               </contains>
               <contains xmlns="http://hl7.org/fhir">
                  <system value="urn:oid:2.16.840.1.113883.5.1008" />
                  <code value="UNK" />
                  <display value="unknown" />
               </contains>
            </expansion>
         </ValueSet>
      </atom:content>
   </atom:entry>
</atom:feed>

Appropriate XPATH expressions should select the code list. E.g., the XPATH expression

/atom:feed/atom:entry/atom:content/ValueSet/expansion/contains

retrieves all (code, code system)-pairs with their display name.