FHIR Chat · TestScript minimumId assertions on a subset of a fixture · implementers

Stream: implementers

Topic: TestScript minimumId assertions on a subset of a fixture


view this post on Zulip Ivan Dubrov (Dec 02 2019 at 02:35):

Is there any way to use Testscript.test.action.assert.minimumId assertion on a subset of a response rather than the whole response fixture?

There are two use-cases where this could be useful:

  1. Response is a bundle and we want to assert against one of the entries. The order, however, is not fixed so we don't know exactly which entry we should assert against.
  2. Response is a Parameters resource returned from an operation and one of the returned parameters is a resource. Again, order of response parameters is not fixed.

Would be useful to be able to use FHIR Path to extract resource first (for example, Bundle.entry.where(resource is Patient).resource , when assert via minimumId, but it doesn't look like it is currently possible?

view this post on Zulip Grahame Grieve (Dec 02 2019 at 02:36):

@Richard Ettema

view this post on Zulip ryan moehrke (Dec 02 2019 at 18:12):

https://www.hl7.org/fhir/testscript.html#invs tst-6 -- path and minimumId cannot exist together.
You might be able to use fixtures to save the subset and assert against the fixture instead though.

view this post on Zulip ryan moehrke (Dec 02 2019 at 18:14):

I was working with a similar usecase recently and I wonder if making path less strict in its use (so it can be used for asserts like minimumID or validateProfileID) is a good idea.

view this post on Zulip Ivan Dubrov (Dec 04 2019 at 22:50):

I was working with a similar usecase recently and I wonder if making path less strict in its use (so it can be used for asserts like minimumID or validateProfileID) is a good idea.

Yep, that was my thinking, too.

Not sure how to do it with fixtures without having our own custom extension to "run FHIR Path on a fixture and save to another fixture".


Last updated: Apr 12 2022 at 19:14 UTC