NAV Navbar
Logo
Details

Introduction

Welcome to the Smart Flow Sheet API! The Smart Flow Sheet API is organized around REST and is designed to have predictable, resource-oriented URLs and to use HTTP response codes to indicate API errors. JSON will be returned in all responses from the API, including errors.

By using the Smart Flow Sheet (hereinafter SFS) API the third-party software (hereinafter EMR) can create, edit and read patient data, as well as receive different events from the Smart Flow Sheet services.

Environment Setup

API Sandbox Endpoint:

https://sandbox.smartflowsheet.com/api/v3

API Production Endpoint:

https://www.smartflowsheet.com/api/v3

To make the SFS API as explorable as possible, we provide test-mode API keys as well as live-mode API keys. The test-mode API keys should be used in our sandbox environment, while live-mode keys should be used in our production environment.

To retrieve the events from SFS you should register two webhooks: one for sandbox environment, and another for production. SFS then sends an HTTP POST request with the event object to the URLs you provided.

To receive your API keys, please prepare the urls that will be used for the webhooks, and send us a request at info@smartflowsheet.com.

Your API keys carry many privileges, so be sure to keep them secret!

You can find the API endpoints for sandbox and production in Details section in the right part of this page.

You may also register a custom webhook per each clinic account (see Register custom webhook for more information).

Clinic Setup

Sandbox Home and Settings pages:

https://sandbox.smartflowsheet.com
https://sandbox.smartflowsheet.com/Settings?page=emr

Production Home and Settings pages:

https://www.smartflowsheet.com
https://www.smartflowsheet.com/Settings?page=emr

Our API is intended for use with a registered clinic account. You can register a clinic account on the Home page both in sandbox and production environments.

After a new clinic account has been registered in SFS, there is a clinic API Key automatically generated. This key should be used to authenticate against our API (see Authentication for more information). It is also used with the Events sent to EMR to identify the account.

The clinic API key can be obtained by user from Settings page on our web-site after registration. We assume that SFS user will be able to register this key in EMR’s user interface.

Basic Use-Cases

Sample Project:

https://github.com/veterinarium/public-sfs

This section describes the basic integration workflows.

Please download a sample project from GitHub that contains several examples of the SFS API usage.

Creating Patients

Creating patients from EMR into SFS has two obvious benefits:

  1. Saving the clinic’s staff time. Almost always the information required to create a patient in Smart Flow Sheet has been already entered into EMR user interface upon patient addmission to the hospital. Using /hospitalization API method it is possible to transfer that information into SFS and we will automatically create a new patient record for the user.

  2. Automatically collecting charges for the patient. Smart Flow Sheet will not send medical records for the patients created from SFS user interface. To receive medical records for the patient you will need to create a patient in SFS explicitly using /hospitalization API method.

Usually, what we recommend is that you place ‘Smart Flow Sheet’ button on your user interface. Clinic staff could then press it when they are ready to create a patient’s flowsheet (usually when a doctor decides to leave a patient in the hospital). Before creating a patient in Smart Flow Sheet, you may want to allow a user to select a treatment template and department for the patient. After the required treatment template and department has been selected, you should use this API to create patient record in Smart Flow Sheet.

After the patient has been submitted to Smart Flow Sheet, you may want to query the patient’s hospitalization status using this API. With its help, you can get some additional information, e.g. patient image file to update your user interface. Or you may track the status of the patient, and as soon as the patient has been discharged, you could download and attach to your medical records the set of files related to the patient, e.g. the flowsheet report.

Discharging Patients

At the end of hospitalization, the clinic staff will usually discharge the patient. During this step, Smart Flow Sheet generates a set of documents (in pdf format) that your practice management software might want to attach to the patient record. Below is the list of such reports with references of how to download them using the API:

There are two options for discharging the patient in Smart Flow Sheet:

  1. The user initiates discharge of the patient from Smart Flow Sheet user interface. In this case, Smart Flow Sheet will prepare all pdf reports and send the hospitalization.discharged event that your EMR may consume, download the appropriate pdf files from Smart Flow Sheet and attach them to the patient records.

  2. The user initiates discharge operation from the EMR side. In this case, the EMR should call discharge API to initiate discharging of the patient in Smart Flow Sheet. After the successful call to this API, the response will include the hospitalization object with the status field equal to discharged, but the reportPath field will be empty. At this point, all patient reports are not generated yet - Smart Flow Sheet only initiated the document generation process. To download the files, you have a couple of implementation strategies:

    • wait for the hospitalization.discharged event and then start downloading the documents
    • wait at least 15 seconds and then call the get hospitalization API. If the reportPath is not empty, then you may start downloading the reports
    • add some sort of “Download patient documents” button that will call the get hospitalization API, and if the reportPath is not empty, then the download may start. Otherwise, propose to repeat the operation later because the documents are not ready yet

Client Self Check-in Form

We offer the “Client Self Check-in Admission form” feature available in the “Smart Flow” iPad app. This means clients have the ability from the iPad to fill out their own information, take a photo of their pet, enter a reason for their visit and update and/or enter the name of their regular clinic from the waiting room. Upon completion of the form, the patient is created in Smart Flow and appears on the whiteboard.

As soon as the patient is created from the Client Self Check-in form, Smart Flow Sheet will notify the EMR by sending hospitalizations.created and forms.created events. You might want to consume and handle these events to:

There are three steps that should be realized to get client’s data entered on the admission form:

  1. The EMR should consume the hospitalizations.created event that is sent from Smart Flow Sheet as soon as a patient is added from the Client Self Check-in Admission form. The hospitalization object will be provided with the event. When the event is received both the client and patient records might be created in the EMR.

  2. In a second step, you should attach your internal records to SFS hospitalization. This is required to receive all other types of events related to this patient, as well as to be able to use any hospitalization API.

  3. Finally, Smart Flow Sheet will send the forms.created event that you might consume to get the rest of the data entered by the client during the check-in process.

Inventory Import

The most common reason to integrate with the SFS services is to be able to receive medical records from SFS upon treatment execution. This information can be used to automatically collect charges for the inventory items stored in EMR database.

In order to accomplish this goal the SFS API provides a possibility to import inventory items from the EMR system into SFS. We will store external identifiers for the inventory items during inventory import, and will provide these identifiers back to EMR with the medical records information entered during treatment execution. In this way EMR will be able to associate entered medical record with the correct inventory item, and create a charge.

To import inventory you may use next API methods:

The later API method works asynchronously and sends inventoryitems.imported event to the url specified with the webhook.

