Retrieve available code systems

Aus Termserver-CTS2
(Unterschied zwischen Versionen)
Wechseln zu: Navigation, Suche
(Java)
(Java)
 
Zeile 146: Zeile 146:
  
 
  <source lang="java">
 
  <source lang="java">
public void listCodeSystems()
+
import de.fhdo.terminologie.ws.search.ListCodeSystemsRequestType;
 +
import de.fhdo.terminologie.ws.search.ListCodeSystemsResponse;
 +
import de.fhdo.terminologie.ws.search.Search;
 +
import de.fhdo.terminologie.ws.search.Search_Service;
 +
import java.net.URL;
 +
import javax.xml.namespace.QName;
 +
import types.termserver.fhdo.de.CodeSystem;
 +
import types.termserver.fhdo.de.CodeSystemVersion;
 +
 
 +
/**
 +
*
 +
* @author Robert Mützner <robert.muetzner@fh-dortmund.de>
 +
*/
 +
public class ListCodeSystems
 
{
 
{
  try
 
  {
 
    // create webservice reference and port
 
    Search_Service service = new Search_Service(
 
            new URL("http://193.25.22.69:8080/TermServer/Search?wsdl"),
 
            new QName("http://search.ws.terminologie.fhdo.de/", "Search"));
 
    Search port = service.getSearchPort();
 
  
    // define parameter
+
  public ListCodeSystems()
    ListCodeSystemsRequestType request = new ListCodeSystemsRequestType();
+
  {
 
+
  }
    // invoke method
+
 
    ListCodeSystemsResponse.Return response = port.listCodeSystems(request);
+
  public void listCodeSystems()
 
+
  {
     // handle response
+
     try
    System.out.println("Response: " + response.getReturnInfos().getMessage());
+
 
+
    if(response.getReturnInfos().getStatus() == de.fhdo.terminologie.ws.search.Status.OK)
+
 
     {
 
     {
       System.out.println("Count: " + response.getReturnInfos().getCount());
+
       // create webservice reference and port
 +
      Search_Service service = new Search_Service(
 +
              new URL("http://193.25.22.69:8080/TermServer/Search?wsdl"),
 +
              new QName("http://search.ws.terminologie.fhdo.de/", "Search"));
 +
      Search port = service.getSearchPort();
  
       for(CodeSystem cs : response.getCodeSystem())
+
       // define parameter
 +
      ListCodeSystemsRequestType request = new ListCodeSystemsRequestType();
 +
     
 +
      // invoke method
 +
      ListCodeSystemsResponse.Return response = port.listCodeSystems(request);
 +
     
 +
      // handle response
 +
      System.out.println("Response: " + response.getReturnInfos().getMessage());
 +
     
 +
      if(response.getReturnInfos().getStatus() == de.fhdo.terminologie.ws.search.Status.OK)
 
       {
 
       {
         for(CodeSystemVersion csv : cs.getCodeSystemVersions())
+
         System.out.println("Count: " + response.getReturnInfos().getCount());
 +
       
 +
        for(CodeSystem cs : response.getCodeSystem())
 
         {
 
         {
           System.out.println("VersionId: " + csv.getVersionId() + ", " + cs.getName() + " - " + csv.getName());
+
           for(CodeSystemVersion csv : cs.getCodeSystemVersions())
 +
          {
 +
            System.out.println("VersionId: " + csv.getVersionId() + ", " + cs.getName() + " - " + csv.getName());
 +
          }
 
         }
 
         }
 +
      }
 +
      else
 +
      {
 +
        // handle error message
 
       }
 
       }
 
     }
 
     }
     else
+
     catch (Exception ex)
 
     {
 
     {
       // handle error message
+
       ex.printStackTrace();
 
     }
 
     }
  }
 
  catch (Exception ex)
 
  {
 
    ex.printStackTrace();
 
 
   }
 
   }
 
}
 
}
 
</source>
 
</source>

Aktuelle Version vom 2. Dezember 2014, 12:48 Uhr

Inhaltsverzeichnis

Description

You can retrieve all available code system with the method "ListCodeSystems" in the "Search" web service. You don't have to specify any parameters here.

