OnyeOne Documentation
  1. Appointments
OnyeOne Documentation
  • Overview
  • OnyeOne Use Cases
  • Authentication
  • Guides
    • OnyeOne Request Flow
  • Core EHR/EMR FHIR R4 APIs
    • Administration
      • Patients
        • Create Patient Resource
        • Update Patient Resource
      • Practitioners
        • Create Practitioner Resource
        • Update Practitioner Resource
        • Create Practitioner Role
        • Update PractitionerRole Resource
      • Locations
        • Create a Location Resource
        • Update Location Resource
      • Health Service
        • Create Health Service Resource
        • Update Health Service Resource
      • Encounters
        • Create Encounter Resource
        • Update Encounter Resource
      • Appointments
        • Create Appointment Resource
          POST
        • Update Appointment Resource
          PUT
      • Group
    • Clinical
      • AllergyIntolerance
      • Condition (Problem)
      • Procedure
      • FamilyMemberHistory
      • CarePlan
      • Goal
      • CareTeam
      • ClinicalImpression
      • AdverseEvent
      • DetectedIssue
      • RiskAssessment
    • Diagnostics
      • Observation
        • Create Observation Resource
      • DiagnosticReport
      • ServiceRequest
      • Media
      • ImagingStudy
      • MolecularSequence
      • Specimen
      • BodyStructure
    • Medications
      • MedicationRequest
      • MedicationDispense
      • MedicationAdministration
      • MedicationStatement
      • Medication
      • MedicationKnowledge
      • Immunization
      • ImmunizationEvaluation
      • ImmunizationRecommendation
    • Financial
      • Account
      • Contract
      • Coverage
      • CoverageEligibilityRequest
      • CoverageEligibilityResponse
      • EnrollmentRequest
      • EnrollmentResponse
      • Claim
      • ClaimResponse
      • PaymentNotice
      • PaymentReconciliation
      • ExplanationOfBenefit
      • VisionPrescription
  • Health Data Transformation
    • Transfrom HL7v2 to FHIR R4
      POST
    • Transform CCDA to FHIR R4
      POST
    • Transform HL7v2 to FHIR R4 and Store in Backend Database
      POST
    • Track API Request
      GET
  • Health Interoperabilty System
    • Create a Subscription
      POST
  • Webhook
  • Get Resource.
    GET
  1. Appointments

Create Appointment Resource

Testing
Testing Env
https://staging.onyeone.com/api
Testing Env
https://staging.onyeone.com/api
POST
/emr/appointment
emr
A booking of a healthcare event among patient(s), practitioner(s), related person(s) and/or device(s) for a specific date/time. This may result in one or more Encounter(s).

Request

Authorization
Add parameter in header
x-api-key
Example:
x-api-key: ********************
Body Params application/json
status
enum<string> 
required
Allowed values:
proposedpendingbookedarrivedfulfilledcancellednoshowentered-in-errorchecked-inwaitlist
participant
array [object {5}] 
required
type
enum<string> 
required
Allowed values:
admitterattendercallback contactconsultantdischargerescortreferrersecondary performerprimary performerParticipationTranslatorEmergency
actor
object 
required
required
boolean 
required
Whether this participant is required to be present at the meeting.
status
enum<string> 
optional
Participation status of the actor.
Allowed values:
accepteddeclinedtentativeneeds-action
period
object 
optional
Participation period of the actor.
reason_reference
array [object {2}] 
optional
Reason the appointment has been scheduled to take place, as specified using information from another resource.
type
enum<string> 
required
See http://hl7.org/fhir/ValueSet/encounter-reason for codes and name.
Allowed values:
conditionprocedureobservationimmunization_recommendation
id
string 
required
ID of type above
reason_code
array [object {2}] 
optional
code
string 
required
See http://hl7.org/fhir/ValueSet/encounter-reason for codes and name.
name
string 
required
cancellation_reason
enum<string> 
optional
The coded reason for the appointment being cancelled. This is often used in reporting/billing/futher processing to determine if further actions are required, or specific fees apply.
Allowed values:
patpat-crspat-decpat-ltpat-no-shwprovprov-persprov-techprov-zoomsysoth
description
string 
optional
The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field.
start
string 
optional
Date/Time that the appointment is to take place. An instant in time in the format YYYY-MM-DDThh:mm:ss.sss+zz:zz (e.g. 2015-02-07T13:28:17.239+02:00 or 2017-01-01T00:00:00Z).
end
string 
optional
Date/Time that the appointment is to conclude. n instant in time in the format YYYY-MM-DDThh:mm:ss.sss+zz:zz (e.g. 2015-02-07T13:28:17.239+02:00 or 2017-01-01T00:00:00Z).
minutes_duration
number 
optional
Number of minutes that the appointment is to take.
>= 0
slot
array[string]
optional
The slots from the participants' schedules that will be filled by the appointment.
comment
string 
optional
Additional comments about the appointment.
patient_instruction
string 
optional
While Appointment.comment contains information for internal use, Appointment.patientInstructions is used to capture patient facing information about the Appointment (e.g. please bring your referral or fast from 8pm night before).
based_on
array[string]
optional
The service request this appointment is allocated to assess (e.g. incoming referral or procedure request).
requested_period
array [object {2}] 
optional
start
string 
required
YYYY-MM-DD format
end
string 
required
YYYY-MM-DD format
Example
{
    "status": "waitlist",
    "participant": [
        {
            "type": "Emergency",
            "actor": {
                "type": "patient",
                "id": "364bf61f-d0ac-3b9a-d91c-dbc2d9d9f46f"
            },
            "required": false,
            "status": "declined",
            "period": {
                "start": "2025-01-03",
                "end": "2025-01-08"
            }
        }
    ],
    "reason_reference": [],
    "reason_code": [
        {
            "code": "122003",
            "name": "Choroidal hemorrhage"
        },
        {
            "code": "409002",
            "name": "Food allergy diet"
        }
    ],
    "description": "Lorem ipsum...",
    "start": "2025-02-07T13:28:17.239+02:00",
    "end": "2025-02-07T17:30:17.239+02:00",
    "minutes_duration": 30,
    "slot": [],
    "comment": "id ex",
    "patient_instruction": "esse ad elit qui",
    "based_on": [],
    "requested_period": [
        {
            "start": "2025-01-02",
            "end": "2025-01-10"
        },
        {
            "start": "2025-01-20",
            "end": "2025-01-30"
        }
    ]
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://staging.onyeone.com/api/emr/appointment' \
--header 'Content-Type: application/json' \
--header 'x-api-key;' \
--data-raw '{
    "status": "waitlist",
    "participant": [
        {
            "type": "Emergency",
            "actor": {
                "type": "patient",
                "id": "364bf61f-d0ac-3b9a-d91c-dbc2d9d9f46f"
            },
            "required": false,
            "status": "declined",
            "period": {
                "start": "2025-01-03",
                "end": "2025-01-08"
            }
        }
    ],
    "reason_reference": [],
    "reason_code": [
        {
            "code": "122003",
            "name": "Choroidal hemorrhage"
        },
        {
            "code": "409002",
            "name": "Food allergy diet"
        }
    ],
    "description": "Lorem ipsum...",
    "start": "2025-02-07T13:28:17.239+02:00",
    "end": "2025-02-07T17:30:17.239+02:00",
    "minutes_duration": 30,
    "slot": [],
    "comment": "id ex",
    "patient_instruction": "esse ad elit qui",
    "based_on": [],
    "requested_period": [
        {
            "start": "2025-01-02",
            "end": "2025-01-10"
        },
        {
            "start": "2025-01-20",
            "end": "2025-01-30"
        }
    ]
}'

