Skip to content

Commit

Permalink
Merge branch 'feature/FHIR-2063-Retire-dbgap-fhir-mapping' into produ…
Browse files Browse the repository at this point in the history
…ction
  • Loading branch information
RadixSeven committed Sep 26, 2023
2 parents b282a8d + cd6e617 commit 59f2288
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ FHIR is HL7's REST API standard for electronic medical data.

- [**Quickstart**](quickstart.md)
- [**Obtaining a Task-Specific Token for Controlled Data**](obtaining_a_token.md)
- [**Mapping dbGaP concepts to FHIR concepts**](https://dbgap-api-preview.ncbi.nlm.nih.gov/fhir-mapping/interactive/)
- Note: this mapping will be retired and replaced by alternate documentation in future
- [**Notebooks**](jupyter)

## Prerequisites
Expand Down Expand Up @@ -41,8 +39,7 @@ ever come.
If you report a bug or request a feature, it will probably be overlooked
and neglected.

- The CSV download for the interactive concept mapping does
not handle quoting correctly. You'll need to hand-edit it.
- There is no documentation showing how the dbGaP submitted resources map to FHIR resources.

- If you have a query that returns after 20 seconds with an error that looks
like the below:
Expand Down
43 changes: 23 additions & 20 deletions quickstart.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# Location

The dbGaP FHIR API is available at [http://dbgap-api.ncbi.nlm.nih.gov/fhir/x1](http://dbgap-api.ncbi.nlm.nih.gov/fhir/x1). It is a standard FHIR API. The documentation for FHIR is at <https://www.hl7.org/fhir/>. This guide is just a quick-start. We have documented how dbGaP concepts map to FHIR resources at [https://dbgap-api.ncbi.nlm.nih.gov/fhir-mapping/interactive](https://dbgap-api.ncbi.nlm.nih.gov/fhir-mapping/interactive).
The dbGaP FHIR API is available at [http://dbgap-api.ncbi.nlm.nih.gov/fhir/x1](http://dbgap-api.ncbi.nlm.nih.gov/fhir/x1). It is a standard FHIR API. The documentation for FHIR is at <https://www.hl7.org/fhir/>. This guide is just a quick-start.

## Follow Along with Postman

Postman is an API testing application you can [download for free](https://www.postman.com/downloads/).
You can follow along using the included [dbGaP_FHIR_API.postman_collection.json](postman/dbGaP_FHIR_API.postman_collection.json)

* [Instructions on how to use Postman](https://learning.postman.com/docs/getting-started/introduction/)
* [Notes about dbGaP_FHIR_API.postman_collection.json](postman/dbGaP_FHIR_API.postman_collection.json.md)
- [Instructions on how to use Postman](https://learning.postman.com/docs/getting-started/introduction/)
- [Notes about dbGaP_FHIR_API.postman_collection.json](postman/dbGaP_FHIR_API.postman_collection.json.md)

# Retrieving all studies

Expand All @@ -17,9 +18,9 @@ To retrieve all the studies we have stored, you would start with the URL:

<http://dbgap-api.ncbi.nlm.nih.gov/fhir/x1/ResearchStudy>

This will return a Bundle resource (you can see which type of resource it is by looking at the "resourceType" field)
This will return a Bundle resource (you can see which type of resource it is by looking at the "resourceType" field)
which contains an array of [FHIR ResearchStudy objects](https://www.hl7.org/fhir/researchstudy.html).
You can change the number of studies returned for each request by appending the parameter "_count=" followed by an integer.
You can change the number of studies returned for each request by appending the parameter "\_count=" followed by an integer.
For example, <http://dbgap-api.ncbi.nlm.nih.gov/fhir/x1/ResearchStudy?_count=2> will only return the first two studies on the first page.
In the following, we will assume you've left the count at the default value of 100.

Expand All @@ -35,24 +36,26 @@ If this is not the first page of studies in a result, there will be a link with

## Entries

All 100 studies can be found under the `entry` field.
Each entry will have 3 fields:
All 100 studies can be found under the `entry` field.
Each entry will have 3 fields:

1. `fullURL` - a link directly to that study object.
2. `resource` - the object you'd find at that `fullURL` link.
3. `search` - parameters about the search that produced this entry.

# Retrieving studies matching a criterion (searching)

Rather than retrieving all studies, you can get a subset by including search parameters.
The list of available search parameters is available at <http://dbgap-api.ncbi.nlm.nih.gov/fhir/x1/metadata>.

You can find ResearchStudy search parameters at the [JSONPath](https://goessner.net/articles/JsonPath/)
The list of available search parameters is available at <http://dbgap-api.ncbi.nlm.nih.gov/fhir/x1/metadata>.

You can find ResearchStudy search parameters at the [JSONPath](https://goessner.net/articles/JsonPath/)

```jsonpath
$.rest[?(@.mode=='server')].resource[?(@.type=='ResearchStudy')].searchParam
```
```

A more human-readable version is in the official documents <https://www.hl7.org/fhir/researchstudy.html#search>.
This has only the search parameters defined by the standard and omits
This has only the search parameters defined by the standard and omits
parameters unique to the dbGaP API.

### Prefix
Expand Down Expand Up @@ -88,7 +91,7 @@ You can access the metadata for a single study with a URL formed by adding the s

For example:
<https://dbgap-api.ncbi.nlm.nih.gov/fhir/x1/ResearchStudy/phs000204>
**Note that this specific study id may not be accessible and is used only as an example.*
\*_Note that this specific study id may not be accessible and is used only as an example._

Here the study's id is `phs000204`.
This will return a JSON object representing the study.
Expand All @@ -102,8 +105,8 @@ Using a GET request from a program will still return the JSON.
## The `extension` fields

We make heavy use of the `extension` field to model things not available in the standard FHIR specification.
Line 10 <!-- TODO: FHIR-1300 Fix the line references when you update the image
--> holds the
Line 10 <!-- TODO: FHIR-1300 Fix the line references when you update the image
--> holds the
first occurrence of an extension in the example.
Each extension has a URL that links to a machine-readable description of that field called a StructureDefinition.
The URLs are named to allow a human to guess their semantics.
Expand All @@ -114,17 +117,17 @@ For example, line 13 has a URL that shows it is the ReleaseDate field and its va

## Codeable Concepts

Many values are codes within a system. For example, line 19 says
"`valueCoding`" indicating that its value comes from a code system. These have
Many values are codes within a system. For example, line 19 says
"`valueCoding`" indicating that its value comes from a code system. These have
several fields (FHIR has [more documentation on Coding](https://www.hl7.org/fhir/datatypes.html#Coding)). "`system`" is a URL that identifies which coding system is being used. "`code`" is a code within that system. In this example, the system is <https://dbgap-api.ncbi.nlm.nih.gov/fhir/x1/CodeSystem/ResearchStudy-StudyConsents-StudyConsent> and the code with the system is "phs000204.v1.p1 - 1". There is also a display value ("GRU") for quick-reference or to use in displaying this code to a human user. If you look at the [CodeSystem object](https://dbgap-api.ncbi.nlm.nih.gov/fhir/x1/CodeSystem/ResearchStudy-StudyConsents-StudyConsent), and find the code "phs000204.v1.p1 - 1", you can see a slightly expanded definition for this field, "General Research Use (GRU)".

* * * * *
---

# Other objects

Besides ResearchStudy, the server also contains Patient and Observation data. This is individual-level data simulated to resemble TOPMed's new, harmonized data. In the future, it will require authentication, but is currently available for demonstration purposes. Observations describe individual measurements like blood pressure or survey answers. Patients are the research subjects from which the measurements were taken. We intend to eventually use the ResearchSubject resource to connect Patients with ResearchStudy resources.

For more information about Patient and Observation resources, please visit the FHIR website:

- [Patient](https://www.hl7.org/fhir/Patient.html)
- [Observation](https://www.hl7.org/fhir/observation.html)
- [Patient](https://www.hl7.org/fhir/Patient.html)
- [Observation](https://www.hl7.org/fhir/observation.html)

0 comments on commit 59f2288

Please sign in to comment.