# FHIR : ValueSets, Concepts

### Specific FHIR concepts

FHIR expects to render data with codes in specified ValueSets

#### The concept\_fhir SQL table

This table is needed by our FHIR implementation to fasten how we render data to REST clients. We store a mapping between codes that appear in OMOP patient data tables (person, visit, ...) and the codes that FHIR expects to render in every Resource

| `source_concept_id` | `source_concept_code` | `source_concept_name` | `urce_vocabulary_reference`        | `target_concept_id` | `target_concept_code` | `target_vocabulary_reference`                 |
| ------------------- | --------------------- | --------------------- | ---------------------------------- | ------------------- | --------------------- | --------------------------------------------- |
| 12997538            | H72                   | Some description      | <http://valueset.com/somevalueset> | 9845131             | KYVV                  | <http://randomvalueset.com/someothervalueset> |

#### FHIR constraints on Resource fields codes

As [described in the FHIR standard](https://www.hl7.org/fhir/terminologies.html#strength), there are 4 different kind of constraints on ressource fields codes:

| Constraint | Description                                                                                      | Example                                                                                                                                                                                                               |
| ---------- | ------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| required   | Code is required to be from a specified ValueSet                                                 | Patient.gender code is **required** to be a code from [http://hl7.org/fhir/ValueSet/administrative-gender&#xD;](<http://hl7.org/fhir/ValueSet/administrative-gender&#xD;&#xA;>)                                       |
| extensible | Code is required to be from a specified ValueSet but if needed you can add your own codes        | Patient.maritalStatus code is **required** to be a code from the [http://hl7.org/fhir/ValueSet/marital-status](<http://hl7.org/fhir/ValueSet/marital-status&#xD;&#xA;>) **but you can extend it with your own codes** |
| preferred  | it is encouraged to use a code from a ValueSet specified by the standard but it is not mandatory | Patient.communication.language is **encouraged** to be from the [http://hl7.org/fhir/ValueSet/all-languages](<http://hl7.org/fhir/ValueSet/all-languages&#xD;&#xA;>) **but you can use your own ValueSet**            |
| example    | Code can be from any ValueSet                                                                    | Encounter.type can be from [http://hl7.org/fhir/ValueSet/encounter-type&#xD;](<http://hl7.org/fhir/ValueSet/encounter-type&#xD;&#xA;>) or any other                                                                   |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cohort360.org/fhir/fhir-valuesets-concepts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