Responses

🟢200Success
application/json
Body
message
string 
required
resource_name
string 
required
resource_id
string 
required
full_resource
object 
required
resourceType
string 
required
id
string 
required
meta
object 
required
status
string 
required
reasonCode
array [object {2}] 
optional
description
string 
optional
start
string 
optional
end
string 
optional
minutesDuration
integer 
optional
comment
string 
optional
patientInstruction
string 
optional
participant
array [object {4}] 
optional
requestedPeriod
array [object {2}] 
optional
Example
{
    "message": "Resource created successfully",
    "resource_name": "Appointment",
    "resource_id": "339d4678-8482-5d81-b000-346edfd86484",
    "full_resource": {
        "resourceType": "Appointment",
        "id": "339d4678-8482-5d81-b000-346edfd86484",
        "meta": {
            "versionId": "1",
            "lastUpdated": "2024-12-30T10:18:02.887+00:00",
            "source": "#iQanb40TgsOn9K5M",
            "tag": [
                {
                    "system": "http://onyeone.com/facility-tags/origination",
                    "code": "1",
                    "display": "Green Group Hospital"
                }
            ]
        },
        "status": "waitlist",
        "reasonCode": [
            {
                "coding": [
                    {
                        "system": "http://hl7.org/fhir/ValueSet/encounter-reason",
                        "code": "122003",
                        "display": "Choroidal hemorrhage"
                    }
                ],
                "text": "Choroidal hemorrhage"
            },
            {
                "coding": [
                    {
                        "system": "http://hl7.org/fhir/ValueSet/encounter-reason",
                        "code": "409002",
                        "display": "Food allergy diet"
                    }
                ],
                "text": "Food allergy diet"
            }
        ],
        "description": "Lorem ipsum...",
        "start": "2025-02-07T13:28:17.239+02:00",
        "end": "2025-02-07T17:30:17.239+02:00",
        "minutesDuration": 30,
        "comment": "id ex",
        "patientInstruction": "esse ad elit qui",
        "participant": [
            {
                "type": [
                    {
                        "coding": [
                            {
                                "system": "http://hl7.org/fhir/participant-type",
                                "code": "emergency",
                                "display": "Emergency"
                            }
                        ],
                        "text": "Emergency"
                    }
                ],
                "actor": {
                    "reference": "Patient/364bf61f-d0ac-3b9a-d91c-dbc2d9d9f46f"
                },
                "status": "declined",
                "period": {
                    "start": "2025-01-03",
                    "end": "2025-01-08"
                }
            }
        ],
        "requestedPeriod": [
            {
                "start": "2025-01-02",
                "end": "2025-01-10"
            },
            {
                "start": "2025-01-20",
                "end": "2025-01-30"
            }
        ]
    }
}
Previous
Update Encounter Resource
Next
Update Appointment Resource
Built with