swagger: '2.0'
info:
  version: "0.0.1"
  title: Connect API
  x-logo:
    url: "https://www.clearcareonline.com/hs-fs/hubfs/bandage/logo-clearcare.png?width=223&name=logo-clearcare.png"
  description: |
    Integration points for WellSky Personal Care.

    <style>
    table {
      table-layout: fixed;
      width: 100%;
    }
    td {
      word-wrap: break-word;
      overflow-wrap: break-word;
    }
    </style>

    # Home Connect API
    WellSky Personal Care is proud to announce Home Connect API, the first and only enterprise class API system in home care. 
    It was built to enable enterprise-class home care agencies to make interoperability, standards, quality, and transparency part of your value proposition.
    
    <img src="assets/home_connect_api.png" alt="">
          
    Connecting Home Care to Healthcare | Lead to Revenue
    ------ |------
    This new, first-of-its-kind technology seamlessly connects home care agencies with insurance companies and hospitals. <br> - Lower healthcare costs, improve outcomes and quality of life. <br> - Reduce hospital readmissions. <br> - Win referrals and serve clients with quality and at scale – for the first time ever. | With Home Connect API, you can also flow data in and out of your system, turning prospects into clients, and applicants into caregivers. <br> - Get to prospects and applicants first. <br> - Convert clients and new hires faster. <br> - Optimize operational efficiency. <br> - Compete better.

    # Getting Started
    With the imminent demand to go digital, the need to share vast amount of data across various departments
     as also with patients and practitioners has become somewhat mandatory. This is where having a software 
     intermediary for applications programs to interact with one another comes into play.

    The lack of healthcare API can create challenges especially in the case of care, safety, and cost. 
    This is mainly because of the lack of communication or data sharing among various units within various 
    branches of a hospital as also within each hospital.

    This need gap has given rise to a set of regulations where patients can access their information through 
    an API using an application of their choice.

    ## About Connect API
    In accordance with these regulations, WellSky Personal Care started 'Connect API' for patients and caregivers 
    who will now have easier access to clinical data at a single location and benefit by means of interoperability.

    Connect API is a tailored application encompassing all the facets of healthcare, 
    having the potential to increase patient empowerment and cultivate the habit of sharing decision making 
    between patients and caregivers.

    ## Setup App
    The first step towards setting up Connect API is to understand its authorization flow. 
    The permissions granted in Connect API are not role based and so the client (agency) needs an access 
    token to initiate the process.

    WellSky Personal Care Connect API uses Outh 2.0 for the purpose of delegation and to control access.

    A bearer type token passed along an HTTP authorization header gives the client access to WellSky Personal Care data. 
    The client is required to use their 'client id' and 'client secret' to procure an authorization token 
    from the Connect API.
        
    See [Auth flow](#tag/Auth-Flow) for a full description.

    ### Rate Limits
    WellSky Personal Care does not explicitly throttle the API's use. However, please note: 
        
    Limit requests to no more than 100 requests per second. There is no limit on concurrent calls; however, the API was designed for 
    real-time CRUD operations on an object-by-object or profile-by-profile basis.  

    There are parameters that allow for paginated operations, but best practice is "as a rule, do not use 
    the API for batch operations." Note: A successful call to create an object results in the return of 
    the resource type's ID in the response body. Ensure the order of operations of any implementation 
    stores or caches that object ID to minimize subsequent fetch or search-related calls.

    # Supported APIs

    The table below gives a live view of APIs that are currently been provided by WellSky Personal Care.

    Name | Supported Actions
    ----- |------
    [AdminTask](#tag/AdminTask) | <img src="assets/Add.png" alt=""> <img src="assets/Search.png" alt="">
    [AgencyAdmin](#tag/AgencyAdmin) | <img src="assets/Add.png" alt=""> <img src="assets/Edit.png" alt=""> <img src="assets/Search.png" alt=""> <img src="assets/Delete.png" alt="">
    [AllergyIntolerance](#tag/AllergyIntolerance) | <img src="assets/Add.png" alt=""> <img src="assets/Edit.png" alt=""> <img src="assets/Search.png" alt=""> <img src="assets/Delete.png" alt="">
    [Appointment](#tag/Appointment) | <img src="assets/Search.png" alt="">
    [Auth Flow](#tag/Auth-Flow) | <img src="assets/Add.png" alt="">
    [CarePlan](#tag/CarePlan) | <img src="assets/Add.png" alt=""> <img src="assets/Edit.png" alt=""> <img src="assets/Search.png" alt="">
    [ChargeItem](#tag/ChargeItem) | <img src="assets/Add.png" alt=""> <img src="assets/Edit.png" alt=""> <img src="assets/Search.png" alt=""> <img src="assets/Delete.png" alt="">
    [ClockIn](#tag/ClockIn) | <img src="assets/Add.png" alt="">
    [ClockOut](#tag/ClockOut) | <img src="assets/Edit.png" alt="">
    [Condition](#tag/Condition) | <img src="assets/Add.png" alt=""> <img src="assets/Edit.png" alt=""> <img src="assets/Search.png" alt="">
    [DocumentReference](#tag/DocumentReference) | <img src="assets/Add.png" alt=""> <img src="assets/Edit.png" alt=""> <img src="assets/Search.png" alt=""> <img src="assets/Delete.png" alt="">
    [Encounter](#tag/Encounter) | <img src="assets/Search.png" alt=""> <img src="assets/Delete.png" alt="">
    [Goal](#tag/Goal) | <img src="assets/Add.png" alt=""> <img src="assets/Edit.png" alt=""> <img src="assets/Search.png" alt="">
    [Invoice](#tag/Invoice) | <img src="assets/Add.png" alt=""> <img src="assets/Edit.png" alt=""> <img src="assets/Search.png" alt="">
    [Location](#tag/Location) | <img src="assets/Search.png" alt="">
    [MedicationStatement](#tag/MedicationStatement) | <img src="assets/Add.png" alt=""> <img src="assets/Edit.png" alt=""> <img src="assets/Search.png" alt=""> <img src="assets/Delete.png" alt="">
    [Organization](#tag/Organization) | <img src="assets/Search.png" alt="">
    [Patient](#tag/Patient) | <img src="assets/Add.png" alt=""> <img src="assets/Edit.png" alt=""> <img src="assets/Search.png" alt=""> <img src="assets/Delete.png" alt="">
    [Practitioner](#tag/Practitioner) | <img src="assets/Add.png" alt=""> <img src="assets/Edit.png" alt=""> <img src="assets/Search.png" alt=""> <img src="assets/Delete.png" alt="">
    [ProfileTags](#tag/ProfileTags) | <img src="assets/Add.png" alt=""> <img src="assets/Edit.png" alt=""> <img src="assets/Search.png" alt=""> <img src="assets/Delete.png" alt="">
    [ReferralSource](#tag/ReferralSources) | <img src="assets/Add.png" alt=""> <img src="assets/Edit.png" alt=""> <img src="assets/Search.png" alt="">
    [RelatedPerson](#tag/RelatedPerson) | <img src="assets/Add.png" alt=""> <img src="assets/Edit.png" alt=""> <img src="assets/Search.png" alt=""> <img src="assets/Delete.png" alt="">
    [Subscription](#tag/Subscription) | <img src="assets/Add.png" alt=""> <img src="assets/Edit.png" alt=""> <img src="assets/Search.png" alt=""> <img src="assets/Delete.png" alt="">
    [Task](#tag/Task) | <img src="assets/Add.png" alt=""> <img src="assets/Edit.png" alt="">

    <br>

    **Icon Legend:** <br><br>

    <img src="assets/Add.png" alt=""> Create <br>

    <img src="assets/Edit.png" alt=""> Update <br>

    <img src="assets/Search.png" alt=""> Search <br>

    <img src="assets/Delete.png" alt=""> Delete

    # Implementation Rules
    1. It is imperative that all the commands that are sent out carry a '/' (trailing slash) at the end to get 
    a response 
    
        **For example:** <br>
        `GET v1/documentReferences/` will fetch you a list of document reference. 
        Whereas, `GET v1/documentReferences` will throw an error.

        **Exception:** The exception however is while making specific searches using GET.<br>
        `GET v1/documentReferences/6769250/?agencyId=1234`<br>
        In this case, the trailing slash at the end must not be included.

    2. Please ensure the correct base URL is used in your HTTP client and/or script.

        The base URL for production purposes is: <br>
        https://connect.clearcareonline.com/v1/

        Append the endpoint of concern to the base URL, like so: <br>
        https://connect.clearcareonline.com/v1/practitioners

    3. Phone numbers must be 10 digits to validate. Drop any leading country code.
     
        **For phone numbers**
        WellSky Personal Care allows exactly 10 digits for all phone numbers, and the first digit should not be a 1 or 0.
         
        **For work phones**
        Adding an optional extension is supported only for work phones, that is “x” followed by 1 to 6 digits.

    4. **Character Validation** <br>
        (a) All UTF-8 characters will be validated including \! @ # $ % ^ & * ( ) \[ ] - + = < > ? . / | ' <br>
        (b) The escaped special white space characters \\b \\f \\n \\r \\t will be validated however, 
        the way they will render in the User Interface varies from field to field.<br>
        (c) A string must not contain Unicode character points below 32 with the exception of 
        u0009(horizontal tab), u0010 (carriage return) and u0013 (line feed). 
        The hexadecimal representation of Unicode characters will generally not be will validated.

    # Data Types
    The list below contains the description of commonly used data types.

    ## Simple Data Type

    Name | Example | Description
    ----- |------ |-----
    boolean | true/ false | A data type with only two possible values and representing the truth values of logic can be termed as boolean
    integer | 0-9, 1-9 | Whole numbers or a signed 32- bit integers used for the purpose of separate dates from other information
    string | 12345 | A data type like an integer or a floating point unit. It is a sequence of Unicode characters
    decimal | 0.010, 0.01 | Rational numbers having a decimal representation
    uri | urn:uuid:53fefa32-fcbb-4ff8-8a92-55ee120877b7 | A uniform resource identifier. They are case sensitive and can be absolute or relative
    date | 2018-06-12 | A date or a partial date (just the year or year+month) can be used for communication purpose.
    dateTime | 2016-03-01T04:06 | A date or partial date along with time.
    time | 11:22:36 | The time of the day without date specifications. Neither is the time "24:00" allowed nor the time zone.
    code | en-US | A code is a value that is taken from a set of controlled strings. It is usually a single string with one character and no leading whitespace other than single spaces.
    positiveInt | 1-9 | Any integer that is greater than or equal to 1 will be determined as a positive integer.
    object | element | The head of a data cluster under which various other fields operate.

    > **Note**:
    > A string must not exceed 1 MB in size. It must not contain Unicode character points below 32 with the exception of u0009 (horizontal tab), u0010 (carriage return), and u0013 (line feed).
    > In the 'date' data type, there are no time zones, and dates are expected to be valid ones.
    > In the 'dateTime' data type, the time "24:00" is not allowed. If hours and minutes are specified, a time zone shall be populated.

    ## Complex Data Types

    Here is a list and the related links containing the detailed description of each complex data type:
    - Attachment: This acts as a reference for attachments.
    - Coding: This represents data using 'code systems'.
    - CodeableConcept: A value supplied by providing a reference.
    - Quantity: The amount to be measured.
    - Defined variations on quantity.
    - Range: A set order of values.
    - Ratio: A relation between two quantity values.
    - Period: A specific time period with a start and end date/time.
    - Sampled Data: Data from measurements taken from devices.
    - Identifier: A numeric or alphanumeric string associated with a single object or entity.
    - HumanName: A name of a human with text and usage information.
    - Address: An address written using postal conventions.
    - ContactPoint: Details of contact points of a person or an organization.
    - Timing: The events that occur multiple times.
    - Signature: An electronic representation of a signature.
    - XML signature rules.
    - Annotation: A note that contains information on when and who made a statement.
    - Meta: The metadata about a resource.

    ## Other Types

    - Resource: The base class for all resources.
    - Reference: The reference repository from one resource to another.
    - Extension: The data type that can send across additional data in a resource.
    - Narrative: A representation of the content written within the resource.

    # ChangeLog
    This section records all of the notable changes made to the APIs.

    ## Current Release
    ### August 28, 2025
    ##### Bug Fixes
    1. [Condition](#tag/Condition)
      - Yes/No/Unknowns presented through GET calls as shown in the UI
      - Exercise_Importance field correction for all options in POST and PUT calls
    2. [Practitioner](#tag/Practitioner)
      - Contact information Relationship types responding as intended through POST and PUT calls
    3. [Encounter](#tag/Encounter)  
      - Search function shows appropriate Rate amount
      - GET by ID has “unit” field removed as it held duplicative information. 
    
    ## Past Release
    ### August 13, 2025
    ##### Bug Fixes
    1. [Patient](#tag/Patient)
      - Created and Updated dates on Patient GET and POST /_search/ calls
      - deceasedDateTime field now accepts Date information without Time (as indicated in documentation)
    2. [Practitioner](#tag/Practitioner)
      - birthDate field now accepts Date information without Time (as indicated in documentation)
    3. [Condition](#tag/Condition)
      - Empty String values are now accounted for and do not resolve in errors
    4. [ProfileTags](#tag/ProfileTags)
      - Corrections made in the Canadian API for this endpoint
    5. [ReferralSource](#tag/ReferralSource)
      - Corrections made in the Canadian API for this endpoint pertaining to individual referral sources in GET calls
    
    ### May 29, 2025
    ##### ENHANCEMENTS
    1. [Patient](#tag/Patient)  
      - Added `Preferred Name` to the patient endpoint `PUT` and `POST`.
      - Added `Deactivation Reason` and `Deactivated Date` to the patient endpoint `GET` response example.
      - Added a note for the initial contact date in patient POST method.
    2. [Practitioner](#tag/Practitioner)  
      - Added `Preferred Name` to the practitioner endpoint `PUT` and `POST`.

    ### May 9, 2025
    ##### ENHANCEMENTS
    1. [Condition](#tag/Condition)  
      - This section records all of the notable changes made to the APIs.
      - Added POST and PUT functionality for Yes/No/Unknown fields  
        - https://www.clearcareonline.com/fhir/condition/assessment/equipment_environment/interested_in_lifeline
        - https://www.clearcareonline.com/fhir/condition/assessment/mental_behavior_conditions/can_client_be_left_alone
        - https://www.clearcareonline.com/fhir/condition/assessment/medication/separate_medicine_schedule
        - https://www.clearcareonline.com/fhir/condition/assessment/medication/medications_set_in_pill_box
        - https://www.clearcareonline.com/fhir/condition/assessment/environment/has_safety_assessment_been_done
        - https://www.clearcareonline.com/fhir/condition/assessment/mental_behavior_conditions/wanderer
        - https://www.clearcareonline.com/fhir/condition/assessment/medication/needs_medication_reminders
    
    ### Apr 15, 2025
    ##### ENHANCEMENTS
    1. [ProfileTags](#tag/ProfileTags)  
      - Added a new endpoint to create, update, and retrieve profile tags.

    ### Mar 31, 2025
    ##### ENHANCEMENTS
    1. [Patient](#tag/Patient)  
      - Added `Preferred Name` to the patient endpoint `GET` response example.
    2. [Practitioner](#tag/Practitioner)  
      - Added `Preferred Name` to the practitioner endpoint `GET` response example.

    ### Mar 17, 2025
    ##### ENHANCEMENTS
    1. [Condition](#tag/Condition)
      - Added assessment to all all condition extensions.
      - Added support for all extension endpoints to work with assessment as part of the api path.

    ### Jan 24, 2025
    ##### ENHANCEMENTS
    1. [Practitioner](#tag/Practitioner) 
      - Added a profileTags field to the response payload for GET, GET by ID and POST _search methods to fetch the profile tags for a practitioner.
      - Added the capability to add or update profile tags for POST and PUT practitioner methods.
      - Added search practitioner by profileTags.
    2. [Patient](#tags/Patient)
      - Added a profileTags field to the response payload for GET, GET by ID and POST _search methods to fetch the profile tags for a patient.
      - Added the capability to add or update profile tags for POST and PUT patient methods.
      - Added search patient by profileTags.

    ### Nov 6, 2024
    ##### ENHANCEMENTS
    1. [Subscription](#tag/Subscription) - Added a new subscription criteria:
      - agency_admin.created - when an agency admin is created.

    ### Oct 10, 2024
    ##### ENHANCEMENTS
    1. [Subscription](#tag/Subscription) - Added two new subscription criteria:
      - agency_admin.deactivated.changed - when an agency admin is deactivated or reactivated.
      - patient.dateofdeath.changed - when a patient's date of death changes.
    2. [Encounter](#tag/Encounter) - Added the isCommunityCare and communityId fields to the request payload for POST and PUT methods to update the community care information for an encounter.
    3. [Practitioner](#tag/Practitioner) 
      - Added eligibilityToRehire field to the response payload for GET and POST _search methods to fetch the eligibility to rehire status for a practitioner.
      - Updated the search parameters to include is_hired for the GET method to search using the hiring status of practitioners.

    ### Jul 24, 2024
    ##### ENHANCEMENTS
    1. [Task API](#tag/Task) - Added GET request to fetch task logs from an Encounter.
    2. [Subscription](#tag/Subscription) - Added new criteria for subscription to subscribe to encounter clock-out events.
    3. [DocumentReference](#tag/DocumentReference) - Updated the examples to reflect the new structure of the response payload.

    ### Feb 28, 2024
    ##### ENHANCEMENTS
    1. [Patient API](#tag/Patient) - Added community info of patient in GET (read), GET with id (read), and POST (search) methods. Now name and community id will be seen in the community section of the response payload.
    2. [Patient API](#tag/Patient) - Enhanced PUT (update) and POST (create) to update community info for a patient based on community id.
    3. [Task Tasklog API](#tag/Task/paths/~1v1~1encounter~1{encounter_id}~1tasklog~1{tasklog_id}/put) - Added PUT (update) and POST (create) endpoints for creating task logs for an encounter. These endpoints will allow creating new tasks and updating them for an encounter.
    4. [Encounter API](#tag/Encounter) - Added PUT (update) and POST (create) for the encounter endpoint. This will allow creating and updating encounters.

    ### Feb 1, 2023
    ##### ENHANCEMENTS
    1. [ChargeItem API](#tag/ChargeItem) - Added invoiced, updated tags to meta tags in GET (read) and POST (search) method responses.

    ### Jan 25, 2023
    ##### ENHANCEMENTS
    1. [RelatedPerson API](#tag/RelatedPerson) - Added profile tags to GET (read) and POST (search) method responses.

    ### Aug 17, 2022
    ##### ENHANCEMENTS
    1. [ChargeItem API](#tag/ChargeItem) - Added POST (create), PUT (update), GET (read), and POST (search) methods to the ChargeItem API. This new resource type is used to enable the billing process and internal cost allocation.
    2. [Encounter API](#tag/Encounter) - Added POST (search), GET (read), and DEL (delete) methods to the Encounter API. This new resource is an interaction between a patient and WellSky Personal Care for the purpose of providing healthcare service(s) or assessing the health status of a patient.
    3. [Invoice API](#tag/Invoice) - Added POST (create), PUT (update), and GET (read) methods to the Invoice API. This new resource is a financial document issued by a healthcare provider to a patient or a payer indicating the goods and services (ChargeItems) performed with their quantities and prices.
    4. [Agency Admin API](#tag/AgencyAdmin) - Added POST (create) and PUT (update) methods to the existing Agency Admin API. Agency Admins are the admin/office staff user profiles that work in the agency's office and log in to the personal care system.
    5. Added supported APIs page (CRUD - Create/Read/Update/Delete information).

    ### Apr 15, 2022
    ##### ENHANCEMENTS

    1. [AllergyIntolerance API](#tag/AllergyIntolerance) - This new resource type is a record of a clinical assessment of an allergy or intolerance.
    2. [CarePlan API](#tag/CarePlan) - This new resource type is used in many areas of healthcare with a variety of scopes.
    3. [Condition API](#tag/Condition) - This new resource enables adding, updating, and fetching various records.
    4. [Goal API](#tag/Goal) - This new resource enables adding, updating, and fetching records of Care Needs from the WellSky Personal Care application.
    5. [MedicationStatement API](#tag/MedicationStatement) - This new resource type is used to record medications or substances.

    ### Oct 20, 2020
    ##### ENHANCEMENTS

    1. [Clock In API](#tag/ClockIn) - This new resource enables caregiver's shift clock in.
    2. [Clock Out API](#tag/ClockOut) - This new resource enables caregiver's shift clock out.
    3. [Appointment API](#tag/Appointment) - This new resource enables fetching shifts/appointments.
    4. [Task API](#tag/Task) - This new resource supports the ability to update the shift task assigned to the caregiver.
    5. [Related Person API](#tag/RelatedPerson) - This new resource supports creation and fetching of information related to the patient contact.

    <br>

    ### Apr 30, 2020
    ##### ENHANCEMENTS

    1. The [Practitioner POST](#tag/Practitioner/paths/~1v1~1practitioners/post) method has been updated to include 
    "sendQuickApplyEmail" in its meta tag. **sendQuickApplyEmail** will work only if **isHired** is set to false 
    while creating the applicant account. <br> **Note:** This is a trigger to send email via POST create method 
    ONLY. It will have no impact on other methods.<br><br>
    Email screenshot for reference:
    <img src="assets/Quick_Apply_link_email.png" alt="">

    <br>

    ### Mar 09, 2020
    ##### ENHANCEMENTS
    1. Field validation criteria for special characters and Unicode are now articulated in [Implementation Rules](#section/Implementation-Rules).

    <br>

    ### Dec 04, 2019
    ##### ENHANCEMENTS
    1. A validation has been added for agencyId on all endpoints if agencyId provided in POST/PUT methods is
    incorrect. (For non-franchisor users) 
    
    <br>

    ### Nov 19, 2019
    ##### ENHANCEMENTS
    1. The responses of POST, PUT and GET methods of Referral Source endpoint have been enhanced to be aligned 
    with FHIR standards. <br>
    Like- encapsulating all address information in FHIR standard address object, encapsulating all 
    name information in FHIR standard human name object, etc.

    ##### FIXES
    1. The parameter owner has now been correctly considered as an Optional parameter instead of 
    Required parameter while creating an Admin Task (i.e., POST method). [Click here for details...](#tag/AdminTask/paths/~1v1~1adminTasks/post)
    2. The request to create referral source will now give an authorization error if user does not have 
    access to the agency for which the referral source needs to be created. [Click here for details...](#tag/ReferralSources)

    <br>

    ### Oct 31, 2019
    ##### FIXES
    1. The status.changed subscription notification will now be sent when deleting a lead status 
    (Note: unchecking any of the status boxes on a prospects statuses means deleting a "lead status").

    <br>

    ### Oct 23, 2019
    ##### ENHANCEMENTS
    1. Following additional subscription criteria have been added to subscription API: [(Click here for details...)](#tag/Subscription)
      -  practitioner.created
      -  practitioner.name.changed
      -  practitioner.telecom.changed
      -  practitioner.address.changed
      -  patient.created
      -  patient.name.changed
      -  patient.telecom.changed
      -  patient.address.changed
      -  referralsources.created
      -  referralsources.changed
      -  admintask.created
      -  admintask.changed

    ##### FIXES
    1. The Patient contact search with Franchisor token will now correctly return results. [Click here for details...](#tag/Patient/paths/~1v1~1patients~1/get)
    2. The Referrer ID will now default to null in all the success responses for the Practitioners created with no Referrer ID (i.e., in POST create, POST search, and PUT). [Click here for details...](#tag/Practitioner)
    3. When adding new prospect in WellSky Personal Care application, the care requests will now be arranged in correct order with respect to timestamp:
       - New Lead
       - Initial Call    

    ### Oct 09, 2019
    ##### ENHANCEMENTS
    1. Added [DocumentReference API](#tag/DocumentReference).
    2. The Patients search response has been updated to also include "totalRecords". [Click here for details...](#tag/Patient/paths/~1v1~1patients~1_search~1/post)
    3. All the search responses for Patient (GET v1/patients/{id}, GET v1/patients/ and POST v1/patients/search) 
    have been updated to return language information in an identical structure. [Click here for details...](#tag/Patient/paths/~1v1~1patients~1/get)
        > **Language structure:**
        > 
        > Previous language structure: <br>
        > "communication": [{"language": {"coding": [{"code": "en-US","display": "Engelsk (Amerikansk)"}]}, "preferred": true}]
        > 
        > Standard language structure: <br>
        > "communication": [{"coding": [{"code": "'en-us'","display": "English"}],"text": "Language"}]
    4. The search response for Subscription endpoint has been enhanced to include metadata tag to be in consistency with other FHIR based endpoints. [Click here for details...](#tag/Subscription/paths/~1v1~1subscriptions~1/get)
    5. All the search responses for Practitioner endpoint (GET v1/practitioners/{id}, GET v1/practitioners/ and POST v1/practitioners/search) 
    have been updated to return language information in an identical structure. [Click here for details...](#tag/Practitioner/paths/~1v1~1practitioners/get)
        > **Language structure:**
        > 
        > Previous language structure: <br>
        > "communication": [{"language": {"coding": [{"code": "en-US","display": "Engelsk (Amerikansk)"}]},"preferred": true}]
        > 
        > Standard language structure: <br>
        > "communication": [{"coding": [{"code": "'en-us'","display": "English"}],"text": "Language"}]

    ##### FIXES
    1. The POST (create) and PUT (update) responses for following endpoints have been updated to ONLY return ID and Resource Type:
      - Document Reference: POST Response, PUT Response
      - Practitioner: POST Response, PUT Response
      - Admin Task: POST Response
      - Patient: POST Response, PUT Response
      - Subscriptions: POST Response, PUT Response
      - Referral Sources: POST Response, PUT Response

    <br>

    ### Sept 25, 2019
    ##### ENHANCEMENTS
    1. The result response for POST v1/documentReference/profile/ (i.e., search document references by profile) 
    of DocumentReference endpoint will now return an empty array instead of "You are not authorized to view 
    this/these files." validation error while retrieving files in bulk from a profile that does not have files.
    2. The fields type and securityLabel have been added to POST/PUT methods of DocumentReference API as per 
    FHIR standards.
    3. The request pattern for DocumentReference search-by-Profile ID has been enhanced. [Click here for details...](#tag/DocumentReference/paths/~1v1~1documentReferences~1_profile~1/post)
        > **Version history:** <br>
        > Previous pattern: {"context": {"related": [{"ref": {"reference": "Patient/##"}}]}} <br>
        > New updated pattern: {"reference": "Patient/##"}
    4. The GET response of DocumentReference endpoint has been updated to include securityLabel and type as well.
     [Click here for details...](#tag/DocumentReference/paths/~1v1~1documentReferences~1_profile~1/post)
        > **Version history:** <br>
        > The fileType and confidentialFile fields appear in POST request (i.e., while creating a DocumentReference). 
        > To retrieve the same while searching the document reference, the securityLabel and type have been added to 
        > GET response. The securityLabel represents the confidentiality (confidentialFile) and type represents the 
        > fileType.
        > 
        > "securityLabel": [{"text": "Unrestricted"}] <br>
        > "type": {"text": "Electronic Signature Authorization"}
    5. The result response for POST v1/documentReference/_profile/ (i.e., search document references by profile) 
    of DocumentReference endpoint has been updated to include file object data (like: name, size, and file ID) 
    along with the download URL. [Click here for details...](#tag/DocumentReference/paths/~1v1~1documentReferences~1{id}~1/put)
        > **Version history:** <br>
        > Previously, the response for the file bulk download API only returned the download URLs for each file. <br> 
        > So, the response has been updated to return a proper DocumentReference object with the proper file descriptor 
        > information as well including name, size, and file ID.
    <br>


#servers:
#  - url: https://connect.clearcareonline.com
#    description: WellSky Personal Care Connect API v1
schemes:
  - https
host:
  - connect.clearcareonline.com

tags:
  # Primary objects
  - name: "AdminTask"
    x-displayName: "AdminTask"
    description: |
      ### Overview
      A task is an activity that is performed or that can be performed. It can also track the state of completion 
      of the activity.

      ### Create or edit tasks on the WellSky Personal Care app
      > **Note:** <br> On the WellSky Personal Care app, the 'owner' is the 'assignee' and the 'requester' is the 'relates to'.  
      #### To create a new task
      1. Click on the 'Add task' on the WellSky Personal Care dashboard.
      <br><img src="assets/Admintask1.png" alt="">
      2. Once the 'Add task' window opens, select the due date.
      <br><img src="assets/Admintask2.png" alt="">
      3. Then select the Status.
      <br><img src="assets/Admintask3.png" alt="">
      4. Then choose the recurrence period.
      <br><img src="assets/Admintask4.png" alt="">
      5. Select an assignee from the dropdown list.
      <br><img src="assets/Admintask5.png" alt="">
      6. Fill in the other details and save.
      <br><img src="assets/Admintask6.png" alt="">

      #### To edit a task
      1. Click on the task details on the WellSky Personal Care dashboard.
      <br><img src="assets/Admintask7.png" alt="">
      2. Fill in the other details and save.
      <br><img src="assets/Admintask8.png" alt="">

  - name: "AgencyAdmin"
    x-displayName: "Agency Admin"
    description: |
      ### Overview
      The agency admin is a user who receives alerts on behalf of the agency. There are four levels of admins within WellSky Personal Care.
      - Super Admins - The Super admin has access to all agency information and settings. This user can also change and edit the level of access for other admins.
      - Agency Admins - The Agency Admin has access to every section on WellSky Personal Care except for the Agency settings. This user cannot edit access levels of other admins.
      - Read-only Admins - The Read-only Admin can view everything the Agency admin can, but will not be able to edit, export or delete certain types of information.
      - Scheduling Admins - The Scheduling Admin can access every section on WellSky Personal Care, except the Agency settings, the Accounting section and the Reports section.

      ### Add or edit admins on the WellSky Personal Care app
      
      #### Adding an admin
      Only a super admin can add other admins. Here is how the super admin can go about doing the task.
      1. Go to the WellSky Personal Care dashboard and click on 'agency settings'. 
      <br><img src="assets/Agencyadmin1.png" alt="">
      2. Then click on 'Administrators'.
      <br><img src="assets/Agencyadmin2.png" alt="">
      3. Click on 'Add administrator'.
      <br><img src="assets/Agencyadmin3.png" alt="">
      4. Fill in all the details and click on save.
      <br><img src="assets/Agencyadmin4.png" alt=""> 
        * General - Name, address and contact details.
        * Login - Check the box if the individual is allowed to login to the WellSky Personal Care system.
        * Admin settings -
          * Super admin select 'Allow the user to change agency settings'. 
          * Agency admin select 'Allow this user to change agency settings' and 'Hide all accounting pages and reports from this administrator'. 
          * Read-only admin select 'Grant read-only access to Receivables and Rates to this administrator'. 
          * Scheduling admin select 'Hide all accounting pages and reports from this administrator', and if need be you can also select 'Also hide all rates from this administrator'.	
        * Email signatures- Add email signatures if necessary.
        * Alerts - Choose the alerts the user can receive.
        * Worksafe - Choose the compensation code and the pay structure. 
        * Contact - Add the required emergency contacts. **Note** The emergency contact list can hold up to three contacts. The contact tab is available only when the feature flag is enabled.


      #### Editing an admin
      The super admin can also edit details or permission levels of other admins. <br>
      Follow the path `Dashboard » Agency Settings » Administrators` on the WellSky Personal Care App.
      Then,
      1. Click on the name of the administrator. 
      <br><img src="assets/Agencyadmin5.png" alt=""> 
      2. Edit necessary details and click on 'Save'. 
      <br><img src="assets/Agencyadmin6.png" alt="">

  - name: "AllergyIntolerance"
    x-displayName: "AllergyIntolerance"
    description: |
      ### Overview
      This resource is used to provide a single place within the health record to document a range of 
      clinical statements about adverse reactions to substances/products.

      AllergyIntolerance is a record of a clinical assessment of an allergy or 
      intolerance; a propensity, or a potential risk to an individual, to have an adverse reaction on 
      future exposure to the specified substance, or class of substance.
      Substances include, but are not limited to a therapeutic substance administered correctly at 
      an appropriate dosage for the individual; food; material derived from plants or animals; 
      or venom from insect stings.

      ### Add/edit/delete allergies on the WellSky Personal Care app
      
      #### To add allergies
      1. Go to `Dashboard » Clients » Client profile » Assessments & Care Plan`. 
      2. Select **Allergies** from the **Quick Links** and go to the **Allergies** section.
      <br><img src="assets/allergyintolerance1.png" alt=""> 
      3. Select the allergy name(s) from the dropdown, add notes and submit.
      <br><img src="assets/allergyintolerance2.png" alt="">

      #### To remove/delete allergies
      1. Go to `Dashboard » Clients » Client profile » Assessments & Care Plan » Allergies`. 
      2. Click on the `x` icon present against the name and submit.
      <br><img src="assets/allergyintolerance3.png" alt="">

      #### To update allergies
      1. Go to `Dashboard » Clients » Client profile » Assessments & Care Plan » Allergies`. 
      2. We can only update the notes for this section. So, update the notes and submit.


  - name: "Appointment"
    x-displayName: "Appointment"
    description: |
      ### Overview
      This resource enables fetching shifts/appointments, and, ultimately, searching for shifts/appointments.

  - name: "Auth Flow"
    x-displayName: "Auth Flow"
    description: |
      ### Overview
      The WellSky Connect API uses OAuth 2.0 for access control and delegation.
      > Note:
      > Read more on the Connect Auth Flow design implementation here
      General OAuth 2.0 Authorization Flow
      - The client requests an access token
      - The authorization server grants one after authenticating the client id, client secret and grant type
      - The client then uses this access token to call for a protected resource on WellSky Personal Care
      - The resource servers extract information, then it can perform two actions:
        - If the server finds the access token valid it will show the output
        - If the server finds the access token invalid, it will throw an error and ask for a refresh token
        
       <img src="assets/Auth_flow.png" alt="">

  - name: "CarePlan"
    x-displayName: "CarePlan"
    description: |
      ### Overview
      CarePlans are used in many areas of healthcare with a variety of scopes. 
      They can be as simple as a general practitioner keeping track of when their patient 
      is next due for a tetanus immunization through to a detailed plan for an oncology 
      patient covering diet, chemotherapy, radiation, lab work and counselling with detailed 
      timing relationships, pre-conditions and goals.

      **Note:** Currently, in this resource we are only supporting ADLs (Activities of Daily Living) 
      and IADLs (Instrumental Activities of Daily Living).


      ### Add or edit ADLs and IADLs on the WellSky Personal Care app
      
      1. Go to `Dashboard » Clients » Client Profile » Assessments & Care Plan`.
      2. Select **ADLs** and **IADLs** from the **Quick Links** and those sections appear on the right side.
      3. Click on **Add ADLs** to add the daily living activity for the client. Click on **Add IADLs** to add the daily living instrumental activity for the client.
      <br><img src="assets/Careplan1.png" alt="">
      4. Click the appropriate checkbox to select the activity for the client.
      <br><img src="assets/Careplan2.png" alt="">
      5. Add **task(s)** and click **Save**. 
      <br><img src="assets/Careplan3.png" alt="">
      <br><img src="assets/Careplan4.png" alt="">
      6. At the end click **Done** and the data gets saved.

  # - name: "Carelogs"
  #   x-displayName: "CareLog"
  #   description: |
  #     ### Overview
  #     Care logs are shifts that have taken place 3 or more hours after the scheduled clock out time.
  #     Think of Care logs as shifts in the past.

  # - name: "Certificate"
  #   x-displayName: "Certificate"
  #   description: |
  #     ### Overview
  #     Certificates are digital documents which map a public key to an entity. The certificate verifies the public key belongs to an individual entity.
  #     It returns all the agency certification information and certificates associated with the profile.

  - name: "ChargeItem"
    x-displayName: "ChargeItem"
    description: |
      ### Overview
      According to FHIR regulations, the resource ChargeItem describes the provision of healthcare provider 
      products for a certain patient, therefore referring not only to the product, but containing in addition 
      details of the provision, like date, time, amounts and participating organizations and persons. 
      Main Usage of the ChargeItem is to enable the billing process and internal cost allocation.

  - name: "ClockIn"
    x-displayName: "ClockIn"
    description: |
      ### Overview
      To clock in is to record caregiver's time of arrival at shift, usually by punching a time clock; 
      to begin work.

      Our Connect Clock In / Clock Out APIs leverage the existing logic used by our mobile app to create 
      or update a care log to clock in or out of a shift.
      
      Importantly, beyond the API, a care log may also be generated via an Admin using the WellSky Personal Care UI, 
      a Caregiver via telephony, a Caregiver via our mobile app, or auto-clock in set up in the 
      agency settings, etc.

      If there is an existing care log, the API will not overwrite it or update the existing information, 
      and the API response will simply return the information for the existing care log.

      ### Clock-in using the WellSky Personal Care app

      1. Go to `Dashboard » Caregivers » Caregiver name » Shift Calendar` 
      <br><img src="assets/Clockin_Calendar.png" alt=""> 
      2. Select the client shift to clock-in.
      3. Click on **Clock In** button to mark the clock-in.
      <br><img src="assets/Clockin.png" alt=""> 
      4. Once clocked-in, the shift status gets marked as **In Progress**.
      <br><img src="assets/Clockin_inprogress.png" alt="">

  - name: "ClockOut"
    x-displayName: "ClockOut"
    description: |
      ### Overview
      To clock out is to record caregiver's time of departure from shift; to end work.

      Our Connect Clock In / Clock Out APIs leverage the existing logic used by our 
      mobile app to create or update a care log to clock in or out of a shift.
      
      Importantly, beyond the API, a care log may also be generated via an Admin using the WellSky Personal Care UI, 
      a Caregiver via telephony, a Caregiver via our mobile app, or auto-clock in set up in the 
      agency settings, etc.

      If there is an existing care log, the API will not overwrite it or update the existing information, 
      and the API response will simply return the information for the existing care log.

      ### Clock-out using the WellSky Personal Care app

      1. Go to `Dashboard » Caregivers » Caregiver name » Shift Calendar`.
      <br><img src="assets/Clockin_Calendar.png" alt=""> 
      2. Select the shift to clock-out.
      3. Click on **Clock Out** button to mark the shift as completed.
      <br><img src="assets/Clockout.png" alt="">
      4. The **Edit Care Log** window appears. Enter the required fields (if missing). Add **Mileage** if required and click on **Save**.
      <br><img src="assets/Clockout_Carelog.png" alt="">
      5. The shift gets marked as **Complete** once the clock-out is successful.
      <br><img src="assets/Clockout_complete.png" alt="">   

  - name: "Condition"
    x-displayName: "Condition"
    description: |
      ### Overview
      This resource enables adding, updating, and fetching records of medical conditions, 
      mental/behavior conditions, elimination, medications, ambulation, transfers, bathing, 
      grooming & dressing, meal, driving, exercise, sleep patterns, 
      equipment/environment, pet care and daily routine activities.

      ### Add or edit any condition record using the WellSky Personal Care app

      1. Go to `Clients » Client Profile » Assessments & Care Plan`.
      <br><img src="assets/.png" alt="">
      2. The sections that are covered under this Condition API are as follows:
      <br> - Medical Conditions
      <br> - Mental/Behavior Conditions
      <br> - Elimination
      <br> - Medications
      <br> - Ambulation
      <br> - Transfers
      <br> - Bathing, Grooming & Dressing
      <br> - Meals
      <br> - Driving
      <br> - Exercise
      <br> - Sleep Patterns
      <br> - Equipment/Environment
      <br> - Pet Care 
      <br> - Daily Routine
      <br><img src="assets/Condition1.png" alt="">
      3. Select the respective section from the left menu so that it appears on the right for edit.
      4. Only limited fields from each of the above-mentioned sections have been considered in this API, those are highlighted as follows:
      <br><img src="assets/Condition2.png" alt="">
      <br><img src="assets/Condition3.png" alt="">
      <br><img src="assets/Condition13.png" alt="">
      <br><img src="assets/MedicationNotes.png" alt="">
      <br><img src="assets/Condition4-5.png" alt="">
      <br><img src="assets/Condition6.png" alt="">
      <br><img src="assets/Condition7.png" alt="">
      <br><img src="assets/Condition8-9.png" alt="">
      <br><img src="assets/Condition14.png" alt="">
      <br><img src="assets/Condition10-11.png" alt="">
      <br><img src="assets/Condition12.png" alt="">
      5. Enter all the required fields and click `Save`.
      6. The data gets saved.

  - name: "DocumentReference"
    x-displayName: "DocumentReference"
    description: |
      ### Overview
      'DocumentReference' means reference to a document of any kind for any purpose. 
      A DocumentReference resource is used to index a document, clinical note, and other binary objects to 
      make them available to the healthcare system. A document is some sequence of bytes that is identifiable, 
      establishes its own context (e.g., what subject, author, etc. can be displayed to the user), 
      and has defined update management. The DocumentReference resource can be used with any document format 
      that has a recognized mime type and that conforms to this definition.

  - name: "Encounter"
    x-displayName: "Encounter"
    description: |
      ### Overview
      According to FHIR regulations, it is an interaction between a patient
      and WellSky Personal Care for the purpose of providing healthcare service(s)
      or assessing the health status of a patient.

  - name: "Goal"
    x-displayName: "Goal"
    description: |
      ### Overview
      This resource enables adding, updating, and fetching records of **Care Needs** from the WellSky Personal Care application.

      ### Add or edit any Care Needs record using the WellSky Personal Care app

      1. Go to `Clients » Client Profile » Assessments & Care Plan`.
      2. Select **Care Needs** from the Quick Links. The **Care Needs** section appears at the right.
      <br><img src="assets/CareNeeds.png" alt="">
      3. Enter the fields values and click `Save`.
      4. The data gets saved.

  - name: "Invoice"
    x-displayName: "Invoice"
    description: |
      ### Overview
      Tracking Financial information is vital in Patient Administration and 
      Finance systems in most Healthcare Organizations. An invoice is a 
      financial document issued by a healthcare provider to a patient or 
      a payer indicating the goods and services (ChargeItems) performed 
      with their quantities and prices.

  - name: "Location"
    x-displayName: "Location"
    description: |
      ### Overview
      According to FHIR regulations, location includes both incidental locations 
      (a place which is used for healthcare without prior designation or authorization) and dedicated, 
      formally appointed locations. Locations may be private, public, mobile or fixed and scale 
      from small freezers to full hospital buildings or parking garages.

  - name: "MedicationStatement"
    x-displayName: "MedicationStatement"
    description: |
      ### Overview
      Representing medications in most healthcare settings is a matter of identifying an item from 
      a list and then conveying a reference for the item selected ither into a patient-related resource.
      
      The **MedicationStatement** resource is used to record a medications or substances that the patient reports 
      as being taken, not taking, have taken in the past or may take in the future.
      A record of a medication that is being consumed by a patient.

      ### Add a Medication/Supplement record to a patient using the WellSky Personal Care app

      1. Go to `Clients » Client Name » Assessments & Care Plan » Medications and Supplements`.
      <br><img src="assets/MedicationStatement1.png" alt="">
      2. Click on `+Medication/Supplement` to add a medication statement for the selected client.
      <br><img src="assets/MedicationStatementAdd.png" alt="">
      3. Enter all the required fields on both the tabs and click `Save`.
      <br><img src="assets/MedicationStatement3a.png" alt=""> 
      <br>**Note:** Checking the 'Client is actively taking this' checkbox means the patient is currently taking the medication 
      and unchecking means the patient has stopped taking that medication.
      <br><img src="assets/MedicationStatementStatus.png" alt="">
      <br><img src="assets/MedicationStatement3b.png" alt=""> 
      4. The record gets added. 
      <br>**Note:** All the active and stopped medication statements can be seen under the `All` tab.
      <br><img src="assets/MedicationStatementAllTab.png" alt=""> 
      
      <br>

      > <b> Additional Note: </b> <br>
      > This API only provides support to medication statement. <br>
      > General medication "Notes" are captured under [Condition API](#tag/Condition).
      > <br><img src="assets/MedicationNotes.png" alt="">

  - name: "Organization"
    x-displayName: "Organization"
    description: |
      ### Overview
      The Organizations resource supports the retrieval and search of "agencies" within WellSky Personal Care. 
      This resource confirms to the FHIR Organization standard.

    # ### Actions
    #   #### 1. Fetch organizations by ID
    #   - Use the [HTTP GET](#tag/Organization/paths/~1v1~1organizations~1{id}~1/get) method to
    #   fetch organizations.

    #   #### 2. Search for an organization using 'GET'
    #   - Use the [HTTP GET](#tag/Organization/paths/~1v1~1organizations~1/get) method to search
    #   for an organization.

    #   #### 3. Search for an organization using 'POST'
    #   - Use the [HTTP POST](#tag/Organization/paths/~1v1~1organizations~1_search~1/post) method
    #   to search an organization.

  - name: "Patient"
    x-displayName: "Patient"
    description: |
      ### Overview
      The purpose of the Patient resource is to allow for administration of a patient. 
      The resource provides all the functions of searching, retrieving, updating, or changing and deleting 
      patient information. 
      The Patient resource under Connect API is one of the core integration points for WellSky Personal Care. 
      The patient search operation ensures that the franchisor/agency developer has access to demographic 
      information of a person receiving care services from related organizations.

      ### WellSky Personal Care App

      A user can change the optional fields to 'Required' by following these steps on the WellSky Personal Care app.

      #### To change optional fields to 'Required' on the WellSky Personal Care app
      1. Click on Agency Settings on the WellSky Personal Care dashboard.     
      <br><img src="assets/Patient1.png" alt="">    
      2. Go to the 'Clients' section and click on 'Client Form Required Fields'.  
      <br><img src="assets/Patient2.png" alt=""> 
      3. Change the settings of each field as per requirement. Select 'Required' if the field needs to 
      be made into a mandatory one, else select 'Enabled'.
      <br><img src="assets/Patient3.png" alt="">
      >**Note:**<br>
      >If the agency is a part of a franchise, the franchisor may choose to set the custom field as 'Required' (for example, in the screenshot above, 'Territory' is the custom field).
      >1. If the franchisor does not set the custom field as 'Required', then the agency can set the custom field as 'Required' from here.<br>
      >2. If the franchisor sets the custom field as 'Required', then it gets marked as 'Required' and the agency cannot choose to make it as not required.<br>

      #### To add general details of a prospect on the WellSky Personal Care app
      > Note: The * marked with the image shows 'mandatory/required patient fields. The others are optional fields. 
      1. Click on Prospect on the WellSky Personal Care dashboard.
      <br><img src="assets/Patient4.png" alt=""> 
      2. Click on Add prospect.
      <br><img src="assets/Patient5.png" alt=""> 
      3. Fill the details and save.
      <br><img src="assets/Patient6.png" alt=""> 

      #### To add general details of a client on the WellSky Personal Care app 
      > Note: The * marked with the image shows 'mandatory/required patient fields. The others are optional fields.
      1. Click on 'Clients' on the WellSky Personal Care dashboard.
      <br><img src="assets/Patient7.png" alt=""> 
      2. Click on Add client.
      <br><img src="assets/Patient8.png" alt=""> 
      3. Fill the details and save.
      <br><img src="assets/Patient9.png" alt=""> 

      #### To add Client Contacts on the WellSky Personal Care app
      A. `Dashboard » Clients » Client name » Edit Profile » Contact` 
      <br><img src="assets/Patient10.png" alt=""> 
      1. Select the "+" to add information on the client's family members.
      <br><img src="assets/Patient11.png" alt=""> 
      2.  Add necessary information.
      <br><img src="assets/Patient12.png" alt=""> 
      3.  Choose the relationship, fill other details, and save)
      <br><img src="assets/Patient13.png" alt=""> 

      B. `Dashboard » Client Contacts» Add client contact` 
      Follow the same procedure as adding a prospect.
          
      #### To add general details of a Referral Source on the WellSky Personal Care app  
      Follow the same procedure as [Adding a referral source](#tag/ReferralSources)
        
      #### To edit the details of a prospect -
      A. Changes can be made to the prospect's general details, by following the path given below.
      <br> `Dashboard » Prospects » Prospect name » Edit Profile » General`
      <br><img src="assets/Patient14.png" alt=""> 

      B. Changes to the demographic details of a prospect can be made:
      <br> `Dashboard » Prospects » Prospect name » Assessment and Care Plan » Demographics` 
      <br><img src="assets/Patient15.png" alt="">  

      #### To edit the details of a client -
      A. Changes can be made to the client's general details, by following the path given below.
      <br> `Dashboard » Clients » Client name » Edit Profile » General`
      <br><img src="assets/Patient16.png" alt=""> 

      B. Use the path given below to edit demographic details of the client-patient.
      <br> `Dashboard » Clients » Client name » Assessment and Care Plan » Demographics`
      <br><img src="assets/Patient17.png" alt="">  
          
      #### To edit the contact details of a client -
      Use this path to edit Client Contacts on the WellSky Personal Care App.
      A. `Dashboard » Clients » Client name » Edit Profile » Contact` 
      <br><img src="assets/Patient18.png" alt=""> 
      1. Select the "+" to add information on the client's family members:
      <br><img src="assets/Patient19.png" alt=""> 
      2. Add necessary information: 
      <br><img src="assets/Patient20.png" alt=""> 
      3. Choose the relationship, fill other details, and save: 
      <br><img src="assets/Patient21.png" alt=""> 

      B. `Dashboard » Client Contacts» Edit client contact` 
      Follow the same procedure as editing a prospect.

      #### To edit the details of a Referral Source -
      Follow the same procedure as [editing a referral source](#tag/ReferralSources)


    #  ### Actions
    #  #### 1. Create a patient.
    #  Use the [HTTP POST](#tag/Patient/paths/~1v1~1patients~1/post) method to create patients.
    #  #### 2. Fetch a patient by ID.
    #  Use the [HTTP GET](#tag/Patient/paths/~1v1~1patients~1{id}~1/get) code to fetch patient information.
    #  #### 3. Update a patient.
    #  Use [PUT](#tag/Patient/paths/~1v1~1patients~1{id}~1/put) to update a patient's details in WellSky Personal Care.
    #  #### 4. Delete a patient.
    #  Use [DELETE](#tag/Patient/paths/~1v1~1patients~1{id}~1/delete) to delete patient records.
    #  #### 5. Search a patient using 'GET'.
    #  Use [GET](#tag/Patient/paths/~1v1~1patients~1/get) to search a patient in WellSky Personal Care.
    #  #### 6. Search a patient using 'POST'.
    #  Use [HTTP POST](#tag/Patient/paths/~1v1~1patients~1_search~1/post) to search patient information.

  - name: "Practitioner"
    x-displayName: "Practitioner"
    description: |
      ### Overview
      A practitioner is directly or indirectly involved in patient care. Physicians, nurses, social workers, 
      scribes, pharmacists, paramedics, dieticians, therapists, IT personnel dealing with 
      patient records etc., in short all those who are either in health care or in related services 
      fall under the "practitioner" category.

      The 'Practitioner' is different from 'RelatedPerson' in that a practitioner oversees 
      multiple patients on behalf of a healthcare organization, while the RelatedPerson is 
      deemed to do tasks specifically related to the "RelatedPerson's" patient.
      > Note:
      > In WellSky Personal Care we use the term 'Caregiver' to define a 'practitioner'.

      ### On WellSky Personal Care App
      A user can change the optional fields to 'Required' by following below steps on the WellSky Personal Care app.

      #### To change optional fields to 'Required' on the WellSky Personal Care app  
      1. Click on Agency Settings on the WellSky Personal Care dashboard.<br>
      <img src="assets/Practitioner1.png" alt="">
      2. Go to the 'General Settings' section and click on 'Caregiver Form Required Fields'.<br>
      <img src="assets/Practitioner2.png" alt="">
      3. Change the settings of each field as per requirement. Select 'Required' if the field needs to be made into a mandatory one, else select ' Enabled' and click Save.
      <br><img src="assets/Practitioner3.png" alt="">
      >**Note:**<br>
      >If the agency is a part of a franchise, the franchisor may choose to set the custom field as 'Required' (for example, in the screenshot above, 'Territory' is the custom field).
      >1. If the franchisor does not set the custom field as 'Required', then the agency can set the custom field as 'Required' from here.<br>
      >2. If the franchisor sets the custom field as 'Required', then it gets marked as 'Required' and the agency cannot choose to make it as not required.<br>
      

      #### To add general details of an applicant on the WellSky Personal Care app
      > Note: The * marked in the images below show mandatory/required practitioner fields.
      1. Click on Applicant on the WellSky Personal Care dashboard. 
      <br><img src="assets/Practitioner4.png" alt="">
      2. Click on Add Applicant.   
      <br><img src="assets/Practitioner5.png" alt="">
      3. Fill details and save. <br>
         Add the required emergency contacts. **Note** The emergency contact list can hold up to three contacts. The contact tab is available only when the feature flag is enabled.
      <br><img src="assets/Practitioner6.png" alt="">

      #### To add general caregiver details on the WellSky Personal Care app
      > Note: The * marked in the images below show mandatory/required practitioner fields.
      1. Click on 'Caregivers' on the Caregiver dashboard.   
      <br><img src="assets/Practitioner7.png" alt="">
      2. Click on 'Add caregiver'. 
      <br><img src="assets/Practitioner8.png" alt="">
      3. Fill the details and save.
      <br><img src="assets/Practitioner9.png" alt="">
        
      #### Referral Source 
      Follow the same procedure as [Adding a referral source](#tag/ReferralSources)

      Once a practitioner has been created, there may arise a need to make some changes or add additional information. This can be done on the WellSky Personal Care app.

      #### To edit details of an applicant
      A. Changes to the profile can be made by going to the path below -
      <br>`Dashboard » Applicants » Applicant name » Edit Profile » General`
      <br><img src="assets/Practitioner10.png" alt="">

      B. Changes to other demographic details can be made by going to -
      <br>`Dashboard » Applicants » Applicant name » Skills, Background & Certification » Demographics` 
      <br><img src="assets/Practitioner11.png" alt="">

      #### To edit details of a caregiver
      A. Changes to the profile can be made by following - 
      <br>`Dashboard » Caregivers » Caregiver name » Edit Profile » General`
      <br><img src="assets/Practitioner12.png" alt="">

      B. Changes to the demographic details can be made by following - 
      <br>`Dashboard » Caregivers » Caregiver name » Skills, Background & Certification » Demographics`
      <br><img src="assets/Practitioner13.png" alt="">

      #### Referral Source 
      Follow the same procedure as [Editing a referral source](#tag/ReferralSources)

      #### Additional Notes
      - The `eligibleToRehire` property has been added to the `meta` object. This property is linked to a feature that is not standard within the WellSky Personal Care platform. For further details on this feature, please contact personalcaresupport@wellsky.com.

  - name: "ProfileTags"
    x-displayName: "ProfileTags"
    description: |
      ### Overview
      The Profile Tags resource is used to manage the profile tags associated with a WellSky Personal Care agency. 
      Tags are used to categorize and organize profiles based on specific criteria or attributes. 
      Tags can be used to filter and search for profiles based on specific criteria, 
      making it easier to manage and organize profiles within the system. 
      The Profile Tags resource allows you to create, read, and update tags associated with an agency.

  - name: "ReferralSources"
    x-displayName: "ReferralSource"
    description: |
      ### Overview
      `ReferralSource` is used to share relevant information required to support a referral request or 
      a transfer of care request from one practitioner or organization to another. 
      It is intended for use when a patient is required to be referred to another provider 
      for a consultation/second opinion and/or for short term or longer-term management 
      of one or more health issues or problems.

      ### WellSky Personal Care App

      #### To **create a referral source** on the WellSky Personal Care app
      > Note
      > The * marked with the image shows mandatory/required patient fields. The others are optional fields.
      1. Click on Client / Caregivers on the WellSky Personal Care dashboard and go to Referral sources.   
      <br><img src="assets/ClientReferralSources1.png" alt="">
      2. Click on 'Add referral source'.
      <br><img src="assets/ClientReferralSources2.png" alt=""> 
      3. Fill details and click on 'Save'.<br>
         For - Individual referral sources:
         <br><img src="assets/ClientReferralSources3.png" alt="">
         <br>For Organizations: 
         <br><img src="assets/ClientReferralSources4.png" alt="">

      #### To **add personnel (clients/caregivers) within the referral source** on the WellSky Personal Care app  <br>
      1. Click on 'Organization' name in the referral sources section.
      <br><img src="assets/ClientReferralSources5.png" alt="">   
      2. Go to the 'Personnel' section of the Organization. 
      <br><img src="assets/ClientReferralSources6.png" alt="">  
      3. Click on 'Add personnel'.  
      <br><img src="assets/ClientReferralSources7.png" alt="">
      4. Fill in details in the 'General tab' and click on 'Next'. <br>
         For - Individual referral sources:
         <br><img src="assets/ClientReferralSources8.png" alt="">
         For Organizations: 
         <br><img src="assets/ClientReferralSources9.png" alt="">
      5. Select the 'Client Referrals'. 
      <br><img src="assets/ClientReferralSources10.png" alt="">
      6. Select the 'Caregiver Referrals' and then click on 'Save'. 
      <br><img src="assets/ClientReferralSources11.png" alt="">  

      #### To edit referral sources on the WellSky Personal Care app.
      1. Click on the 'Organization' / 'Name'on the referral sources page.
      <br><img src="assets/ClientReferralSources12.png" alt="">    
      2. Click on Edit profile of the concerned organization/ individual client.
      <br><img src="assets/ClientReferralSources13.png" alt="">    
      3. Edit referral source details and click on 'Save'.   
      <br><img src="assets/ClientReferralSources14.png" alt=""> 
      4. Or Edit Client name and click on 'Save'. 
      <br><img src="assets/ClientReferralSources15.png" alt=""> 

    #
    #  ### Actions
    #  #### 1. Create a Referral Source
    #  Use the HTTP POST method to create referral sources.
    #  #### 2. Fetch referral source by ID
    #  Use HTTP GET to fetch information about a particular referral source.
    #  #### 3. Update a referral source
    #  Use HTTP PUT to update a referral source details in WellSky Personal Care.


  - name: "RelatedPerson"
    x-displayName: "RelatedPerson"
    description: |
      ### Overview
      -----
      RelatedPerson typically have a personal or non-healthcare-specific
      professional relationship to the patient. A RelatedPerson resource is primarily used for 
      attribution of information, since RelatedPerson is often a source of information about the patient.
      For keeping information about people for contact purposes for a patient, use a Patient's Contact element.

      The resourceType used here is `RelatedPerson`.

        Examples:
        - A patient's wife or husband
        - A patient's relatives or friends
        - A patient's attorney or guardian

  - name: "Subscription"
    x-displayName: "Subscription"
    description: |
      ### Overview
      The Subscription resource enables subscribing to events raised by WellSky Personal Care.

      Notifications are sent to a client-provided web hook, containing the resource type and the ID of the updated resource, e.g.,
      <br>{ "resourceType": "Patient", "id": 3675284 }

      Below is the list of valid **Subscription Criteria**

      ResourceType | Criteria | Description 
      ----- | ----- | ----- 
      AdminTask | admintask.changed | Subscribe to notifications when an admin task changes.
      AdminTask | admintask.created | Subscribe to notifications when an admin task is created.
      AdminTask | admintask.status.changed | Subscribe to notifications when the status of an admin task changes.
      AdminTask | admintask.status.complete | Subscribe to notifications when an admin task or activity is completed.
      Agency Admin | agency_admin.deactivated.changed | Subscribe to notifications when an administrator is deactivated or reactivated.
      Encounter | encounter.clockout.changed | Subscribe to notifications when an encounter is clocked out or changed.
      Patient | patient.address.changed | Subscribe to notifications when a patient's address changes.
      Patient | patient.created | Subscribe to notifications when a patient is created.
      Patient | patient.dateofdeath.changed | Subscribe to notifications when a patient's date of death is changed.
      Patient | patient.deactivated.changed | Subscribe to notifications when a patient is deactivated or reactivated.
      Patient | patient.name.changed | Subscribe to notifications when a patient's name changes.
      Patient | patient.telecom.changed | Subscribe to notifications when a patient's telecom information changes.
      Patient | prospect.status.changed | Subscribe to notifications when a prospect's status changes.
      Practitioner | applicant.status.changed | Subscribe to notifications when an applicant's status changes.
      Practitioner | practitioner.address.changed | Subscribe to notifications when a practitioner's address changes.
      Practitioner | practitioner.created | Subscribe to notifications when a practitioner is created.
      Practitioner | practitioner.deactivated.changed | Subscribe to notifications when a practitioner is deactivated or reactivated.
      Practitioner | practitioner.name.changed | Subscribe to notifications when a practitioner's name changes.
      Practitioner | practitioner.telecom.changed | Subscribe to notifications when a practitioner's telecom information changes.
      ReferralSource | referralsources.changed | Subscribe to notifications when a referral source changes.
      ReferralSource | referralsources.created | Subscribe to notifications when a referral source is created.

  - name: "Task"
    x-displayName: "Task"
    description: |
      ### Overview
      The Task resource facilitates retrieving or updating the Encounter's Tasklog

paths:
  /v1/adminTasks/:
    $ref: './admin-tasks/admin-tasks.yaml'
  /v1/adminTasks/{id}/:
    $ref: './admin-tasks/admin-tasks.id.yaml'
  /v1/admins/:
    $ref: './admins/admins.yaml'
  /v1/admins/{id}/:
    $ref: './admins/admins.id.yaml'
  /v1/admins/_search/:
    $ref: './admins/admins.search.yaml'
    # AllergyIntolerance
  /v1/allergyintolerance/patient/{patient_id}/:
    $ref: './allergyintolerance/allergyintolerance.yaml'
  /v1/allergyintolerance/all-allergy/:
    $ref: './allergyintolerance/allergyintolerance.allsearch.yaml'
  /v1/allergyintolerance/<id>/:
    $ref: './allergyintolerance/allergyintolerance.del.yaml'
    # Appointment
  /v1/appointment/{id}/:
    $ref: './appointment/appointment.id.yaml'
  /v1/appointment/:
    $ref: './appointment/appointment.yaml'
  /v1/appointment/_search/:
    $ref: './appointment/appointment.search.yaml'
  /oauth/accesstoken:
    $ref: './auth/oauth.accesstoken.yaml'
  # /v1/carelogs:
  #   $ref: './carelogs/carelogs.yaml'
  /v1/careplan/activity/<patient_id>/:
    $ref: './careplan/careplan.yaml'
  /v1/careplan/activity-metadata:
    $ref: './careplan/careplan.id.yaml'
  # /v1/certificate/:
  #   $ref: './certificate/certificate.yaml'
  # /v1/certificate/{certificateid}:
  #   $ref: './certificate/certificate.certificateid.yaml'
  # /v1/certificate/profile/{profileid}:
  #   $ref: './certificate/certificate.profile.profileid.yaml'
  # /v1/certificate/agency/{agencyid}:
  #   $ref: './certificate/certificate.agency.agencyid.yaml'
  /v1/chargeitem/:
    $ref: './chargeitem/chargeitem.yaml'
  /v1/chargeitem/{carelogid}:
    $ref: './chargeitem/chargeitem.carelogid.yaml'
  /v1/chargeitem/{itemid}:
    $ref: './chargeitem/chargeitem.itemid.yaml'
  /v1/chargeitem/_search/:
    $ref: './chargeitem/chargeitem.search.yaml'
  /v1/encounter/<appointment_id>/clockin/:
    $ref: './clock-in/clock-in.yaml'
  /v1/encounter/<carelog_id>/clockout/:
    $ref: './clock-out/clock-out.yaml'
  /v1/condition/{patient_id}:
    $ref: './condition/condition.id.yaml'
  /v1/documentReferences/:
    $ref: './document-references/document-references.yaml'
  /v1/documentReferences/_profile/:
    $ref: './document-references/document-references.profile.yaml'
  /v1/documentReferences/{id}/:
    $ref: './document-references/document-references.id.yaml'
  /v1/encounter/:
    $ref: './encounter/encounter.yaml'
  /v1/encounter/{id}:
    $ref: './encounter/encounter.carelogid.yaml'
  /v1/encounter/_search/:
    $ref: './encounter/encounter.search.yaml'
  /v1/goal/patient/{patient_id}:
    $ref: './goal/goal.yaml'
  /v1/invoice/:
    $ref: './invoice/invoice.yaml'
  /v1/invoice/{invoiceid}:
    $ref: './invoice/invoice.invoiceid.yaml'
  /v1/locations/:
    $ref: './locations/locations.yaml'
  /v1/locations/{id}/:
    $ref: './locations/locations.id.yaml'
  /v1/locations/_search:
    $ref: './locations/locations.search.yaml'
  /v1/medicationstatement/patient/{patient_id}:
    $ref: './medicationstatement/medicationstatement.yaml'
  /v1/medicationstatement/patient/{patient_id}/:
    $ref: './medicationstatement/medicationstatement.patient.yaml'
  /v1/medicationstatement/{medicationstatement_id}:
    $ref: './medicationstatement/medicationstatement.id.yaml'
  /v1/medication/_search/:
    $ref: './medicationstatement/medicationstatement.search.yaml'
  /v1/organizations/{id}/:
    $ref: './organizations/organizations.id.yaml'
  /v1/organizations/:
    $ref: './organizations/organizations.yaml'
  /v1/organizations/_search/:
    $ref: './organizations/organizations.search.yaml'
  /v1/patients/:
    $ref: './patients/patients.yaml'
  /v1/patients/{id}/:
    $ref: './patients/patients.id.yaml'
  /v1/patients/_search/:
    $ref: './patients/patients.search.yaml'
  /v1/practitioners/:
    $ref: './practitioners/practitioners.yaml'
  /v1/practitioners/{id}:
    $ref: './practitioners/practitioners.id.yaml'
  /v1/practitioners/_search/:
    $ref: './practitioners/practitioners.search.yaml'
  /v1/profileTags/:
    $ref: './profiletags/profiletags.yaml'
  /v1/profileTags/{id}/:
    $ref: './profiletags/profiletags.id.yaml'
  /v1/referralsource/:
    $ref: './referral-sources/referral-sources.yaml'
  /v1/referralsource/{id}/:
    $ref: './referral-sources/referral-sources.id.yaml'
  /v1/relatedperson/:
    $ref: './relatedperson/relatedperson.yaml'
  /v1/relatedperson/{patient_id}:
    $ref: './relatedperson/relatedperson.id.yaml'
  /v1/relatedperson/<contact_id>:
    $ref: './relatedperson/relatedperson.update.yaml'
  /v1/relatedperson/<patient_id>/contacts/<contact_id>:
    $ref: './relatedperson/relatedperson.delete.yaml'
  /v1/relatedperson/_search/:
    $ref: './relatedperson/relatedperson.search.yaml'
  /v1/subscriptions/:
    $ref: './subscriptions/subscriptions.yaml'
  /v1/subscriptions/{id}/:
    $ref: './subscriptions/subscriptions.id.yaml'
  /v1/subscriptions/_search/:
    $ref: './subscriptions/subscriptions.search.yaml'
  /v1/encounter/{encounter_id}/task/{task_id}:
    $ref: './tasks/tasks.yaml'
  /v1/encounter/{encounter_id}/tasklog:
    $ref: './tasks/tasklog.encounter_id.yaml'
  /v1/encounter/{encounter_id}/tasklog/:
    $ref: './tasks/tasklog.yaml'
  /v1/encounter/{encounter_id}/tasklog/{tasklog_id}:
    $ref: './tasks/tasklog.id.yaml'
