# Findings: "Transform openEHR to FHIR Questionnaire"

**URL:** https://discourse.openehr.org/t/findings-transform-openehr-to-fhir-questionnaire/614
**Category:** LinkEHR
**Created:** [27 April 2020 08:22 UTC](https://discourse.openehr.org/t/findings-transform-openehr-to-fhir-questionnaire/614 "2020-04-27T08:22:01Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Kenneth\_Myhra](https://discourse.openehr.org/user_avatar/discourse.openehr.org/kenneth_myhra/32/322_2.png) [@Kenneth\_Myhra](https://discourse.openehr.org/u/Kenneth_Myhra)
#### Post date: [27 April 2020 08:22 UTC](https://discourse.openehr.org/t/findings-transform-openehr-to-fhir-questionnaire/614/1 "2020-04-27T08:22:01Z")

</div>

Here are some of my findings from playing with the “Transform openEHR to FHIR Questionnaire” feature in LinkEHR:

- enableBehaviour should be enableBehavior
- item.linkId is not always unique
- DV\_QUANTITY is not properly transformed. item.type is missing
- DV\_QUANTITY missing unit
  - For quantity data types I have been using an extension (STU3), that might have been moved to code in R4 version, but I can’t confirm that

- All text fields are converted to item.type = “text”, for some of them it would make more sense to use item.type = “string”

---

<div class="post-metadata">

### Author: ![yampeku](https://discourse.openehr.org/user_avatar/discourse.openehr.org/yampeku/32/25_2.png) [@yampeku](https://discourse.openehr.org/u/yampeku)
#### Post date: [27 April 2020 08:31 UTC](https://discourse.openehr.org/t/findings-transform-openehr-to-fhir-questionnaire/614/2 "2020-04-27T08:31:35Z")

</div>

Hello Kenneth,

Just released a new version, which deals with domain types (one being DvQuantity). I haven’t seen any example with units, so probably is not yet core. Will have a look to the extension. Do you have a link to it?

For the text vs string, do you think there could be some kind of decision tree to choose one or the other? (e.g. if we have answerOption it should be a string).

I’ll have a look at the enableBehaviour & linkid issue

---

<div class="post-metadata">

### Author: ![Kenneth\_Myhra](https://discourse.openehr.org/user_avatar/discourse.openehr.org/kenneth_myhra/32/322_2.png) [@Kenneth\_Myhra](https://discourse.openehr.org/u/Kenneth_Myhra)
#### Post date: [27 April 2020 08:53 UTC](https://discourse.openehr.org/t/findings-transform-openehr-to-fhir-questionnaire/614/3 "2020-04-27T08:53:25Z")

</div>

Example with DV\_QUANTITY and `<units>`: [https://arketyper.no/ckm/templates/1078.60.848/export](https://arketyper.no/ckm/templates/1078.60.848/export)

Link to unit extension: [http://hl7.org/fhir/extension-questionnaire-unit.html](http://hl7.org/fhir/extension-questionnaire-unit.html)

Representation in FHIR STU3:

```
<item>
	<extension url="http://hl7.org/fhir/StructureDefinition/questionnaire-unit">
		<valueCoding>
			<system value="http://unitsofmeasure.org" />
			<code value="mm[Hg]" />
			<display value="mm[Hg]" />
		</valueCoding>
	</extension>
	<linkId value="openEHR-EHR-OBSERVATION.blood_pressure.v2:at0004" />
	<text value="Systolisk" />
	<type value="quantity" />
</item>

```

For text vs string I was hoping there was some kind of distinction between small vs large fields in the .opt, but I think there isn’t?

---

<div class="post-metadata">

### Author: ![yampeku](https://discourse.openehr.org/user_avatar/discourse.openehr.org/yampeku/32/25_2.png) [@yampeku](https://discourse.openehr.org/u/yampeku)
#### Post date: [27 April 2020 08:54 UTC](https://discourse.openehr.org/t/findings-transform-openehr-to-fhir-questionnaire/614/4 "2020-04-27T08:54:55Z")

</div>

> [@Kenneth\_Myhra](#):
>
> For text vs string I was hoping there was some kind of distinction between small vs large fields in the .opt, but I think there isn’t?

Maybe leaving string for DV\_TEXT and text for things like DV\_PARAGRAPH is an option

---

<div class="post-metadata">

### Author: ![Kenneth\_Myhra](https://discourse.openehr.org/user_avatar/discourse.openehr.org/kenneth_myhra/32/322_2.png) [@Kenneth\_Myhra](https://discourse.openehr.org/u/Kenneth_Myhra)
#### Post date: [27 April 2020 08:56 UTC](https://discourse.openehr.org/t/findings-transform-openehr-to-fhir-questionnaire/614/5 "2020-04-27T08:56:38Z")

</div>

That seems to make sense. Just so you know, my openEHR knowledge is currently very limited so I am not very aware of the different data types and/or structures.

---

<div class="post-metadata">

### Author: ![yampeku](https://discourse.openehr.org/user_avatar/discourse.openehr.org/yampeku/32/25_2.png) [@yampeku](https://discourse.openehr.org/u/yampeku)
#### Post date: [27 April 2020 08:58 UTC](https://discourse.openehr.org/t/findings-transform-openehr-to-fhir-questionnaire/614/6 "2020-04-27T08:58:36Z")

</div>

> [@Kenneth\_Myhra](#):
>
> [HL7.FHIR.UV.EXTENSIONS\Questionnaire Unit - FHIR v5.0.0](http://hl7.org/fhir/StructureDefinition/questionnaire-unit)

BTW, how do you deal with having unit alternatives?

---

<div class="post-metadata">

### Author: ![Kenneth\_Myhra](https://discourse.openehr.org/user_avatar/discourse.openehr.org/kenneth_myhra/32/322_2.png) [@Kenneth\_Myhra](https://discourse.openehr.org/u/Kenneth_Myhra)
#### Post date: [27 April 2020 09:04 UTC](https://discourse.openehr.org/t/findings-transform-openehr-to-fhir-questionnaire/614/7 "2020-04-27T09:04:45Z")

</div>

> [@yampeku](#):
>
> BTW, how do you deal with having unit alternatives?

I don’t think we have had such a use case yet

---

<div class="post-metadata">

### Author: ![siljelb](https://discourse.openehr.org/user_avatar/discourse.openehr.org/siljelb/32/12_2.png) [@siljelb](https://discourse.openehr.org/u/siljelb)
#### Post date: [27 April 2020 09:16 UTC](https://discourse.openehr.org/t/findings-transform-openehr-to-fhir-questionnaire/614/8 "2020-04-27T09:16:59Z")

</div>

DV\_PARAGRAPH is deprecated ([https://specifications.openehr.org/releases/RM/latest/data\_types.html#\_dv\_paragraph\_class](https://specifications.openehr.org/releases/RM/latest/data_types.html#_dv_paragraph_class)).

The length of text elements are left up to the implementers when we construct archetypes and templates, it’s not possible (or IMO desirable) to do it in the information model.

I’m not sure I understand the significance of the text/string division? I’ve found the definition of String, but I’m struggling to find Text…

---

<div class="post-metadata">

### Author: ![Kenneth\_Myhra](https://discourse.openehr.org/user_avatar/discourse.openehr.org/kenneth_myhra/32/322_2.png) [@Kenneth\_Myhra](https://discourse.openehr.org/u/Kenneth_Myhra)
#### Post date: [27 April 2020 09:18 UTC](https://discourse.openehr.org/t/findings-transform-openehr-to-fhir-questionnaire/614/9 "2020-04-27T09:18:30Z")

</div>

> [@yampeku](#):
>
> BTW, how do you deal with having unit alternatives?

This seems to be the proper way for handling units on Quantity in R4, also example has unit alternatives

```auto
	  <item>
		<extension url="http://hl7.org/fhir/StructureDefinition/questionnaire-observationLinkPeriod">
		  <valueDuration>
			<value value="3"/>
			<system value="http://unitsofmeasure.org"/>
			<code value="mo"/>
		  </valueDuration>
		</extension>
		<linkId value="code-pop-demo"/>
		<code>
		  <system value="http://loinc.org"/>
		  <code value="29463-7"/>
		  <display value="Body weight"/>
		</code>
		<code>
		  <system value="http://loinc.org"/>
		  <code value="3141-9"/>
		  <display value="Body weight Measured"/>
		</code>
		<code>
		  <system value="http://loinc.org"/>
		  <code value="8341-0"/>
		  <display value="Dry body weight Measured"/>
		</code>
		<text value="What is your current weight?"/>
		<type value="quantity"/>
		<answerOption>
		  <valueCoding>
			<system value="http://unitsofmeasure.org"/>
			<code value="kg"/>
		  </valueCoding>
		</answerOption>
		<answerOption>
		  <valueCoding>
			<system value="http://unitsofmeasure.org"/>
			<code value="[lb_av]"/>
		  </valueCoding>
		</answerOption>
	  </item>

```

---

<div class="post-metadata">

### Author: ![Kenneth\_Myhra](https://discourse.openehr.org/user_avatar/discourse.openehr.org/kenneth_myhra/32/322_2.png) [@Kenneth\_Myhra](https://discourse.openehr.org/u/Kenneth_Myhra)
#### Post date: [27 April 2020 09:22 UTC](https://discourse.openehr.org/t/findings-transform-openehr-to-fhir-questionnaire/614/10 "2020-04-27T09:22:24Z")

</div>

> [@siljelb](#):
>
> I’m not sure I understand the significance of the text/string division? I’ve found the definition of String, but I’m struggling to find Text…

[http://hl7.org/fhir/valueset-item-type.html#expansion](http://hl7.org/fhir/valueset-item-type.html#expansion)

string - Question with a short (few words to short sentence) free-text entry answer (valueString).  
text - Question with a long (potentially multi-paragraph) free-text entry answer (valueString).

This means that our form rendrer will render a text data type as a textarea, and a string a an input

---

<div class="post-metadata">

### Author: ![siljelb](https://discourse.openehr.org/user_avatar/discourse.openehr.org/siljelb/32/12_2.png) [@siljelb](https://discourse.openehr.org/u/siljelb)
#### Post date: [27 April 2020 09:24 UTC](https://discourse.openehr.org/t/findings-transform-openehr-to-fhir-questionnaire/614/11 "2020-04-27T09:24:48Z")

</div>

Ah, now I understand. I think this would need to be the choice of the implementer, so a UI choice applied after the initial conversion in this case.

---

<div class="post-metadata">

### Author: ![yampeku](https://discourse.openehr.org/user_avatar/discourse.openehr.org/yampeku/32/25_2.png) [@yampeku](https://discourse.openehr.org/u/yampeku)
#### Post date: [27 April 2020 09:33 UTC](https://discourse.openehr.org/t/findings-transform-openehr-to-fhir-questionnaire/614/12 "2020-04-27T09:33:35Z")

</div>

can also be a choice in the generation, however would be or all texts or all strings 😅

---

<div class="post-metadata">

### Author: ![yampeku](https://discourse.openehr.org/user_avatar/discourse.openehr.org/yampeku/32/25_2.png) [@yampeku](https://discourse.openehr.org/u/yampeku)
#### Post date: [27 April 2020 09:36 UTC](https://discourse.openehr.org/t/findings-transform-openehr-to-fhir-questionnaire/614/13 "2020-04-27T09:36:45Z")

</div>

From this example I think it should be ok to put in the code the binding to the original openEHR object, such as

```auto
<code>
   <system value="openEHR-EHR-OBSERVATION.laboratory_test_result.v1"/>
   <code value="at0005"/>
   <display value="Test name"/>
</code>

```

---

<div class="post-metadata">

### Author: ![Kenneth\_Myhra](https://discourse.openehr.org/user_avatar/discourse.openehr.org/kenneth_myhra/32/322_2.png) [@Kenneth\_Myhra](https://discourse.openehr.org/u/Kenneth_Myhra)
#### Post date: [27 April 2020 09:55 UTC](https://discourse.openehr.org/t/findings-transform-openehr-to-fhir-questionnaire/614/14 "2020-04-27T09:55:02Z")

</div>

> [@yampeku](#):
>
> From this example I think it should be ok to put in the code the binding to the original openEHR object, such as

Like this?

```
<item>
	<linkId value="openEHR-EHR-OBSERVATION.blood_pressure.v2:at0004" />
	<text value="Systolisk" />
	<type value="quantity" />
	<code>
		<system value="http://unitsofmeasure.org" />
		<code value="mm[Hg]" />
		<display value="mm[Hg]" />
	</code>
</item>

```

---

<div class="post-metadata">

### Author: ![yampeku](https://discourse.openehr.org/user_avatar/discourse.openehr.org/yampeku/32/25_2.png) [@yampeku](https://discourse.openehr.org/u/yampeku)
#### Post date: [27 April 2020 09:59 UTC](https://discourse.openehr.org/t/findings-transform-openehr-to-fhir-questionnaire/614/15 "2020-04-27T09:59:28Z")

</div>

I mean, instead of the loinc bindings, treat the original openEHR object as what’s giving the meaning. The units part with answerOption I think it’s ok

---

<div class="post-metadata">

### Author: ![Kenneth\_Myhra](https://discourse.openehr.org/user_avatar/discourse.openehr.org/kenneth_myhra/32/322_2.png) [@Kenneth\_Myhra](https://discourse.openehr.org/u/Kenneth_Myhra)
#### Post date: [27 April 2020 10:20 UTC](https://discourse.openehr.org/t/findings-transform-openehr-to-fhir-questionnaire/614/16 "2020-04-27T10:20:32Z")

</div>

Is there some common unique reference to the Code System other than `openEHR-EHR-OBSERVATION.laboratory_test_result.v1`?

[http://hl7.org/fhir/datatypes-definitions.html#Coding.system](http://hl7.org/fhir/datatypes-definitions.html#Coding.system)

> The URI may be an OID (urn:oid:…) or a UUID (urn:uuid:…). OIDs and UUIDs SHALL be references to the HL7 OID registry. Otherwise, the URI should come from HL7’s list of FHIR defined special URIs or it should reference to some definition that establishes the system clearly and unambiguously.

---

<div class="post-metadata">

### Author: ![yampeku](https://discourse.openehr.org/user_avatar/discourse.openehr.org/yampeku/32/25_2.png) [@yampeku](https://discourse.openehr.org/u/yampeku)
#### Post date: [27 April 2020 10:24 UTC](https://discourse.openehr.org/t/findings-transform-openehr-to-fhir-questionnaire/614/17 "2020-04-27T10:24:32Z")

</div>

I’ve put that under an uri such as “[http://openehr.org/openEHR-EHR-OBSERVATION.laboratory\_test\_result.v1](http://openehr.org/openEHR-EHR-OBSERVATION.laboratory_test_result.v1)” in the past. In fact, this openehr base uri is also configurable

---

<div class="post-metadata">

### Author: ![yampeku](https://discourse.openehr.org/user_avatar/discourse.openehr.org/yampeku/32/25_2.png) [@yampeku](https://discourse.openehr.org/u/yampeku)
#### Post date: [27 April 2020 14:38 UTC](https://discourse.openehr.org/t/findings-transform-openehr-to-fhir-questionnaire/614/18 "2020-04-27T14:38:00Z")

</div>

> [@Kenneth\_Myhra](#):
>
> enableBehaviour should be enableBehavior

This attribute was removed completely in today’s version BTW

---

<div class="post-metadata">

### Author: ![Kenneth\_Myhra](https://discourse.openehr.org/user_avatar/discourse.openehr.org/kenneth_myhra/32/322_2.png) [@Kenneth\_Myhra](https://discourse.openehr.org/u/Kenneth_Myhra)
#### Post date: [28 April 2020 07:35 UTC](https://discourse.openehr.org/t/findings-transform-openehr-to-fhir-questionnaire/614/19 "2020-04-28T07:35:47Z")

</div>

Noticed that a few of the ValueSet generated from this OPT: [https://arketyper.no/ckm/templates/1078.60.876/opt](https://arketyper.no/ckm/templates/1078.60.876/opt) is missing code values

I’ve added two examples generated from that OPT, one where the code values are included, and one where they are missing

Example of ValueSet missing code values:

```
<?xml version="1.0" encoding="UTF-8"?>
<ValueSet xmlns="http://hl7.org/fhir">
   <id value="ValueSet-report-v1-_testname_en_-R4"/>
   <meta>
      <profile value="http://hl7.org/fhir/StructureDefinition/shareablevalueset"/>
   </meta>
   <text>
      <status value="generated"/>
      <div xmlns="http://www.w3.org/1999/xhtml">
         <p> Value set *Test name (en). *The name of the imaging examination or procedure performed. (en)</p>
         <p> Developed by: openEHR community</p>
         <p> Generated with LinkEHR</p>
         <p> This value set includes codes from terminology NCRP</p>
         <ul>
            <li>SSC0AA: </li>
         </ul>
      </div>
   </text>
   <url value="http://linkehr.com/fhir/ValueSet-report-v1-_testname_en_-R4"/>
   <version value="20200428"/>
   <name value="*Test name (en)"/>
   <status value="active"/>
   <experimental value="false"/>
   <publisher value="openEHR"/>
   <description value="*The name of the imaging examination or procedure performed. (en)"/>
   <compose>
      <include>
         <system value="http://openehr.org/ckm/archetypes/openEHR-EHR-OBSERVATION.imaging_exam_result.v0"/>
         <concept>
            <code value=""/>
            <display value=""/>
         </concept>
      </include>
   </compose>
</ValueSet>

```

Example of ValueSet not missing code values:

```
<?xml version="1.0" encoding="UTF-8"?>
<ValueSet xmlns="http://hl7.org/fhir">
   <id value="ValueSet-report-v1-erdetnoentilstandertilstede_-R4"/>
   <meta>
      <profile value="http://hl7.org/fhir/StructureDefinition/shareablevalueset"/>
   </meta>
   <text>
      <status value="generated"/>
      <div xmlns="http://www.w3.org/1999/xhtml">
         <p> Value set Er det noen tilstander tilstede?. Tilstedeværelse av relevante tilstander.</p>
         <p> Developed by: openEHR community</p>
         <p> Generated with LinkEHR</p>
         <p> This value set includes codes from archetype openEHR-EHR-COMPOSITION.report.v1 internal terminology</p>
         <ul>
            <li>at0031: Tilstede</li>
            <li>at0032: Fraværende</li>
            <li>at0033: Ukjent</li>
         </ul>
      </div>
   </text>
   <url value="http://linkehr.com/fhir/ValueSet-report-v1-erdetnoentilstandertilstede_-R4"/>
   <version value="20200428"/>
   <name value="Er det noen tilstander tilstede?"/>
   <status value="active"/>
   <experimental value="false"/>
   <publisher value="openEHR"/>
   <description value="Tilstedeværelse av relevante tilstander."/>
   <compose>
      <include>
         <system value="http://openehr.org/ckm/archetypes/openEHR-EHR-OBSERVATION.condition_screening.v0"/>
         <concept>
            <code value="at0031"/>
            <display value="Tilstede"/>
         </concept>
         <concept>
            <code value="at0032"/>
            <display value="Fraværende"/>
         </concept>
         <concept>
            <code value="at0033"/>
            <display value="Ukjent"/>
         </concept>
      </include>
   </compose>
</ValueSet>
```

---

<div class="post-metadata">

### Author: ![yampeku](https://discourse.openehr.org/user_avatar/discourse.openehr.org/yampeku/32/25_2.png) [@yampeku](https://discourse.openehr.org/u/yampeku)
#### Post date: [28 April 2020 07:48 UTC](https://discourse.openehr.org/t/findings-transform-openehr-to-fhir-questionnaire/614/20 "2020-04-28T07:48:32Z")

</div>

Thanks, seems related to external terminologies, I’ll try it with your example 😃

[Next page](https://discourse.openehr.org/t/findings-transform-openehr-to-fhir-questionnaire/614.md?page=2)
