Findings: "Transform openEHR to FHIR Questionnaire"

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”
2 Likes

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

1 Like

Example with DV_QUANTITY and <units>: https://arketyper.no/ckm/templates/1078.60.848/export

Link to unit extension: 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?

1 Like

Maybe leaving string for DV_TEXT and text for things like DV_PARAGRAPH is an option

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.

BTW, how do you deal with having unit alternatives?

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

1 Like

DV_PARAGRAPH is deprecated (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…

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

	  <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>
2 Likes

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

1 Like

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.

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

1 Like

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

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

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>

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

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

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.

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

This attribute was removed completely in today’s version BTW

1 Like

Noticed that a few of the ValueSet generated from this 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>
2 Likes

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

2 Likes