After the import is finished, the user can start using the inventory immediately by adding imported items to the patients` flowsheets. For the inventory items being added for the first time, Smart Flow Sheet will display a popup window. In this window, the user can adjust the display name of the item, and which SFS section (monitoring, activity, fluid, medication, or procedure) it should be attached to.

Receiving Medical Records

Receiving medical records information from Smart Flow Sheet provides an opportunity to automatically collect charges for the inventory items stored in your database. Please make sure to import inventory into SFS before that.

Medical record information is sent to EMR with the treatment.record_entered event (or treatments.records_entered event when multiple records has been entered).

Here is an example:

Example inventoryitem object imported with /inventoryitem API:

{
    "id": "external-inventory-id",
    "name": "Cefazolin 100",
    "concentration": 100,
    "concentrationUnits": "mg",
    "concentrationVolume": "ml"
}

Example treatment.record_entered event object sent to webhook:

{
    "clinicApiKey": "clinic-api-key",
    "eventType": "treatment.record_entered",
    "object": {
        "objectType": "treatment",
        "name": "Cefazolin 100",
        "inventoryId": "external-inventory-id",
        "hospitalizationId": "external-hospitalization-id",
        "treatmentGuid": "internal-sfs-treatment-guid",
        "time":"2013-03-28T14:23:56.000+00:00",
        "status": "added",
        "qty": 2.25,
        "volume": 2.25,
        "value": "IZ",
        "units": "ml",
        "doctorName": "Dr. Ivan Zak"
    }
}
  1. EMR imports Cefazolin 100 mg/ml inventory item with the /invetoryitem API method.

  2. Then doctor creates a patient in the EMR, the patient record is transferred into SFS with the /hospitalization API method and new patient automatically appears on a Smart Flow Sheet whiteboard.

  3. After the patient is created in Smart Flow Sheet, doctor adds Cefazolin 100 mg/ml to the flowsheet, and sets the dosage to 25 mg/kg (see image below).

  4. When Cefazolin 100 mg/ml is given to the patient, Smart Flow Sheet sends medical record information with the treatment.record_entered event to the EMR webhook, and transfer the volume of the medication dispensed. In this case it will be 2.25 ml.

You can find the example JSONs in Details section in the right part of this page. As you can notice the object transferred with the treatment.record_entered event contains the inventoryId field that is equal to the id field of the inventory item imported into SFS with the /inventoryitem API method. In this way EMR is able to associate entered medical record with the correct inventory item, and create a charge.

Billing for a Surgery

When the patient is admitted for surgery, Smart Flow Sheet provides access to the electronic anesthetic sheet feature. The anesthetic sheet allows medical staff to map the patient’s vitals and calculate pre-op and emergency drugs. After the surgery is over, the clinic staff finalizes the anesthetic sheet to:

To make it easier for your EMR to calculate billing for the surgery, Smart Flow Sheet sends the anesthetics.finalized event with the included anesthetic object as soon as the user presses the 'Finalize Anesthetiс Sheet’ button on the iPad.

Authentication

GET /inventoryitems HTTP/1.1
User-Agent: MyClient/1.0.0
Content-Type: application/json
emrApiKey: "emr-api-key-received-from-sfs"
clinicApiKey: "clinic-api-key-taken-from-account-web-page"
timezoneName: Europe/Helsinki

You authenticate to the SFS API by providing both EMR API key and clinic API key in all API requests to the server in a header.

emrApiKey: emr-api-key-received-from-sfs

clinicApiKey: clinic-api-key-taken-from-account-web-page

You must replace emr-api-key-received-from-sfs with your personal emr API key and clinic-api-key-taken-from-account-web-page with the clinic API key taken from the Settings web-page.

All API requests must be made over HTTPS. Calls made over plain HTTP will fail. You must authenticate for all requests.

We also recommend providing the time zone name with the timezoneName header of the HTTP request (e.g. timezoneName: Europe/Helsinki). Please visit this web-page for the complete list of the time zone names.

Errors

HTTP Status Code Summary

200 OK - Everything worked as expected.

400 Bad Request - Often missing a required parameter.

401 Unauthorized - No valid emrApiKey or clinicApiKey provided.

402 Payment Required - If reached clinic`s patient limit. This may happen when trying to create a new patient, but clinic`s subscription expired.

403 Forbidden - If trying to update clinic with different clinicApiKey.

404 Not Found - The requested item doesn`t exist.

409 Conflict - If the request with the same “id“ (e.g. “inventoryitems.id“) has been already received and is currenly under processing. Normally means that second request is not needed.

429 Too Many Requests - May happen when trying to upload a lot of inventory items. Need to slown down. 

500, 502, 503, 504 Server errors - something went wrong on SFS`s end

Smart Flow Sheet uses conventional HTTP response codes to indicate success or failure of an API request. In general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error that resulted from the provided information (e.g. a required parameter was missing), and codes in the 5xx range indicate an error with SFS’s servers.

Not all errors map cleanly onto HTTP response codes, however. Please refer to the documentation on a particular API method for the details on possible HTTP codes and responses.

The Error object

GET /inventoryitem HTTP/1.1
User-Agent: MyClient/1.0.0
Content-Type: application/json
emrApiKey: "emr-api-key-received-from-sfs"
clinicApiKey: "clinic-api-key-taken-from-account-web-page"
HTTP/1.1 404 Not Found
Accept: application/json

{
   "Message" : "Inventory item not found"
}

Smart Flow Sheet may send the Error object in the response to the API methods that failed with the 4xx HTTP status codes.

Also, SFS expects EMR to send the Error object (optionally) in the response to the event calls that fail together with the 4xx HTTP status codes.

Attributes

Parameter Type Description
Message String The message describing the cause of fail

Anesthetics

Anesthetic is an abstraction used in Smart Flow Sheet to represent the anesthetic sheet data. The main purpose of this abstraction is to provide the possibility to download anesthetic sheet report after the patient discharge event.

The anesthetics object

Attributes

Parameter Type Description
objectType String Optional. Describes the type of the object returned with the SFS API. Equals to anesthetics
id String Required. Identificator of the object.
anesthetics Array The array of anesthetic objects. See description of the anesthetic object below

The anesthetic object

Attributes

Parameter Type Description
objectType String Describes the type of the object transferred with the SFS API. Equals to anesthetic
hospitalizationId String EMR internal ID of the hospitalization
surgeryGuid String A unique internal identifier of the surgery. This field will be transferred with the SFS events.
dateStarted Date Optional. Anesthesia start time. Time format: YYYY-MM-DDThh:mm:ss.sssTZD (e.g. 1997-07-16T19:20:30.000+00:00)
dateEnded Date Optional. Anesthesia end time. Time format: YYYY-MM-DDThh:mm:ss.sssTZD (e.g. 1997-07-16T19:20:30.000+00:00)
reportPath String Optional. The path to the anesthetic sheet report file that has been generated during finalization of the anesthetic sheet.
recordsReportPath String Optional. The path to the anesthetic records report file that has been generated during finalization of the anesthetic sheet.
surgeon Medic Optional. The medic object that corresponds to the doctor assigned to the anesthetic sheet.
anesthetist Medic Optional. The medic object that corresponds to the anesthetist assigned to the anesthetic sheet.
assistant Medic Optional. The medic object that corresponds to the assistant assigned to the anesthetic sheet.

Finalize anesthetic event

Example of anesthetics.finalized event JSON:

{
    "clinicApiKey": "clinic-api-key",
    "eventType": "anesthetics.finalized",
    "object": {
        "objectType": "anesthetics",
        "id": "sfs-operation-id",
        "anesthetics": [
            {
                "objectType": "anesthetic",
                "hospitalizationId": "emr-hospitalization-id",
                "surgeryGuid": "sfs-surgery-guid",
                "dateStarted": "2015-11-04T17:23:07.707+00:00",
                "dateEnded": "2015-11-04T19:17:03.463+00:00",
                "reportPath": "https://pdf-anesthetic-sheet-report-webfile-path",
                "recordsReportPath": "https://pdf-anesthetic-records-report-webfile-path",
                "surgeon": {
                    "objectType": "medic",
                    "medicId": "emrIdm4",
                    "name": "Dr. George",
                    "medicType": "doctor"
                },
                "anesthetist": {
                    "objectType": "medic",
                    "medicId": "emrIdm3",
                    "name": "Ivan",
                    "medicType": "doctor"
                },
                "assistant": {
                    "objectType": "medic",
                    "medicId": "emrIdm4",
                    "name": "Dr. George",
                    "medicType": "doctor"
                }
            }
        ]
    }
}

As soon as one or several anesthetic sheets have been finalized in Smart Flow app on iPad, SFS will notify EMR by sending anesthetics.finalized event. The anesthetics object will be transferred with the event.

To enable anesthetics.finalized events please turn on EXPORT ANESTHETIC AFTER FINALIZATION TO EMR on the Settings page.

Retreive anesthetic sheet and anesthetic records reports

Example Request:

GET /hospitalization/{hospitalizationId}/anesthetics HTTP/1.1
User-Agent: MyClient/1.0.0
Content-Type: application/json
emrApiKey: "emr-api-key-received-from-sfs"
clinicApiKey: "clinic-api-key-taken-from-account-web-page"
{
    "objectType": "anesthetics",
    "id": "sfs_operation_id",
    "anesthetics": [
        {
            "objectType": "anesthetic",
            "hospitalizationId": "emr-hospitalization-id",
            "surgeryGuid": "sfs-surgery-guid",
            "dateStarted": "2015-11-04T17:23:07.707+00:00",
            "dateEnded": "2015-11-04T19:17:03.463+00:00",
            "reportPath": "https://pdf-anesthetic-sheet-report-webfile-path",
            "recordsReportPath": "https://pdf-anesthetic-records-report-webfile-path",
            "surgeon": {
                "objectType": "medic",
                "medicId": "emrIdm4",
                "name": "Dr. George",
                "medicType": "doctor"
            },
            "anesthetist": {
                "objectType": "medic",
                "medicId": "emrIdm3",
                "name": "Ivan",
                "medicType": "doctor"
            },
            "assistant": {
                "objectType": "medic",
                "medicId": "emrIdm4",
                "name": "Dr. George",
                "medicType": "doctor"
            }
        },
        {
            "objectType": "anesthetic",
            "hospitalizationId": "emr-hospitalization-id",
            "surgeryGuid": "sfs-surgery-guid",          
            "dateStarted": "2015-11-04T17:23:07.707+00:00",
            "dateEnded": null,
            "reportPath": null,
            "recordsReportPath": null,
            "surgeon": {
                "objectType": "medic",
                "medicId": "emrIdm4",
                "name": "Dr. George",
                "medicType": "doctor"
            },
            "anesthetist": {
                "objectType": "medic",
                "medicId": "emrIdm3",
                "name": "Ivan",
                "medicType": "doctor"
            },
            "assistant": null
        }
    ]
}

This method allows to download all anesthetic sheet reports and anesthetic records reports related to some hospitalization from Smart Flow Sheet.

Specify the hospitalizationId of the hospitalization object in the EMR. Use the same hospitalizationId that was supplied when hospitalization had been created.

Departments

This API allows to get the list of departments in the clinic. You may want to use this API to allow users to select a department before submitting a new patient into Smart Flow Sheet.

The department object

Attributes

Parameter Type Description
objectType String Optional. Describes the type of the object transferred with the SFS events. Should be assigned department value
departmentId Integer Required. The ID of the department. You should use this value to specify the department when creating a new hospitalization
name String Required. The unique name of department

Retreive existing departments

Example Request:

GET /departments HTTP/1.1
User-Agent: MyClient/1.0.0
Content-Type: application/json
emrApiKey: "emr-api-key-received-from-sfs"
clinicApiKey: "clinic-api-key-taken-from-account-web-page"
[
{
     "objectType":"department",
     "name":"Treatment Room",
     "departmentId":0
},
{
     "objectType":"department",
     "name":"Internal Medicine",
     "departmentId":1
}
]

Forms

The are three objects used by Smart Flow Sheet to notify EMR when forms are filled in:

All objects are sent with the asynchronous forms.created event when one or several forms has been entered.

The forms object

Attributes

Parameter Type Description
objectType String Optional. Describes the type of the object transferred with the SFS events (e.g. forms.created). Should be assigned forms value
id String Identificator of the object. Will be transferred to EMR with the forms.created event.
forms Array The array of form objects. See description of the form object below

The form object

Attributes

Parameter Type Description
objectType String Describes the type of the object transferred with the SFS events (e.g. forms.created). Should be assigned form value
formGuid String Required. A unique internal identifier of the form
hospitalizationId String Hospitalization external id (which was provided with hospitalization creation)
name String A unique identifier of the form type. (E.g. checkinform is the default value of the name attribute for “Client Self Check-in form”)
title String The title of the form (e.g. “Client Self Check-in”)
fields Array The array of formfield objects. See description of the formfield object below

The formfield object

Attributes

Parameter Type Description
objectType String Describes the type of the object transferred with the SFS events (e.g. forms.created). Should be assigned formfield value
name String A unique identifier of the form field
title String Field label (the one that users sees while filling in the form field)
contentType String This field describes the type of content of the value field (e.g. text/plain, image/jpg)
value String The string value of the form field

Retreive forms

Example of forms.created event JSON:

{
  "clinicApiKey": "clinic-api-key",
  "eventType": "forms.created",
  "object": {
    "objectType": "forms",
    "id": "sfs-operation-id"
    "forms": [
      {
        "objectType": "form",
        "formGuid": "sfs-form-guid",
        "hospitalizationId": "external-hospitalization-id",
        "name": "checkinform",
        "title": "Client Self Check-in",
        "fields": [
          {
            "objectType": "formfield",
            "name": "avatar",
            "title": "Avatar",
            "value": "https://attached-image-webfile-path",
            "contentType": "image/jpg"
          },
          {
            "objectType": "formfield",
            "name": "email",
            "title": "Your email",
            "value": "me@example.com",
            "contentType": "text/plain"
          },
          {
            "objectType": "formfield",
            "name": "first_name",
            "title": "Your name",
            "value": "John",
            "contentType": "text/plain"
          },
          {
            "objectType": "formfield",
            "name": "last_name",
            "title": "Last name",
            "value": "Doe",
            "contentType": "text/plain"
          },
          {
            "objectType": "formfield",
            "name": "address",
            "title": "Address",
            "value": "105, 11th Ave",
            "contentType": "text/plain"
          },
          {
            "objectType": "formfield",
            "name": "city",
            "title": "City",
            "value": "New York",
            "contentType": "text/plain"
          },
          {
            "objectType": "formfield",
            "name": "state",
            "title": "State",
            "value": "NY",
            "contentType": "text/plain"
          },
          {
            "objectType": "formfield",
            "name": "zip",
            "title": "Zip",
            "value": "10001",
            "contentType": "text/plain"
          },
          {
            "objectType": "formfield",
            "name": "phone_home",
            "title": "Home phone",
            "value": "(111) 111-1111",
            "contentType": "text/plain"
          },
          {
            "objectType": "formfield",
            "name": "phone_work",
            "title": "Work phone",
            "value": "(222) 222-2222",
            "contentType": "text/plain"
          },
          {
            "objectType": "formfield",
            "name": "phone_cell",
            "title": "Owner's cell phone",
            "value": "(333) 333-3333",
            "contentType": "text/plain"
          },
          {
            "objectType": "formfield",
            "name": "phone_co_owner",
            "title": "Co-Owner's cell phone",
            "value": "(444) 444-4444",
            "contentType": "text/plain"
          },
          {
            "objectType": "formfield",
            "name": "phone_number_to_reach",
            "title": "Best number to reach you today",
            "value": "Home phone",
            "contentType": "text/plain"
          },
          {
            "objectType": "formfield",
            "name": "pet_name",
            "title": "Your Pet's Name",
            "value": "Fluffy",
            "contentType": "text/plain"
          },
          {
            "objectType": "formfield",
            "name": "weight",
            "title": "Weight (kg)",
            "value": "3.5",
            "contentType": "text/plain"
          },
          {
            "objectType": "formfield",
            "name": "birth_date",
            "title": "Birth date",
            "value": "2016-07-16T19:20:30.000+00:00",
            "contentType": "text/plain"
          },
          {
            "objectType": "formfield",
            "name": "breed",
            "title": "Breed",
            "value": "English Cocker Spaniel",
            "contentType": "text/plain"
          },
          {
            "objectType": "formfield",
            "name": "sex",
            "title": "Sex",
            "value": "Male",
            "contentType": "text/plain"
          },
          {
            "objectType": "formfield",
            "name": "family_veterinarian",
            "title": "Family veterinarian",
            "value": "Dr. Ivan Zak",
            "contentType": "text/plain"
          },
          {
            "objectType": "formfield",
            "name": "clinic",
            "title": "Clinic",
            "value": "Best Pet Vet",
            "contentType": "text/plain"
          },
          {
            "objectType": "formfield",
            "name": "visit_reason",
            "title": "What is the reason for your visit today?",
            "value": "Vaccination",
            "contentType": "text/plain"
          },
          {
            "objectType": "formfield",
            "name": "signature",
            "title": "Consent Form",
            "value": "https://attached-image-webfile-path",
            "contentType": "image/jpg"
          }
        ]
      }
    ]
  }
}

The forms.created event is sent from SFS when one or several forms were created. SFS will send forms object with all information entered into the forms.

To enable forms.created events please turn on SEND FORMS TO EMR on the Settings page.

Download the Client Self Check-in form

Example Request:

GET /hospitalization/emr-hospitalization-id/checkinformreport HTTP/1.1
User-Agent: MyClient/1.0.0
Content-Type: application/json
emrApiKey: "emr-api-key-received-from-sfs"
clinicApiKey: "clinic-api-key-taken-from-account-web-page"
timezoneName: Europe/Helsinki

This method allows to download the Client Self Check-in form from Smart Flow Sheet.

All the dates in the downloaded report will be represented in the time zone that you must explicitly specify in the timezoneName header of the HTTP request (e.g. timezoneName: Europe/Helsinki). Please visit this web-page for the complete list of the time zone names.

Specify the hospitalizationId of the hospitalization object in the EMR. Use the same hospitalizationId that was supplied when hospitalization had been created.

Hospitalizations

Hospitalization is an abstraction used in Smart Flow Sheet to represent the patient record. As soon as patient is admitted in the hospital the Hospitalization object is created. In turn, the hospitalization object nests patient and client information. This information can be transferred and retrieved from SFS using the patient object and the client object.

The are the hospitalizations and hospitalization objects used to create hosptitalizations in SFS and receiving events from the Smart Flow Sheet services.

The hospitalizations object

Attributes

Parameter Type Description
objectType String Optional. Describes the type of the object transferred with the SFS events. Should be assigned hospitalizations value
id String Optional. Identificator of the object. Will be transferred to EMR with the SFS events
hospitalizations Array The array of hospitalization objects.

This object will be sent with the hospitalizations.discharged event in case when multiple patients were discharged from the Smart Flow Sheet whiteboard.

The hospitalization object

Attributes

Parameter Type Description
objectType String Optional. Describes the type of the object transferred with the SFS events. Should be assigned hospitalization value
hospitalizationId String Required. EMR internal ID of the hospitalization
departmentId Integer Optional. Id of the department patient should be created at. If not specified hospitalization will be created in SFS default department
hospitalizationGuid String Optional. A unique internal identifier of the hospitalization. This field will be transferred with the SFS events.
dateCreated Date Required. Specifies the date and time of the patient arrival in the hospital. Time format: YYYY-MM-DDThh:mm:ss.sssTZD (e.g. 1997-07-16T19:20:30.000+00:00)
treatmentTemplateName String Optional The name of the treatment template to be used for created hospitalization. If not specified then the “Default” template will be used.
temperatureUnits String Optional. Units for the temperature. Can be F or C. If not specified then clinic’s default temperature units will be used
weightUnits String Optional. Units for the weight. Can be kg or lbs. If not specified then clinic’s default weight units will be used
weight Double Required. Weight of the patient. Smart Flow Sheet requires weight to be specified for every patient from the moment hospitalization is created
estimatedDaysOfStay Integer Optional. This value will be used to create requested number of days of hospitalization. If this value is not specified then by default 2 days will be created
fileNumber String Optional. The value of emr file number, that will be shown on a flowsheet. If not specified SFS will populate it with hospitalizationId
caution Boolean Optional. Whether to show caution stripe on a flowsheet or not
deposit String Optional. Client deposit
doctorName String Optional. The name of the doctor on duty
medicId String Optional. Alternatively to specifying the doctorName field, you can provide the id of the medic object that corresponds to the doctor on duty, and has been registered with the appropriate API call
diseases Array Optional. Array of strings. A collection of diseases
cageNumber String Optional. The cage number. This value will be shown on the whiteboard near patient name.
color String Optional. The RGB hex color code (eg. #439FE0). This value is used to color patient`s info panel on the whiteboard and flowsheets.
reportPath String Optional. The path to the flowsheet report file that has been generated during patient discharge
status String Optional. The status of the hospitalization. This field will be transferred with the SFS events. Can be active, deleted or discharged.
patient Patient Required when creating new hospitalization. Optional if used to update existing hospitalization. The patient object
resuscitate String Optional Can be dnr, bls or als. Default value is bls.

