When working with the Nutrition Care Process Terminology (NCPT) reference set, it’s essential to have efficient access to the content through various systems, regardless of the technology used.
Clinical applications will access the Reference Set content from the selected terminology repository. The main functional requirements include listing all concepts in the Reference Set, filtering by text search strings, and validating whether a concept is a member of the Reference Set.
This page provides examples of how to interact with the reference set, whether you’re using a FHIR terminology server or a relational database like MySQL.
When working with the Nutrition Care Process Terminology (NCPT) reference set, leveraging a FHIR terminology server can simplify access and management. The server allows you to handle the reference set as a Value Set, providing key operations such as $expand and $validate to interact with the content.
A FHIR terminology server provides mechanisms to work with the Reference Set as a Value Set; the main operations available are $expand and $validate-code:
Service Name and Status | Input | Output |
---|---|---|
$expand Get all members of the reference set REQUIRED |
|
|
$validate-code Test if a concept or description is a member of a specified reference set REQUIRED |
|
|
These examples use the concept 1303957004 |Nutrition Care Process Terminology reference set (foundation metadata concept)| as the refsetId.
Service Name | API Call | Result |
Get all members of the reference set | GET [fhir]/ValueSet/$expand ?url=http://snomed.info/sct?fhir_vs=refset/[refsetId] &count=10 for example GET [fhir]/ValueSet/$expand ?url=http%3A%2F%2Fsnomed.info%2Fsct%3Ffhir_vs%3Drefset%2F1303957004&count=10 An alternative solution is to use the expression constraint language, as shown here: GET [fhir]/ValueSet/$expand ?url=http%3A%2F%2Fsnomed.info%2Fsct%3Ffhir_vs%3Decl%2F%5E%5B1303957004%5D &count=10 GET [fhir]/ValueSet/$expand ?url=http%3A%2F%2Fsnomed.info%2Fsct%3Ffhir_vs%3Decl%2F%5E1303957004 &count=10 | Returns a JSON representation of data about each of the reference set member. The data returned for each concept includes:
Also returns the total number of reference set members As some reference sets have very large numbers of children, this service is paged. Requests parameters include:
|
Test if a concept is a member of the reference set | GET [fhir]/ValueSet/$validate-code ?system=http://snomed.info/sct&code=181216001 &url=http://snomed.info/sct/[moduleId]/version/[effectiveTime]?fhir_vs=refset/[refsetId] for example GET [fhir]/ValueSet/$validate-code ?system=http://snomed.info/sct&code=181216001 &url=http://snomed.info/sct/900000000000207008/version/20200131?fhir_vs=refset/723264001 | Returns a JSON object with a "Parameters" resource, including a "result" parameter with a boolean value (true/false) indicating whether the member validated OK or not against the reference set. |
If the Reference Set has been loaded in a relational database using a model that complies with the RF2 specification for tables and column names, the reference set content can be accessed using SQL queries in line with the examples below:
Service Name | SQL Query 6 | Result |
Get all members of the reference set | SELECT referencedComponentId FROM snap_refset_simple WHERE active=1 AND refsetId=[refsetId]; for example SELECT referencedComponentId FROM snap_refset_simple WHERE active=1 AND refsetId=1303957004; | Returns the ids of all the concepts or descriptions that are the members of the reference set. |
Test if a concept is a member of the reference set | SELECT count(referencedComponentId) FROM snap_refset_simple WHERE active=1 AND refsetId=[refsetId] AND referencedComponentId=[candidateComponentId]; for example SELECT count(referencedComponentId) FROM snap_refset_simple WHERE active=1 AND refsetId=1303957004 AND referencedComponentId=53120007; | Returns:
|