# Filtering by clinical registries in Atlas

By default, for Data Freeze 7 - DF10 Atlas uses the following registries INPAT/OPER\_IN, OUTPAT/OPER\_OUT, PRIM\_OUT, CANC, PURCH, and REIMB from [detailed longitudinal data](https://docs.finngen.fi/finngen-data-specifics/red-library-data-individual-level-data/what-phenotype-files-are-available-in-sandbox-1/detailed-longitudinal-data). From Data Freeze 11 onwards Atlas is reading INPAT/OPER\_IN, OUTPAT/OPER\_OUT, PRIM\_OUT, CANC, PURCH, REIMB, and DEATH registers from [service sector data](https://docs.finngen.fi/finngen-data-specifics/red-library-data-individual-level-data/what-phenotype-files-are-available-in-sandbox-1/service-sector-data) that contains the same data as detailed longitudinal data and additional fields (for more details see [service sector data](https://docs.finngen.fi/finngen-data-specifics/red-library-data-individual-level-data/what-phenotype-files-are-available-in-sandbox-1/service-sector-data)).

If you wish to use only some of these registries see [Filtering by clinical registries in Atlas](https://docs.finngen.fi/working-in-the-sandbox/which-tools-are-available/atlas/detailed-guide/how-to-define-a-cohort-in-atlas/cohort-definitions/filter-by-clinical-registries-in-atlas).

**Note**: First, check that Atlas is [reading from the vocabulary matching to the data freeze](https://docs.finngen.fi/working-in-the-sandbox/which-tools-are-available/atlas/detailed-guide/how-to-define-a-cohort-in-atlas/selecting-configuration-in-atlas) of your choice.

### Filtering by clinical registries in Atlas using DF11

See a **tutorial video** about how to filter by clinical registries in Atlas using DF11 data from [FinnGen data users meeting recording](https://www.finngen.fi/en/members/recordings/finngen-data-users-meeting-30th-may-2023) (at 10min 39sec).

From the Data Freeze 11 onwards registers INPAT, OUTPAT, OPER\_IN, OPER\_OUT, PRIM\_OUT, CANC, PURCH, and REIMB (see [detailed longitudinal data](https://docs.finngen.fi/finngen-data-specifics/red-library-data-individual-level-data/what-phenotype-files-are-available-in-sandbox-1/detailed-longitudinal-data)) are available as a vocabulary called FGVisitType (see [service sector data](https://docs.finngen.fi/finngen-data-specifics/red-library-data-individual-level-data/what-phenotype-files-are-available-in-sandbox-1/service-sector-data)). As registers are given in vocabulary we may build a Concept Set for them. Then we use the registers concept set with the medical code concept set to filter data according to registers.

Define a[ Concept Set](https://docs.finngen.fi/working-in-the-sandbox/which-tools-are-available/atlas/detailed-guide/how-to-define-a-cohort-in-atlas/how-to-define-a-simple-icd-case-control-cohort-in-atlas/define-a-simple-icd-concept-set-in-atlas) for a register, here for example for the INPAT register. In the search step of Concept Set search with the register name (INPAT). Select the FGVisitType vocabulary from the filtering menu. Select all codes starting with INPAT and save the Concept Set.

<figure><img src="https://3072695768-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhYL0UTLjqsuIdK0SSO%2Fuploads%2Fgit-blob-1338a2b5e7d1f70aeb64d857205298cbda789cf6%2Fimage%20(357).png?alt=media" alt=""><figcaption></figcaption></figure>

We have also created a set of FinnGen support concept sets which you may use.

<figure><img src="https://3072695768-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhYL0UTLjqsuIdK0SSO%2Fuploads%2Fgit-blob-05df030939f4363e84cf25f2d62658f826cf4909%2Fimage%20(119).png?alt=media" alt=""><figcaption></figcaption></figure>

In the Cohort building phase on Definition page select +Add initial Event... -> Add Visit occurrence

![](https://3072695768-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhYL0UTLjqsuIdK0SSO%2Fuploads%2Fgit-blob-c7af1a660a32f0ae40846de93d349da8258f8951%2Fimage%20\(835\).png?alt=media)

From `+ add attribute...` select `Add Visit Source Concept Criteria` ->Import concept set and select your INPAT concept set.

![](https://3072695768-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhYL0UTLjqsuIdK0SSO%2Fuploads%2Fgit-blob-7f31fdb79a6d12bb411542a46be22f844e5daad9%2Fimage%20\(275\).png?alt=media)

After selection it looks like this

<figure><img src="https://3072695768-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhYL0UTLjqsuIdK0SSO%2Fuploads%2Fgit-blob-d92d72d96735a0eaa772c89f8443e27e2810a64f%2Fimage%20(833).png?alt=media" alt=""><figcaption></figcaption></figure>

Now we will include diagnose concept set. From `+ add attribute...` select `Add Nested Criteria...`

![](https://3072695768-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhYL0UTLjqsuIdK0SSO%2Fuploads%2Fgit-blob-10f2687ad601f8c23a030bbd9374364bc132f351%2Fimage%20\(831\).png?alt=media)

Import the medical code concept set. Remember to [set the concept set to the right box](https://docs.finngen.fi/working-in-the-sandbox/which-tools-are-available/atlas/detailed-guide/how-to-define-a-cohort-in-atlas/cohort-definitions/mapping-between-atlas-registries-and-medical-codes) according to whether the concept set is built with [standard or non-standard](https://docs.finngen.fi/working-in-the-sandbox/which-tools-are-available/atlas/detailed-guide/code-sets-in-atlas) codes. Select the option to **restrict to the same visit occurrence** ![](https://3072695768-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhYL0UTLjqsuIdK0SSO%2Fuploads%2Fgit-blob-7dc5cc3ae6d5e637cbd4aa0c1dfd2ade11e2a41c%2Fimage%20\(291\).png?alt=media).

<figure><img src="https://3072695768-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhYL0UTLjqsuIdK0SSO%2Fuploads%2Fgit-blob-f67e3d63496e5cd9b52ae68e76095468b4bd126c%2Fimage%20(834).png?alt=media" alt=""><figcaption></figcaption></figure>

### Filtering by clinical registries in Atlas using DF7 - DF10

#### Step 1:

To define which registries are used select `+Add attribute` and `Add Visit` for each criteria group (gray box with green borders) in the `Inclusion Criteria` section.

![](https://3072695768-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhYL0UTLjqsuIdK0SSO%2Fuploads%2Fgit-blob-149916b820888a20916fdc5ba820db3757ea8803%2Fimage%20\(118\).png?alt=media)

Select `Add`

![](https://3072695768-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhYL0UTLjqsuIdK0SSO%2Fuploads%2Fgit-blob-e03ad1919b7e1d1719eb8d7dd37afaf5c7e1d517%2Fimage%20\(773\).png?alt=media)

#### Step 2:

Search the register you like to use. If you search for "FinnGen" and filter by "Visit", Atlas will show you all the available registers and the equivalent in the code in the `detailed longitudinal data`. Click <img src="https://3072695768-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhYL0UTLjqsuIdK0SSO%2Fuploads%2Fgit-blob-c5894941eee550796dde7909635e5c603f11bee9%2Fimage%20(624).png?alt=media" alt="" data-size="line"> to select registries. Then click **Add Selected** and **Close**.

![](https://3072695768-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhYL0UTLjqsuIdK0SSO%2Fuploads%2Fgit-blob-b029780246a1fb245ab0c896f89e87abee4ed848%2Fimage%20\(127\).png?alt=media)

After selection, it looks like this

![](https://3072695768-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhYL0UTLjqsuIdK0SSO%2Fuploads%2Fgit-blob-60848580dd70a7292d8850fc8bbc073143b62572%2Fimage%20\(159\).png?alt=media)

Similarly, registries can be set as filtering criteria also for other Inclusion Criteria like conditions and procedures.

See also [Standard and non-standard medical codes in Atlas](https://docs.finngen.fi/working-in-the-sandbox/which-tools-are-available/atlas/detailed-guide/code-sets-in-atlas)

Exploring your new cohort with tools designed for the purpose is highly recommended before moving to downstream analysis like GWAS.

For further instructions see [General workflows for the most common analyses](https://docs.finngen.fi/working-in-the-sandbox/general-workflows-for-the-most-common-analyses), [Cohort Characterizations in Atlas](https://docs.finngen.fi/working-in-the-sandbox/which-tools-are-available/atlas/detailed-guide/cohort-characterizations-in-atlas), [Cohort Operations tool](https://docs.finngen.fi/working-in-the-sandbox/which-tools-are-available/cohort-operations-tool-co), [Trajectory Visualization tool](https://docs.finngen.fi/working-in-the-sandbox/which-tools-are-available/trajectory-visualization-tool-tvt), and [Custom GWAS tool](https://docs.finngen.fi/working-in-the-sandbox/which-tools-are-available/untitled/custom-gwas-tool).

Custom GWAS can also be launched using the [Cohort Operations tool](https://docs.finngen.fi/working-in-the-sandbox/which-tools-are-available/cohort-operations-tool-co).

1.