SOAP

Web service: Search

Method: ListCodeSystems

Request

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sear="http://search.ws.terminologie.fhdo.de/">
   <soapenv:Header/>
   <soapenv:Body>
      <sear:ListCodeSystems>
         <parameter>
         </parameter>
      </sear:ListCodeSystems>
   </soapenv:Body>
</soapenv:Envelope>

Response

A possible response can look like this:

<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
   <S:Body>
      <ns2:ListCodeSystemsResponse xmlns:ns2="http://search.ws.terminologie.fhdo.de/">
         <return>
            <returnInfos>
               <count>6</count>
               <message>CodeSysteme erfolgreich gelesen</message>
               <overallErrorCategory>INFO</overallErrorCategory>
               <status>OK</status>
            </returnInfos>
            <codeSystem>
               <codeSystemVersions>
                  <insertTimestamp>2014-11-24T11:43:10+01:00</insertTimestamp>
                  <lastChangeDate>2014-11-25T09:12:13+01:00</lastChangeDate>
                  <name>authorSpeciality</name>
                  <oid>2.16.756.5.30.1.127.3.2.1.5</oid>
                  <preferredLanguageCd/>
                  <status>1</status>
                  <statusDate>2014-11-20T15:42:07+01:00</statusDate>
                  <underLicence>false</underLicence>
                  <validityRange>4</validityRange>
                  <versionId>6</versionId>
               </codeSystemVersions>
               <currentVersionId>6</currentVersionId>
               <description>Medizinische Fachrichtung der Person</description>
               <id>5</id>
               <insertTimestamp>2014-11-20T15:42:07+01:00</insertTimestamp>
               <name>authorSpecialty</name>
            </codeSystem>
            <codeSystem>
               <codeSystemVersions>
                  <insertTimestamp>2014-11-17T08:46:34+01:00</insertTimestamp>
                  <lastChangeDate>2014-11-24T15:39:32+01:00</lastChangeDate>
                  <name>CPI v1</name>
                  <preferredLanguageCd/>
                  <status>1</status>
                  <statusDate>2014-11-17T08:46:34+01:00</statusDate>
                  <underLicence>false</underLicence>
                  <validityRange>4</validityRange>
                  <versionId>1</versionId>
               </codeSystemVersions>
               <currentVersionId>1</currentVersionId>
               <id>1</id>
               <insertTimestamp>2014-11-17T08:46:34+01:00</insertTimestamp>
               <name>Community Portal Index (CPI)</name>
            </codeSystem>
            <codeSystem>
               <codeSystemVersions>
                  <insertTimestamp>2014-11-24T11:43:10+01:00</insertTimestamp>
                  <lastChangeDate>2014-11-25T09:11:39+01:00</lastChangeDate>
                  <name>healthcareFacilityTypeCode</name>
                  <oid>2.16.756.5.30.1.127.3.2.1.19</oid>
                  <preferredLanguageCd/>
                  <status>1</status>
                  <statusDate>2014-11-20T15:39:41+01:00</statusDate>
                  <underLicence>false</underLicence>
                  <validityRange>4</validityRange>
                  <versionId>5</versionId>
               </codeSystemVersions>
               <currentVersionId>5</currentVersionId>
               <description>Typ der Gesundheitseinrichtung</description>
               <id>4</id>
               <insertTimestamp>2014-11-20T15:39:41+01:00</insertTimestamp>
               <name>healthcareFacilityTypeCode</name>
            </codeSystem>
            <codeSystem>
               <codeSystemVersions>
                  <insertTimestamp>2014-11-24T11:48:50+01:00</insertTimestamp>
                  <lastChangeDate>2014-11-24T14:56:00+01:00</lastChangeDate>
                  <name>practiceSettingCode</name>
                  <preferredLanguageCd/>
                  <status>1</status>
                  <statusDate>2014-11-24T11:48:50+01:00</statusDate>
                  <underLicence>false</underLicence>
                  <validityRange>4</validityRange>
                  <versionId>7</versionId>
               </codeSystemVersions>
               <currentVersionId>7</currentVersionId>
               <id>6</id>
               <insertTimestamp>2014-11-24T11:48:50+01:00</insertTimestamp>
               <name>practiceSettingCode</name>
            </codeSystem>
            <codeSystem>
               <codeSystemVersions>
                  <insertTimestamp>2014-11-17T08:52:10+01:00</insertTimestamp>
                  <lastChangeDate>2014-11-24T14:08:16+01:00</lastChangeDate>
                  <name>RI v1</name>
                  <preferredLanguageCd/>
                  <status>1</status>
                  <statusDate>2014-11-17T08:52:10+01:00</statusDate>
                  <underLicence>false</underLicence>
                  <validityRange>4</validityRange>
                  <versionId>4</versionId>
               </codeSystemVersions>
               <currentVersionId>4</currentVersionId>
               <id>2</id>
               <insertTimestamp>2014-11-20T09:28:44+01:00</insertTimestamp>
               <name>Role-Index (RI)</name>
            </codeSystem>
            <codeSystem>
               <codeSystemVersions>
                  <insertTimestamp>2014-11-24T14:58:04+01:00</insertTimestamp>
                  <lastChangeDate>2014-11-24T14:59:06+01:00</lastChangeDate>
                  <name>Vertraulichkeitsstufen</name>
                  <preferredLanguageCd/>
                  <status>1</status>
                  <statusDate>2014-11-24T14:58:04+01:00</statusDate>
                  <underLicence>false</underLicence>
                  <validityRange>4</validityRange>
                  <versionId>8</versionId>
               </codeSystemVersions>
               <currentVersionId>8</currentVersionId>
               <id>7</id>
               <insertTimestamp>2014-11-24T14:58:04+01:00</insertTimestamp>
               <name>Vertraulichkeitsstufen</name>
            </codeSystem>
         </return>
      </ns2:ListCodeSystemsResponse>
   </S:Body>