The patient object

Attributes

Parameter Type Description
objectType String Optional. Describes the type of the object transferred with the SFS events. Should be assigned patient value
patientId String Optional. EMR internal ID of the patient
name String Required. The name of the patient
birthday Date Optional. Patient`s birthday. Time format: YYYY-MM-DDThh:mm:ss.sssTZD (e.g. 1997-07-16T19:20:30.000+00:00)
sex String Required. Patient’s sex type. There is a set of standard predefined strings that specify the sex type of a patient: M, F, MN, FS
species String Optional. Patient’s species
color String Optional. Patient’s color
breed String Optional. Patient’s breed
criticalNotes String Optional. The value of the critical notes that will be shown on a flowsheet.
customField String Optional. The value of the custom field that will be shown on a flowsheet.
imagePath String Optional. The path to the patient`s image file.
owner Client Required when creating new hospitalization. Optional if used to update existing hospitalization. The client object

The client object

Attributes

Parameter Type Description
objectType String Optional. Describes the type of the object transferred with the SFS events. Should be assigned client value
ownerId String Optional. EMR internal ID of the client
nameLast String Optional. Pet owner’s last name
nameFirst String Optional. Pet owner’s first name
homePhone String Optional. Pet owner’s home phone
workPhone String Optional. Pet owner’s work phone

Create a patient

Example Request:

POST /hospitalization HTTP/1.1
User-Agent: MyClient/1.0.0
Content-Type: application/json
emrApiKey: "emr-api-key-received-from-sfs"
clinicApiKey: "clinic-api-key-taken-from-account-web-page"
timezoneName: Europe/Helsinki
{
    "objectType": "hospitalization",
    "hospitalizationId": "emr-hospitalization-id",
    "dateCreated": "2014-11-03T17:54:55.221+00:00",
    "temperatureUnits": "C",
    "weightUnits": "kg",
    "weight": 5.8,
    "estimatedDaysOfStay": 1,
    "fileNumber": "# 123",
    "caution": false,
    "color": "#439FE0",
    "doctorName": "Dr. Ivan",
    "medicId": "dr-ivan-emr-id",
    "diseases": [
        "high temperature",
        "vomiting"
    ],
    "patient": {
        "objectType": "patient",
        "patientId": "emr-patient-id",
        "name": "Jordi Alba",
        "species": "Canin",
        "owner": {
            "objectType": "client",
            "ownerId": "emr-client-id",
            "nameLast": "Dow",
            "nameFirst": "Jack",
            "workPhone": "555-55-55"
        },
        "color": "Brown",
        "sex": "M",
        "criticalNotes": "Cefazolin allergy",
        "customField": "some notes"
    }
}

The Smart Slow Sheet API does not allow to create several hospitalizations with the same hospitalizationId. However, it may happen that the user needs to re-submit the hospitalization that has been previously created (and then deleted or discharged from Smart Flow Sheet user interface). In this case, the second call of this API will return the error with the message Hospitalization already exists. If this happens, we advise to show the user the error message and prompt them if they would like to re-submit the patient. If user selects the option to re-submit the patient, then EMR should:

  1. Make a call to delete hospitalization API first;
  2. Call create a patient API again to re-submit the patient information.

Get active hospitalizations

Example Request:

GET /hospitalizations HTTP/1.1
User-Agent: MyClient/1.0.0
Content-Type: application/json
emrApiKey: "emr-api-key-received-from-sfs"
clinicApiKey: "clinic-api-key-taken-from-account-web-page"
timezoneName: Europe/Helsinki

This method allows to get all hospitalizations that have active value of the status field.

Get hospitalization

Example Request:

