You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 5 Next »

We will be adding code snippets in other languages.

Added an R example

Added a Java example

Added a SAS example

Introduction

In this article, you will find several ways to connect to the CDISC Library programmatically using REST API.

Python

The objective is to obtain a list of CDISC Controlled Terminology that are loaded into the metadata repository. Two libraries you will need to make a REST API request and store the JSON output:A REST API GET operation is basically a URL with three parts: base URL, endpoint, path.You may also specify the output format (or, media type). For JSON, you will specify to accept application/json in the request header:XML is an alternate output format you may specify:You can obtain the full script using CDISC Wiki/Jiraaccount: https://bitbucket.cdisc.org/snippets/8912925345864c31a30d7d7a57ea61cf/download. Link to sign up for CDISC Wiki/Jira: https://wiki.cdisc.org/signup.action.

SAS

Below is a sample program to also obtain a list of CDISC Controlled Terminology. This program is compatible with v9.4 and SAS OnDemand for Academics. For further reading about PROC HTTP, visit on-line documentation at https://documentation.sas.com/?docsetId=proc&docsetVersion=9.4&docsetTarget=n1tv5bhcqw9q4ln1btjqicqdqws3.htm&locale=en. Example 9 discusses how to specify HEADER statements for a GET operation. For creating access to SAS OnDemand for Academics, visit https://www.sas.com/en_us/software/on-demand-for-academics.htm.You can obtain the full script using CDISC WIKI/JIRA account: 
https://bitbucket.cdisc.org/snippets/a84d469d6e86400f98af62547370b4dc/download. Link to sign up for CDISC WIKI/JIRA: https://wiki.cdisc.org/signup.action.

Java

Below is a basic CDISC Library client in Java. This example client, by Jozef Aerts, demonstrates how to get started creating a CDISC Library REST client in java. A valid CDISC Library account is required.You can obtain the full script using CDISC WIKI/JIRA account: 
https://bitbucket.cdisc.org/snippets/c81ab9b9e133420e80510465e234f533/download. Link to sign up for CDISC Wiki/Jira: https://wiki.cdisc.org/signup.action.

R

Below is a basic CDISC Library client in R, tested using R Studio v1.2.5 with R v3.6. This example demonstrates how to obtain a product catalog using the /mdr/products endpoint. A valid CDISC Library account is required. You can obtain the full script using CDISC WIKI/JIRA account: https://bitbucket.cdisc.org/snippets/aa1533d6feaa44a5812d223e1dad999f. Link to sign up for CDISC WIKI/JIRA: https://wiki.cdisc.org/signup.action.

  • No labels