FHIR Chat · Changing OperationDefinition.parameter to use profiles · implementers

Stream: implementers

Topic: Changing OperationDefinition.parameter to use profiles


view this post on Zulip Lloyd McKenzie (Aug 21 2017 at 00:13):

Change request GF#13561 proposes dropping OperationDefinition.parameter and instead pointing to StructureDefinition to define both input and output parameters. The rationale for this is that OperationDefinition.parameter does exactly the same sort of thing that StructureDefinition elements do, but without the same level of expressivity. As well, OperationDefinition.parameter can't be used to validate input our output Parameters instances. So at present, if implementers want to perform validation they will need to first define the parameters within the OperationDefinition and then also define those same parameters creating profiles on the Parameters resource.

The concern raised on FHIR Infrastructure was whether making this change is likely to make it too complex for implementers to feel comfortable defining their own operations. This topic is to solicit feedback on the proposal.

view this post on Zulip Richard Townley-O'Neill (Aug 21 2017 at 00:43):

A set of graded examples would flatten the learning curve.

view this post on Zulip Eric Haas (Aug 21 2017 at 01:08):

Currently it is possible to hand edit a typical OperationDefinition but that would be a challenge if we used SD. Here is an example of an OperationDefinition I created in XMLSpy:

view this post on Zulip Eric Haas (Aug 21 2017 at 01:08):

    <?xml version="1.0" encoding="UTF-8"?>
    <OperationDefinition xmlns="http://hl7.org/fhir">
        <id value="Appointment-hold"/>
        <url value="http://fhir.org/guides/argonaut-scheduling/OperationDefinition/Appointment-hold"/>
        <name value="Appointment Hold"/>
        <status value="draft"/>
        <kind value="operation"/>
        <date value="2017-08-09T11:36:05-07:00"/>
        <publisher value="Argonaut Project"/>
        <description value="Request for a hold on the selected proposed Appointment in order for the user to complete entering data for booking an appointment.  This operation precedes  the booking operation for an appointment and  follows the appointment availability operation ($find).  The server determines if the nominated appointment is still available (i.e., all the required actors and physical assets needed for the appointment are still available) . The length of the hold is defined by local business rules."/>
        <code value="hold"/>
        <comment value="additional notes here"/>
        <resource value="Appointment"/>
        <system value="true"/>
        <type value="true"/>
        <instance value="false"/>
        <parameter>
            <name value="appt-id"/>
            <use value="in"/>
            <min value="0"/>
            <max value="1"/>
            <documentation value="A resource id for one of proposed Appointments returned by a prior $find operation (e.g., Resource/1234).  References can be to an absolute URL, but servers only perform this operation on their own appointments."/>
            <type value="uri"/>
        </parameter>
        <parameter>
            <name value="return"/>
            <use value="out"/>
            <min value="0"/>
            <max value="1"/>
            <documentation value="An [Appointment Availability Bundle profile](StructureDefinition-avail-bundle.html)  of type `searchset` of requested held Appointment resource and may also contain an OperationOutcome with errors, warnings or information as a result of processing the operation.   The Appointment resource will have an updated `status` of &quot;pending&quot; if the hold is approved or  &quot;cancelled&quot; if the hold is rejected."/>
            <type value="Bundle"/>
                    <profile>
                <reference value="StructureDefinition/avail-bundle"/>
            </profile>
        </parameter>

    </OperationDefinition>

view this post on Zulip Lloyd McKenzie (Aug 21 2017 at 02:13):

True, but you would then be able to use tools like Forge or Trifolia to define the parameters rather than needing to hand-edit that portion at all...

view this post on Zulip Eric Haas (Aug 21 2017 at 02:17):

I understand and I probably used the IG Build to generate this initially since I am lazy.... but I want to illustrate how simple it is now. It would be nice to create an example using SD but I haven't thought it through to that level.

view this post on Zulip Grahame Grieve (Aug 21 2017 at 06:59):

StructureDefinition doesn't do everything that OperationDefinition.parameter does, and does a pile stuff that's not necessary. Feels very much like using a sledgehammer to crack a nut

view this post on Zulip Richard Kavanagh (Aug 21 2017 at 11:45):

I agree with @Grahame Grieve We have a number of solutions using OperationDefinition. The simplicity of the parameters is very useful a StructureDefinitions seems to be excessive.

view this post on Zulip Lloyd McKenzie (Aug 21 2017 at 15:43):

What does StructureDefinition do that OperationDefinition doesn't need? We need invariants, length constraints, etc. And we definitely need validation. The only thing OperationDefinition does that StructureDefinition doesn't is define the URI query parameter data type - and that can easily be handled by an extension. Note that we're not talking about removing OperationDefinition, just moving the parameter definition out of it.


Last updated: Apr 12 2022 at 19:14 UTC