GET /hospitalization/emr-hospitalization-id HTTP/1.1
User-Agent: MyClient/1.0.0
Content-Type: application/json
emrApiKey: "emr-api-key-received-from-sfs"
clinicApiKey: "clinic-api-key-taken-from-account-web-page"
timezoneName: Europe/Helsinki

This method allows to get information about hospitalization by id. Specify the hospitalizationId of the hospitalization object in the EMR. Use the same hospitalizationId that was supplied when hospitalization had been created.

Attach to existing hospitalization

Example Request:

POST /hospitalization/sfs-hospitalization-guid/attach/emr-hospitalization-id HTTP/1.1
User-Agent: MyClient/1.0.0
Content-Type: application/json
emrApiKey: "emr-api-key-received-from-sfs"
clinicApiKey: "clinic-api-key-taken-from-account-web-page"
timezoneName: Europe/Helsinki

When a patient is created manually by the user with Smart Flow Sheet user interface, the hospitalization will be sent to EMR with hospitalizations.created event. The hospitalizationId field of the object will be empty, however, hospitalizationGuid field (a unique internal identifier of the hospitalization) will be provided. You may want to attach your EMR internal ID to this hospitalization to be able to receive any other type of events, as well as download patient reports and use any other API that requires hospitalizationId. The HTTP request below provides such possibility. It takes hospitalizationGuid value as one part of Url, while your internal hospializationId is included in another part of Url.

Delete hospitalization

Example Request:

DELETE /hospitalization/emr-hospitalization-id HTTP/1.1
User-Agent: MyClient/1.0.0
Content-Type: application/json
emrApiKey: "emr-api-key-received-from-sfs"
clinicApiKey: "clinic-api-key-taken-from-account-web-page"
timezoneName: Europe/Helsinki

This method deletes hospitalization by id. Specify the hospitalizationId of the hospitalization object in the EMR. Use the same hospitalizationId that was supplied when hospitalization had been created. This method also “unmaps” the hospitalizationId from the internal hospitalization record - this allows to submit the patient to Smart Flow Sheet again afterward.

Discharge hospitalization

Example Request:

POST /hospitalization/discharge/emr-hospitalization-id HTTP/1.1
User-Agent: MyClient/1.0.0
Content-Type: application/json
emrApiKey: "emr-api-key-received-from-sfs"
clinicApiKey: "clinic-api-key-taken-from-account-web-page"
timezoneName: Europe/Helsinki

This method initiates the patient discharge operation. Specify the hospitalizationId of the hospitalization object in the EMR. Use the same hospitalizationId that was supplied when hospitalization had been created. This API requires the valid timezoneName header specified in the request.

Discharge hospitalization event

Example of hospitalizations.discharged event JSON:

{
    "clinicApiKey": "clinic-api-key",
    "eventType": "hospitalizations.discharged",
    "object": {
        "objectType": "hospitalizations",
        "id": "sfs-operation-id",
        "hospitalizations": [
            {
                "objectType": "hospitalization",
                "hospitalizationId": "emr-hospitalization-id",
                "hospitalizationGuid": "sfs-hospitalization-guid",
                "dateCreated": "2014-11-05T10:20:19.000+00:00",
                "fileNumber": "#File number",
                "reportPath": "https://pdf-report-webfile-path"
            }
        ]
    }
}

As soon as one or several patients have been discharged from the Smart Flow Sheet whiteboard, SFS will notify EMR by sending one of the following events:

  1. The hospitalization.discharged event in case if single patient was discharged. In this case the hospitalization object will be transferred with the event.

  2. The hospitalizations.discharged event in case if multiple patients were discharged. In this case the hospitalizations object will be transferred with the event.

Every hospitalization object transferred with these events will contain the path to the flowsheet report pdf file in the reportPath field. If for some reason the value of this field is empty then you may explicitly download the flowsheet report.

To enable hospitalizations.discharged events please turn on EXPORT FLOWSHEET AFTER DISCHARGE TO EMR on the Settings page.

Get notified about new hospitalizations

Example of hospitalizations.created event JSON:

{
    "clinicApiKey": "clinic-api-key",
    "eventType": "hospitalizations.created",
    "object": {
        "objectType": "hospitalizations",
        "id": "sfs-operation-id",
        "hospitalizations": [
            {
                "objectType": "hospitalization",
                "hospitalizationGuid": "sfs-hospitalization-guid",
                "dateCreated": "2014-11-05T10:20:19.000+00:00",
                "weight": 5.8,
                "estimatedDaysOfStay": 1,
                "fileNumber": "# 123",
                "caution": false,
                "color": "#439FE0",
                "doctorName": "Dr. Ivan",
                "medicId": "dr-ivan-emr-id",
                "diseases": [
                    "high temperature",
                    "vomiting"
                ],
                "patient": {
                    "objectType": "patient",
                    "name": "Jordi Alba",
                    "species": "Canin",
                    "owner": {
                        "objectType": "client",
                        "nameLast": "Dow",
                        "nameFirst": "Jack",
                        "workPhone": "555-55-55"
                    },
                    "color": "Brown",
                    "sex": "M",
                    "criticalNotes": "Cefazolin allergy",
                    "customField": "some notes"
                }
            }
        ]
    }
}

When hospitalization is created in Smart Flow Sheet (both through the user interface and create patient API) the hospitalizations.created event will be sent to EMR. The hospitalization object will be included in the payload.

The hospitalizationId field would be empty in case if the patient were created manually from Smart Flow Sheet user interface. You may want to attach your EMR internal ID to this hospitalization to be able to receive any other type of events, as well as download patient reports and use any other API that requires hospitalizationId.

You may find more details about attaching hospitalizations API here.

Download the Flowsheet report

Example Request:

GET /hospitalization/emr-hospitalization-id/flowsheetreport HTTP/1.1
User-Agent: MyClient/1.0.0
Content-Type: application/json
emrApiKey: "emr-api-key-received-from-sfs"
clinicApiKey: "clinic-api-key-taken-from-account-web-page"
timezoneName: Europe/Helsinki

This method allows to download the flowsheet report from Smart Flow Sheet.

All the dates in the downloaded report will be represented in the time zone that you must explicitly specify in the timezoneName header of the HTTP request (e.g. timezoneName: Europe/Helsinki). Please visit this web-page for the complete list of the time zone names.

Specify the hospitalizationId of the hospitalization object in the EMR. Use the same hospitalizationId that was supplied when hospitalization had been created.

Download the Medical Records report

Example Request:

GET /hospitalization/emr-hospitalization-id/medicalrecordsreport HTTP/1.1
User-Agent: MyClient/1.0.0
Content-Type: application/json
emrApiKey: "emr-api-key-received-from-sfs"
clinicApiKey: "clinic-api-key-taken-from-account-web-page"
timezoneName: Europe/Helsinki

This method allows to download the medical record report from Smart Flow Sheet. Use this method when receiving hospitalizations.discharged event, as at this point the report should contain all medical records of the specified hospitalization.

All the dates in the downloaded report will be represented in the time zone that you must explicitly specify in the timezoneName header of the HTTP request (e.g. timezoneName: Europe/Helsinki). Please visit this web-page for the complete list of the time zone names.

Specify the hospitalizationId of the hospitalization object in the EMR. Use the same hospitalizationId that was supplied when hospitalization had been created.

Download the Billing report

Example Request:

GET /hospitalization/emr-hospitalization-id/billingreport HTTP/1.1
User-Agent: MyClient/1.0.0
Content-Type: application/json
emrApiKey: "emr-api-key-received-from-sfs"
clinicApiKey: "clinic-api-key-taken-from-account-web-page"
timezoneName: America/Chicago

This method allows to download the billing report from Smart Flow Sheet. Use this method when receiving hospitalizations.discharged event, as at this point the report should contain the complete inventory usage information of the specified hospitalization.

All the dates in the downloaded report will be represented in the time zone that you must explicitly specify in the timezoneName header of the HTTP request (e.g. timezoneName: America/Chicago). Please visit this web-page for the complete list of the time zone names.

