{
  "resourceType": "OperationDefinition",
  "meta": {
    "versionId": "4",
    "lastUpdated": "2017-06-08T14:36:41.893+00:00"
  },
  "url": "http://epic.com/fhir/OperationDefinition/Appointment-find",
  "name": "Appointment finder",
  "status": "draft",
  "kind": "operation",
  "publisher": "Epic Systems",
  "contact": [
    {
      "telecom": [
        {
          "system": "email",
          "value": "cooper@epic.com"
        }
      ]
    }
  ],
  "date": "2017-06-08T00:00:00Z",
  "description": "Searches for available appointments slots.  This operation accepts a preferred date range for an appointment, as well as a specialty, optional list of practitioners, healthcare service, and patient.  For those criteria, it determines which schedulable resources are needed for the visit, and provides time slots where all required resources are available.",
  "code": "find",
  "system": false,
  "type": [
    "Appointment"
  ],
  "instance": false,
  "parameter": [
    {
      "name": "requestedPeriod",
      "use": "in",
      "min": 0,
      "max": "*",
      "documentation": "The period of time that should be checked for appointment availability.",
      "type": "period"
    },
    {
      "name": "actor",
      "use": "in",
      "min": 0,
      "max": "*",
      "documentation": "A preferred list of actors to book the appointment with.   If multiple actors are listed, the response will contain appointments with any of these actors (i.e. this does not drive joint appointment with multiple actors).",
      "type": "reference"
    },
    {
      "name": "service-type",
      "use": "in",
      "min": 0,
      "max": "1",
      "documentation": "The type of service for the appointment.",
      "type": "CodeableConcept"
    },
    {
      "name": "patient",
      "use": "in",
      "min": 0,
      "max": "1",
      "documentation": "A Patient resource that includes demographics and patient preferences.  This is provided as a resource instead of a reference because the patient may not exist when performing an availablity search.  If the appointment is for a new patient, the patient record should not be created until just before booking an appointment.",
      "type": "Patient",
      "profile": {
        "reference": "https://www.hl7.org/fhir/patient.profile.xml"
      }
    },
    {
      "name": "specialty",
      "use": "in",
      "min": 0,
      "max": "*",
      "documentation": "Indiciates which specialty for the appointment.",
      "type": "CodeableConcept"
    },
    {
      "name": "indiciation",
      "use": "in",
      "min": 0,
      "max": "*",
      "documentation": "A list of diagnoses that this appointment is indended to treat.  This is used in conjunction with the specialty to determine which schedulable resources are needed for the visit.  For example, for an orthopedics appointment, the indiciation may drive whether a hip specialist or knee specialist is preferred.",
      "type": "CodeableConcept"
    },
    {
      "name": "solutions",
      "use": "out",
      "min": 0,
      "max": "1",
      "documentation": "A searchset Bundle of proposed Appointments where all required resources are available.",
      "type": "Bundle"
    },
    {
      "name": "errors",
      "use": "out",
      "min": 0,
      "max": "1",
      "documentation": "A OperationOutcome that represent errors that occured during execution of the operation.",
      "type": "OperationOutcome"
    }
  ]
}