New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

epic-api-client

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

epic-api-client

EPIC API Client including authentication flow and some wrapped API calls

  • 2025.1.5
  • PyPI
  • Socket score

Maintainers
1

EPIC API Client

Installation

use pip install EPIC-API-Client.
see example.py for usage and setup .env accordingly.
tip: use uv pip for faster pip (pip install uv)!

How to use

Testing on EPIC sandbox

To familiarize, play around and test out the functionality of this package, you can use the EPIC sandbox. To use this sandbox, you only need to register an app at vendor services of EPIC, enable the EPIC sandbox and you're done! In the environment file, leave the url blanc, the epic api client will then automatically refer requests to the EPIC sandbox.

Using this wrapper within Nebula

Nebula uses unix websockets to send web requests instead of simple http requests. This capability has been added to this wrapper which can be activated setting the use_unix_socket=True argument:
client = EPICClient(client_id=client_id, jwt_generator=jwt_generator, base_url=base_url, use_unix_socket=True)
Make sure to setup your Nebula environment as if you would use the Webcallout functionality from EPIC itself.

still to write about and implement

  1. Using FHIR API functions
  2. Using internal API functions (vendor services)
  3. authentication methods OAUTH but also basic token?
  4. how is this wrapper organized and what are base vs extensions?

If your favorite function is not yet implemented, let me know, I will do this for you!

Troubleshooting

  • AttributeError: module 'jwt' object has no attribute 'encode'
    uv pip uninstall jwt
    uv pip uninstall PyJWT
    uv pip install PyJWT
    

Implemented functions

  • Internal API functions
    • handle_external_model_scores
    • set_smart_data_values
    • get_smart_data_values
  • Internal API extention functions
    • None yet
  • FHIR API functions
    • get_metadata
    • patient_read
    • patient_search
    • encounter_read
    • encounter_search
    • document_reference_read
    • document_reference_search
    • document_reference_create
    • observation_create
    • condition_read
    • condition_search
    • condition_create
  • FHIR API extention functions
    • patient_search_MRN
    • mrn_to_FHIRid

handle_external_model_scores

Send predictive model scores back to the Epic Cognitive Computing Platform for filing.

:param model_id: str, the ECCP model ID the scores are for
:param job_id: str, the autogenerated job ID for the evaluation on ECCP
:param output_type: str, the type of output for the predictive model
:param server_version: str, the server version of the predictive context
:param session_id: str, the session ID of the predictive context
:param entity_ids: list, a list of dictionaries with ID and Type for the entity
:param outputs: dict, the output values of the predictive model
:param raw: dict, optional, raw features used to calculate the scores
:param predictive_context: dict, optional, additional context information for the predictive model

:return: dict, the response from the Epic Cognitive Computing Platform

example outputs

{
    "Output_Name": {
        "Scores": {
            "Score_Name_1" : { "Values": [val1, val2,.., valN] },
            "Score_Name_2" : { "Values": [val1, val2,.., valN] }
        },
        "Features": {
            "Feature1": { "Contributions":[contrib1, contrib2, ..., contribN]},
            "Feature2": { "Contributions":[contrib1, contrib2, ..., contribN]}
        }
    }
}

example raw

{
    "Additional_Feature_1" : { "Values": [val1, val2,.., valN] },
    "Additional_Feature_2" : { "Values": [val1, val2,.., valN] }
}

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc