Search code examples
postendpointhl7-fhirepic

How to create encounter in epic?


Following this documentation link https://fhir.epic.com/Documentation?docId=oauth2&section=BackendOAuth2Guide

I could create patient successfully, please guide me on how to create encounter for the patient created, as I couldnt find endpoint to post encounter in epic. Am I missing anything or is not possible to create encounter through POST method?

Thanks


Solution

  • Epic's HL7v2 ADT interface supports encounter creation. The HL7v2 interface allows you to provide information that is usually required for encounter creation, like which insurance to bill for that encounter (or indicate if the encounter should be self-pay), what relevant consents were collected, etc.

    A simple REST API to create only an encounter usually won't be sufficient to meet real-world workflow requirements. In order to complete a full "encounter create" workflow, you'd likely need to orchestrate (at least) these APIs:

    • Patient.search (or $match) (to find the Patient associated with the encounter)
    • Patient.create (if the encounter is for a new patient)
    • Account.search (to see if the relevant account already exist)
    • Account.create (to create the account if it doesn't already exist)
    • Coverage.search (to see if the relevant coverage already exists)
    • Coverage.create (to create the coverage if it doesn't exist)
    • Account.update (to link the coverage you created to the account)
    • Encounter.search (to see if there is a parent encounter to which your new encounter should be linked, like an active admission))
    • Consent.search (to see which consents are already on file)
    • Consent.create (to create any consents you have collected which are required for the encounter)
    • Encounter.create (to finally do the actual encounter create, linking to all the stuff you found above)

    Also, if any of these fail, you may need to manage rolling back, which can get complicated (especially if the rollback involves deleting a patient).

    Until all of these APIs (and probably more) are available, your best option is to use the HL7v2 interface for creating new encounters.