Patient2 Examples

Examples of using the API

REST samples

These following REST examples were all run via Fiddler. For more information on Fiddler and SOAP samples please refer to our Samples page.


JSON GET

http://devs.patient-inquiry.com/patient2/json/BobFred/?Api-Key=a8e09fcb-76d4-4912-be4c-6ed3bcd1e93a

Response

{"FirstName":"Bob","LastName":"Fred","Alias":null,"DateOfBirth":"\/Date(-18510000000-0700)\/","Email":"bobfred@fotoinc.com","ExternalId":"BobFred","ExternalSiteId":null,"Gender":"M","Language":null,"MiddleInitial":null}

XML GET

http://devs.patient-inquiry.com/patient2/BobFred/?Api-Key=a8e09fcb-76d4-4912-be4c-6ed3bcd1e93a

Response

<IncomingPatient2 xmlns="http://schemas.datacontract.org/2004/07/PI.Domain" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<FirstName>Test</FirstName>
<LastName>Patient</LastName>
<Alias/>
<DateOfBirth>1999-05-31T11:20:00</DateOfBirth>
<Email>testing@fotoinc.com</Email>
<ExternalId>TestPatient</ExternalId>
<ExternalSiteId/>
<Gender>F</Gender>
<Language>en</Language>
<MiddleInitial/>
</IncomingPatient2>

JSON POST

http://devs.patient-inquiry.com/patient2/json/?Api-Key=a8e09fcb-76d4-4912-be4c-6ed3bcd1e93a

User-Agent: Fiddler
Content-Type: text/json

[{
  "FirstName":"Test",
  "LastName":"Patient",
  "MiddleInitial":"A",
  "DateOfBirth":"\/Date(928164000000-0400)\/",
  "Email":"testing@fotoinc.com",
  "ExternalId":"TestPatient",
  "ExternalSiteId":"TestSite",
  "Alias":"TestPatientAlias",
  "Gender":"F",
  "Language":"en"
}]

Response

[{"MessageID":1148,"OrganizationID":1,"PatientExternalID":"TestPatient","Success":true,"Text":null}]

XML POST

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

User-Agent: Fiddler
Content-Type: text/xml

<ArrayOfIncomingPatient2 xmlns="http://schemas.datacontract.org/2004/07/PI.Domain">
  <IncomingPatient2>
    <FirstName>Jane</FirstName>
    <LastName>Doe</LastName>
    <Alias></Alias>
    <DateOfBirth>1956-03-30T11:20:00</DateOfBirth>
    <Email>JaneDoe@fotoinc.com</Email>
    <ExternalId>JaneDoe</ExternalId>
    <ExternalSiteId>TestSite</ExternalSiteId>
    <Gender>F</Gender>
    <Language>es</Language>
    <MiddleInitial></MiddleInitial>
  </IncomingPatient2>
  <IncomingPatient2>
    <FirstName>Bob</FirstName>
    <LastName>Fred</LastName>
    <Alias></Alias>
    <DateOfBirth>1969-05-31T11:20:00</DateOfBirth>
    <Email>bobfred@fotoinc.com</Email>
    <ExternalId>BobFred</ExternalId>
    <ExternalSiteId>TestSite</ExternalSiteId>
    <Gender>M</Gender>
    <Language>ar</Language>
    <MiddleInitial></MiddleInitial>
  </IncomingPatient2>
</ArrayOfIncomingPatient2>

Response

<ArrayOfAPIPatientResponse xmlns="http://schemas.datacontract.org/2004/07/PI.Domain" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <APIPatientResponse>
    <MessageID>140</MessageID>
    <OrganizationID>1</OrganizationID>
    <PatientExternalID>JaneDoe</PatientExternalID>
    <ExternalSiteId>TeestSite</ExternalSiteId>
    <Success>true</Success>
    <Text i:nil="true"/>
  </APIPatientResponse>
  <APIPatientResponse>
    <MessageID>140</MessageID>
    <OrganizationID>1</OrganizationID>
    <PatientExternalID>BobFred</PatientExternalID>
    <ExternalSiteId>TeestSite</ExternalSiteId>
    <Success>true</Success>
    <Text i:nil="true"/>
  </APIPatientResponse>
</ArrayOfAPIPatientResponse>