Create a context launch link
post /api/v1/launch-tokens
For another worklist or the EMR: a link that opens one study in PacsPilot's viewer for the reader
at the keyboard. Open the returned url in the reader's browser within 60 seconds; it
works once. The reader must already be signed in to PacsPilot and allowed to see the study. Pass
the accession and mrn your screen shows: if either is not the study's,
PacsPilot refuses to open it (409 launch-mismatch, audited) so a patient switch never
opens the wrong images. The link is signed; an edited link answers 401. Needs an orders interface
token with launch:issue and the practice's context launch switch on.
Scope: launch:issue (hl7 tokens).
Audited as launch.issue in the practice's audit log.
Request body
The study to open
application/json
| Field | Type | Description |
|---|---|---|
studyUid |
string | StudyInstanceUID of a study in the practice |
accession optional |
string or null | Accession number the other system shows; the link fails if it is not the study's |
mrn optional |
string or null | Patient ID the other system shows; the link fails if it is not the study's |
{
"studyUid": "1.2.826.0.1.3680043.8.498.1",
"accession": "ACC1001",
"mrn": "SYNTH0001"
}
Responses
201
The link
application/json
| Field | Type | Description |
|---|---|---|
url |
string | Open in the reader's browser within 60 seconds; it works once |
expiresAt |
integer | Epoch milliseconds |
400
Problem: invalid-json, validation
401
Problem: unauthenticated
403
Problem: forbidden
404
Problem: cockpit-disabled, not-found
500
Problem: internal
Errors
| Status | Type | Meaning |
|---|---|---|
| 401 |
unauthenticated
|
Not authenticated |
| 403 |
forbidden
|
Not allowed |
| 500 |
internal
|
Internal error |
| 404 |
cockpit-disabled
|
Feature is off |
| 404 |
not-found
|
Not found |
| 400 |
invalid-json
|
Body is not JSON |
| 400 |
validation
|
Invalid request |
Examples
curl
curl -X POST 'https://app.pacspilot.com/api/v1/launch-tokens' \
-H "Authorization: Bearer $PACSPILOT_TOKEN" \
-H 'Content-Type: application/json' \
--data-binary '{
"studyUid": "1.2.826.0.1.3680043.8.498.1",
"accession": "ACC1001",
"mrn": "SYNTH0001"
}'
JavaScript
const res = await fetch("https://app.pacspilot.com/api/v1/launch-tokens", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PACSPILOT_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"studyUid": "1.2.826.0.1.3680043.8.498.1",
"accession": "ACC1001",
"mrn": "SYNTH0001"
}),
});
console.log(res.status, await res.text());
Python
import os
import requests
data = "{\n \"studyUid\": \"1.2.826.0.1.3680043.8.498.1\",\n \"accession\": \"ACC1001\",\n \"mrn\": \"SYNTH0001\"\n}"
res = requests.request(
"POST",
"https://app.pacspilot.com/api/v1/launch-tokens",
headers={"Authorization": f"Bearer {os.environ['PACSPILOT_TOKEN']}", "Content-Type": "application/json"},
data=data.encode("utf-8"),
)
print(res.status_code, res.text)