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
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

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 Code 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 'x-api-key: <api-key>' \
--header 'Content-Type: application/json' \
--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

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"
                }
            }
        ]
    }
}
Modified at 2024-12-19 12:31:39
Previous
Update Practitioner Resource
Next
Update PractitionerRole Resource
Built with