Episode

Claim episodes in PI Web

Episode Definition

FOTO defines an episode as a single incident for a single body part/impairment combination. Each episode can be be assigned an external episode id to associate that episode with an external system. A single externalEpisodeID can be assigned to multiple FOTO episode ids via the claim episode method.

The API provides methods to determine which episodes are available for claiming, claiming those episodes or releasing previously claimed episodes

SOAP Methods

SOAP Discovery

SOAP 1.1
    http://devs.patient-inquiry.com/episode/soap?wsdl
SOAP 1.2
    http://devs.patient-inquiry.com/episode/soap12?wsdl

APIEpisodeResponse[] GetCollection(string externalPatientId)

Gets unclaimed episodes for the specified patient


APIClaimEpisodeResponse Claim(string episodeId, string externalEpisodeId)

Claims an episode — If the episode exists and is owned by the requester (verified by ExternalID).


APIClaimEpisodeResponse2 Claim(string episodeId, string externalEpisodeId)

Claims an episode — If the episode exists and is owned by the requester (verified by ExternalID).


bool Release(string episodeId, string externalEpisodeId)

Releases a claimed episode with the provided EpisodeID


string EpisodeSurveyURL(string episodeId)

Returns the url to launch a survey for the specified episode


string EpisodeSurveyLobbyCode(string episodeId)

Returns the lobby code to launch a survey for the specified episode


Stream EpisodeSurveyQRCode(string episodeId)

Returns the QR Code to launch a survey for the specified episode


EmployerReferral(IncommingReferral referral)

Adds an Employer Referral to the specified episode


InsuranceReferral(IncommingReferral referral)

Adds an Insurance Referral to the specified episode


OtherReferral(IncommingReferral referral)

Adds a referral to the specified episode that doesn't fit one of the other types


PhysicianReferral(IncommingPhysicianReferral referral)

Adds a Physician Referral to the specified episode


APIArtifactVisitResponse ArtifactVisit(APIArtifactVisitInput visit)

Assigns a visit number to an Episode Update (survey)

REST Methods

Resource URLs

REST XML
    http://devs.patient-inquiry.com/episode/ 
REST json
    http://devs.patient-inquiry.com/episode/json/ 

GET

Gets unclaimed episodes for the specified patient

Parameter: externalPatientId
Response: APIEpisodeResponse[]

Example Request: GET http://devs.patient-inquiry.com/episode/YourPatientID?Api-Key=a8e09fcb-76d4-4912-be4c-6ed3bcd1e93a

PUT

Claims an episode — If the episode exists and is owned by the requester (verified by ExternalID).

Parameters sent in body: episodeId, externalEpisodeId
Response: APIClaimEpisodeResponse

Example Request: PUT http://devs.patient-inquiry.com/episode/?Api-Key=a8e09fcb-76d4-4912-be4c-6ed3bcd1e93a

PUT

Claims an episode — If the episode exists and is owned by the requester (verified by ExternalID).

Parameters sent in body: episodeId, externalEpisodeId
Response: APIClaimEpisodeResponse2

Example Request: PUT http://devs.patient-inquiry.com/episode/claim2?Api-Key=a8e09fcb-76d4-4912-be4c-6ed3bcd1e93a

DELETE

Releases a claimed episode with the provided EpisodeID

Parameters: episodeId, externalEpisodeId
Response: bool

Example Request: DELETE http://devs.patient-inquiry.com/episode/123/YourEpisodeID?Api-Key=a8e09fcb-76d4-4912-be4c-6ed3bcd1e93a

GET

Returns the url to launch a survey for the specified episode

Parameters: episodeId
Response: string

Example Request: GET http://devs.patient-inquiry.com/episode/SurveyURL/FOTOEpisodeID?Api-Key=a8e09fcb-76d4-4912-be4c-6ed3bcd1e93a

GET

Returns the lobby code to launch a survey for the specified episode

Parameters: episodeId
Response: string

Example Request: GET http://devs.patient-inquiry.com/episode/SurveyLobbyCode/FOTOEpisodeID?Api-Key=a8e09fcb-76d4-4912-be4c-6ed3bcd1e93a

GET

Returns the QR Code to launch a survey for the specified episode

Parameters: episodeId
Response: Stream

Example Request: GET http://devs.patient-inquiry.com/episode/SurveyQRCode/FOTOEpisodeID?Api-Key=a8e09fcb-76d4-4912-be4c-6ed3bcd1e93a

POST (EmployerReferral)

Adds an Employer Referral to the specified episode

Parameters: IncommingReferral

Example Request: POST http://devs.patient-inquiry.com/episode/EmployerReferral/?Api-Key=a8e09fcb-76d4-4912-be4c-6ed3bcd1e93a

POST (InsuranceReferral)

Adds an Insurance Referral to the specified episode

Parameters: IncommingReferral

Example Request: POST http://devs.patient-inquiry.com/episode/InsuranceReferral/?Api-Key=a8e09fcb-76d4-4912-be4c-6ed3bcd1e93a

POST (OtherReferral)

Adds an Other Referral type to the specified episode

Parameters: IncommingReferral

Example Request: POST http://devs.patient-inquiry.com/episode/OtherReferral/?Api-Key=a8e09fcb-76d4-4912-be4c-6ed3bcd1e93a

POST (PhysicianReferral)

Adds a Physician Referral to the specified episode

Parameters: IncommingPhysicianReferral

Example Request: POST http://devs.patient-inquiry.com/episode/PhysicianReferral/?Api-Key=a8e09fcb-76d4-4912-be4c-6ed3bcd1e93a

POST (APIArtifactVisit)

Assigns a visit number to an Episode Update (survey)

Parameters: APIArtifactVisitInput
Response: APIArtifactVisitResponse

Example Request: POST http://devs.patient-inquiry.com/episode/ArtifactVisit/?Api-Key=a8e09fcb-76d4-4912-be4c-6ed3bcd1e93a

Supporting Objects and Structures (order matters when using XML)

    public class APIEpisodeResponse
    {
      public int BodyPartId;
      public string BodyPartText;
      public DateTime CreateDate;
      public int EpisodeId;
      public int ImpairmentId;
      public string ImpairmentText;
      public string TherapistName;
    }
    public class APIClaimEpisodeResponse
    {
      public List<APIEpisodeArtifactwithReport> EpisodeArtifacts;
      public int EpisodeId;
      public string ExternalEpisodeId;
      public int MessageID;
      public bool Success;
      public string Text;
    }
    public class APIEpisodeArtifactwithReport
    {
      public int EpisodeId;
      public string ExternalEpisodeId;
      public string GCode;
      public string Measure;
      public int ReportId;
      public PatientReportType ReportType;
      public DateTime SurveyDateTimeCompleted;
      public DateTime SurveyDateTimeStarted;
      public byte[] PDFReport;
    }
    public class IncommingReferral
    {
      public string ExternalEpisodeId;
      public string Id;
      public string Misc;
      public string Name;
    }
    public class IncommingPhysicianReferral
    {
      public string ExternalEpisodeId;
      public string FirstName;
      public string Id;
      public string LastName;
      public string Title;
    }
    public class APIArtifactVisitInput
    {
      public string ExternalEpisodeId;
      public int ReportId;
      public int VisitNumber;
    }
    public class APIArtifactVisitResponse
    {
      public string ExternalEpisodeId;
      public int MessageId;
      public int ReportId;
      public bool Success;
      public string Text;
    }