FHIR Chat · Basic Question about Valueset · implementers

Stream: implementers

Topic: Basic Question about Valueset


view this post on Zulip Nath (Jun 05 2020 at 00:37):

I have install Hapi FHIR JPA version. I am trying to understand how can I read the valueset defined out of the box by FHIR. For example, https://www.hl7.org/fhir/v3/EducationLevel/cs.html. The code/system/display is defined as follows:

Level Code Display Definition
1 ASSOC Associate's or technical degree complete Associate's or technical degree complete
1 BD College or baccalaureate degree complete College or baccalaureate degree complete
1 ELEM Elementary School Elementary School
1 GD Graduate or professional Degree complete Graduate or professional Degree complete
1 HS High School or secondary school degree complete High School or secondary school degree complete
1 PB Some post-baccalaureate education Some post-baccalaureate education
1 POSTG Doctoral or post graduate education Doctoral or post graduate education
1 SCOL Some College education Some College education
1 SEC Some secondary or high school education Some secondary or high school education


Questions:
1.How can I read these values in my java program?.

  1. Do I need to load any extra valuseset terminology data to get these ?.

I am fairly at loss. I tried this on my instance http://localhost:8090/fhir/ValueSet
I get back
{
"resourceType": "Bundle",
"id": "da85d7a9-8f24-494e-b21e-5a26ddfee326",
"meta": {
"lastUpdated": "2020-06-04T17:21:17.801-07:00"
},
"type": "searchset",
"total": 0,
"link": [
{
"relation": "self",
"url": "/fhir/*/ValueSet"
}
]
}
Can someone help me understand this?.

thanks a lot

view this post on Zulip Lloyd McKenzie (Jun 05 2020 at 02:47):

Your search response is saying that there are currently no ValueSet instances stored in your repository

view this post on Zulip Lloyd McKenzie (Jun 05 2020 at 02:47):

Also, if you're defining your own codes, you'll need both a CodeSystem (where the codes are defined) and a ValueSet (which indicates which subset of codes you want - though there's a simple way to say "all of them" if that's your requirement).

view this post on Zulip Nath (Jun 05 2020 at 13:45):

thanks @Lloyd McKenzie . I would like to get all the values defined in FHIR. i.e. https://www.hl7.org/fhir/terminologies-valuesets.html
How can I load these into my repository?. Can you please give me pointer how can I load them?.

thanks for your help.

view this post on Zulip Lloyd McKenzie (Jun 05 2020 at 14:16):

http://hl7.org/fhir/valuesets.xml or http://hl7.org/fhir/valuesets.json

view this post on Zulip Lloyd McKenzie (Jun 05 2020 at 14:18):

Note that not all value sets necessarily have expansions in-line. For some value sets (e.g. those that draw on SNOMED), the set of codes is dynamic and changes as the underlying code systems change. You can get current expansions by hitting http://tx.fhir.org

view this post on Zulip Nath (Jun 05 2020 at 14:52):

thanks @Lloyd McKenzie . So, could you please kindly tell me what command would I use to load this valuesets.json to my fhir repo?.

Btw, this link in tx.fhir.org, http://tx.fhir.org/r4 throws exception.

view this post on Zulip Lloyd McKenzie (Jun 05 2020 at 16:40):

That would depend on the nature of your FHIR repository. In theory, you could POST each value set in turn to create it.
@Grahame Grieve - tx.fhir.org needs a restart.

view this post on Zulip Nath (Jun 05 2020 at 18:44):

thanks @Lloyd McKenzie I will try this. thanks for your help.

view this post on Zulip Nath (Jun 10 2020 at 01:44):

@Lloyd McKenzie . I tried this sample valueset from here http://hl7.org/fhir/R4/valueset-relatedperson-relationshiptype.json. I tried to post to my hapi jpa server.
curl --location --request POST 'http://localhost:8080/fhir/ValueSet' \
--header 'Content-Type: application/fhir+json' \
--header 'Cookie: JSESSIONID=45A8B8827CD707FD9A0CF7D25B5D0B41' \
--data-raw '{
"resourceType" : "ValueSet",
"id" : "relatedperson-relationshiptype",
"meta" : {
"lastUpdated" : "2019-11-01T09:29:23.356+11:00",
"profile" : ["http://hl7.org/fhir/StructureDefinition/shareablevalueset"]
},
"text" : {
"status" : "generated",
"div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><h2>Patient relationship type</h2><div><p>A set of codes that can be used to indicate the relationship between a Patient and a Related Person.</p>\n</div><p>This value set includes codes from the following code systems:</p><ul><li>Include all codes defined in <a href=\"v2/0131/index.html\"><code>http://terminology.hl7.org/CodeSystem/v2-0131</code></a></li><li>Include codes from <a href=\"v3/RoleCode/cs.html\"><code>http://terminology.hl7.org/CodeSystem/v3-RoleCode</code></a> where concept is-a <a href=\"v3/RoleCode/cs.html#v3-RoleCode-_PersonalRelationshipRoleType\">_PersonalRelationshipRoleType</a></li></ul></div>"
},
"extension" : [{
"url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg",
"valueCode" : "pa"
}],
"url" : "http://hl7.org/fhir/ValueSet/relatedperson-relationshiptype",
"identifier" : [{
"system" : "urn:ietf:rfc:3986",
"value" : "urn:oid:2.16.840.1.113883.4.642.3.449"
}],
"version" : "4.0.1",
"name" : "PatientRelationshipType",
"title" : "Patient relationship type",
"status" : "draft",
"experimental" : false,
"date" : "2019-11-01T09:29:23+11:00",
"publisher" : "FHIR Project team",
"contact" : [{
"telecom" : [{
"system" : "url",
"value" : "http://hl7.org/fhir"
}]
}],
"description" : "A set of codes that can be used to indicate the relationship between a Patient and a Related Person.",
"compose" : {
"include" : [{
"system" : "http://terminology.hl7.org/CodeSystem/v2-0131"
},
{
"system" : "http://terminology.hl7.org/CodeSystem/v3-RoleCode",
"filter" : [{
"property" : "concept",
"op" : "is-a",
"value" : "_PersonalRelationshipRoleType"
}]
}]
}
}'

but I got back this error
{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "error",
"code": "processing",
"diagnostics": "Failed to call access method: org.springframework.dao.InvalidDataAccessApiUsageException: No EntityManager with actual transaction available for current thread - cannot reliably process 'persist' call; nested exception is javax.persistence.TransactionRequiredException: No EntityManager with actual transaction available for current thread - cannot reliably process 'persist' call"
}
]
}

Can you please kindly help me ?. thanks for your help.

view this post on Zulip Lloyd McKenzie (Jun 10 2020 at 03:29):

When you POST, you shouldn't have an 'id' in the resource. (Some servers may tolerate it, but it shouldn't be there and it'll get ignored by those who do tolerate it.) However, that's unlikely to be your problem - and if it is, the error message sucks :) Suggest raising the issue on the #hapi stream.

view this post on Zulip Nath (Jun 10 2020 at 04:51):

thanks @Lloyd McKenzie . I tried removing the id also, same error. I will post it in hapi forum. thanks for your help. appreciate it.


Last updated: Apr 12 2022 at 19:14 UTC