OnyeOne Documentation
  1. Practitioners
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
          POST
        • Update Practitioner Resource
          PUT
        • Create Practitioner Role
          POST
        • Update PractitionerRole Resource
          PUT
      • 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
        • Update Appointment Resource
      • 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. Practitioners

Create Practitioner Role

Testing Env
https://staging.onyeone.com/api
Testing Env
https://staging.onyeone.com/api
POST
/emr/practitionerrole
emr
This API creates a PractitionerRole resource, which defines the role of a practitioner within an organization. It links to a Practitioner resource (representing the individual), an Organization resource (the organization they work for), and includes details such as their role, specialty, active status, availability and the period during which the role is valid.

Request

Authorization
Add parameter in header
x-api-key
Example:
x-api-key: ********************
Body Params application/json
practitioner_id
string 
required
Resource ID of Practitioner that is able to provide the defined services for the organization.
roles
array [object {2}] 
required
Role of practitioner, e.g "nurse", "doctor", "pharmacist", etc
code
string 
required
Hl7 code for the role. See https://www.hl7.org/fhir/valueset-practitioner-role.html for value sets.
name
string 
required
HL7 value for the code. See See https://www.hl7.org/fhir/valueset-practitioner-role.html for value sets.
active
boolean 
required
Whether this practitioner role record is in active use. Some systems may use this property to mark non-active practitioners, such as those that are not currently employed.
period
object 
optional
The period during which the person is authorized to act as a practitioner in these role(s) for the organization.
start
string 
optional
end
string 
optional
specialties
array [object {2}] 
optional
The specialty of a practitioner that describes the functional role they are practicing at a given organization or location.
code
string 
optional
HL7 specialty code, see http://hl7.org/fhir/ValueSet/c80-practice-codes
name
string 
optional
Specialty name. See http://hl7.org/fhir/ValueSet/c80-practice-codes
locations
array[string]
optional
The location(s) at which this practitioner provides care.
available_times
array [object {4}] 
optional
days_of_week
array[string]
optional
Allowed values:
montuewedthufrisatsun
all_day
boolean 
optional
Always available? i.e. 24 hour service
start_time
string 
optional
Opening time of day (ignored if all_day = true). A time during the day, in the format hh:mm:ss
end_time
string 
optional
Closing time of day (ignored if all_day = true). A time during the day, in the format hh:mm:ss
not_available_times
array [object {3}] 
optional
Not available during this time due to provided reason
description
string 
optional
Reason presented to the user explaining why time not available
start_date
string 
optional
Service not available during this period
end_date
string 
optional
Service not available during this period
Example
{
    "practitioner_id": "ff9d42ba-2174-56fb-866f-1dad74b629f5",
    "roles": [{
        "code": "doctor", 
        "name": "doctor"
    }],
    "active": true,
    "period": {
        "start": "2024-12-20",
        "end": "2025-04-26"
    },
    "specialties": [
        {
            "code": "39457900",
            "name": "Cardiology"
        }
    ],
    "available_times": [
        {
            "days_of_week": [
                "mon"
            ],
            "all_day": false,
            "start_time": "17:00:00",
            "end_time": "18:00:00"
        },
        {
            "days_of_week": [
                "mon",
                "fri"
            ],
            "all_day": true,
            "start_time": "15:00:00",
            "end_time": "18:00:00"
        },
        {
            "days_of_week": [
                "thu",
                "fri",
                "sun"
            ],
            "all_day": true,
            "start_time": "20:00:00",
            "end_time": "18:00:00"
        }
    ],
    "not_available_times": [
        {
            "description": "Away on a holiday.",
            "start_date": "2025-08-17",
            "end_date": "2025-08-26"
        }
    ]
}

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/practitionerrole' \
--header 'Content-Type: application/json' \
--header 'x-api-key;' \
--data-raw '{
    "practitioner_id": "ff9d42ba-2174-56fb-866f-1dad74b629f5",
    "roles": [{
        "code": "doctor", 
        "name": "doctor"
    }],
    "active": true,
    "period": {
        "start": "2024-12-20",
        "end": "2025-04-26"
    },
    "specialties": [
        {
            "code": "39457900",
            "name": "Cardiology"
        }
    ],
    "available_times": [
        {
            "days_of_week": [
                "mon"
            ],
            "all_day": false,
            "start_time": "17:00:00",
            "end_time": "18:00:00"
        },
        {
            "days_of_week": [
                "mon",
                "fri"
            ],
            "all_day": true,
            "start_time": "15:00:00",
            "end_time": "18:00:00"
        },
        {
            "days_of_week": [
                "thu",
                "fri",
                "sun"
            ],
            "all_day": true,
            "start_time": "20:00:00",
            "end_time": "18:00:00"
        }
    ],
    "not_available_times": [
        {
            "description": "Away on a holiday.",
            "start_date": "2025-08-17",
            "end_date": "2025-08-26"
        }
    ]
}'

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
active
boolean 
required
period
object 
optional
practitioner
object 
required
organization
object 
required
code
array [object {2}] 
optional
specialty
array [object {2}] 
optional
telecom
array [object {3}] 
optional
availableTime
array [object {4}] 
optional
notAvailable
array [object {2}] 
optional
Example
{
    "message": "Resource created successfully",
    "resource_name": "PractitionerRole",
    "resource_id": "16c73a58-fe55-515f-ba79-57c6392777e9",
    "full_resource": {
        "resourceType": "PractitionerRole",
        "id": "16c73a58-fe55-515f-ba79-57c6392777e9",
        "meta": {
            "versionId": "1",
            "lastUpdated": "2024-12-17T10:17:44.500+00:00",
            "source": "#BenkyK8TlQD3cDER",
            "tag": [
                {
                    "system": "http://onyeone.com/facility-tags/origination",
                    "code": "1",
                    "display": "Green Group Hospital"
                }
            ]
        },
        "active": true,
        "period": {
            "start": "2024-12-20",
            "end": "2025-04-26"
        },
        "practitioner": {
            "reference": "Practitioner/ff9d42ba-2174-56fb-866f-1dad74b629f5",
            "display": "Don Merekesh"
        },
        "organization": {
            "reference": "Organization/5abe99ee-0928-546b-93e9-0207ba8a556b",
            "display": "Green Group Hospital"
        },
        "code": [
            {
                "coding": [
                    {
                        "system": "http://hl7.org/fhir/ValueSet/practitioner-role",
                        "code": "doctor",
                        "display": "doctor"
                    }
                ],
                "text": "doctor"
            }
        ],
        "specialty": [
            {
                "coding": [
                    {
                        "system": "http://hl7.org/fhir/ValueSet/c80-practice-codes",
                        "code": "39457900",
                        "display": "Cardiology"
                    }
                ],
                "text": "Cardiology"
            }
        ],
        "telecom": [
            {
                "system": "phone",
                "value": "08034768638",
                "use": "mobile"
            },
            {
                "system": "email",
                "value": "Colton_Schimmel68@gmail.com",
                "use": "home"
            }
        ],
        "availableTime": [
            {
                "daysOfWeek": [
                    "mon"
                ],
                "allDay": false,
                "availableStartTime": "17:00:00",
                "availableEndTime": "18:00:00"
            },
            {
                "daysOfWeek": [
                    "mon",
                    "fri"
                ],
                "allDay": true
            },
            {
                "daysOfWeek": [
                    "thu",
                    "fri",
                    "sun"
                ],
                "allDay": true
            }
        ],
        "notAvailable": [
            {
                "description": "Away on a holiday.",
                "during": {
                    "start": "2025-08-17",
                    "end": "2025-08-26"
                }
            }
        ]
    }
}
Previous
Update Practitioner Resource
Next
Update PractitionerRole Resource
Built with