</S:Envelope>

Java

WSDL: http://193.25.22.69:8080/TermServer/Search?wsdl

Sample has been created with netbeans. You have to add a web service reference with above WSDL to use the code below.

import de.fhdo.terminologie.ws.search.ListCodeSystemsRequestType;
import de.fhdo.terminologie.ws.search.ListCodeSystemsResponse;
import de.fhdo.terminologie.ws.search.Search;
import de.fhdo.terminologie.ws.search.Search_Service;
import java.net.URL;
import javax.xml.namespace.QName;
import types.termserver.fhdo.de.CodeSystem;
import types.termserver.fhdo.de.CodeSystemVersion;
 
/**
 *
 * @author Robert Mützner <robert.muetzner@fh-dortmund.de>
 */
public class ListCodeSystems
{
 
  public ListCodeSystems()
  {
  }
 
  public void listCodeSystems()
  {
    try
    {
      // create webservice reference and port
      Search_Service service = new Search_Service(
              new URL("http://193.25.22.69:8080/TermServer/Search?wsdl"),
              new QName("http://search.ws.terminologie.fhdo.de/", "Search"));
      Search port = service.getSearchPort();
 
      // define parameter
      ListCodeSystemsRequestType request = new ListCodeSystemsRequestType();
 
      // invoke method
      ListCodeSystemsResponse.Return response = port.listCodeSystems(request);
 
      // handle response
      System.out.println("Response: " + response.getReturnInfos().getMessage());
 
      if(response.getReturnInfos().getStatus() == de.fhdo.terminologie.ws.search.Status.OK)
      {
        System.out.println("Count: " + response.getReturnInfos().getCount());
 
        for(CodeSystem cs : response.getCodeSystem())
        {
          for(CodeSystemVersion csv : cs.getCodeSystemVersions())
          {
            System.out.println("VersionId: " + csv.getVersionId() + ", " + cs.getName() + " - " + csv.getName());
          }
        }
      }
      else
      {
        // handle error message
      }
    }
    catch (Exception ex)
    {
      ex.printStackTrace();
    }
  }
}
Meine Werkzeuge
Namensräume
Varianten
Aktionen
Navigation
Werkzeuge