iFrame Launch Payload
As a developer embedding the Lab Network iFrame, you build the launch payload that opens each ordering session. It carries the patient the session opens for, the prefilled billing details your system already holds, and the callback URL the user returns to afterwards. You choose the kind of facility with facilityType, and the laboratories that appear in the directory come from your tenant configuration.
Every field is marked required or optional, with the values it accepts and what it changes on the ordering screen. That matters while you are building the call, and again when a launch does not behave as expected. Three cases come up most: a field on the ordering screen is empty, a field is prefilled with something unexpected, or a launch is rejected before the frame loads.
The Session Request
Post the payload as a JSON-RPC 2.0 request to POST /doctor/api, with a bearer token carrying the place_orders scope. Credential and scope information is available on the Lab Ordering Tenant Setup page.
Each session takes one request and covers one patient and one order. The whole payload sits in a single object inside params, so one call contains every field for the patient, insurance, guarantor, and billing.
Every object in the payload except an address and a date carries a className naming its type. The patient, and each insurance, insurance provider, and insured party all need one, and a request that omits it is rejected.
POST /doctor/api HTTP/1.1
Authorization: Bearer <your_access_token>
Host: api.healthgorilla.com
{
"id": 8,
"jsonrpc": "2.0",
"method": "placeOrder",
"params": [
{
"facilityType": "DiagnosticLaboratories",
"callbackUrl": "https://yourapp.com/neworder/callback",
"state": "1",
"patientId": "59f71f62e8f8cc8cbe17cfd7"
}
]
}Values are case sensitive, so a maritalStatus of Married is rejected when the accepted value is the lowercase married. The rejected payload comes back on the request itself. Your system catches it and no frame opens.
Top-Level Parameters
Seven parameters sit at the top level of the request, outside the patient object. Send patientId rather than patient when your system already knows the identifier, because an exact match avoids both duplicate patient creation and the disambiguation prompt.
A state value comes back on your callback URL unchanged, so your system can tie a completed order to the session that started it, and a visitId stays on the order for your records. Neither appears on the ordering screen. Sending overwritePatientInsurances as true replaces the insurances already held for a matched patient rather than adding to them.
The callbackUrl you send is not the callbackUrl you get back. The one you send is where the user is redirected at the end of the session, and the one in the response is the session URL you load in the frame.
| Field | Required | Accepted Values | Determines |
|---|---|---|---|
facilityType | Required | Ordering facility type | Kind of order screen that opens, with its directory and catalog |
callbackUrl | Required | URL | Screen the user lands on after submitting |
patient | One of the two | Patient object | Patient the screen opens for, after matching |
patientId | One of the two | Health Gorilla patient resource identifier | Patient the screen opens for, with no matching ambiguity |
state | Optional | String | Nothing on screen |
visitId | Optional | String | Nothing on screen |
overwritePatientInsurances | Optional | Boolean | Insurance prefilled when billing is set to Third Party |
Ordering Facility Types
Send facilityType to define what kind of facility an order is going to. You choose a category rather than a particular lab, and which laboratories appear inside it comes from your tenant configuration.
The platform has 20 facility types and 13 of them support ordering. The other seven exist for directory and routing, and a request carrying one of them is rejected before the frame loads with "Bad request" .
| Facility Type | Description |
|---|---|
DiagnosticLaboratories | Diagnostic laboratories |
RadiologyImaging | Radiology imaging |
GeneticTesting | Genetic testing |
SurgicalCenter | Surgical centers |
PhysicalTherapy | Physical therapy |
SkilledNursingFacilities | Skilled nursing facilities |
HomeHealthAgencies | Home health agencies |
SleepCenters | Sleep centers |
DurableMedicalEquipmentSupplies | Durable medical equipment and supplies |
Hospice | Hospices |
AssistedLivingFacilities | Assisted living facilities |
Hospitals | Hospitals |
Specialist | Specialists |
Patient Demographics
The first time you open a session for a patient, before your system has a Health Gorilla patient identifier, send a patient object. The demographics are matched against existing patients, and a new patient is created when nothing matches.
Optional fields are worth sending because address and contact details sharpen matching and keep duplicate patients from accumulating across launches.
| Field | Required | Accepted Values | Determines |
|---|---|---|---|
className | Required | Always com.informedika.common.shared.vo.PatientVO | Nothing on screen |
firstName | Required | String | Patient the screen opens for |
lastName | Required | String | Patient the screen opens for |
middleName | Optional | String | How closely the demographics match |
title | Optional | mr, ms, mrs, dr | Patient's title on the ordering screen |
gender | Required | male, female, other, unknown | Patient the screen opens for |
dateOfBirth | Required | Local date object | Patient the screen opens for |
address | Optional | Address object | Address prefilled when billing is set to Patient |
maritalStatus | Optional | Lowercase values such as married | Marital status prefilled on the patient |
id2 | Optional | String | Medical record number carried on the order as the patient's alternate identifier |
Patient Identifier
After the first session, when your system already holds the patient identifier, send patientId. For details on retrieving the identifier from the order, go to Displaying Orders and Results.
The match is exact, so no disambiguation prompt reaches the user and no duplicate patient is created. An identifier for a patient that does not exist fails the request with an invalid-patient error carrying that identifier.
| Field | Required | Accepted Values | Determines |
|---|---|---|---|
patientId | One of the two | Health Gorilla patient resource identifier | Patient the screen opens for, with no matching ambiguity |
Address Object
The patient, guarantor, and insurer each take an address, and all three use the same shape. Send country only for addresses outside the United States, because it defaults to USA when you send neither a country nor a state, and a state implies its own country.
| Field | Required | Accepted Values |
|---|---|---|
address1 | Required | String |
address2 | Optional | String |
city | Required | String |
state | Required | Two-letter state or province code |
zip | Required | String |
country | Required | USA or CAN |
Local Date Object
Dates are sent as three numeric fields rather than a formatted string, which removes any ambiguity about date order. On the patient and guarantor, date-of-birth fields take this shape. Values are numbers rather than zero-padded strings, so January is 1, for example.
| Field | Required | Accepted Values |
|---|---|---|
year | Required | Number greater than 1900 |
month | Required | 1 to 12 |
day | Required | 1 to 31 |
Insurance
Insurance sits on the patient object in up to three slots: primaryInsurance, secondaryInsurance, and tertiaryInsurance. Send it to prefill the payer when billing is set to Third Party, which is also the billing type that makes a diagnosis code mandatory. Every insurance must carry an insured block, and a request without one fails with Missing "insured" block.
| Field | Required | Accepted Values | Description |
|---|---|---|---|
className | Required | Always com.informedika.common.shared.vo.InsuranceVO | Type marker |
provider | Required | String | Insurance provider's name |
policyId | Required | String | Policy number |
groupNumber | Optional | String | Policy group number, when available |
providerInfo | Required | Insurance provider object | Payer for the plan |
insured | Required | Guarantor object | Insured party |
A full insurance block shows the nesting and the className on each level.
{
"className": "com.informedika.common.shared.vo.PatientVO",
"firstName": "Jane",
"lastName": "Doe",
"gender": "female",
"dateOfBirth": { "year": 1990, "month": 1, "day": 1 },
"primaryInsurance": {
"className": "com.informedika.common.shared.vo.InsuranceVO",
"provider": "Blue Shield",
"policyId": "123456789",
"providerInfo": {
"className": "com.informedika.common.shared.vo.BaseInsurerVO",
"name": "Blue Shield",
"phone": "8005551212",
"address": {
"address1": "PO Box 272850",
"city": "Chico",
"state": "CA",
"zip": "95927",
"country": "USA"
}
},
"insured": {
"className": "com.informedika.common.shared.vo.GuarantorVO",
"firstName": "Jane",
"lastName": "Doe",
"relationship": "self"
}
}
}Send the patient object as the patient value inside params.
Insurance Provider Object
The providerInfo object holds the payer's identity and the claims address. name and address are both required, and a payload missing either fails with Bad request. Invalid insurer. Name, Address are required. phone is optional, but a missing payer phone is a routine cause of claim rejection at the laboratory, so send it when you have it.
| Field | Required | Accepted Values | Description |
|---|---|---|---|
className | Required | Always com.informedika.common.shared.vo.BaseInsurerVO | Type marker |
name | Required | String | Insurer's name |
phone | Optional | United States phone number | Insurer's phone number |
address | Required | Address object | Claims address |
Guarantor Object
Sent as insured on each insurance, the guarantor is a flat object that carries the guarantor's details and their relationship to the patient. First name, last name, and relationship are required, and a payload without them fails with Bad request. Invalidguarantor. FirstName, LastName, Relationship are required. When relationship is self, the guarantor is the patient and their details are sent again.
gender and dateOfBirth are optional in the request, but guarantor billing requires them, so send both when Bill To is set to Guarantor. For details on billing type requirements, go to the Billing and Accounts page.
| Field | Required | Accepted Values | Description |
|---|---|---|---|
className | Required | Always com.informedika.common.shared.vo.GuarantorVO | Type marker |
firstName | Required | String | Guarantor's given name |
lastName | Required | String | Guarantor's surname |
gender | Optional | male, female, other, unknown | Guarantor's gender |
dateOfBirth | Optional | Local date object | Guarantor's date of birth |
relationship | Required | self, spouse, parent, other | Relationship between the patient and the guarantor |
phone | Optional | United States phone number | Guarantor's phone number, copied onto whichever of the guarantor's mobile, home, or work phone fields is blank, in that order |
address | Optional | Address object | Guarantor's address |
employer | Optional | String | Guarantor's employer, when available |
coveredPartyId | Optional | String | Covered party's identifier, when the payer issues one |
Response
A successful response carries one field, the URL that opens the ordering screen. It is not the callbackUrl you sent. Yours is the redirect target at the end of the session, and this one is what you load to begin.
| Field | Description |
|---|---|
callbackUrl | URL that opens the ordering screen |
A failed request returns HTTP 200, reporting the failure in the body rather than in the status line. This makes it important to read the body on every call. Each failure carries a numeric code and a message.
| Code | Meaning |
|---|---|
| 0 | Bad request, used for validation failures such as a missing insurer or guarantor field |
| 1 | Success |
| 2 | Facility type does not support ordering |
| 3 | Callback URL missing or malformed |
| 4 | Patient invalid, either an identifier that matches nothing or a missing demographic payload |
| 5 | Insurance invalid |
A patient identifier that matches nothing returns code 4 with the message Patient with ID [<id>] not found.
{
"jsonrpc": "2.0",
"result": [
{
"callbackUrl": "https://healthgorilla.com/newsession?go=..."
}
],
"id": 8
}To put the ordering screen in front of your user, append your OAuth 2.0 access token to that URL as an access_token parameter and load the result in a frame or a separate window. The token signs the user in, so they never see a Health Gorilla login.
Callback Parameters
When the user submits or cancels, they are redirected to the callbackUrl you supplied, with the outcome in the query string. You can supply a callback URL that already has parameters on it. When one is present, Health Gorilla appends with &. When no parameter is present, Health Gorilla appends with ?.
Two things need care. Treat canceled as an ordinary outcome rather than a failure, since a user abandoning an order is normal traffic. Also, read both orderId and orderIds. The two never appear together, so an order that splits during placement returns orderIds, and a system reading only orderId captures no identifier for that order.
| Parameter | When Present | Accepted Values | Description |
|---|---|---|---|
responseCode | Always | success, canceled, error | Outcome of the ordering session |
responseMessage | On error | String | Error description, when one is available |
state | Always | String | state value from the original request |
orderId | On success | String | Placed order identifier, when the order did not split |
orderIds | On success | Identifiers joined by a pipe, URL-encoded | Placed order identifiers, when the order split |
Updated about 5 hours ago