Specify the hospitalizationId of the hospitalization object in the EMR. Use the same hospitalizationId that was supplied when hospitalization had been created.

Download the Notes report

Example Request:

GET /hospitalization/emr-hospitalization-id/notesreport HTTP/1.1
User-Agent: MyClient/1.0.0
Content-Type: application/json
emrApiKey: "emr-api-key-received-from-sfs"
clinicApiKey: "clinic-api-key-taken-from-account-web-page"
timezoneName: Europe/Helsinki

This method allows to download the notes report from Smart Flow Sheet. Use this method when receiving hospitalizations.discharged event, as at this point the report should contain all the tech notes of the specified hospitalization.

All the dates in the downloaded report will be represented in the time zone that you must explicitly specify in the timezoneName header of the HTTP request (e.g. timezoneName: Europe/Helsinki). Please visit this web-page for the complete list of the time zone names.

Specify the hospitalizationId of the hospitalization object in the EMR. Use the same hospitalizationId that was supplied when hospitalization had been created.

Inventory Items

There are the inventoryitems and inventoryitem objects used to import inventory from EMR to SFS.

The inventoryitems object

Example inventoryitems object with 2 nested inventoryitem objects:

{
    "objectType": "inventoryitems",
    "id": "some-operation-id",
    "inventoryitems": [
        {
            "objectType": "inventoryitem",
            "id": "some-emr-internal-id",
            "name": "Cefazolin 100",
            "concentration": 100,
            "concentrationUnits": "mg",
            "concentrationVolume": "ml"
        },
        {
            "objectType": "inventoryitem",
            "id": "some-emr-internal-id2",
            "name": "Ampicillin"
        }
    ]
}

This object should be sent with the /inventoryitems API method (POST or PUT method).

Attributes

Parameter Type Description
objectType String Optional. Describes the type of the object transferred with the SFS events (e.g. inventory.imported). Should be assigned iventoryitems value
id String Optional. Identificator of the object. Will be transferred to EMR with the SFS events (e.g. inventory.imported)
inventoryitems Array The array of inventoryitem objects. See description of the inventoryitem object below

The inventoryitem object

Attributes

Parameter Type Description
objectType String Optional. Describes the type of the object transferred with the SFS events (e.g. inventory.imported). Should be assigned iventoryitem value
id String Required. The EMR internal ID of the inventory item
name String Required. The unique name of the inventory item
concentration Double Optional. The concentration value for the given medication. This value should not be specified if the inventory item is not a medication.
concentrationUnits String Required if the concentration value is specified. Otherwise optional. Units that define the amount of drug. There is no limitation on what data will be transferred. This value should not be specified if inventory item is not a medication.
concentrationVolume String Required if the concentration value is specified. Otherwise optional. Units for the volume. There is no limitation on what data will be transferred. This value should not be specified if inventory item is not a medication.
asyncOperationStatus Integer Optional. The status of the asynchronous operation for the inventory item. This will be filled in by SFS when sending the inventoryitems.imported event. Should be: 1. less than 0 - error occured; 2. greater or equal 0 - operation succeed.
asyncOperationMessage String Optional. May contain the error message in case the asyncOperationStatus field represents the error (less than 0).

Create or update single inventory item

Example Request:

POST /inventoryitem HTTP/1.1
User-Agent: MyClient/1.0.0
Content-Type: application/json
emrApiKey: "emr-api-key-received-from-sfs"
clinicApiKey: "clinic-api-key-taken-from-account-web-page"
{
    "id": "external-inventory-id",
    "name": "Cefazolin 100",
    "concentration": 100,
    "concentrationUnits": "mg",
    "concentrationVolume": "ml"
}

Creates or updates single inventory item sent in the request. SFS will attempt to link the transferred inventory item with the internal SFS items by name.

Create or update multiple inventory items

Example Request:

POST /inventoryitems HTTP/1.1
User-Agent: MyClient/1.0.0
Content-Type: application/json
emrApiKey: "emr-api-key-received-from-sfs"
clinicApiKey: "clinic-api-key-taken-from-account-web-page"
{
    "id": "some-emr-operation-id",
    "inventoryitems": [
        {
            "id": "some-emr-internal-id",
            "name": "Cefazolin 100",
            "concentration": 100,
            "concentrationUnits": "mg",
            "concentrationVolume": "ml"
        },
        {
            "id": "some-emr-internal-id2",
            "name": "Ampicillin"
        }
    ]
}

Asynchronously creates or updates the inventory items sent with the request. Before creating an inventory item system tries to match it with any existing records by name. If exact match is found then records are linked, otherwise a new inventory item is created.

After an import operation finishes SFS will send the inventoryitems.imported event to the registered webhook. We will pass back the same inventoryitems object to EMR, and fill in the status of the import operation for every inventory item provided.

Retreive existing inventory items

Retreive single inventory item

Returns the inventory item. Specify the id of the inventory item in the EMR. The same id that was supplied when object was created

Delete single inventory item

This method deletes an inventory item by id.

Receiving the status of import operation

Example of inventoryitems.imported event JSON:

{
    "clinicApiKey": "clinic-api-key",
    "eventType": "inventoryitems.imported",
    "object": {
        "objectType": "inventoryitems",
        "id": "some-emr-internal-id",
        "inventoryitems": [
            {
                "objectType": "inventoryitem",
                "id": "some-emr-internal-id",
                "name": "Cefazolin 100",
                "concentration": 100,
                "concentrationUnits": "mg",
                "concentrationVolume": "ml",
                "asyncOperationStatus": 0
            },
            {
                "objectType": "inventoryitem",
                "id": "some-emr-internal-id2",
                "name": "Ampicillin",
                "asyncOperationStatus": -1,
                "asyncOperationMessage":  "Some error message"
            }
        ]
    }
}

SFS will send the inventoryitems.imported event to the url provided by EMR at the end of asynchronous import operation. SFS sends the inventoryitems object with this event. Every inventoryitem object will contain asyncOperationStatus and optionally asyncOperationMessage in case of errors.

Medics

There are the medics and medic objects used to import the list of clinic stuff from EMR to SFS.

The medics object

Example medics object with 2 nested medic objects:

{
    "objectType": "medics",
    "id": "some-operation-id",
    "medics": [
        {
            "objectType": "medic",
            "medicId": "some-emr-internal-id-1",
            "name": "Dr. Jackson",
            "medicType": "doctor"
        },
        {
            "objectType": "medic",
            "medicId": "some-emr-internal-id-2",
            "name": "Dr. Smith",
            "medicType": "doctor"
        }
    ]
}

This object should be sent with the /medics API method (POST or PUT method).

Attributes

Parameter Type Description
objectType String Optional. Describes the type of the object transferred with the SFS events (e.g. medics.imported). Should be assigned medics value
id String Optional. Identificator of the object. Will be transferred to EMR with the SFS events (e.g. medics.imported)
medics Array The array of medic objects. See description of the medic object below

The medic object

Attributes

Parameter Type Description
objectType String Optional. Describes the type of the object transferred with the SFS events (e.g. medics.imported). Should be assigned medic value
medicId String Required. The EMR internal ID of the medic
name String Required. The unique name of the medic for a particular medicType
medicType String Required. The type of the medic imported in SFS. Should always be assigned the doctor value. (There will be technician and other types supported in the future).
asyncOperationStatus Integer Optional. The status of the asynchronous operation for the medic object. This will be filled in by SFS when sending the medics.imported event. Should be: 1. less than 0 - error occured; 2. greater or equal 0 - operation succeed.
asyncOperationMessage String Optional. May contain the error message in case the asyncOperationStatus field represents the error (less than 0).

Create or update single medic

Example Request:

POST /medic HTTP/1.1
User-Agent: MyClient/1.0.0
Content-Type: application/json
emrApiKey: "emr-api-key-received-from-sfs"
clinicApiKey: "clinic-api-key-taken-from-account-web-page"
{
    "medicId": "some-emr-internal-id-1",
    "name": "Dr. Jackson",
    "medicType": "doctor"
}

