FHIR Chat · MedicationStatement Not a valid resource · ibm

Stream: ibm

Topic: MedicationStatement Not a valid resource


view this post on Zulip Dorian Quell (May 19 2021 at 12:06):

Hey all, we just updated to version 4.7.0 (from version 4.5.0)
When I tried to load a MedicationStatement resource into the FHIR Server I got the following error:

400 Bad Request: [{
"resourceType": "OperationOutcome",
"id": "c0-a8-a0-3-8f3064f7-1cff-4ff5-becc-a6060d92c971",
"issue": [ {
"severity": "error",
"code": "not-found",
"details": {
"text": "The requested resource type 'MedicationStatement' is not found"
}}]}]

Is there something I need to add to the standard installation of the fhir server to use the MedicationStatement resource? Seems odd that it is not able to find the resource type anymore.

view this post on Zulip Lee Surprenant (May 19 2021 at 15:38):

Hi Dorian. I'd be surprised if there was something special about MedicationStatement here. Do other resource types work? I assume not and I'd suggest having a quick look at the server logs. Are you using the docker image or did you install yourself?

view this post on Zulip Lee Surprenant (May 19 2021 at 15:39):

quite a bit has changed since 4.5.0, so I'd highly suggest going through the migration consideration sections of the release notes. especially for 4.6.0 and 4.7.0

view this post on Zulip Dorian Quell (May 20 2021 at 10:53):

Hey, I tried out some other resources.
Conditon, Observation, Procedure, Patient, and Immunization worked without problems.
MedicationStatement and Consent were not recognized.
We running the server in a docker container, but because of the large jump between the versions, we didn't migrate the data, but created new resources and posted them to the server again. So the server is a clean install and had no data before.

The Docker container also says unhealthy, but we cannot find any problem that would cause this

The server logs only say "Error while processing request bundle."

[5/20/21, 6:34:04:348 UTC] 0000031c FHIRRestServl I Received request: tenantId:[default] dsId:[default] user:[fhiruser] method:[POST] uri:[****/fhir-server/api/v4]
[5/20/21, 6:34:04:354 UTC] 0000031c CacheTransact I Transaction failed - afterCompletion(status = 4)
[5/20/21, 6:34:04:354 UTC] 0000031c FHIRResource I Error while processing request bundle.
[5/20/21, 6:34:04:355 UTC] 0000031c FHIRRestServl I Completed request[0.007 secs]: tenantId:[default] dsId:[default] user:[fhiruser] method:[POST] uri:[*****/fhir-server/api/v4] status:[400]

view this post on Zulip Dorian Quell (May 20 2021 at 12:33):

Here is also the docker-compose we used:

version: '3.7'
services:
postgres:
build:
context: postgres
dockerfile: Dockerfile
shm_size: 256MB
tty: true
stdin_open: true
hostname: postgres-db
volumes:

  - type: bind
    source: ./postgres/db
    target: /db
# Stop Grace Period - 30 seconds
stop_grace_period: 30s
sysctls:
  net.core.somaxconn: 256
  net.ipv4.tcp_syncookies: 0
  # To use all of 2 gigabytes
  kernel.shmmax: 1055092736
  kernel.shmall: 257591
privileged: true
command: tail -f /dev/null
environment:
  PG_TRUST_LOCALNET: 'true'
healthcheck:
  start_period: 21s
  test: ["CMD-SHELL", "pg_isready -d fhirdb -U fhiradmin"]
  interval: 10s
  timeout: 5s
  retries: 3
networks:

  - fhir

ports:

- 5432:5432

fhir-server:
image: ibmcom/ibm-fhir-server:4.7.1
hostname: fhir
volumes:

  - type: bind
    source: ./fhir/config
    target: /opt/ol/wlp/usr/servers/defaultServer/config
    read_only: true

  - type: bind
    source: ./fhir/configDropins/overrides
    target: /opt/ol/wlp/usr/servers/defaultServer/configDropins/overrides
    read_only: true

  - type: bind
    source: ./fhir/userlib
    target: /opt/ol/wlp/usr/servers/defaultServer/userlib
    read_only: true

  - type: bind
    source: ./fhir/openapi.json
    target: /opt/ol/wlp/usr/servers/defaultServer/apps/expanded/fhir-openapi.war/META-INF/openapi.json
    read_only: true

  - type: bind
    source: ./fhir/server.xml
    target: /opt/ol/wlp/usr/servers/defaultServer/server.xml
    read_only: true

  - type: bind
    source: ./certs
    target: /opt/ol/wlp/usr/servers/defaultServer/resources/security
    read_only: true
command: bash -c "
  java -jar /opt/ibm-fhir-server/tools/fhir-persistence-schema-*-cli.jar
    --db-type postgresql --prop db.host=postgres --prop db.port=5432 --prop db.database=fhirdb --prop user=fhiradmin --prop password=change-password
    --prop resourceTypes=AllergyIntolerance,CarePlan,CareTeam,CodeSystem,Condition,Coverage,Device,DiagnosticReport,DocumentReference,Encounter,ExplanationOfBenefit,Goal,Group,Immunization,List,Location,Medication,MedicationAdministration,MedicationDispense,MedicationRequest,Observation,Organization,Patient,Practitioner,PractitionerRole,Procedure,Provenance,StructureDefinition,ValueSet
    --update-schema --grant-to fhirserver &&
  /opt/ol/wlp/bin/server run"
healthcheck:
  start_period: 32s
  interval: 30s
  timeout: 5s
  retries: 3
  # https://docs.docker.com/compose/compose-file/#variable-substitution
  test: curl -k -u 'fhiruser:change-password' 'https://localhost/fhir-server/api/v4/$$healthcheck'
ports:

- 9080:9080

  - 443:9443
depends_on:
  postgres:
    condition: service_healthy
networks:

  - fhir

networks:
fhir:
driver: bridge

The only things we adjusted was to change the port from 9443 to 443 and add the binds for the certificates.

view this post on Zulip Lee Surprenant (May 20 2021 at 13:22):

Thanks for the added detail, that helps a lot. It looks like you based this docker-compose on the one in our demo folder at https://github.com/IBM/FHIR/tree/main/demo ...thats great!

This docker-compose uses a somewhat-experimental feature (read: not well documented) for creating tables for only a subset of the resource types in the specification. The list is documented at https://github.com/IBM/FHIR/tree/main/demo#limitations along with steps on how to add new ones.

view this post on Zulip Lee Surprenant (May 20 2021 at 13:23):

Note that we also just landed a quick update to explain how to modify the docker-compose.yml and fhir-server-config.json files to support additional resource types.

view this post on Zulip Dorian Quell (May 20 2021 at 14:38):

Thank you, that fixed the problem.

view this post on Zulip Lee Surprenant (May 20 2021 at 14:39):

great. i've also opened a pull request to add those 2 resource types to the demo env by default: https://github.com/IBM/FHIR/pull/2397


Last updated: Apr 12 2022 at 19:14 UTC