# Define a simple ICD case cohort in Atlas

This example shows how to build a simple case cohort using the Finnish-specific H81 ICD10fi codes.

We will first use **Cohort Entry Events** to include everyone in the cohort and then use **Inclusion Criteria** to exclude people who are not in our Concept Set. In other words, we will use the **Inclusion Criteria** to only include patents with the Finnish-specific H81 ICD10fi codes into the case cohort.

Make sure to read the [Using standard and non-standard codes in Atlas Cohort Definitions](https://docs.finngen.fi/working-in-the-sandbox/which-tools-are-available/atlas/code-sets-in-atlas#using-standard-and-non-standard-codes-in-atlas-cohort-definitions) section from [Standard and non-standard codes](https://docs.finngen.fi/working-in-the-sandbox/which-tools-are-available/atlas/detailed-guide/code-sets-in-atlas) to get more information on how to define cohorts with standard or non-standard codes. During this example. keep in mind that the H81 ICD10fi code is a non-standard code.

### Step 1: Create an empty Cohort

* Select the **Cohort Definitions** option on the left and click the **New Cohort** button on the right.

<figure><img src="https://3072695768-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhYL0UTLjqsuIdK0SSO%2Fuploads%2Fgit-blob-4bcb91ccacd9d8500ea347d6fe0e5616b71338ef%2FScreenshot%202023-05-28%20at%2018.17.11.png?alt=media" alt=""><figcaption></figcaption></figure>

* **Name the Cohort** using a descriptive name followed by your initials (e.g. Test\_Cohort\_Cases\_MN).

<figure><img src="https://3072695768-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhYL0UTLjqsuIdK0SSO%2Fuploads%2Fgit-blob-519bfcdc1fb2290883eab6c252dd8aa307981041%2FScreenshot%202023-05-28%20at%2018.15.38.png?alt=media" alt=""><figcaption></figcaption></figure>

* **Save the Cohort** by clicking the save button <img src="https://3072695768-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhYL0UTLjqsuIdK0SSO%2Fuploads%2Fgit-blob-8a010ae33fa5327a89cbf047de77d491ba768403%2FScreenshot%202023-05-28%20at%2017.56.06.png?alt=media" alt="" data-size="line">

### Step 2: Define Cohort Entry Events

* **Include everyone** and every event in the cohort by clicking the **Add Initial Event** button in the **Cohort Entry Events** section and by selecting the **Add Visit Occurrence** option from the list:

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

Select a visit occurrence of "Any Visit" to include all visits in the data.

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

### Step 3: Define Cohort Inclusion Criteria

We will now use **Inclusion Criteria** to only include patients with the H81 ICD10fi codes into the cohort.

* Click **New inclusion criteria** button in the **Inclusion Criteria** section and enter the criteria name (e.g. TestPhenotype) and an inclusion rule description:

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

* Click **Add criteria to group** button and select **Add Condition Occurrence**:

<figure><img src="https://3072695768-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhYL0UTLjqsuIdK0SSO%2Fuploads%2Fgit-blob-9c910a0a7278f2aa95f31756b31cfea63799f9eb%2FScreenshot%202023-05-28%20at%2020.04.10.png?alt=media" alt=""><figcaption></figcaption></figure>

* Note the **"at least 1**” selection for the cases cohort.
* Click **Add attribute** button and, because we are dealing with a non-standard code, select [**Add Condition Source Concept**](https://docs.finngen.fi/working-in-the-sandbox/which-tools-are-available/atlas/code-sets-in-atlas#using-standard-and-non-standard-codes-in-atlas-cohort-definitions):

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

* Click the <img src="https://3072695768-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhYL0UTLjqsuIdK0SSO%2Fuploads%2Fgit-blob-c86c2f48ba0b2260d1db9af194cc4e03e30edf34%2FScreenshot%202023-05-28%20at%2020.07.56.png?alt=media" alt="" data-size="line"> button on the right of the "Condition Souce Concept is" text and select the **Import Concept Set** option to import your Concept Set (e.g. MyPhenotypeCodeSet\[MN]):

<figure><img src="https://3072695768-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhYL0UTLjqsuIdK0SSO%2Fuploads%2Fgit-blob-a677861f11c7cc0ced6630eb5218da7e700ef352%2FScreenshot%202023-05-28%20at%2020.11.39.png?alt=media" alt=""><figcaption></figcaption></figure>

* The Concept Set name will be displayed on the right of the "Condition Souce Concept is" text:

<figure><img src="https://3072695768-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhYL0UTLjqsuIdK0SSO%2Fuploads%2Fgit-blob-b3cc6ebc41cfc43e99b81dfae86e1a51d293b287%2FScreenshot%202023-05-28%20at%2020.17.57.png?alt=media" alt=""><figcaption></figcaption></figure>

* **Save the Cohort** by clicking the save button <img src="https://3072695768-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhYL0UTLjqsuIdK0SSO%2Fuploads%2Fgit-blob-8a010ae33fa5327a89cbf047de77d491ba768403%2FScreenshot%202023-05-28%20at%2017.56.06.png?alt=media" alt="" data-size="line">

### Step 4: Generate the case cohort

* Open the **Generation** tab and generate the cohort by clicking the **Generate** button next to the FinnGen data release (FinnGen CDM R11 in the screenshot below). The cohort generation will take a few minutes and the speed is not dependent on the size of the sandbox IVM.

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

The case cohort is now ready. This cohort can be [explored within Atlas](https://docs.finngen.fi/working-in-the-sandbox/which-tools-are-available/atlas/detailed-guide/cohort-characterizations-in-atlas) and used in [Cohort Operations](https://docs.finngen.fi/working-in-the-sandbox/which-tools-are-available/cohort-operations-tool-co) and [Trajectory Visualization tool](https://docs.finngen.fi/working-in-the-sandbox/which-tools-are-available/trajectory-visualization-tool-tvt). The cohort may also be [exported from Atlas](https://docs.finngen.fi/working-in-the-sandbox/which-tools-are-available/atlas/detailed-guide/how-to-define-a-cohort-in-atlas/how-do-you-export-finngen-ids-for-an-analysis-cohort) for further analyses like those described in the [General Workflows for the most common analyses](https://docs.finngen.fi/working-in-the-sandbox/general-workflows-for-the-most-common-analyses).

### Next steps

* [Define a simple ICD control cohort in Atlas](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-control-cohort-in-atlas)
