OnyeOne Documentation
  1. Patients
OnyeOne Documentation
  • Overview
  • OnyeOne Use Cases
  • Authentication
  • Guides
    • OnyeOne Request Flow
  • Core EHR/EMR FHIR R4 APIs
    • Administration
      • Patients
        • Create Patient Resource
          POST
        • Update Patient Resource
          PUT
      • 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
        • 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. Patients

Create Patient Resource

Developing
Testing Env
https://staging.onyeone.com/api
Testing Env
https://staging.onyeone.com/api
POST
/emr/patient

Request

Authorization
Add parameter in header
x-api-key
Example:
x-api-key: ********************
Body Params application/json
active
boolean 
required
name
object 
required
first_name
string 
required
last_name
string 
required
title
string 
optional
telecom
array [object {2}] 
optional
phone
string 
optional
email
string 
optional
gender
enum<string> 
required
Allowed values:
malefemaleotherunknown
birth_date
string 
optional
deceased
boolean 
optional
address
object 
optional
line
string 
optional
city
string 
optional
state
string 
optional
postal_code
string 
optional
country
string 
optional
marital_status
enum<string> 
optional
Allowed values:
AnnulledDivorcedInterlocutoryLegally SeparatedMarriedCommon LawPolygamousDomestic PartnerUnmarriedNever MarriedWidowed
general_practitioner
array[string]
optional
Practitioner Resources IDs
link
array [object {2}] 
optional
Link to another patient resource that concerns the same actual patient.
other
string 
required
The other patient resource ID that the link refers to.
type
enum<string> 
required
Allowed values:
replaced-byreplacesreferseealso
contact
array [object {6}] 
optional
relationship
enum<string> 
required
Allowed values:
Emergency ContactEmployerFederal AgencyInsurance CompanyNext-of-KinState AgencyUnknown
telecom
array [object {2}] 
required
name
object 
required
address
object 
optional
gender
enum<string> 
optional
Allowed values:
malefemaleotherunknown
period
object 
optional
The period during which this contact person or organization is valid to be contacted relating to this patient.
Example
{
    "active": true,
    "name": {
        "first_name": "Kiley",
        "last_name": "Ziemann-Huel",
        "title": "yum miserably knavishly radiant what beside"
    },
    "telecom": [
        {
            "phone": "+1234546798",
            "email": "Carolyn36@yahoo.com"
        }
    ],
    "gender": "other",
    "birth_date": "2025-05-15",
    "deceased": false,
    "address": {
        "line": "exercitation",
        "city": "East Elda",
        "state": "Hawaii",
        "postal_code": "34161-4996",
        "country": "Bulgaria"
    },
    "marital_status": "Polygamous",
    "general_practitioner": [
        "5762e3c4-43ef-5585-9827-177d51c2ed2d"
    ],
    "link": [
        {
            "other": "18ff6238-1f1a-51b3-8a83-04a8492a4fd6",
            "type": "refer"
        }
    ],
    "contact": [
        {
            "relationship": "State Agency",
            "telecom": [
                {
                    "phone": "+1237547468",
                    "email": "Alexandro.Lynch@hotmail.com"
                }
            ],
            "name": {
                "first_name": "Mariela",
                "last_name": "Kunde"
            },
            "address": {
                "line": "nulla",
                "city": "Ilianamouth",
                "state": "Florida",
                "postal_code": "87062",
                "country": "Algeria"
            },
            "gender": "male",
            "period": {
                "start": "2017-02-19",
                "end": "2027-09-24"
            }
        },
        {
            "relationship": "Employer",
            "telecom": [
                {
                    "phone": "+4497598469",
                    "email": "Filomena45@yahoo.com"
                },
                {
                    "phone": "+234565435748",
                    "email": "Madge84@hotmail.com"
                }
            ],
            "name": {
                "first_name": "Preston",
                "last_name": "Waters",
                "title": "Mr"
            },
            "address": {
                "line": "nulla minim",
                "city": "South Kearaville",
                "state": "Vermont",
                "postal_code": "29006-7112",
                "country": "Ireland"
            },
            "gender": "other",
            "period": {
                "start": "2016-09-22",
                "end": "2028-10-13"
            }
        }
    ]
}

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/patient' \
--header 'Content-Type: application/json' \
--header 'x-api-key;' \
--data-raw '{
    "active": true,
    "name": {
        "first_name": "Kiley",
        "last_name": "Ziemann-Huel",
        "title": "yum miserably knavishly radiant what beside"
    },
    "telecom": [
        {
            "phone": "+1234546798",
            "email": "Carolyn36@yahoo.com"
        }
    ],
    "gender": "other",
    "birth_date": "2025-05-15",
    "deceased": false,
    "address": {
        "line": "exercitation",
        "city": "East Elda",
        "state": "Hawaii",
        "postal_code": "34161-4996",
        "country": "Bulgaria"
    },
    "marital_status": "Polygamous",
    "general_practitioner": [
        "5762e3c4-43ef-5585-9827-177d51c2ed2d"
    ],
    "link": [
        {
            "other": "18ff6238-1f1a-51b3-8a83-04a8492a4fd6",
            "type": "refer"
        }
    ],
    "contact": [
        {
            "relationship": "State Agency",
            "telecom": [
                {
                    "phone": "+1237547468",
                    "email": "Alexandro.Lynch@hotmail.com"
                }
            ],
            "name": {
                "first_name": "Mariela",
                "last_name": "Kunde"
            },
            "address": {
                "line": "nulla",
                "city": "Ilianamouth",
                "state": "Florida",
                "postal_code": "87062",
                "country": "Algeria"
            },
            "gender": "male",
            "period": {
                "start": "2017-02-19",
                "end": "2027-09-24"
            }
        },
        {
            "relationship": "Employer",
            "telecom": [
                {
                    "phone": "+4497598469",
                    "email": "Filomena45@yahoo.com"
                },
                {
                    "phone": "+234565435748",
                    "email": "Madge84@hotmail.com"
                }
            ],
            "name": {
                "first_name": "Preston",
                "last_name": "Waters",
                "title": "Mr"
            },
            "address": {
                "line": "nulla minim",
                "city": "South Kearaville",
                "state": "Vermont",
                "postal_code": "29006-7112",
                "country": "Ireland"
            },
            "gender": "other",
            "period": {
                "start": "2016-09-22",
                "end": "2028-10-13"
            }
        }
    ]
}'

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
name
array [object {3}] 
required
telecom
array [object {3}] 
required
gender
string 
required
birthDate
string 
required
address
array [object {5}] 
required
contact
array [object {6}] 
required
generalPractitioner
array [object {1}] 
required
managingOrganization
object 
required
link
array [object {2}] 
required
Example
{
    "message": "Resource created successfully",
    "resource_name": "Patient",
    "resource_id": "1e9c2550-bd42-5ba5-8ba5-db1e7c945054",
    "full_resource": {
        "resourceType": "Patient",
        "id": "1e9c2550-bd42-5ba5-8ba5-db1e7c945054",
        "meta": {
            "versionId": "1",
            "lastUpdated": "2024-12-18T16:29:37.515+00:00",
            "source": "#GuI3fTHNIegGaDnK",
            "tag": [
                {
                    "system": "http://onyeone.com/facility-tags/origination",
                    "code": "1",
                    "display": "Green Group Hospital"
                }
            ]
        },
        "active": true,
        "name": [
            {
                "family": "Ziemann-Huel",
                "given": [
                    "Kiley"
                ],
                "prefix": [
                    "yum miserably knavishly radiant what beside"
                ]
            }
        ],
        "telecom": [
            {
                "system": "phone",
                "value": "+1234546798",
                "use": "work"
            },
            {
                "system": "email",
                "value": "Carolyn36@yahoo.com",
                "use": "work"
            }
        ],
        "gender": "other",
        "birthDate": "2025-05-15",
        "address": [
            {
                "line": [
                    "exercitation"
                ],
                "city": "East Elda",
                "state": "Hawaii",
                "postalCode": "34161-4996",
                "country": "Bulgaria"
            }
        ],
        "contact": [
            {
                "relationship": [
                    {
                        "coding": [
                            {
                                "system": "http://terminology.hl7.org/CodeSystem/v2-0131",
                                "code": "S",
                                "display": "State Agency"
                            }
                        ],
                        "text": "State Agency"
                    }
                ],
                "name": {
                    "family": "Kunde",
                    "given": [
                        "Mariela"
                    ]
                },
                "telecom": [
                    {
                        "system": "phone",
                        "value": "+1237547468",
                        "use": "work"
                    },
                    {
                        "system": "email",
                        "value": "Alexandro.Lynch@hotmail.com",
                        "use": "work"
                    }
                ],
                "address": {
                    "line": [
                        "nulla"
                    ],
                    "city": "Ilianamouth",
                    "state": "Florida",
                    "postalCode": "87062",
                    "country": "Algeria"
                },
                "gender": "male",
                "period": {
                    "start": "2017-02-19",
                    "end": "2027-09-24"
                }
            },
            {
                "relationship": [
                    {
                        "coding": [
                            {
                                "system": "http://terminology.hl7.org/CodeSystem/v2-0131",
                                "code": "E",
                                "display": "Employer"
                            }
                        ],
                        "text": "Employer"
                    }
                ],
                "name": {
                    "family": "Waters",
                    "given": [
                        "Preston"
                    ],
                    "prefix": [
                        "Mr"
                    ]
                },
                "telecom": [
                    {
                        "system": "phone",
                        "value": "+4497598469",
                        "use": "work"
                    },
                    {
                        "system": "email",
                        "value": "Filomena45@yahoo.com",
                        "use": "work"
                    },
                    {
                        "system": "phone",
                        "value": "+234565435748",
                        "use": "work"
                    },
                    {
                        "system": "email",
                        "value": "Madge84@hotmail.com",
                        "use": "work"
                    }
                ],
                "address": {
                    "line": [
                        "nulla minim"
                    ],
                    "city": "South Kearaville",
                    "state": "Vermont",
                    "postalCode": "29006-7112",
                    "country": "Ireland"
                },
                "gender": "other",
                "period": {
                    "start": "2016-09-22",
                    "end": "2028-10-13"
                }
            }
        ],
        "generalPractitioner": [
            {
                "reference": "Practitioner/5762e3c4-43ef-5585-9827-177d51c2ed2d"
            }
        ],
        "managingOrganization": {
            "reference": "Organization/5abe99ee-0928-546b-93e9-0207ba8a556b",
            "display": "Green Group Hospital"
        },
        "link": [
            {
                "other": {
                    "reference": "Patient/18ff6238-1f1a-51b3-8a83-04a8492a4fd6"
                },
                "type": "refer"
            }
        ]
    }
}
Previous
Core EHR/EMR FHIR R4 APIs
Next
Update Patient Resource
Built with