Closed znatty22 closed 1 year ago
This needs to be done for both the integration test and production servers
A ticket has been created at smile CDR's Service Desk, CCing @znatty22.
The following is the response from the Smile CDR developers on 06-04-2020 (also viewable on the above ticket):
The terminology server in Smile CDR does have the ability to load very large CodeSystems, using dedicated tables that are intended for content that is too big to fit in a FHIR resource. We do have native importers for LOINC and SNOMED CT and could certainly work with you to add others. Customers have also used the "delta operations" described here to upload their own very large code systems in manageable chunks so that they can be used by the terminology server: 5.12.7 Delta Add Operation
It is also possible to configure the validator to communicate with an external terminology server by using the "Remote Terminology Service" configuration on the FHIR Storage module: 24.38 FHIR Validation: Remote Terminology Service
I continue to curate testing results and issues regarding Smile CDR's FHIR validation capability with a remote terminology service.
Smile CDR has delivered a new image 2020.08.PRE-16
which supports FHIR validation via remote terminology service. To test this image, I 1) set a remote terminology service URL to https://r4.ontoserver.csiro.au/fhir and 2) POSTed the following Patient resource to the server:
Patient-pt-001.json.zip
As a result, the server threw the following error with a status code 400:
{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "error",
"code": "invalid",
"diagnostics": "[99648911-e12c-4e6f-b0bf-0bca59c72ad4]: If the code parameter is provided, the system parameter must also be provided."
}
]
}
To further figure out a root cause of this error, I looked into the server's log:
smilecdr | 20:44:14.689 [fhir_endpoint.fhirEndpointServer-437] INFO c.u.f.r.c.i.LoggingInterceptor - Client request: POST https://r4.ontoserver.csiro.au/fhir/ValueSet/$validate-code HTTP/1.1
smilecdr | 20:44:14.689 [fhir_endpoint.fhirEndpointServer-437] INFO c.u.f.r.c.i.LoggingInterceptor - Client request headers:
smilecdr | Accept-Charset: utf-8
smilecdr | Accept: application/fhir+json;q=1.0, application/json+fhir;q=0.9
smilecdr | User-Agent: HAPI-FHIR/5.1.0-SNAPSHOT (FHIR Client; FHIR 4.0.1/R4; apache)
smilecdr | Accept-Encoding: gzip
smilecdr | Content-Type: application/fhir+json; charset=UTF-8
smilecdr | 20:44:14.690 [fhir_endpoint.fhirEndpointServer-437] INFO c.u.f.r.c.i.LoggingInterceptor - Client request body:
smilecdr | {"resourceType":"Parameters","parameter":[{"name":"url","valueUri":"http://hl7.org/fhir/ValueSet/name-use"},{"name":"code","valueString":"official"}]}
smilecdr | 20:44:16.250 [fhir_endpoint.fhirEndpointServer-437] INFO c.u.f.r.c.i.LoggingInterceptor - Client response: HTTP 400 in 1559ms
smilecdr | 20:44:16.250 [fhir_endpoint.fhirEndpointServer-437] INFO c.u.f.r.c.i.LoggingInterceptor - Client response headers:
smilecdr | x-request-id: bp3RjiwkUmFz6HIU
smilecdr | date: Mon, 10 Aug 2020 20:44:16 GMT
smilecdr | server: nginx/1.15.9
smilecdr | transfer-encoding: chunked
smilecdr | x-xss-protection: 1; mode=block
smilecdr | x-content-type-options: nosniff
smilecdr | vary: Accept,Origin,Accept-Encoding,Accept-Language,Authorization
smilecdr | x-frame-options: DENY
smilecdr | x-powered-by: HAPI FHIR 4.2.0 REST Server (FHIR Server; FHIR 4.0.1/R4)
smilecdr | connection: keep-alive
smilecdr | content-type: application/fhir+json;charset=UTF-8
smilecdr | cache-control: must-revalidate, max-age=1
smilecdr | 20:44:16.250 [fhir_endpoint.fhirEndpointServer-437] INFO c.u.f.r.c.i.LoggingInterceptor - Client response body:
smilecdr | {"resourceType":"OperationOutcome","issue":[{"severity":"error","code":"invalid","diagnostics":"[e4b038ac-d243-4ac1-b83a-4eb66b354e46]: If the code parameter is provided, the system parameter must also be provided."}]}
smilecdr | 20:44:16.275 [fhir_endpoint.fhirEndpointServer-437] INFO kidsfirstdrc.fhir_endpoint.access - 2020-08-10T20:44:14.290Z POST /Patient HTTP/1.1 400
The above log shows that the server threw an error when sending a POST request to Ontoserver with the following part:
"name": [
{
"use": "official",
"text": "Mariah Abigail Smith",
"family": "Smith",
"given": [
"Mariah",
"Abigail"
]
}
]
with the following Parameters resource:
{
"resourceType": "Parameters",
"parameter": [
{
"name": "url",
"valueUri": "http://hl7.org/fhir/ValueSet/name-use"
},
{
"name": "code",
"valueCode": "official"
}
]
}
Based on the FHIR official documentation, the above Parameters resource meets the requirements because "url"
(an implicit ValueSet is used here) and "code"
are specified:
"If the operation is not called at the instance level, one of the in parameters url, context or valueSet must be provided. One (and only one) of the in parameters code, coding, or codeableConcept must be provided."
Since Ontoserver returned an error saying a system parameter is required, I tried to POST the three following JSON payloads directly to Ontoserver respectively:
"codeableConcept"
parameter: {
"resourceType": "Parameters",
"parameter": [
{
"name": "url",
"valueUri": "http://hl7.org/fhir/ValueSet/name-use"
},
{
"name": "codeableConcept",
"valueCodeableConcept": {
"coding": [
{
"system": "http://hl7.org/fhir/name-use",
"code": "official"
}
]
}
}
]
}
"coding"
parameter: {
"resourceType": "Parameters",
"parameter": [
{
"name": "url",
"valueUri": "http://hl7.org/fhir/ValueSet/name-use"
},
{
"name": "coding",
"valueCoding": [
{
"system": "http://hl7.org/fhir/name-use",
"code": "official"
}
]
}
]
}
"code"
and "system"
parameters: {
"resourceType": "Parameters",
"parameter": [
{
"name": "url",
"valueUri": "http://hl7.org/fhir/ValueSet/name-use"
},
{
"name": "system",
"valueUri": "http://hl7.org/fhir/name-use"
},
{
"name": "code",
"valueCode": "official"
}
]
}
All of them returned the following result with a status code 200:
{
"resourceType": "Parameters",
"parameter": [
{
"name": "result",
"valueBoolean": true
},
{
"name": "display",
"valueString": "Official"
}
]
}
In conclusion, when "code"
gets validated, Ontoserver seems to require "system"
and it seems like a customized spec.
Alejandro confirmed that the "system"
parameter is indeed required when the "code"
parameter is used (please see the Documentation column of the code row in the In Parameters table). It is obvious that the Smile CDR server doesn't include the "system"
parameter in its request. I am contacting Smile CDR about this.
We believe that Ontoserver is within spec. here. What Ontoserver is saying is that while you've asked to validate the code official
with respect to a ValueSet http://hl7.org/fhir/ValueSet/name-use
, you haven't said which CodeSystem the code comes from (the system parameter).
The specification for /ValueSet/$validate-code says this:
IN code 0..1 code The code that is to be validated. If a code is provided, a system or a context must be provided (if a context is provided, then the server SHALL ensure that the code is not ambiguous without a system)
(emphasis mine)
Small ontologies can be imported via CodeSystem FHIR resources but for larger ontologies such as HPO, this is not feasible. We should figure out how to use an external terminology server to host large CodeSystems such as HPO.
An external terminology server can be registered in Smile CDR: https://smilecdr.com/docs/fhir_repository/terminology.html. We should try registering and using the Ontoserver: https://r4.ontoserver.csiro.au/fhir