Creates or updates single medic object sent in the request. SFS will attempt to link the transferred medic object with the internal SFS items by name.

Create or update multiple medics

Example Request:

POST /medics HTTP/1.1
User-Agent: MyClient/1.0.0
Content-Type: application/json
emrApiKey: "emr-api-key-received-from-sfs"
clinicApiKey: "clinic-api-key-taken-from-account-web-page"
{
    "id": "some-operation-id",
    "medics": [
        {
            "medicId": "some-emr-internal-id-1",
            "name": "Dr. Jackson",
            "medicType": "doctor"
        },
        {
            "medicId": "some-emr-internal-id-2",
            "name": "Dr. Smith",
            "medicType": "doctor"
        }
    ]
}

Asynchronously creates or updates the medics objects sent with the request. Before creating a medic object system tries to match it with any existing records by name. If exact match is found then records are linked, otherwise a new medic is created.

After an import operation finishes SFS will send the medics.imported event to the registered webhook. We will pass back the same medics object to EMR, and fill in the status of the import operation for every object provided.

Retreive existing medics

Retreive single medic

Returns the medic object. Specify the id of the medic in the EMR. The same id that was supplied when the object was created

Delete single medic

This method deletes a medic by id.

Receiving the status of the import operation

Example of medics.imported event JSON:

{
    "clinicApiKey": "clinic-api-key",
    "eventType": "medics.imported",
    "object": {
        "objectType": "medics",
        "id": "some-emr-internal-id",
        "medics": [
            {
                "objectType": "medic",
                "medicId": "some-emr-internal-id-1",
                "name": "Dr. Jackson",
                "medicType": "doctor",
                "asyncOperationStatus": 0
            },
            {
                "objectType": "medic",
                "medicId": "some-emr-internal-id-2",
                "name": "Dr. Smith",
                "medicType": "doctor",
                "asyncOperationStatus": -1,
                "asyncOperationMessage":  "Some error message"
            }
        ]
    }
}

SFS will send the medics.imported event to the url provided by EMR at the end of asynchronous import operation. SFS sends the medics object with this event. Every medic object will contain asyncOperationStatus and optionally asyncOperationMessage in case of errors.

Notes

The are two objects used by Smart Flow Sheet to notify EMR when notes entered into the flowsheet or anesthetic:

Both objects are sent with the asynchronous notes.entered event when one or several tech notes has been entered/removed.

The notes object

Attributes

Parameter Type Description
objectType String Optional. Describes the type of the object transferred with the SFS events (e.g. notes.entered). Should be assigned notes value
id String Identificator of the object. Will be transferred to EMR with the notes.entered event.
notes Array The array of note objects. See description of the note object below

The note object

Attributes

Parameter Type Description
objectType String Describes the type of the object transferred with the SFS events (e.g. notes.entered). Should be assigned note value
noteGuid String Required. A unique internal identifier of the note item
hospitalizationId String Hospitalization external id (which was provided with hospitalization creation)
time Date Note creation time (UTC time that corresponds to an hour on a flowsheet). Time format: YYYY-MM-DDThh:mm:ss.sssTZD (e.g. 1997-07-16T19:20:30.000+00:00)
text String The string value that was entered during note creation
status String This field describes what have happened to the note. Can be one of the following: 1. added, 2. changed, 3. removed
type Integer The type of note. Should be 0 - Flowsheet note or 1 - Anesthetic note
anestheticGuid String A unique internal identifier of the anesthetic sheet, required if type = 1, otherwise is equal to null

Retreive multiple notes

Example of notes.entered event JSON:

{
    "clinicApiKey": "clinic-api-key",
    "eventType": "notes.entered",
    "object": {
        "objectType": "notes",
        "id": "sfs-operation-id",
        "notes":[
            {
                "objectType": "note",
                "noteGuid": "sfs-note-guid1",
                "hospitalizationId": "external-hosp-id1",
                "time":"2013-03-28T14:23:56.000+00:00",
                "status": "changed",
                "text": "Lorem ipsum...",
                "type": 0,
                "anestheticGuid": null
            },
            {
                "objectType": "note",
                "noteGuid": "sfs-note-guid2",
                "hospitalizationId": "external-hosp-id1",
                "time":"2013-03-28T14:23:56.000+00:00",
                "status": "added",
                "text": "Donec eu mattis diam...",
                "type": 1,
                "anestheticGuid": "sfs-anesthetic-guid"
            }       
        ]
    }
}

To enable notes.entered events please turn on SEND NOTES TO EMR on the Settings page.

Treatments

The are two objects used by Smart Flow Sheet to notify EMR when medical records entered into the flowsheet:

The treatments object

Attributes

Parameter Type Description
objectType String Optional. Describes the type of the object transferred with the SFS events (e.g. treatment.record_entered). Should be assigned treatments value
id String Required if sent to /treatments API method. Identificator of the object. Will be transferred to EMR with the treatments.records_entered event. EMR should return this field with the /treatments API method
treatments Array The array of treatment objects. See description of the treatments object below

The treatment object

Attributes

Parameter Type Description
objectType String Describes the type of the object transferred with the SFS events (e.g. treatment.record_entered). Should be assigned treatment value
inventoryId String Inventory item external id (which was provided with inventory upload). If “Null” then there is no inventory item for this treatment found in SFS
name String Name of the treatment parameter as it is shown on the flowsheet
hospitalizationId String Hospitalization external id (which was provided with hospitalization creation)
treatmentGuid String Required. A unique internal identifier of the treatment item (which corresponds to the treatment at particular hour on a flowsheet)
time Date Treatment time (UTC time that corresponds to an hour on a flowsheet). Time format: YYYY-MM-DDThh:mm:ss.sssTZD (e.g. 1997-07-16T19:20:30.000+00:00)
status String This field describes what have happened to the medical record. Can be one of the following: 1. changed, 2. added, 3. removed, 4. not_changed
qty Double Quantity. In case if the medication has been given to a patient this value will be equal to the volume field (described below). Otherwise it will be 1
volume Double The volume of the medication that has been given to a patient. In case of non-medication treatment this value will not be provided.
units String The units of the medication volume (ml, tab, etc). For non-medication items this value will not be provided
value String The string value that was entered during treatment execution
mediaPath String The path to the media file that has been attached to the treatment
mediaContentType String The content type of media file (e.g. image/jpg, video/mp4, etc…)
doctorName String The name of the doctor on duty. This value will be provided only in case if the name of the doctor is specified on a correspondent flowsheet
doctor Medic The medic object that corresponds to the doctor on duty. This value will be provided only in case if associated medic has been imported from EMR
type Integer The type of the treatment, should be one of following types: 0 - Flowsheet treatment, 1 - Anesthetic treatment, 2 - Treatment task.
billed Boolean If true then treatment should be included in the billing (more information here)
asyncOperationStatus Integer Required if sent to /treatments API method. This field should be filled in by EMR when sending the treatments object with the /treatments API method. This is usually happens in response to the treatments.records_entered async event. This field describes the status of the asynchronous operation for each treatment. Should be: 1. less than 0 - error occured; 2. greater or equal 0 - operation succeed.
asyncOperationMessage String Optional. May contain the error message in case the asyncOperationStatus field represents the error (less than 0).

Including treatments in the billing

Smart Flow Sheet provides a user interface option for the user to explicitly include or exclude the treatment from being included in the billing (see image below). This option is only shown for the parameters mapped to the EMR inventory items. If the user sets “Billing” option to ON, then true is provided with the billed field. Otherwise, Smart Flow sends false.

Retreive single medical record

Example of treatment.record_entered event JSON:

