I am having a difficult time wrapping my head around codesystems and valuesets, so I am taking it to the community in hopes that I can get some clarity.
- $lookup operation: https://www.hl7.org/fhir/codesystem-operation-lookup.html I struggled with this for a while and then I read that system and code are required, but the table only says if a code is provided a system must be provided. It doesn’t say you can’t just pass a system and I think it should, because in the top description it states: “a client SHALL provide both a system and a code”
So to be clear, $lookup must have at a minimum code and system to process the request?
1a. For the result of a $lookup, what is the payload response? Are we to return a single codesystem resourceType with the matching results? I have been searching on the docs and can only find what to pass in not what the response includes.
- General CodeSystem searches, ie /CodeSystem?system=http://examplecodes.org. Is this supposed to return all values for this codesystem? Or is it just supposed to return the properties that are custom to X codesystem? Where the user then uses a $lookup to get the code they need?
2a. For example, if I have a codesystem with information such as { full_name, short_name, status, code, description, last_updated_date } am I supposed to translate that data to the property array?
Example property array on CodeSystem resourceType:
{
"resourceType": "CodeSystem",
"id": "example",
"url": "http://hl7.org/fhir/CodeSystem/example",
"version": "20190522",
"name": "Sample System",
"title": "Sample System of Codes",
"status": "active",
"experimental": true,
"date": "2019-05-22",
"description": "Sample System to understand Codesystems resourceType",
"caseSensitive": true,
"content": "complete",
"property": [{
"code": "code",
"description": "the code value of the sample system",
"type": "code"
}, {
"code": "full_name",
"description": "the full official name of the sample code in the system",
"type": "string"
}, {
"code": "short_name",
"description": "the abbreviated name of the sample code in the system",
"type": "string"
}, {
"code": "nonvaccine",
"description": "whether or not the code is a vaccine",
"type": "boolean"
}, {
"code": "active",
"description": "the codes status as active or inactive in the system",
"type": "boolean"
}, {
"code": "description",
"description": "the description of the sample code entry",
"type": "string"
}, {
"code": "last_update_date",
"description": "the last time the sample code entry was updated",
"type": "dateTime"
}]
}
2b. Then if a user wants to do a lookup and get back the code, short_name, and last_update_date would the request be: /CodeSystem/$lookup?code=24&sytem=http:example.org&active=true&&property=code&&property=full_name&&property=last_update_date
2c. What would the response be?
- ValueSet: Is this were we would return lists of values from a codesystem?
3a. Where can I get a list of all available valuesets in a system?
3b. In the above example we stated our example system had the following properties: full_name, short_name, status, code, description, last_updated_date. So how would I request a list of all { code, full_name, last_update_date } from a code system? I see a valueset has compose.include but I dont see any examples where the values from a codesystem’s properties are coming back in a valueset response.
I am sorry if this is all over the place, the CodeSystem and ValueSet are complex and have been really tricky for me to understand and I want to make sure I am doing the right things.
Any help is appreciated!