{
    "clinicApiKey": "clinic-api-key",
    "eventType": "treatment.record_entered",
    "object": {
        "objectType": "treatmet",
        "name": "Cefazolin 100",
        "inventoryId": "external-inventory-id",
        "hospitalizationId": "external-hospitalization-id1",
        "treatmentGuid": "sfs-treatment-guid1",
        "time":"2013-03-28T14:23:56.000+00:00",
        "status": "changed",
        "qty": 3.5,
        "volume": 3.5,
        "value": "IZ",
        "mediaPath": "https://attached-image-webfile-path",
        "mediaContentType": "image/jpg",
        "units": "ml",
        "doctorName": "name-of-the-doctor",
        "doctor": {
            "objectType": "medic",
            "medicId": "some-emr-internal-id-2",
            "name": "name-of-the-doctor",
            "medicType": "doctor"
            }
    }
}

The treatment.record_entered event is sent from SFS when one medical record has been entered/removed. SFS will send treatment object with all information about medical record.

To enable treatment.record_entered events please turn on SEND BILLING & MEDICAL RECORDS TO EMR on the Settings page.

Retreive multiple medical records

Example of treatments.records_entered event JSON:

{
    "clinicApiKey": "clinic-api-key",
    "eventType": "treatments.records_entered",
    "object": {
        "objectType": "treatments",
        "id": "sfs-operation-id",
        "treatments":[
            {
                "objectType": "treatment",
                "name": "Cefazolin 100",
                "inventoryId": "external-inventory-id",
                "hospitalizationId": "external-hosp-id1",
                "treatmentGuid": "sfs-treatment-guid1",
                "time":"2013-03-28T14:23:56.000+00:00",
                "status": "changed",
                "qty": 3.5,
                "volume": 3.5,
                "value": "IZ",
                "units": "ml",
                "doctorName": "name-of-the-doctor",
                "doctor": {
                    "objectType": "medic",
                    "medicId": "some-emr-internal-id",
                    "name": "name-of-the-doctor",
                    "medicType": "doctor"
                    }               
            },
            {
                "objectType": "treatment",
                "name": "Temperature",
                "inventoryId": null,
                "hospitalizationId": "external-hosp-id2",
                "treatmentGuid": "sfs-treatment-guid2",
                "time":"2013-03-28T14:23:56.000+00:00",
                "status": "added",
                "qty": 1,
                "volume": null,
                "value": "36.6",
                "units": null,
                "doctorName": "name-of-the-doctor-2",
                "doctor": null
            }       
        ]
    }
}

The treatments.records_entered event is sent from SFS when one or several medical record has been entered/removed. SFS will send treatments object with all information about medical records. It is required that this event handled asynchronously by EMR. SFS expects EMR to make a call to the treatments API method and transfer back treatments objects with the all original information, plus including the results of processing.

It is very important that you call the /treatments API method, after you finish processing the medical records that SFS sends to EMR with this event. Make sure to preserve and send back the id field received with the treatments object.

To enable treatments.records_entered events please turn on SEND BILLING & MEDICAL RECORDS TO EMR on the Settings page.

Send medical records processing results

Example Request:

POST /treatments HTTP/1.1
User-Agent: MyClient/1.0.0
Content-Type: application/json
emrApiKey: "emr-api-key-received-from-sfs"
clinicApiKey: "clinic-api-key-taken-from-account-web-page"
{
    "id": "sfs_operation_id",
    "treatments": [
        {
            "objectType": "treatment",
            "name": "Cefazolin 100",
            "inventoryId": "external-inventory-id",
            "hospitalizationId": "external-hosp-id1",
            "treatmentGuid": "sfs-treatment-guid1",
            "time":"2013-03-28T14:23:56.000+00:00",
            "status": "changed",
            "qty": 3.5,
            "volume": 3.5,
            "value": "IZ",
            "units": "ml",
            "doctorName": "name-of-the-doctor",
            "asyncOperationStatus": -1,
            "asyncOperationMessage": "Some error message"
        },
        {
            "objectType": "treatment",
            "name": "Temperature",
            "inventoryId": null,
            "hospitalizationId": "external-hosp-id2",
            "treatmentGuid": "sfs-treatment-guid2",
            "time":"2013-03-28T14:23:56.000+00:00",
            "status": "added",
            "qty": 1,
            "volume": null,
            "value": "36.6",
            "units": null,
            "doctorName": "name-of-the-doctor",
            "asyncOperationStatus": 0
        }
    ]
}

With this request Smart Flow Sheet will receive the results of medical records processing by EMR. SFS then will update medical records with the appropriate status transferred with asyncOperationStatus field. Call this method after asynchronous processing of the treatments.records_entered event finished.

Treatment Templates

This API allows to get the list of active treatment templates in the clinic. You may want to use this API to allow users to select a treatment template before submitting a new patient into Smart Flow Sheet.

The treatment template object

Attributes

Parameter Type Description
objectType String Optional. Describes the type of the object transferred with the SFS events. Should be assigned treatmenttemplate value
name String Required. The unique name of treatment template. You should use this value to specify the treatment template when creating a new hospitalization

Retreive active treatment templates

Example Request:

GET /treatmenttemplates HTTP/1.1
User-Agent: MyClient/1.0.0
Content-Type: application/json
emrApiKey: "emr-api-key-received-from-sfs"
clinicApiKey: "clinic-api-key-taken-from-account-web-page"
[
{
     "objectType":"treatmenttemplate",
     "name":"FLUTD"
},
{
     "objectType":"treatmenttemplate",
     "name":"Seizure"
}
]

Events

Smart Flow Sheet will send events to EMR on different occasions:

  1. Inventory import finished
  2. When single medical record has been entered or removed
  3. When mutliple medical records have been entered or removed
  4. When patient has been created in Smart Flow Sheet
  5. When patient has been discharged from the whiteboard
  6. When mutliple notes have been entered or removed
  7. When anesthetic sheet has been finalized
  8. When the form has been filled in for a patient

In the future there can be other events added to this, e.g. sending flowsheet report or medical records report on patient discharge, etc…

Events will be sent only for those hospitalizations that have been created from EMR. The only exception is the hospitalizations.created event that is sent even for the patients created manually with Smart Flow Sheet user interface. Events on hospitalizations created directly from SFS won`t be sent to EMR webhook.

Sending events require webhook to be registered in SFS. You may register a webhook that will receive all the events associated with your EMR, or you may register a custom webhook for each clinic account. Requirements to webhook:

The event object

Example of the event object:

{
    "clinicApiKey": "clinic-api-key",
    "eventType": "treatments.records_entered",
    "object": {

    }
}

Attributes

Parameter Type Description
clinicApiKey String Clinic api key to associate clinic on EMR`s side
eventType String The type of the event
object Object Object of one of the following type: treatment, treatments, inventoryitems, hospitalization, etc… This list can expand as soon as new objects will be sent with the API.

Types of events

Smart Flow Sheet will send several events on different occasions. Below is short description of the events.

Event Description
anesthetics.finalized Sent from SFS when clinic stuff finalizes anesthetic sheet(s)
forms.created Sent from SFS when the form(s) is created and filled in for the patient (e.g. client self check-in form)
hospitalizations.created Sent after a patient(s) has been created in Smart Flow Sheet
hospitalization.discharged Sent after a patient has been discharged from the Smart Flow Sheet whiteboard
hospitalizations.discharged Sent after multiple patients have been discharged from the Smart Flow Sheet whiteboard
inventoryitems.imported Sent after importing of emr inventory items finished
notes.entered Sent from SFS when multiple notes have been entered/removed
medics.imported Sent after importing of emr medics finished
treatment.record_entered Sent from SFS when one medical record has been entered/removed
treatments.records_entered Sent from SFS when multiple medical records have been entered/removed

Register custom webhook

Example Request:

POST /account/webhook?url=your_custom_url HTTP/1.1
User-Agent: MyClient/1.0.0
Content-Type: application/json
emrApiKey: "emr-api-key-received-from-sfs"
clinicApiKey: "clinic-api-key-taken-from-account-web-page"

You may use this API to register a custom webhook that will receive events only for the specified clinic account. You may use this webhook for a group of clinics also.